qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	qemu-devel@nongnu.org, Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PULL 05/23] pc-dimm: add pc_dimm_build_list()
Date: Thu, 25 Feb 2016 12:22:54 +0200	[thread overview]
Message-ID: <20160225122131-mutt-send-email-mst@redhat.com> (raw)
In-Reply-To: <56CED2CC.3040208@redhat.com>

On Thu, Feb 25, 2016 at 11:09:16AM +0100, Paolo Bonzini wrote:
> 
> 
> On 25/02/2016 10:54, Vladimir Sementsov-Ogievskiy wrote:
> > On 25.02.2016 12:11, Michael S. Tsirkin wrote:
> >> On Thu, Feb 25, 2016 at 11:55:56AM +0300, Vladimir Sementsov-Ogievskiy
> >> wrote:
> >>> On 25.02.2016 11:39, Michael S. Tsirkin wrote:
> >>>> On Thu, Feb 25, 2016 at 10:01:18AM +0300, Vladimir
> >>>> Sementsov-Ogievskiy wrote:
> >>>>> Stop!
> >>>> It builds fine here. Did you check out my tree?
> >>> anyway, this file should be here, as it is added into Makefile:
> >>>
> >>> --- a/stubs/Makefile.objs
> >>> +++ b/stubs/Makefile.objs
> >>> @@ -35,7 +35,7 @@ stub-obj-y += vmstate.o
> >>>   stub-obj-$(CONFIG_WIN32) += fd-register.o
> >>>   stub-obj-y += cpus.o
> >>>   stub-obj-y += kvm.o
> >>> -stub-obj-y += qmp_pc_dimm_device_list.o
> >>> +stub-obj-y += pc_dimm.o
> >>>   stub-obj-y += target-monitor-defs.o
> >>>   stub-obj-y += target-get-monitor-def.o
> >>>   stub-obj-y += vhost.o
> >>>
> >> Hmm that's right.
> >> Thanks!
> >> Looks like it was picking up an old object in the filesystem :(
> >> I'll respin - for now, does everything work for you if you drop
> >> this line from the makefile?
> > 
> > it will break compilation for targets without memory hotplug, it was
> > discussed on list. stubs are necessary.
> 
> mst,
> 
> indeed it's not clear to me why you're deleting qmp_pc_dimm_device_list.c...
> 
> On the other hand, pc_dimm_build_list doesn't need a stub.  Just put it
> in hw/virtio/virtio-balloon.c.
> 
> Paolo

Like this then?

diff --git a/include/hw/mem/pc-dimm.h b/include/hw/mem/pc-dimm.h
index 0f587a4..f6cbc78 100644
--- a/include/hw/mem/pc-dimm.h
+++ b/include/hw/mem/pc-dimm.h
@@ -95,6 +95,4 @@ void pc_dimm_memory_plug(DeviceState *dev, MemoryHotplugState *hpms,
 void pc_dimm_memory_unplug(DeviceState *dev, MemoryHotplugState *hpms,
                            MemoryRegion *mr);
 
-int pc_dimm_build_list(Object *obj, void *opaque);
-
 #endif
diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 09e99ce..835179e 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -267,21 +267,6 @@ static int pc_dimm_build_list_sorted(Object *obj, void *opaque)
     return 0;
 }
 
-int pc_dimm_build_list(Object *obj, void *opaque)
-{
-    GSList **list = opaque;
-
-    if (object_dynamic_cast(obj, TYPE_PC_DIMM)) {
-        DeviceState *dev = DEVICE(obj);
-        if (dev->realized) { /* only realized DIMMs matter */
-            *list = g_slist_prepend(*list, dev);
-        }
-    }
-
-    object_child_foreach(obj, pc_dimm_build_list, opaque);
-    return 0;
-}
-
 uint64_t pc_dimm_get_free_addr(uint64_t address_space_start,
                                uint64_t address_space_size,
                                uint64_t *hint, uint64_t align, uint64_t size,
diff --git a/hw/virtio/virtio-balloon.c b/hw/virtio/virtio-balloon.c
index 3fb6c52..24eab0a 100644
--- a/hw/virtio/virtio-balloon.c
+++ b/hw/virtio/virtio-balloon.c
@@ -305,12 +305,27 @@ static void virtio_balloon_get_config(VirtIODevice *vdev, uint8_t *config_data)
     memcpy(config_data, &config, sizeof(struct virtio_balloon_config));
 }
 
+int build_dimm_list(Object *obj, void *opaque)
+{
+    GSList **list = opaque;
+
+    if (object_dynamic_cast(obj, TYPE_PC_DIMM)) {
+        DeviceState *dev = DEVICE(obj);
+        if (dev->realized) { /* only realized DIMMs matter */
+            *list = g_slist_prepend(*list, dev);
+        }
+    }
+
+    object_child_foreach(obj, build_dimm_list, opaque);
+    return 0;
+}
+
 static ram_addr_t get_current_ram_size(void)
 {
     GSList *list = NULL, *item;
     ram_addr_t size = ram_size;
 
-    pc_dimm_build_list(qdev_get_machine(), &list);
+    build_dimm_list(qdev_get_machine(), &list);
     for (item = list; item; item = g_slist_next(item)) {
         Object *obj = OBJECT(item->data);
         if (!strcmp(object_get_typename(obj), TYPE_PC_DIMM)) {

  parent reply	other threads:[~2016-02-25 10:23 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 20:35 [Qemu-devel] [PULL 00/23] vhost, virtio, pci, pc Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 01/23] bios-linker-loader: document+validate input Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 02/23] vhost-user: don't merge regions with different fds Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 03/23] move get_current_ram_size to virtio-balloon.c Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 04/23] pc-dimm: rename pc_dimm_built_list() Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 05/23] pc-dimm: add pc_dimm_build_list() Michael S. Tsirkin
2016-02-25  7:01   ` Vladimir Sementsov-Ogievskiy
2016-02-25  8:39     ` Michael S. Tsirkin
2016-02-25  8:55       ` Vladimir Sementsov-Ogievskiy
2016-02-25  9:11         ` Michael S. Tsirkin
2016-02-25  9:54           ` Vladimir Sementsov-Ogievskiy
2016-02-25 10:09             ` Paolo Bonzini
2016-02-25 10:12               ` Michael S. Tsirkin
2016-02-25 10:22               ` Michael S. Tsirkin [this message]
2016-02-26  9:08                 ` Vladimir Sementsov-Ogievskiy
2016-02-26  9:08               ` Vladimir Sementsov-Ogievskiy
2016-02-24 20:35 ` [Qemu-devel] [PULL 06/23] virtio-balloon: rewrite get_current_ram_size() Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 07/23] balloon: Use only 'pc-dimm' type dimm for ballooning Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 08/23] pci core: function pci_host_bus_register() cleanup Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 09/23] pci core: function pci_bus_init() cleanup Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 10/23] block-migration: acquire AioContext as necessary Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 11/23] vring: make vring_enable_notification return void Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 12/23] virtio: add AioContext-specific function for host notifiers Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 13/23] virtio: export vring_notify as virtio_should_notify Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 14/23] virtio-blk: fix "disabled data plane" mode Michael S. Tsirkin
2016-02-24 20:35 ` [Qemu-devel] [PULL 15/23] virtio-blk: do not use vring in dataplane Michael S. Tsirkin
2016-02-24 20:36 ` [Qemu-devel] [PULL 16/23] virtio-scsi: " Michael S. Tsirkin
2016-02-24 20:36 ` [Qemu-devel] [PULL 17/23] vring: remove Michael S. Tsirkin
2016-02-24 20:36 ` [Qemu-devel] [PULL 18/23] tests/vhost-user-bridge: fix build on 32 bit systems Michael S. Tsirkin
2016-02-24 20:36 ` [Qemu-devel] [PULL 19/23] q35: Remove old machine versions Michael S. Tsirkin
2016-02-24 20:36 ` [Qemu-devel] [PULL 20/23] machine: Remove no_tco field Michael S. Tsirkin
2016-02-24 20:36 ` [Qemu-devel] [PULL 21/23] ich9: Remove enable_tco arguments from init functions Michael S. Tsirkin
2016-02-24 20:36 ` [Qemu-devel] [PULL 22/23] q35: Remove unused q35-acpi-dsdt.aml file Michael S. Tsirkin
2016-02-24 20:36 ` [Qemu-devel] [PULL 23/23] q35: No need to check gigabyte_align Michael S. Tsirkin

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=20160225122131-mutt-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.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).