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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/libvir-list

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]