[PATCH] hw/virtio/virtio-mem: Fix error message on invalid NUMA node

Gavin Shan posted 1 patch 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261020012404.191329-1-gshan@redhat.com
Maintainers: David Hildenbrand <david@kernel.org>, "Michael S. Tsirkin" <mst@redhat.com>
hw/virtio/virtio-mem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] hw/virtio/virtio-mem: Fix error message on invalid NUMA node
Posted by Gavin Shan 1 month ago
Add space as the separator between "exceeds" and "the number of numa
nodes:". Otherwise, we will see error message with twisted format like
below.

  qemu-system-aarch64: -device virtio-mem-pci,id=vmem1,bus=pcie.3, \
  memdev=virtio-mem1-mem,requested-size=0,node=1: 'node' property  \
  has value '1', which exceedsthe number of numa nodes: 1

Signed-off-by: Gavin Shan <gshan@redhat.com>
---
 hw/virtio/virtio-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
index 7130ed852d..ee6a0c206a 100644
--- a/hw/virtio/virtio-mem.c
+++ b/hw/virtio/virtio-mem.c
@@ -846,7 +846,7 @@ static void virtio_mem_device_realize(DeviceState *dev, Error **errp)
     if ((nb_numa_nodes && vmem->node >= nb_numa_nodes) ||
         (!nb_numa_nodes && vmem->node)) {
         error_setg(errp, "'%s' property has value '%" PRIu32 "', which exceeds"
-                   "the number of numa nodes: %d", VIRTIO_MEM_NODE_PROP,
+                   " the number of numa nodes: %d", VIRTIO_MEM_NODE_PROP,
                    vmem->node, nb_numa_nodes ? nb_numa_nodes : 1);
         return;
     }
-- 
2.56.0
Re: [PATCH] hw/virtio/virtio-mem: Fix error message on invalid NUMA node
Posted by David Hildenbrand 1 month ago
On 10/20/26 03:24, Gavin Shan wrote:
> Add space as the separator between "exceeds" and "the number of numa
> nodes:". Otherwise, we will see error message with twisted format like
> below.
> 
>   qemu-system-aarch64: -device virtio-mem-pci,id=vmem1,bus=pcie.3, \
>   memdev=virtio-mem1-mem,requested-size=0,node=1: 'node' property  \
>   has value '1', which exceedsthe number of numa nodes: 1
> 
> Signed-off-by: Gavin Shan <gshan@redhat.com>
> ---
>  hw/virtio/virtio-mem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/virtio/virtio-mem.c b/hw/virtio/virtio-mem.c
> index 7130ed852d..ee6a0c206a 100644
> --- a/hw/virtio/virtio-mem.c
> +++ b/hw/virtio/virtio-mem.c
> @@ -846,7 +846,7 @@ static void virtio_mem_device_realize(DeviceState *dev, Error **errp)
>      if ((nb_numa_nodes && vmem->node >= nb_numa_nodes) ||
>          (!nb_numa_nodes && vmem->node)) {
>          error_setg(errp, "'%s' property has value '%" PRIu32 "', which exceeds"
> -                   "the number of numa nodes: %d", VIRTIO_MEM_NODE_PROP,
> +                   " the number of numa nodes: %d", VIRTIO_MEM_NODE_PROP,
>                     vmem->node, nb_numa_nodes ? nb_numa_nodes : 1);
>          return;
>      }

Reviewed-by: David Hildenbrand <david@kernel.org>

-- 
Cheers,

David