From: "Michael S. Tsirkin" <mst@redhat.com>
To: Hu Tao <hutao@cn.fujitsu.com>
Cc: Igor Mammedov <imammedo@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 2/3] pc-dimm: check if the value of node property
Date: Mon, 4 Aug 2014 14:22:48 +0200 [thread overview]
Message-ID: <20140804122248.GA15491@redhat.com> (raw)
In-Reply-To: <798e3da98da2d7e39b1a012ce5e5ca940e86bc4d.1407139490.git.hutao@cn.fujitsu.com>
On Mon, Aug 04, 2014 at 04:16:08PM +0800, Hu Tao wrote:
> If user specifies a node number that exceeds the available numa nodes in
> emulated system for pc-dimm device, the device will reports an invalid _PXM
> to OSPM. Fix it by checking the node value.
>
> Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
> ---
> hw/mem/pc-dimm.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/hw/mem/pc-dimm.c b/hw/mem/pc-dimm.c
> index 08f49ed..92e276f 100644
> --- a/hw/mem/pc-dimm.c
> +++ b/hw/mem/pc-dimm.c
> @@ -252,6 +252,11 @@ 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) {
> + error_setg(errp, "'" PC_DIMM_NODE_PROP
> + "' exceeds numa node number: %" PRId32, nb_numa_nodes);
PRId32 is wrong here, this variable is int, use %d.
Also, this message isn't very clear, I fixed it up
with a patch on top.
> + return;
> + }
> }
>
> static MemoryRegion *pc_dimm_get_memory_region(PCDIMMDevice *dimm)
> --
> 1.9.3
next prev parent reply other threads:[~2014-08-04 12:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-04 8:16 [Qemu-devel] [PATCH 0/3] some numa & memory related fixes Hu Tao
2014-08-04 8:16 ` [Qemu-devel] [PATCH 1/3] hw:i386: typo fix: MEMORY_HOPTLUG_DEVICE -> MEMORY_HOTPLUG_DEVICE Hu Tao
2014-08-04 8:16 ` [Qemu-devel] [PATCH 2/3] pc-dimm: check if the value of node property Hu Tao
2014-08-04 12:22 ` Michael S. Tsirkin [this message]
2014-08-05 1:12 ` Hu Tao
2014-08-04 8:16 ` [Qemu-devel] [PATCH 3/3] numa: show hex number in error message for consistency and prefix them with 0x Hu Tao
2014-08-04 12:23 ` [Qemu-devel] [PATCH 0/3] some numa & memory related fixes 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=20140804122248.GA15491@redhat.com \
--to=mst@redhat.com \
--cc=hutao@cn.fujitsu.com \
--cc=imammedo@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.