Re: [PATCH 4/4] qemu: Remove character device backend only after frontend is gone

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

 



On 05/27/14 16:53, Jiri Denemark wrote:
> In general, we should only remove a backend after seeing DEVICE_DELETED
> event for a corresponding frontend.
> 
> Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx>
> ---
>  src/qemu/qemu_hotplug.c | 25 +++++++++++++++----------
>  1 file changed, 15 insertions(+), 10 deletions(-)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index 43c52bf..4c2f6e3 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -2743,16 +2743,31 @@ qemuDomainRemoveChrDevice(virQEMUDriverPtr driver,
>                            virDomainChrDefPtr chr)
>  {
>      virObjectEventPtr event;
> +    char *charAlias = NULL;
> +    qemuDomainObjPrivatePtr priv = vm->privateData;
>  
>      VIR_DEBUG("Removing character device %s from domain %p %s",
>                chr->info.alias, vm, vm->def->name);
>  
> +    if (virAsprintf(&charAlias, "char%s", chr->info.alias) < 0)
> +        return;
> +
> +    qemuDomainObjEnterMonitor(driver, vm);
> +    if (qemuMonitorDetachCharDev(priv->mon, charAlias) < 0) {
> +        qemuDomainObjExitMonitor(driver, vm);
> +        goto cleanup;
> +    }
> +    qemuDomainObjExitMonitor(driver, vm);
> +

Same conditions as in 3/4.

Peter


Attachment: signature.asc
Description: OpenPGP 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]