qemu-devel
[Top][All Lists]
Advanced

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

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


From: David Hildenbrand
Subject: Re: [PATCH] hw/mem/pc-dimm: Fix error message if no slots were defined some more
Date: Tue, 22 Feb 2022 16:24:40 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

On 22.02.22 16:22, Markus Armbruster wrote:
> 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.
> 

We're referring to the "-m 2g,maxmem=8g,slots=5" slots parameter. And I
agree that we can make that clearer somehow :)

> 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;
>      }
>  


-- 
Thanks,

David / dhildenb




reply via email to

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