[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] qdev: export the bus reset interface
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] qdev: export the bus reset interface |
Date: |
Tue, 10 Jul 2012 10:40:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0 |
Il 10/07/2012 08:16, Liu Ping Fan ha scritto:
> Signed-off-by: Liu Ping Fan <address@hidden>
> ---
> hw/qdev.c | 17 ++++++++++++-----
> hw/qdev.h | 2 ++
> 2 files changed, 14 insertions(+), 5 deletions(-)
>
> diff --git a/hw/qdev.c b/hw/qdev.c
> index d2100a1..f7983e4 100644
> --- a/hw/qdev.c
> +++ b/hw/qdev.c
> @@ -249,11 +249,9 @@ static int qdev_reset_one(DeviceState *dev, void *opaque)
>
> static int qbus_reset_one(BusState *bus, void *opaque)
> {
> - BusClass *bc = BUS_GET_CLASS(bus);
> - if (bc->reset) {
> - return bc->reset(bus);
> - }
> - return 0;
> + int ret;
> + ret = bus_reset(bus);
> + return ret;
> }
>
> void qdev_reset_all(DeviceState *dev)
> @@ -766,6 +764,15 @@ void device_reset(DeviceState *dev)
> }
> }
>
> +int bus_reset(BusState *bus)
> +{
> + BusClass *bc = BUS_GET_CLASS(bus);
> + if (bc->reset) {
> + return bc->reset(bus);
> + }
> + return 0;
> +}
Two comments:
1) Is this correct? Resetting a bus should reset all the children before
resetting the bus itself.
2) Does it make sense to export it, since we're going towards removing
unnecessary buses?
Paolo
> +
> Object *qdev_get_machine(void)
> {
> static Object *dev;
> diff --git a/hw/qdev.h b/hw/qdev.h
> index aecc69e..5f88b4b 100644
> --- a/hw/qdev.h
> +++ b/hw/qdev.h
> @@ -356,6 +356,8 @@ void qdev_machine_init(void);
> */
> void device_reset(DeviceState *dev);
>
> +int bus_reset(BusState *bus);
> +
> const VMStateDescription *qdev_get_vmsd(DeviceState *dev);
>
> const char *qdev_fw_name(DeviceState *dev);
>
- [Qemu-devel] make apic hot-plugable, Liu Ping Fan, 2012/07/10
- [Qemu-devel] [PATCH 2/5] qom: introduce object_is_type_str(), so we can judge its type., Liu Ping Fan, 2012/07/10
- [Qemu-devel] [PATCH 3/5] qdev: export the bus reset interface, Liu Ping Fan, 2012/07/10
- Re: [Qemu-devel] [PATCH 3/5] qdev: export the bus reset interface,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 4/5] qom-cpu: during cpu reset, it will reset its child, Liu Ping Fan, 2012/07/10
- Re: [Qemu-devel] [PATCH 4/5] qom-cpu: during cpu reset, it will reset its child, liu ping fan, 2012/07/10
- Re: [Qemu-devel] [PATCH 4/5] qom-cpu: during cpu reset, it will reset its child, Paolo Bonzini, 2012/07/11
[Qemu-devel] [PATCH 5/5] apic: create apic as a child of cpu, not system_bus any longer, Liu Ping Fan, 2012/07/10