Skip to content
Snippets Groups Projects
Commit 3c12caf6 authored by Laurent Léonard's avatar Laurent Léonard
Browse files

qemu: Fix USB by product with security enabled.

parent fe642561
No related branches found
No related tags found
No related merge requests found
From: Cole Robinson <crobinso@redhat.com>
Date: Fri, 12 Mar 2010 17:37:52 +0000
Subject: [PATCH] qemu: Fix USB by product with security enabled
We need to call PrepareHostdevs to determine the USB device path before
any security calls. PrepareHostUSBDevices was also incorrectly skipping
all USB devices.
Origin: upstream, http://www.libvirt.org/git/?p=libvirt.git;a=commit;h=6d5c8a8f51db8ce97ab35ab6022dd5c94ab016b4
---
src/qemu/qemu_driver.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 2c99ce8..d5ac904 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2360,7 +2360,7 @@ qemuPrepareHostUSBDevices(struct qemud_driver *driver ATTRIBUTE_UNUSED,
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
continue;
- if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI)
+ if (hostdev->source.subsys.type != VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_USB)
continue;
/* Resolve a vendor/product to bus/device */
@@ -2701,6 +2701,10 @@ static int qemudStartVMDaemon(virConnectPtr conn,
return -1;
}
+ /* Must be run before security labelling */
+ if (qemuPrepareHostDevices(driver, vm->def) < 0)
+ goto cleanup;
+
/* If you are using a SecurityDriver with dynamic labelling,
then generate a security label for isolation */
if (driver->securityDriver &&
@@ -2759,9 +2763,6 @@ static int qemudStartVMDaemon(virConnectPtr conn,
if (qemuSetupCgroup(driver, vm) < 0)
goto cleanup;
- if (qemuPrepareHostDevices(driver, vm->def) < 0)
- goto cleanup;
-
if (VIR_ALLOC(priv->monConfig) < 0) {
virReportOOMError();
goto cleanup;
--
......@@ -5,3 +5,4 @@
0005-Terminate-nc-on-EOF.patch
0006-Don-t-drop-caps-when-exec-ing-qemu.patch
0007-Work-around-broken-linux-socket.h.patch
0008-qemu-Fix-USB-by-product-with-security-enabled.patch
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment