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

Re: [PATCH] tools/helpers: fix snprintf argument in init-dom0less.c


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Mon, 4 Jul 2022 15:32:08 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b6wIlNqk0sRucQ1IocjiLeLyZ6yR1ecS/X+7m7HfrW8=; b=CcE38tGKYeSbers1kRvkare34tpb9aAaMg/k7lYN3Z9DAI6w1ddKgF/uWfh8siuA6chaZZnyaLUBY9sapjovZrmemFRFLlMR5zVF4PfizecCta2PHI8VP6TfezFGwS1E9lKxwK+wep5hwsH/Ms2N0o/lXP6zhNlqT33h1f4Uig2ulOIAGFSbNU3NEh26w0uPBzJG7k+28leVG0gVT7c+nU3uFRlgW/lTB31ebO7vgXBF2L/2odQZQcsyn3u/QPu6xbHlbL5rUJYosgmS0LjzEQaT4V9fVIjLnCR+CYoItXnqcyAyQMZ/YZPpbTLEA+5ph1GKshA2FPuM46yzW3rh9Q==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b6wIlNqk0sRucQ1IocjiLeLyZ6yR1ecS/X+7m7HfrW8=; b=UbAGwzIg46gwH9SwZ3Uo2WG0oDkZ95NPJNaNeOSNYouzF5Jj5hG0FcDt2XK2kOSI03LiAIPqihDofkd8wevzURrruNnXuBhR/vOdWNq/IOxEFh3zllPlwFJr+m6V8ehxvY+QZ6MCIUomBnZ7YbhzMgr/H4XXPsEsaqJzHx6iDyMevUBSp2s2VoGnRcj+I4pgQZJHAm0a9kK0CAIXOWyx1SLmJSLXA6C7hKzN6moBmxnkXttBoy9xYsGJqzRSVuhoDKqQdXBjYgD0SgLk6cjQLcNmnbpdWHB6BPZ3OknD5bvvL6keIXyWov8Hdsw+DCgkzpsmTV26LxeHcTXQzEQS0w==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=XtNjUZxnEX3FRJNYZdyoZukY/y4vUoYGsKGMiav0Q/ISCvyO2/NXkFoMmuwyH5tFfv6mm6kC/rRCt24u4ivPO9lJ6VUtdidcYxEzvpd+K8QS8J0V85jf+svCbPGxipUMiYlPYlN6Q+oBkV4kZAJkrNUW+udP8L87Sc8G8qhS534VU9N5Ecjg1LzPejIdeEgWMOUEMi4RrGSHVayw0Ir0+gbRnw7P8unqghQvqtM/n8/hT6UJTRFl9T5p9SvZaMmZ0nfC2RCq9RwSNCop0IbAvypruD1bCdotoE4R6pYHx1nilR3CN/Yl3uwb0xydcn3PTdi894lb03sxmz3Q4H+/Nw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JK5MXp7SbcIyJZJB2YLMxuwmTFB3vlgQB7Id/FK+It8AQznaUrVizn1ewDA+NCr9lEv/CA/IHjgk8ORulqdrJG+5xJh2hxTZjdgwlPg7Cu2cwUR6F7dZMtA8Et58J27rmXkWh5U/KKg5FX+zLN4ddD50qH75zsOVOGviiJhf24r0r1oGkOpTjMyUL9Q8IA2hyF15rmiJ9q5NwWMMv82y4d2NNTDPdpD2ZOnNNZ2rD1MtKMLF7bwzblidUt9/cRlrA0vybAke1GPjgnFFjPgsTzrdAFSa683hOEIi7cMKGL+o3n9dm2nFIs9QKiWSjeVTnJ4F6h9c9tz8PK8hXv9+gQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Wei Chen <Wei.Chen@xxxxxxx>, Wei Liu <wl@xxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Delivery-date: Mon, 04 Jul 2022 15:32:35 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYi7a+fNYcHW6FA0KjaTcd3mPyJK1uXwKA
  • Thread-topic: [PATCH] tools/helpers: fix snprintf argument in init-dom0less.c

Hi Luca,

> On 29 Jun 2022, at 13:49, Luca Fancellu <Luca.Fancellu@xxxxxxx> wrote:
> 
> Fix snprintf argument in init-dom0less.c because two instances of
> the function are using libxl_dominfo struct members that are uint64_t
> types, so change "%lu" to "%"PRIu64 to handle it properly when
> building on arm32 and arm64.
> 
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand

> ---
> tools/helpers/init-dom0less.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/helpers/init-dom0less.c b/tools/helpers/init-dom0less.c
> index 4c90dd6a0c8f..fee93459c4b9 100644
> --- a/tools/helpers/init-dom0less.c
> +++ b/tools/helpers/init-dom0less.c
> @@ -5,6 +5,7 @@
> #include <stdlib.h>
> #include <sys/mman.h>
> #include <sys/time.h>
> +#include <inttypes.h>
> #include <xenstore.h>
> #include <xenctrl.h>
> #include <xenguest.h>
> @@ -138,10 +139,10 @@ static int create_xenstore(struct xs_handle *xsh,
>                   "vm/" LIBXL_UUID_FMT, LIBXL_UUID_BYTES(uuid));
>     if (rc < 0 || rc >= STR_MAX_LENGTH)
>         return rc;
> -    rc = snprintf(max_memkb_str, STR_MAX_LENGTH, "%lu", info->max_memkb);
> +    rc = snprintf(max_memkb_str, STR_MAX_LENGTH, "%"PRIu64, info->max_memkb);
>     if (rc < 0 || rc >= STR_MAX_LENGTH)
>         return rc;
> -    rc = snprintf(target_memkb_str, STR_MAX_LENGTH, "%lu", 
> info->current_memkb);
> +    rc = snprintf(target_memkb_str, STR_MAX_LENGTH, "%"PRIu64, 
> info->current_memkb);
>     if (rc < 0 || rc >= STR_MAX_LENGTH)
>         return rc;
>     rc = snprintf(ring_ref_str, STR_MAX_LENGTH, "%lld",
> -- 
> 2.17.1
> 




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.