[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RESEND PATCH v1 02/13] acpi, mem-hotplug: Add acpi_mem
From: |
Igor Mammedov |
Subject: |
Re: [Qemu-devel] [RESEND PATCH v1 02/13] acpi, mem-hotplug: Add acpi_memory_get_slot_status_descriptor() to get MemStatus. |
Date: |
Thu, 29 Jan 2015 13:33:38 +0100 |
On Thu, 8 Jan 2015 09:06:09 +0800
Tang Chen <address@hidden> wrote:
> Add a new API named acpi_memory_get_slot_status_descriptor() to obtain
> a single memory slot status. Doing this is because this procedure will
> be used by other functions in the next coming patches.
>
> Signed-off-by: Tang Chen <address@hidden>
> ---
> hw/acpi/memory_hotplug.c | 27 +++++++++++++++++++--------
> 1 file changed, 19 insertions(+), 8 deletions(-)
>
> diff --git a/hw/acpi/memory_hotplug.c b/hw/acpi/memory_hotplug.c
> index c6580da..ef56bf6 100644
> --- a/hw/acpi/memory_hotplug.c
> +++ b/hw/acpi/memory_hotplug.c
> @@ -163,29 +163,40 @@ void acpi_memory_hotplug_init(MemoryRegion *as, Object
> *owner,
> memory_region_add_subregion(as, ACPI_MEMORY_HOTPLUG_BASE, &state->io);
> }
>
> -void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st,
> - DeviceState *dev, Error **errp)
> +static MemStatus *
> +acpi_memory_get_slot_status_descriptor(MemHotplugState *mem_st,
> + DeviceState *dev, Error **errp)
how about
s/acpi_memory_get_slot_status_descriptor/acpi_memory_slot_status/
> {
> - MemStatus *mdev;
> Error *local_err = NULL;
> int slot = object_property_get_int(OBJECT(dev), PC_DIMM_SLOT_PROP,
> &local_err);
>
> if (local_err) {
> error_propagate(errp, local_err);
> - return;
> + return NULL;
> }
>
> if (slot >= mem_st->dev_count) {
> char *dev_path = object_get_canonical_path(OBJECT(dev));
> - error_setg(errp, "acpi_memory_plug_cb: "
> + error_setg(errp, "acpi_memory_get_slot_status_descriptor: "
> "device [%s] returned invalid memory slot[%d]",
> - dev_path, slot);
> + dev_path, slot);
> g_free(dev_path);
> - return;
> + return NULL;
> }
>
> - mdev = &mem_st->devs[slot];
> + return &mem_st->devs[slot];
> +}
> +
> +void acpi_memory_plug_cb(ACPIREGS *ar, qemu_irq irq, MemHotplugState *mem_st,
> + DeviceState *dev, Error **errp)
> +{
> + MemStatus *mdev;
> +
> + mdev = acpi_memory_get_slot_status_descriptor(mem_st, dev, errp);
> + if (!mdev)
> + return;
> +
> mdev->dimm = dev;
> mdev->is_enabled = true;
> mdev->is_inserting = true;
- [Qemu-devel] [RESEND PATCH v1 00/13] QEmu memory hot unplug support., Tang Chen, 2015/01/07
- [Qemu-devel] [RESEND PATCH v1 01/13] acpi, mem-hotplug: Use PC_DIMM_SLOT_PROP in acpi_memory_plug_cb()., Tang Chen, 2015/01/07
- [Qemu-devel] [RESEND PATCH v1 02/13] acpi, mem-hotplug: Add acpi_memory_get_slot_status_descriptor() to get MemStatus., Tang Chen, 2015/01/07
- Re: [Qemu-devel] [RESEND PATCH v1 02/13] acpi, mem-hotplug: Add acpi_memory_get_slot_status_descriptor() to get MemStatus.,
Igor Mammedov <=
- [Qemu-devel] [RESEND PATCH v1 03/13] acpi, mem-hotplug: Add acpi_memory_hotplug_sci() to rise sci for memory hotplug., Tang Chen, 2015/01/07
- [Qemu-devel] [RESEND PATCH v1 04/13] acpi, mem-hotplug: Add unplug request cb for memory device., Tang Chen, 2015/01/07
- [Qemu-devel] [RESEND PATCH v1 05/13] acpi, piix4: Add memory hot unplug request support for piix4., Tang Chen, 2015/01/07
- [Qemu-devel] [RESEND PATCH v1 06/13] acpi, ich9: Add memory hot unplug request support for ich9., Tang Chen, 2015/01/07
- [Qemu-devel] [RESEND PATCH v1 08/13] acpi, mem-hotplug: Add unplug cb for memory device., Tang Chen, 2015/01/07
- [Qemu-devel] [RESEND PATCH v1 07/13] pc-dimm: Add memory hot unplug request support for pc-dimm., Tang Chen, 2015/01/07
- [Qemu-devel] [RESEND PATCH v1 09/13] acpi, piix4: Add memory hot unplug support for piix4., Tang Chen, 2015/01/07