]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: hotplug: Assume QEMU_CAPS_DEVICE in qemuDomainAttachHostUSBDevice
authorPeter Krempa <pkrempa@redhat.com>
Tue, 26 Apr 2016 11:40:34 +0000 (13:40 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 2 May 2016 07:12:14 +0000 (09:12 +0200)
src/qemu/qemu_hotplug.c

index 6befdfe0a8fae0480f1a694ca0a928efa5f11eaf..7b1c02a9fb6bacf6fcd09ce32ac3652ffa560a44 100644 (file)
@@ -1884,23 +1884,16 @@ qemuDomainAttachHostUSBDevice(virQEMUDriverPtr driver,
         goto cleanup;
     teardownlabel = true;
 
-    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
-        if (qemuAssignDeviceHostdevAlias(vm->def, &hostdev->info->alias, -1) < 0)
-            goto cleanup;
-        if (!(devstr = qemuBuildUSBHostdevDevStr(vm->def, hostdev, priv->qemuCaps)))
-            goto cleanup;
-    }
+    if (qemuAssignDeviceHostdevAlias(vm->def, &hostdev->info->alias, -1) < 0)
+        goto cleanup;
+    if (!(devstr = qemuBuildUSBHostdevDevStr(vm->def, hostdev, priv->qemuCaps)))
+        goto cleanup;
 
     if (VIR_REALLOC_N(vm->def->hostdevs, vm->def->nhostdevs+1) < 0)
         goto cleanup;
 
     qemuDomainObjEnterMonitor(driver, vm);
-    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE))
-        ret = qemuMonitorAddDevice(priv->mon, devstr);
-    else
-        ret = qemuMonitorAddUSBDeviceExact(priv->mon,
-                                           hostdev->source.subsys.u.usb.bus,
-                                           hostdev->source.subsys.u.usb.device);
+    ret = qemuMonitorAddDevice(priv->mon, devstr);
     if (qemuDomainObjExitMonitor(driver, vm) < 0) {
         ret = -1;
         goto cleanup;