Re: [PATCH 1/2] Always free the device in AttachChrDevice

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

 



On 27.01.2015 14:45, Ján Tomko wrote:
> Do not free it in the caller (qemuDomainAttachDeviceFlags),
> because it has no way of knowing if it hasn't been cleaned
> up by qemuProcessStop on monitor EOF.
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1161024
> ---
>  src/qemu/qemu_driver.c  |  3 +--
>  src/qemu/qemu_hotplug.c | 14 ++++++++++----
>  tests/qemuhotplugtest.c |  1 +
>  3 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index ee5e4f5..333b2bf 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -6997,8 +6997,7 @@ qemuDomainAttachDeviceLive(virDomainObjPtr vm,
>      case VIR_DOMAIN_DEVICE_CHR:
>          ret = qemuDomainAttachChrDevice(driver, vm,
>                                          dev->data.chr);
> -        if (!ret)
> -            dev->data.chr = NULL;
> +        dev->data.chr = NULL;

I think it would be clearer if we make qemuDomainAttachChrDevice to add
the device into vm->def only on success like the rest of attach function
do. There's nothing wrong with the code though.

Michal

--
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]