[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] qdev: free qemu-opts when the QOM path goes awa
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] qdev: free qemu-opts when the QOM path goes away |
Date: |
Wed, 4 Nov 2015 16:53:11 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 19/10/2015 13:11, Paolo Bonzini wrote:
> Otherwise there is a race where the DEVICE_DELETED event has been sent but
> attempts to reuse the ID will fail.
>
> Reported-by: Michael S. Tsirkin <address@hidden>
> Signed-off-by: Paolo Bonzini <address@hidden>
Ping?
Paolo
> ---
> hw/core/qdev.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/core/qdev.c b/hw/core/qdev.c
> index 4ab04aa..92bd8bb 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -1203,7 +1203,6 @@ static void device_finalize(Object *obj)
> NamedGPIOList *ngl, *next;
>
> DeviceState *dev = DEVICE(obj);
> - qemu_opts_del(dev->opts);
>
> QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) {
> QLIST_REMOVE(ngl, node);
> @@ -1251,6 +1250,9 @@ static void device_unparent(Object *obj)
> qapi_event_send_device_deleted(!!dev->id, dev->id, path,
> &error_abort);
> g_free(path);
> }
> +
> + qemu_opts_del(dev->opts);
> + dev->opts = NULL;
> }
>
> static void device_class_init(ObjectClass *class, void *data)
>
- Re: [Qemu-devel] [PATCH] qdev: free qemu-opts when the QOM path goes away,
Paolo Bonzini <=