qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] hw/mem/pc-dimm: Fix error message if no slots were defined some


From: Markus Armbruster
Subject: [PATCH] hw/mem/pc-dimm: Fix error message if no slots were defined some more
Date: Tue, 22 Feb 2022 16:22:11 +0100

The error message added in commit 3ff333effa "pc-dimm: fix error
messages if no slots were defined" is misleading:

    $ qemu-system-x86_64 -object 
memory-backend-file,id=mem1,size=1M,mem-path=1G.img -device 
pc-dimm,id=dimm1,memdev=mem1
    qemu-system-x86_64: -device pc-dimm,id=dimm1,memdev=mem1: no slots where 
allocated, please specify the 'slots' option
    $ qemu-system-x86_64 -object 
memory-backend-file,id=mem1,size=1M,mem-path=1G.img -device 
pc-dimm,id=dimm1,memdev=mem1,slots=0
    qemu-system-x86_64: -device pc-dimm,id=dimm1,memdev=mem1,slots=0: Property 
'pc-dimm.slots' not found

The property it called 'slot', not 'slots'.  With that fixed, we get
another bad error message:

    $ qemu-system-x86_64 -object 
memory-backend-file,id=mem1,size=1M,mem-path=1G.img -device 
pc-dimm,id=dimm1,memdev=mem1,slot=0
    qemu-system-x86_64: -device pc-dimm,id=dimm1,memdev=mem1,slot=0: invalid 
slot number 0, valid range is [0-18446744073709551615]

Left for another day.

Fixes: 3ff333effa319df6178f138d9cf32e3937419790
Signed-off-by: Markus Armbruster <armbru@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 48b913aba6..28fec00575 100644
--- a/hw/mem/pc-dimm.c
+++ b/hw/mem/pc-dimm.c
@@ -115,7 +115,7 @@ static int pc_dimm_get_free_slot(const int *hint, int 
max_slots, Error **errp)
 
     if (max_slots <= 0) {
         error_setg(errp, "no slots where allocated, please specify "
-                   "the 'slots' option");
+                   "the 'slot' option");
         return slot;
     }
 
-- 
2.35.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]