[libvirt] [PATCH v11 3/5] qemu: Need to remove TLS object in RemoveRNGDevice

Pavel Hrdina phrdina at redhat.com
Tue Oct 25 12:53:34 UTC 2016


On Mon, Oct 24, 2016 at 06:46:19PM -0400, John Ferlan wrote:
> Commit id '6e6b4bfc' added the object, but forgot the other end.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/qemu/qemu_hotplug.c | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)

ACK if you agree with review on the first patch that the order of 
qemuMonitorDelObject and qemuMonitorDetachCharDev should be swapped.

Pavel

> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index e287aaf..f401b48 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -3608,6 +3608,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
>      virObjectEventPtr event;
>      char *charAlias = NULL;
>      char *objAlias = NULL;
> +    char *tlsAlias = NULL;
>      qemuDomainObjPrivatePtr priv = vm->privateData;
>      ssize_t idx;
>      int ret = -1;
> @@ -3616,15 +3617,23 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
>      VIR_DEBUG("Removing RNG device %s from domain %p %s",
>                rng->info.alias, vm, vm->def->name);
>  
> +
>      if (virAsprintf(&objAlias, "obj%s", rng->info.alias) < 0)
>          goto cleanup;
>  
>      if (!(charAlias = qemuAliasChardevFromDevAlias(rng->info.alias)))
>          goto cleanup;
>  
> +    if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD &&
> +        !(tlsAlias = qemuAliasTLSObjFromChardevAlias(charAlias)))
> +        goto cleanup;
> +
>      qemuDomainObjEnterMonitor(driver, vm);
> -    if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD)
> +    if (rng->backend == VIR_DOMAIN_RNG_BACKEND_EGD) {
> +        if (tlsAlias)
> +            ignore_value(qemuMonitorDelObject(priv->mon, tlsAlias));
>          ignore_value(qemuMonitorDetachCharDev(priv->mon, charAlias));
> +    }
>  
>      rc = qemuMonitorDelObject(priv->mon, objAlias);
>  
> @@ -3648,6 +3657,7 @@ qemuDomainRemoveRNGDevice(virQEMUDriverPtr driver,
>   cleanup:
>      VIR_FREE(charAlias);
>      VIR_FREE(objAlias);
> +    VIR_FREE(tlsAlias);
>      return ret;
>  }
>  
> -- 
> 2.7.4
> 
> --
> libvir-list mailing list
> libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20161025/fda3016d/attachment-0001.sig>


More information about the libvir-list mailing list