From nobody Mon Feb 9 16:23:11 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1671111148; cv=none; d=zohomail.com; s=zohoarc; b=lpH3Mx7rRz36svpDgTrP3RHvR5vOv8pYUmSMq8g7mZHffaEjNOuhjM3kIkDEMS7DjMlq4fDDJ/et9qkzxsJ1pEUqwlzsX4S9lw6V4bjdQFleHF8dEWh2/l87h8OZgNDaVrp+U9mrGQXCqE8onCSXLo2ZjbD3PKgsWAuUwAu42eE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671111148; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4hmaoQKS8SQdk7CQ+JO49wtIWp6z2c0zI9KuRQA7z6c=; b=I3/wtxrvOkuEP2pjPUa2/RCA7i3FG5zKWiyaOiUzUtt8YCoF9jKG8oCkSoIur8FAtC0NyKFthJdoPsMFM/p9YKZuoDHpEivxR/AP1ulm91tqb9q51+AUX8w0vK792lBb/c1MbmNaAIEWsnm66J8WcjRvQ2fvUWc/SE0b5vqyTsY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1671111148642427.8349548555864; Thu, 15 Dec 2022 05:32:28 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.463393.721546 (Exim 4.92) (envelope-from ) id 1p5oL1-0007hE-Oc; Thu, 15 Dec 2022 13:31:51 +0000 Received: by outflank-mailman (output) from mailman id 463393.721546; Thu, 15 Dec 2022 13:31:51 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p5oL1-0007h7-Lz; Thu, 15 Dec 2022 13:31:51 +0000 Received: by outflank-mailman (input) for mailman id 463393; Thu, 15 Dec 2022 13:31:50 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1p5oL0-0007h1-BJ for xen-devel@lists.xen.org; Thu, 15 Dec 2022 13:31:50 +0000 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [2607:f8b0:4864:20::102c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id d2921eb5-7c7c-11ed-91b6-6bf2151ebd3b; Thu, 15 Dec 2022 14:31:49 +0100 (CET) Received: by mail-pj1-x102c.google.com with SMTP id w4-20020a17090ac98400b002186f5d7a4cso2798623pjt.0 for ; Thu, 15 Dec 2022 05:31:47 -0800 (PST) Received: from localhost ([122.172.87.149]) by smtp.gmail.com with ESMTPSA id e5-20020a17090ada0500b0020ad53b5883sm3212132pjv.14.2022.12.15.05.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Dec 2022 05:31:45 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: d2921eb5-7c7c-11ed-91b6-6bf2151ebd3b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4hmaoQKS8SQdk7CQ+JO49wtIWp6z2c0zI9KuRQA7z6c=; b=Y+7zd78KY76Bzd+eA2UKYjiBO2PIW4m1H0mgmgZdUEBlBCT/hcSWVM0hUdGtIcccdz AKwAV9mUMkFfGKnVCOnW5xK+SUFjworSYHf5Z89HjVjqZ7b0BewFiVcRsh08TDAYNOre GwL+ObHEzbRoYzuQkOhjni0mqQXHEMpPk7kQOif736W9RryDWzl2qZOv9AtFJphZDvs+ wRnJlA7yeivIdozPgsmKXYcJPI7eykHhAMoQCP0qEdQpRYE+acxCNZYfiG4Hr5t7E3Y4 xROuEC0CzzzCth+QPtCS5uujWDs7yNTxSjHuVKISmyrtN0L34q4ekNE7CJKdpp9PutYj vE0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4hmaoQKS8SQdk7CQ+JO49wtIWp6z2c0zI9KuRQA7z6c=; b=crYPm96CmJPLFLoZzqzg5SV5DIr8Fkl55TV0a++afuVL2eG3dB2LXTXKIbRpBRh8kO KLayT8GR2e7Lc3siowYLrfTjMSdtPeuHggj/vnCY386qMl0ltjqE6byv4MbxnzkL+i+K a90r/PjjnPQ2qciigt7H61MrCfibiY3P4XvJRX82bZzkqO40YfOPo4Br2chCPaak1Bu1 TsZdqZ345YvwbQJEwsXAXE+lwjvHdCfPp2F+nvI3CmEkUm2Iv17HkxXCqwUlx56yiuKL n/B/v9cHQVOKENbG2wk6ifYVTbTR4o79slQu0bWb3A2DFyEPITdiVmtr86icI7jehpbp W9GQ== X-Gm-Message-State: ANoB5plv9fKJZ0EnNmvJrpXYyfvK5b4nNw20CQK37+7KO1syCvXVJka5 qn9n3nJygXF6I4AQhzMI42Z7HwZ8tYKVFSza X-Google-Smtp-Source: AA0mqf58blWXMce/Jot7EhsynkWA1JsXQ+cPVhFPEVoApoYoEpwkEgT6ztXPP1+TM0MKfjaFp4Mgkw== X-Received: by 2002:a17:90a:fc85:b0:21a:b64:3488 with SMTP id ci5-20020a17090afc8500b0021a0b643488mr28772562pjb.44.1671111106264; Thu, 15 Dec 2022 05:31:46 -0800 (PST) From: Viresh Kumar To: xen-devel@lists.xen.org, Juergen Gross , Julien Grall , Anthony PERARD , osstest-admin@xenproject.org Cc: Viresh Kumar , Vincent Guittot , stratos-dev@op-lists.linaro.org, =?UTF-8?q?Alex=20Benn=C3=A9e?= , Stefano Stabellini , Mathieu Poirier , Mike Holmes , Oleksandr Tyshchenko , Wei Liu Subject: [PATCH] libxl: virtio: Fix build error for 32-bit platforms Date: Thu, 15 Dec 2022 19:01:40 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1671111151962100001 Content-Type: text/plain; charset="utf-8" The field 'base' in 'struct libxl_device_virtio' is defined as uint64, while we are printing it with '%lu', which is 32bit only 32-bit platforms. And so generates a error like: libxl_internal.h:4388:51: error: format '%lu' expects argument of type 'l= ong unsigned int', but argument 3 has type 'uint64_t' {aka 'long long unsigned int'} [-Werror=3Dformat=3D] Fix the same by using PRIx64 instead. Now that the base name is available in hexadecimal format, prefix it with '0x' as well, which strtoul() also depends upon since base passed is 0. Fixes: 43ba5202e2ee ("libxl: add support for generic virtio device") Signed-off-by: Viresh Kumar --- Couldn't test on 32-bit platforms yet, but works fine for 64 bit one. tools/libs/light/libxl_virtio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libs/light/libxl_virtio.c b/tools/libs/light/libxl_virti= o.c index 6a38def2faf5..2217bda8a253 100644 --- a/tools/libs/light/libxl_virtio.c +++ b/tools/libs/light/libxl_virtio.c @@ -45,12 +45,12 @@ static int libxl__set_xenstore_virtio(libxl__gc *gc, ui= nt32_t domid, const char *transport =3D libxl_virtio_transport_to_string(virtio->tra= nsport); =20 flexarray_append_pair(back, "irq", GCSPRINTF("%u", virtio->irq)); - flexarray_append_pair(back, "base", GCSPRINTF("%lu", virtio->base)); + flexarray_append_pair(back, "base", GCSPRINTF("0x%"PRIx64, virtio->bas= e)); flexarray_append_pair(back, "type", GCSPRINTF("%s", virtio->type)); flexarray_append_pair(back, "transport", GCSPRINTF("%s", transport)); =20 flexarray_append_pair(front, "irq", GCSPRINTF("%u", virtio->irq)); - flexarray_append_pair(front, "base", GCSPRINTF("%lu", virtio->base)); + flexarray_append_pair(front, "base", GCSPRINTF("0x%"PRIx64, virtio->ba= se)); flexarray_append_pair(front, "type", GCSPRINTF("%s", virtio->type)); flexarray_append_pair(front, "transport", GCSPRINTF("%s", transport)); =20 --=20 2.31.1.272.g89b43f80a514