[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/5] qdev: export the bus reset interface
From: |
Liu Ping Fan |
Subject: |
[Qemu-devel] [PATCH 3/5] qdev: export the bus reset interface |
Date: |
Tue, 10 Jul 2012 14:16:05 +0800 |
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;
+}
+
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);
--
1.7.4.4
- [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 <=
- [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