[pve-devel] [PATCH v5 15/19] rename qemu_bridgeadd to qemu_add_pci_bridge

Dietmar Maurer dietmar at proxmox.com
Tue Nov 25 10:19:35 CET 2014


To make it obvious that we add a PCI device, and not a network bridge.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/QemuServer.pm |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index 391376e..a8828be 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3049,7 +3049,7 @@ sub vm_deviceplug {
 	return 1;
     }
 
-    qemu_bridgeadd($storecfg, $conf, $vmid, $deviceid); #add bridge if we need it for the device
+    qemu_add_pci_bridge($storecfg, $conf, $vmid, $deviceid); # add PCI bridge if we need it for the device
 
     if ($deviceid =~ m/^(virtio)(\d+)$/) {
         return undef if !qemu_driveadd($storecfg, $vmid, $device);
@@ -3226,23 +3226,27 @@ sub qemu_findorcreatescsihw {
     return 1;
 }
 
-sub qemu_bridgeadd {
+sub qemu_add_pci_bridge {
     my ($storecfg, $conf, $vmid, $device) = @_;
 
     my $bridges = {};
-    my $bridgeid = undef;
+
+    my $bridgeid;
+
     print_pci_addr($device, $bridges);
 
     while (my ($k, $v) = each %$bridges) {
 	$bridgeid = $k;
     }
-    return if !$bridgeid || $bridgeid < 1;
+    return if !defined($bridgeid) || $bridgeid < 1;
+
     my $bridge = "pci.$bridgeid";
     my $devices_list = vm_devices_list($vmid);
 
-    if(!defined($devices_list->{$bridge})) {
+    if (!defined($devices_list->{$bridge})) {
 	return undef if !vm_deviceplug($storecfg, $conf, $vmid, $bridge);
     }
+
     return 1;
 }
 
-- 
1.7.10.4




More information about the pve-devel mailing list