[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH 2/7] qemu: process: Drop !QEMU_CAPS_DEVICE code



From: Cole Robinson <crobinso redhat com>

Nowadays we only support qemu 0.12.0+ which provides QEMU_CAPS_DEVICE,
so this is all dead code.
---
 src/qemu/qemu_process.c | 53 ++++++++++++++++++++++---------------------------
 1 file changed, 24 insertions(+), 29 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 40c238b..b7c8f25 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -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)
+    VIR_DEBUG("Assigning domain PCI addresses");
+    if ((qemuDomainAssignAddresses(vm->def, priv->qemuCaps, vm)) < 0)
             goto error;
-    }
 
     if ((timestamp = virTimeStringNow()) == NULL)
         goto error;
-- 
2.7.3


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]