Mark McLoughlin aeda45
From 16f20706f8d2f113bb6a49f56e415c16d438183e Mon Sep 17 00:00:00 2001
Mark McLoughlin aeda45
From: Mark McLoughlin <markmc@redhat.com>
Mark McLoughlin aeda45
Date: Wed, 30 Sep 2009 18:37:03 +0100
Mark McLoughlin aeda45
Subject: [PATCH] Fix USB device re-labelling
Mark McLoughlin aeda45
Mark McLoughlin aeda45
A simple misplaced break out of a switch results in:
Mark McLoughlin aeda45
Mark McLoughlin aeda45
  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./vendor': No such file or directory
Mark McLoughlin aeda45
  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./device': No such file or directory
Mark McLoughlin aeda45
  libvir: error : this function is not supported by the hypervisor: Failed to read product/vendor ID for 0000:00:54c.
Mark McLoughlin aeda45
Mark McLoughlin aeda45
when trying to passthrough a USB host device to qemu.
Mark McLoughlin aeda45
Mark McLoughlin aeda45
* src/security_selinux.c: fix a switch/break thinko
Mark McLoughlin aeda45
Mark McLoughlin aeda45
Fedora-patch: libvirt-fix-usb-device-passthrough.patch
Mark McLoughlin aeda45
---
Mark McLoughlin aeda45
 src/security_selinux.c |    3 +--
Mark McLoughlin aeda45
 1 files changed, 1 insertions(+), 2 deletions(-)
Mark McLoughlin aeda45
Mark McLoughlin aeda45
diff --git a/src/security_selinux.c b/src/security_selinux.c
Mark McLoughlin aeda45
index bc295b1..b4dc153 100644
Mark McLoughlin aeda45
--- a/src/security_selinux.c
Mark McLoughlin aeda45
+++ b/src/security_selinux.c
Mark McLoughlin aeda45
@@ -464,12 +464,11 @@ SELinuxSetSecurityHostdevLabel(virConnectPtr conn,
Mark McLoughlin aeda45
 
Mark McLoughlin aeda45
             ret = usbDeviceFileIterate(conn, usb, SELinuxSetSecurityUSBLabel, vm);
Mark McLoughlin aeda45
             usbFreeDevice(conn, usb);
Mark McLoughlin aeda45
-
Mark McLoughlin aeda45
-            break;
Mark McLoughlin aeda45
         } else {
Mark McLoughlin aeda45
             /* XXX deal with product/vendor better */
Mark McLoughlin aeda45
             ret = 0;
Mark McLoughlin aeda45
         }
Mark McLoughlin aeda45
+        break;
Mark McLoughlin aeda45
     }
Mark McLoughlin aeda45
 
Mark McLoughlin aeda45
     case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: {
Mark McLoughlin aeda45
-- 
Mark McLoughlin aeda45
1.6.4.4
Mark McLoughlin aeda45