]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: process: Drop !QEMU_CAPS_DEVICE code
authorCole Robinson <crobinso@redhat.com>
Fri, 22 Jan 2016 19:09:22 +0000 (14:09 -0500)
committerJán Tomko <jtomko@redhat.com>
Fri, 20 May 2016 07:01:48 +0000 (09:01 +0200)
Nowadays we only support qemu 0.12.0+ which provides QEMU_CAPS_DEVICE,
so this is all dead code.

src/qemu/qemu_process.c

index 40c238b6d48b84bfa8a95a24c85c0d00fe2aa069..fbc778bdfdcca992716475e74fdd9971b4a5408f 100644 (file)
@@ -2406,31 +2406,29 @@ qemuProcessInitPasswords(virConnectPtr conn,
             goto cleanup;
     }
 
-    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
-        for (i = 0; i < vm->def->ndisks; i++) {
-            size_t secretLen;
+    for (i = 0; i < vm->def->ndisks; i++) {
+        size_t secretLen;
 
-            if (!vm->def->disks[i]->src->encryption ||
-                !virDomainDiskGetSource(vm->def->disks[i]))
-                continue;
+        if (!vm->def->disks[i]->src->encryption ||
+            !virDomainDiskGetSource(vm->def->disks[i]))
+            continue;
 
-            VIR_FREE(secret);
-            if (qemuProcessGetVolumeQcowPassphrase(conn,
-                                                   vm->def->disks[i],
-                                                   &secret, &secretLen) < 0)
-                goto cleanup;
+        VIR_FREE(secret);
+        if (qemuProcessGetVolumeQcowPassphrase(conn,
+                                               vm->def->disks[i],
+                                               &secret, &secretLen) < 0)
+            goto cleanup;
 
-            VIR_FREE(alias);
-            if (VIR_STRDUP(alias, vm->def->disks[i]->info.alias) < 0)
-                goto cleanup;
-            if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
-                goto cleanup;
-            ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret);
-            if (qemuDomainObjExitMonitor(driver, vm) < 0)
-                ret = -1;
-            if (ret < 0)
-                goto cleanup;
-        }
+        VIR_FREE(alias);
+        if (VIR_STRDUP(alias, vm->def->disks[i]->info.alias) < 0)
+            goto cleanup;
+        if (qemuDomainObjEnterMonitorAsync(driver, vm, asyncJob) < 0)
+            goto cleanup;
+        ret = qemuMonitorSetDrivePassphrase(priv->mon, alias, secret);
+        if (qemuDomainObjExitMonitor(driver, vm) < 0)
+            ret = -1;
+        if (ret < 0)
+            goto cleanup;
     }
 
  cleanup:
@@ -3290,9 +3288,8 @@ qemuProcessReconnect(void *opaque)
         goto cleanup;
     }
 
-    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE))
-        if ((qemuDomainAssignAddresses(obj->def, priv->qemuCaps, obj)) < 0)
-            goto error;
+    if ((qemuDomainAssignAddresses(obj->def, priv->qemuCaps, obj)) < 0)
+        goto error;
 
     /* if domain requests security driver we haven't loaded, report error, but
      * do not kill the domain
@@ -5981,11 +5978,9 @@ int qemuProcessAttach(virConnectPtr conn ATTRIBUTE_UNUSED,
      * we also need to populate the PCI address set cache for later
      * use in hotplug
      */
-    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_DEVICE)) {
-        VIR_DEBUG("Assigning domain PCI addresses");
-        if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
-            goto error;
-    }
+    VIR_DEBUG("Assigning domain PCI addresses");
+    if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
+        goto error;
 
     if ((timestamp = virTimeStringNow()) == NULL)
         goto error;