Skip to contentSkip to conversation

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

PATCH In review Gavin Shan 2 participants 2 messages Oct 20 – Oct 21

lore
Share & tools
lore

Gavin Shan

author
#0 lore raw

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

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
---
 hw/virtio/virtio-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/virtio-mem.c +1 -1
index 7130ed852d..ee6a0c206a 100644
@@ -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;
     }
Signature · 1 line
2.56.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Gavin Shan

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
---
 hw/virtio/virtio-mem.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/virtio/virtio-mem.c +0 -0
index 7130ed852d..ee6a0c206a 100644

hw/virtio/virtio-mem.c static void virtio_mem_device_realize(DeviceState *dev, Error **errp) · line 852

Quoted 8 lines
hw/virtio/virtio-mem.c +1 -1
@@ -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;
     }
Signature · 3 lines
Cheers,

David