From: Igor Mammedov <imammedo@redhat.com>
To: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Cc: qemu-devel@nongnu.org, xiaoguangrong.eric@gmail.com,
mst@redhat.com, bharata@linux.ibm.com, qemu-ppc@nongnu.org,
vaibhav@linux.ibm.com, david@gibson.dropbear.id.au
Subject: Re: [Qemu-devel] [RFC PATCH 1/4] mem: make nvdimm_device_list global
Date: Tue, 19 Feb 2019 08:59:16 +0100 [thread overview]
Message-ID: <20190219085916.7b739718@redhat.com> (raw)
In-Reply-To: <154943065253.27958.18316807886952418325.stgit@lep8c.aus.stglabs.ibm.com>
On Tue, 05 Feb 2019 23:25:54 -0600
Shivaprasad G Bhat <sbhat@linux.ibm.com> wrote:
> nvdimm_device_list is required for parsing the list for devices
> in subsequent patches. Move it to common area.
>
> Signed-off-by: Shivaprasad G Bhat <sbhat@linux.ibm.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> hw/acpi/nvdimm.c | 27 ---------------------------
> hw/mem/nvdimm.c | 27 +++++++++++++++++++++++++++
> include/hw/mem/nvdimm.h | 2 ++
> 3 files changed, 29 insertions(+), 27 deletions(-)
>
> diff --git a/hw/acpi/nvdimm.c b/hw/acpi/nvdimm.c
> index e53b2cb681..34322298c2 100644
> --- a/hw/acpi/nvdimm.c
> +++ b/hw/acpi/nvdimm.c
> @@ -33,33 +33,6 @@
> #include "hw/nvram/fw_cfg.h"
> #include "hw/mem/nvdimm.h"
>
> -static int nvdimm_device_list(Object *obj, void *opaque)
> -{
> - GSList **list = opaque;
> -
> - if (object_dynamic_cast(obj, TYPE_NVDIMM)) {
> - *list = g_slist_append(*list, DEVICE(obj));
> - }
> -
> - object_child_foreach(obj, nvdimm_device_list, opaque);
> - return 0;
> -}
> -
> -/*
> - * inquire NVDIMM devices and link them into the list which is
> - * returned to the caller.
> - *
> - * Note: it is the caller's responsibility to free the list to avoid
> - * memory leak.
> - */
> -static GSList *nvdimm_get_device_list(void)
> -{
> - GSList *list = NULL;
> -
> - object_child_foreach(qdev_get_machine(), nvdimm_device_list, &list);
> - return list;
> -}
> -
> #define NVDIMM_UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
> { (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
> (b) & 0xff, ((b) >> 8) & 0xff, (c) & 0xff, ((c) >> 8) & 0xff, \
> diff --git a/hw/mem/nvdimm.c b/hw/mem/nvdimm.c
> index bf2adf5e16..f221ec7a9a 100644
> --- a/hw/mem/nvdimm.c
> +++ b/hw/mem/nvdimm.c
> @@ -29,6 +29,33 @@
> #include "hw/mem/nvdimm.h"
> #include "hw/mem/memory-device.h"
>
> +static int nvdimm_device_list(Object *obj, void *opaque)
> +{
> + GSList **list = opaque;
> +
> + if (object_dynamic_cast(obj, TYPE_NVDIMM)) {
> + *list = g_slist_append(*list, DEVICE(obj));
> + }
> +
> + object_child_foreach(obj, nvdimm_device_list, opaque);
> + return 0;
> +}
> +
> +/*
> + * inquire NVDIMM devices and link them into the list which is
> + * returned to the caller.
> + *
> + * Note: it is the caller's responsibility to free the list to avoid
> + * memory leak.
> + */
> +GSList *nvdimm_get_device_list(void)
> +{
> + GSList *list = NULL;
> +
> + object_child_foreach(qdev_get_machine(), nvdimm_device_list, &list);
> + return list;
> +}
> +
> static void nvdimm_get_label_size(Object *obj, Visitor *v, const char *name,
> void *opaque, Error **errp)
> {
> diff --git a/include/hw/mem/nvdimm.h b/include/hw/mem/nvdimm.h
> index c5c9b3c7f8..e8b086f2df 100644
> --- a/include/hw/mem/nvdimm.h
> +++ b/include/hw/mem/nvdimm.h
> @@ -150,4 +150,6 @@ void nvdimm_build_acpi(GArray *table_offsets, GArray *table_data,
> uint32_t ram_slots);
> void nvdimm_plug(AcpiNVDIMMState *state);
> void nvdimm_acpi_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev);
> +GSList *nvdimm_get_device_list(void);
> +
> #endif
>
>
next prev parent reply other threads:[~2019-02-19 7:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-06 5:24 [Qemu-devel] [RFC PATCH 0/4] ppc: spapr: virtual NVDIMM support Shivaprasad G Bhat
2019-02-06 5:25 ` [Qemu-devel] [RFC PATCH 1/4] mem: make nvdimm_device_list global Shivaprasad G Bhat
2019-02-19 7:59 ` Igor Mammedov [this message]
2019-02-06 5:26 ` [Qemu-devel] [RFC PATCH 2/4] mem: implement memory_device_set_region_size Shivaprasad G Bhat
2019-02-06 5:26 ` [Qemu-devel] [RFC PATCH 3/4] spapr: Add NVDIMM device support Shivaprasad G Bhat
2019-02-12 1:49 ` David Gibson
2019-02-15 11:11 ` Shivaprasad G Bhat
2019-02-17 23:02 ` David Gibson
2019-02-18 16:15 ` Shivaprasad G Bhat
2019-02-27 4:27 ` David Gibson
2019-02-19 8:11 ` Igor Mammedov
2019-02-19 9:29 ` Shivaprasad G Bhat
2019-02-21 14:12 ` Igor Mammedov
2019-02-28 8:54 ` Shivaprasad G Bhat
2019-03-05 9:13 ` Igor Mammedov
2019-02-06 5:26 ` [Qemu-devel] [RFC PATCH 4/4] spapr: Add Hcalls to support PAPR NVDIMM device Shivaprasad G Bhat
2019-02-12 2:28 ` David Gibson
2019-02-15 11:11 ` Shivaprasad G Bhat
2019-02-19 5:33 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190219085916.7b739718@redhat.com \
--to=imammedo@redhat.com \
--cc=bharata@linux.ibm.com \
--cc=david@gibson.dropbear.id.au \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
--cc=sbhat@linux.ibm.com \
--cc=vaibhav@linux.ibm.com \
--cc=xiaoguangrong.eric@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).