On 04/14/2018 05:18 PM, John Ferlan wrote:
[...]
> *
> @@ -411,13 +434,16 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
> bool driveAdded = false;
> bool secobjAdded = false;
> bool encobjAdded = false;
> + bool prmgrAdded = false;
> bool prdStarted = false;
> virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
> virJSONValuePtr secobjProps = NULL;
> virJSONValuePtr encobjProps = NULL;
> + virJSONValuePtr prmgrProps = NULL;
> qemuDomainStorageSourcePrivatePtr srcPriv;
> qemuDomainSecretInfoPtr secinfo = NULL;
> qemuDomainSecretInfoPtr encinfo = NULL;
> + qemuDomainDiskPRDPtr prd = NULL;
>
> if (qemuHotplugPrepareDiskAccess(driver, vm, disk, NULL, false) < 0)
> goto cleanup;
> @@ -437,6 +463,7 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
> if (srcPriv) {
> secinfo = srcPriv->secinfo;
> encinfo = srcPriv->encinfo;
> + prd = srcPriv->prd;
> }
>
> if (secinfo && secinfo->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES) {
> @@ -447,6 +474,9 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
> if (encinfo && qemuBuildSecretInfoProps(encinfo, &encobjProps) <
0)
> goto error;
>
> + if (qemuMaybeBuildPRManagerInfoProps(vm, prd, &prmgrProps) < 0)
> + goto error;
> +
> if (disk->src->haveTLS &&
> qemuDomainAddDiskSrcTLSObject(driver, vm, disk->src,
> disk->info.alias) < 0)
> @@ -484,6 +514,15 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver,
> encobjAdded = true;
> }
>
> + if (prmgrProps) {
> + rv = qemuMonitorAddObject(priv->mon, "pr-manager-helper",
prd->alias,
> + prmgrProps);
> + prmgrProps = NULL; /* qemuMonitorAddObject consumes */
> + if (rv < 0)
> + goto exit_monitor;
> + prmgrAdded = true;
> + }
> +
Oh yeah - coverity let me know that @prmgrProps could be leaked if we
don't get this far - need to add the virJSONValueFree cleanup
Ah, sure. Nice catch.
Michal