[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 7/9] qdev: add notifier for when the device loses it
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 7/9] qdev: add notifier for when the device loses its parent bus (eject) |
Date: |
Sun, 26 Aug 2012 10:51:36 -0500 |
Signed-off-by: Anthony Liguori <address@hidden>
---
hw/qdev.c | 2 ++
hw/qdev.h | 3 +++
2 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index fdee91f..86e1337 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -672,6 +672,8 @@ static void device_initfn(Object *obj)
object_property_add_link(OBJECT(dev), "parent_bus", TYPE_BUS,
(Object **)&dev->parent_bus, NULL);
+
+ notifier_list_init(&dev->eject_notifier);
}
/* Unlink device from bus and free the structure. */
diff --git a/hw/qdev.h b/hw/qdev.h
index 3561e3a..5009072 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -8,6 +8,7 @@
#include "qapi/qapi-visit-core.h"
#include "qemu/object.h"
#include "error.h"
+#include "notify.h"
typedef struct Property Property;
@@ -76,6 +77,8 @@ struct DeviceState {
int num_child_bus;
int instance_id_alias;
int alias_required_for_version;
+
+ NotifierList eject_notifier;
};
#define TYPE_BUS "bus"
--
1.7.5.4
- [Qemu-devel] [RFC PATCH 0/9] qom: improve reference counting and hotplug, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 1/9] savevm: don't rely on paths if we can store a DeviceState object, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 6/9] qdev: make devices created with device_add nullable so they can be deleted, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 4/9] object: remove object_finalize, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 7/9] qdev: add notifier for when the device loses its parent bus (eject),
Anthony Liguori <=
- [Qemu-devel] [PATCH 2/9] object: automatically free objects based on a release function, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 8/9] qdev: make qdev_set_parent_bus() just set a link property, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 9/9] hotplug: refactor hotplug to leverage new QOM functions, Anthony Liguori, 2012/08/26
- [Qemu-devel] [PATCH 3/9] qbus: remove glib_allocated/qom_allocated and use release hook to free memory, Anthony Liguori, 2012/08/26