[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 008/103] qdev: expose DeviceState.hotplugged field as
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 008/103] qdev: expose DeviceState.hotplugged field as a property |
Date: |
Tue, 17 Jun 2014 20:36:44 +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 000/103] pc, pci, virtio, hotplug fixes, enhancements for 2.1, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 001/103] pc: create custom generic PC machine type, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 003/103] object_add: allow completion handler to get canonical path, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 004/103] vl.c: daemonize before guest memory allocation, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 005/103] add memdev backend infrastructure, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 006/103] vl.c: extend -m option to support options for memory hotplug, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 007/103] qdev: hotplug for buss-less devices, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 002/103] pc: ACPI BIOS: use enum for defining memory affinity flags, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 008/103] qdev: expose DeviceState.hotplugged field as a property,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 011/103] pc-dimm: do not allow to set already used memdev, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 010/103] memory: add memory_region_is_mapped() API, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 009/103] pc: implement pc-dimm device abstraction, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 014/103] pc: add 'etc/reserved-memory-end' fw_cfg interface for SeaBIOS, Michael S. Tsirkin, 2014/06/17
- [Qemu-devel] [PULL 015/103] pc: exit QEMU if compat machine doesn't support memory hotlpug, Michael S. Tsirkin, 2014/06/17