[libvirt] [PATCH v2 5/6] qemu: no hot-plug/unplug support currently for usb-bot

Guannan Ren gren at redhat.com
Tue Sep 10 09:26:12 UTC 2013


---
 src/conf/domain_conf.c  |  4 +++-
 src/qemu/qemu_hotplug.c | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7a4969e..60ca298 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17118,7 +17118,9 @@ virDomainDeviceIsUSB(virDomainDeviceDefPtr dev)
         (t == VIR_DOMAIN_DEVICE_HUB &&
          dev->data.hub->type == VIR_DOMAIN_HUB_TYPE_USB) ||
         (t == VIR_DOMAIN_DEVICE_REDIRDEV &&
-         dev->data.redirdev->bus == VIR_DOMAIN_REDIRDEV_BUS_USB))
+         dev->data.redirdev->bus == VIR_DOMAIN_REDIRDEV_BUS_USB) ||
+        (t == VIR_DOMAIN_DEVICE_CONTROLLER &&
+         dev->data.controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_USB_BOT))
         return true;
 
     return false;
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 6cdee44..b6e3c4c 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -365,6 +365,13 @@ int qemuDomainAttachPciControllerDevice(virQEMUDriverPtr driver,
         return -1;
     }
 
+    if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&
+        controller->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_USB_BOT) {
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                       _("device usb-bot hotplug unsupported currently"));
+        goto cleanup;
+    }
+
     if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
         if (qemuDomainPCIAddressEnsureAddr(priv->pciaddrs, &controller->info) < 0)
             goto cleanup;
@@ -3009,6 +3016,13 @@ int qemuDomainDetachPciControllerDevice(virQEMUDriverPtr driver,
 
     detach = vm->def->controllers[idx];
 
+    if (detach->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&
+        detach->model == VIR_DOMAIN_CONTROLLER_MODEL_SCSI_USB_BOT) {
+        virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
+                       _("device usb-bot cannot be detached currently"));
+        goto cleanup;
+    }
+
     if (!virDomainDeviceAddressIsValid(&detach->info,
                                        VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI)) {
         virReportError(VIR_ERR_OPERATION_FAILED, "%s",
-- 
1.8.3.1




More information about the libvir-list mailing list