On 19/11/2022 01:45, Henry Wang wrote: > Hi Anthony and Andrew, > >> -----Original Message----- >> From: Anthony PERARD <anthony.per...@citrix.com> >> Subject: Re: [PATCH for-4.17] tools/libxl: Correct error message units in >> libxl__domain_set_paging_mempool_size() >> >> On Fri, Nov 18, 2022 at 05:02:13PM +0000, Andrew Cooper wrote: >>> diff --git a/tools/libs/light/libxl_dom.c b/tools/libs/light/libxl_dom.c >>> index b59bbe00bb30..68ad9763b6ba 100644 >>> --- a/tools/libs/light/libxl_dom.c >>> +++ b/tools/libs/light/libxl_dom.c >>> @@ -1459,7 +1459,8 @@ int libxl__domain_set_paging_mempool_size( >>> int r = xc_set_paging_mempool_size(CTX->xch, domid, shadow_mem); >>> if (r) { >>> LOGED(ERROR, domid, >>> - "Failed to set paging mempool size to %"PRIu64"kB", >> shadow_mem); >>> + "Failed to set paging mempool size to %lukB", >>> + d_config->b_info.shadow_memkb); >> Unless I miss read, `shadow_memkb` is also "uint64_t", so I'm pretty >> sure the format doesn't need to be changed, and we should keep using >> PRIu64. > I did a grep in current code, and: > In libs/light/libxl_types.idl, "shadow_memkb" is defined as MemKB, which > is MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT", json_gen_fn = > "libxl__uint64_gen_json") > so yes it is 64bit indeed. Using PRIu64 seems correct.
It highlights that there's yet another overflow bug, pre-existing from the old implementation. ~Andrew