mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
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:
parent
8f7c25ae39
commit
b4f113ee44
@ -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)))
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user