qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>,
	Hu Tao <hutao@cn.fujitsu.com>,
	Anthony Liguori <aliguori@amazon.com>,
	Igor Mammedov <imammedo@redhat.com>
Subject: [Qemu-devel] [PULL 4/5] pc-dimm: Don't check dimm->node when there is non-NUMA config
Date: Tue, 30 Sep 2014 12:40:10 +0300	[thread overview]
Message-ID: <1412069893-4717-5-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1412069893-4717-1-git-send-email-mst@redhat.com>

From: zhanghailiang <zhang.zhanghailiang@huawei.com>

It should not break memory hotplug feature if there is non-NUMA option.

This patch would also allow to use pc-dimm as replacement for initial memory
for non-NUMA configs.

Note: After this patch, the memory hotplug can work normally for Linux guest OS
when there is non-NUMA option and NUMA option. But not support Windows guest OS
to hotplug memory with no-NUMA config, actully, it's Windows limitation.

Reviewed-By: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/mem/pc-dimm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
index 5bfc5b7..a800ea7 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -252,7 +252,7 @@ static void pc_dimm_realize(DeviceState *dev, Error **errp)
         error_setg(errp, "'" PC_DIMM_MEMDEV_PROP "' property is not set");
         return;
     }
-    if (dimm->node >= nb_numa_nodes) {
+    if ((nb_numa_nodes > 0) && (dimm->node >= nb_numa_nodes)) {
         error_setg(errp, "'DIMM property " PC_DIMM_NODE_PROP " has value %"
                    PRIu32 "' which exceeds the number of numa nodes: %d",
                    dimm->node, nb_numa_nodes);
-- 
MST

  parent reply	other threads:[~2014-09-30 12:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-30  9:39 [Qemu-devel] [PULL 0/5] pci, pc, virtio, misc bugfixes Michael S. Tsirkin
2014-09-30  9:40 ` [Qemu-devel] [PULL 1/5] loader: g_realloc(p, 0) frees and returns NULL, simplify Michael S. Tsirkin
2014-09-30  9:40 ` [Qemu-devel] [PULL 2/5] Revert "virtio-pci: fix migration for pci bus master" Michael S. Tsirkin
2014-09-30  9:40 ` [Qemu-devel] [PULL 3/5] pci-hotplug-old: avoid losing error message Michael S. Tsirkin
2014-09-30  9:40 ` Michael S. Tsirkin [this message]
2014-09-30  9:40 ` [Qemu-devel] [PULL 5/5] vl: Adjust the place of calling mlockall to speedup VM's startup Michael S. Tsirkin
2014-09-30 13:59 ` [Qemu-devel] [PULL 0/5] pci, pc, virtio, misc bugfixes Peter Maydell

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=1412069893-4717-5-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=aliguori@amazon.com \
    --cc=hutao@cn.fujitsu.com \
    --cc=imammedo@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.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).