[libvirt] [PATCH 4/4] qemu: Remove character device backend only after frontend is gone
Peter Krempa
pkrempa at redhat.com
Mon Jun 2 12:34:09 UTC 2014
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 at redhat.com>
> ---
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140602/22181f28/attachment-0001.sig>
More information about the libvir-list
mailing list