[PATCH 10/13] qemu: command: Move check whether PR manager object props need to be built

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

 



Move it out of the formatter function and let the caller decide this.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_command.c | 9 +++------
 src/qemu/qemu_hotplug.c | 3 +++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 7df9979cb2..c38dde5a60 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -9687,9 +9687,6 @@ qemuBuildPRManagerInfoProps(const virDomainDiskDef *disk,
     *propsret = NULL;
     *aliasret = NULL;

-    if (!disk->src->pr)
-        return 0;
-
     if (virStoragePRDefIsManaged(disk->src->pr)) {
         if (VIR_STRDUP(alias, qemuDomainGetManagedPRAlias()) < 0)
             goto cleanup;
@@ -9725,6 +9722,9 @@ qemuBuildMasterPRCommandLine(virCommandPtr cmd,
     for (i = 0; i < def->ndisks; i++) {
         const virDomainDiskDef *disk = def->disks[i];

+        if (!disk->src->pr)
+            continue;
+
         if (virStoragePRDefIsManaged(disk->src->pr)) {
             if (managedAdded)
                 continue;
@@ -9735,9 +9735,6 @@ qemuBuildMasterPRCommandLine(virCommandPtr cmd,
         if (qemuBuildPRManagerInfoProps(disk, &props, &alias) < 0)
             goto cleanup;

-        if (!props)
-            continue;
-
         if (!(tmp = virQEMUBuildObjectCommandlineFromJSON("pr-manager-helper",
                                                           alias,
                                                           props)))
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 3a26876c10..6557711ec1 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -395,6 +395,9 @@ qemuMaybeBuildPRManagerInfoProps(virDomainObjPtr vm,
     *propsret = NULL;
     *aliasret = NULL;

+    if (!disk->src->pr)
+        return 0;
+
     if (virStoragePRDefIsManaged(disk->src->pr) &&
         priv->prDaemonRunning) {
         /* @disk requires qemu-pr-helper but there's already one running. */
-- 
2.16.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux