]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix USB device re-labelling
authorMark McLoughlin <markmc@redhat.com>
Wed, 30 Sep 2009 17:37:03 +0000 (18:37 +0100)
committerMark McLoughlin <markmc@redhat.com>
Thu, 1 Oct 2009 10:56:09 +0000 (11:56 +0100)
A simple misplaced break out of a switch results in:

  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./vendor': No such file or directory
  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./device': No such file or directory
  libvir: error : this function is not supported by the hypervisor: Failed to read product/vendor ID for 0000:00:54c.

when trying to passthrough a USB host device to qemu.

* src/security_selinux.c: fix a switch/break thinko

src/security/security_selinux.c

index bdd9eb2a93f4c0bc1bff324056025dd24f34e76e..d08d502faac71695ed0f2c23c76e25b1775837c5 100644 (file)
@@ -492,12 +492,11 @@ SELinuxSetSecurityHostdevLabel(virConnectPtr conn,
 
             ret = usbDeviceFileIterate(conn, usb, SELinuxSetSecurityUSBLabel, vm);
             usbFreeDevice(conn, usb);
-
-            break;
         } else {
             /* XXX deal with product/vendor better */
             ret = 0;
         }
+        break;
     }
 
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: {