qemu: command: Move check whether PR manager object props need to be built

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Peter Krempa 2018-05-11 16:47:49 +02:00
parent 8f7c25ae39
commit b4f113ee44
2 changed files with 6 additions and 6 deletions

View 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)))

View 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. */