]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: command: Move check whether PR manager object props need to be built
authorPeter Krempa <pkrempa@redhat.com>
Fri, 11 May 2018 14:47:49 +0000 (16:47 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 16 May 2018 04:32:29 +0000 (06:32 +0200)
Move it out of the format function and let the caller decide this.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_command.c
src/qemu/qemu_hotplug.c

index 353e0af3d7a3130d814e6694b1d147b147a7e8ba..348ba3e99e54378745d4f9d20fd666d449f0477a 100644 (file)
@@ -9737,9 +9737,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;
@@ -9775,6 +9772,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;
@@ -9785,9 +9785,6 @@ qemuBuildMasterPRCommandLine(virCommandPtr cmd,
         if (qemuBuildPRManagerInfoProps(disk, &props, &alias) < 0)
             goto cleanup;
 
-        if (!props)
-            continue;
-
         if (!(tmp = virQEMUBuildObjectCommandlineFromJSON("pr-manager-helper",
                                                           alias,
                                                           props)))
index 5682695ae036dce60e04fd8396f761f5f1f958d1..1a27b9683022ee8fd7299f012c00a9bb1de34846 100644 (file)
@@ -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. */