[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 09/35] qdev: expose DeviceState.hotplugged field
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 09/35] qdev: expose DeviceState.hotplugged field as a property |
Date: |
Mon, 14 Apr 2014 18:02:32 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 |
Am 04.04.2014 15:36, schrieb Igor Mammedov:
> so that managment could detect via QOM interface if device was
"management"
> hotplugged
>
> Signed-off-by: Igor Mammedov <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 50bb8f5..a278380 100644
> --- a/hw/core/qdev.c
> +++ b/hw/core/qdev.c
> @@ -826,6 +826,20 @@ static bool device_get_hotpluggable(Object *obj, Error
> **err)
> 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;
> +}
What is the use case of setting this from management side?
Otherwise looks good.
Regards,
Andreas
> +
> static void device_initfn(Object *obj)
> {
> DeviceState *dev = DEVICE(obj);
> @@ -844,6 +858,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 {
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH 05/35] vl.c: extend -m option to support options for memory hotplug, (continued)
- [Qemu-devel] [PATCH 05/35] vl.c: extend -m option to support options for memory hotplug, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 06/35] add pc-{i440fx,q35}-2.1 machine types, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 03/35] object_add: allow completion handler to get canonical path, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 08/35] qdev: hotplug for buss-less devices, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 09/35] qdev: expose DeviceState.hotplugged field as a property, Igor Mammedov, 2014/04/04
- Re: [Qemu-devel] [PATCH 09/35] qdev: expose DeviceState.hotplugged field as a property,
Andreas Färber <=
- [Qemu-devel] [PATCH 12/35] dimm: do not allow to set already busy memdev, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 11/35] memory: add memory_region_is_mapped() API, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 02/35] vl: convert -m to QemuOpts, Igor Mammedov, 2014/04/04
- [Qemu-devel] [PATCH 13/35] pc: initialize memory hotplug address space, Igor Mammedov, 2014/04/04
[Qemu-devel] [PATCH 14/35] pc: exit QEMU if slots > 256, Igor Mammedov, 2014/04/04