[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 008/108] qdev: expose DeviceState.hotplugged field
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL v2 008/108] qdev: expose DeviceState.hotplugged field as a property |
Date: |
Wed, 18 Jun 2014 19:44:15 +0300 |
From: Igor Mammedov <address@hidden>
so that management could detect via QOM interface if device was
hotplugged
Signed-off-by: Igor Mammedov <address@hidden>
Acked-by: Peter Crosthwaite <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/core/qdev.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index fded645..3226a71 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -878,6 +878,20 @@ static bool device_get_hotpluggable(Object *obj, Error
**errp)
dev->parent_bus->allow_hotplug);
}
+static bool device_get_hotplugged(Object *obj, Error **err)
+{
+ DeviceState *dev = DEVICE(obj);
+
+ return dev->hotplugged;
+}
+
+static void device_set_hotplugged(Object *obj, bool value, Error **err)
+{
+ DeviceState *dev = DEVICE(obj);
+
+ dev->hotplugged = value;
+}
+
static void device_initfn(Object *obj)
{
DeviceState *dev = DEVICE(obj);
@@ -896,6 +910,9 @@ static void device_initfn(Object *obj)
device_get_realized, device_set_realized, NULL);
object_property_add_bool(obj, "hotpluggable",
device_get_hotpluggable, NULL, NULL);
+ object_property_add_bool(obj, "hotplugged",
+ device_get_hotplugged, device_set_hotplugged,
+ &error_abort);
class = object_get_class(OBJECT(dev));
do {
--
MST
- [Qemu-devel] [PULL v2 000/108] pc, pci, virtio, hotplug fixes, enhancements, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 001/108] pc: create custom generic PC machine type, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 005/108] add memdev backend infrastructure, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 006/108] vl.c: extend -m option to support options for memory hotplug, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 007/108] qdev: hotplug for bus-less devices, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 002/108] pc: ACPI BIOS: use enum for defining memory affinity flags, Michael S. Tsirkin, 2014/06/18
- [Qemu-devel] [PULL v2 008/108] qdev: expose DeviceState.hotplugged field as a property,
Michael S. Tsirkin <=