[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH] xen/arm: Print memory size in decimal in construct_domU
Hi Michal, On 03/01/2023 09:39, Michal Orzel wrote: By easier, do you mean you can easily figure out how much memory in GB/MB/KB you gave to the guest? If so, then I have to disagree. Without a calculator, I will find quicker the split.On 03/01/2023 10:21, Ayan Kumar Halder wrote:Hi Michal, On 02/01/2023 14:49, Michal Orzel wrote:Printing domain's memory size in hex without even prepending it with 0x is not very useful and can be misleading. Switch to decimal notation. Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx> --- xen/arch/arm/domain_build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 829cea8de84f..7e204372368c 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -3774,7 +3774,7 @@ static int __init construct_domU(struct domain *d, if ( rc != 0 ) return rc; - printk("*** LOADING DOMU cpus=%u memory=%"PRIx64"KB ***\n", d->max_vcpus, mem); + printk("*** LOADING DOMU cpus=%u memory=%"PRIu64"KB ***\n", d->max_vcpus, mem);I will prefer it to be printed in hex format with 0x prefixed. The reason being the mem is obtained from device-tree domU's 'memory' prop where the values are in hex.No, I cannot agree. Refer to booting.txt documentation: "A 64-bit integer specifying the amount of kilobytes of RAM to allocate to the guest." Also note that in the provided examples, we are using the decimal values. All in all it does not matter the notation, you can provide e.g. "memory = 131072;" or "memory = 0x20000". I find it a bit odd to print e.g. 0x20000KB and decimal is easier to read. If you want to print in decimal, then I think we should split the amount in GB/MB/KB. Otherwise, we should stick in hexadecimal (so add 0x). Cheers, -- Julien Grall
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |