[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycl
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem |
Date: |
Fri, 24 Aug 2012 16:42:57 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 |
Il 24/08/2012 11:49, Liu Ping Fan ha scritto:
> With this patch, we can protect PCIIDEState from disappearing during
> mmio-dispatch hold the IDEBus->ref.
I don't see why MMIO dispatch should hold the IDEBus ref rather than the
PCIIDEState.
In the case of the PIIX, the BARs are set up by the PCIIDEState in
bmdma_setup_bar (called by bmdma_setup_bar).
Also, containment may happen just as well for devices, not buses. Why
isn't it a problem in that case? It looks like you're papering over a
different bug.
Paolo
> And the ref circle has been broken when calling qdev_delete_subtree().
>
> Signed-off-by: Liu Ping Fan <address@hidden>
> ---
> hw/qdev.c | 2 ++
> hw/qdev.h | 1 +
> 2 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/hw/qdev.c b/hw/qdev.c
> index e2339a1..b09ebbf 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -510,6 +510,8 @@ void qbus_create_inplace(BusState *bus, const char
> *typename,
> {
> object_initialize(bus, typename);
>
> + bus->overlap = parent;
> + object_ref(OBJECT(bus->overlap));
> bus->parent = parent;
> bus->name = name ? g_strdup(name) : NULL;
> qbus_realize(bus);
> diff --git a/hw/qdev.h b/hw/qdev.h
> index 182cfa5..9bc5783 100644
> --- a/hw/qdev.h
> +++ b/hw/qdev.h
> @@ -117,6 +117,7 @@ struct BusState {
> int allow_hotplug;
> bool qom_allocated;
> bool glib_allocated;
> + DeviceState *overlap;
> int max_index;
> QTAILQ_HEAD(ChildrenHead, BusChild) children;
> QLIST_ENTRY(BusState) sibling;
> -- 1.7.4.4
- [Qemu-devel] [PATCH 04/10] qdev: introduce new interface to remove composite sub-tree, (continued)
- [Qemu-devel] [PATCH 04/10] qdev: introduce new interface to remove composite sub-tree, Liu Ping Fan, 2012/08/24
- [Qemu-devel] [PATCH 05/10] qdev: finalize of qbus, qdev will not the right place to free children, Liu Ping Fan, 2012/08/24
- [Qemu-devel] [PATCH 06/10] qom: expose object_property_del_child, Liu Ping Fan, 2012/08/24
- [Qemu-devel] [PATCH 07/10] unplug: using new intf qdev_delete_subtree in acpi_piix_eject_slot, Liu Ping Fan, 2012/08/24
- [Qemu-devel] [PATCH 09/10] mon: release dev's ref hold by qdev_get_peripheral, Liu Ping Fan, 2012/08/24
- [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, Liu Ping Fan, 2012/08/24
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem,
Paolo Bonzini <=
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, liu ping fan, 2012/08/25
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, Paolo Bonzini, 2012/08/27
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, Jan Kiszka, 2012/08/27
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, liu ping fan, 2012/08/27
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, Jan Kiszka, 2012/08/27
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, Avi Kivity, 2012/08/27
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, Jan Kiszka, 2012/08/27
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, Avi Kivity, 2012/08/27
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, Jan Kiszka, 2012/08/27
- Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem, Avi Kivity, 2012/08/27