[Top][All Lists]

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

Re: [PULL 04/10] libvhost-user: Fix wrong type of argument to formatting

From: Stefan Weil
Subject: Re: [PULL 04/10] libvhost-user: Fix wrong type of argument to formatting function (reported by LGTM)
Date: Sat, 5 Nov 2022 10:15:15 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.4.1

Am 04.11.22 um 17:16 schrieb Laurent Vivier:

Hi Stefan,

Le 03/11/2022 à 17:17, Laurent Vivier a écrit :
From: Stefan Weil <sw@weilnetz.de>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20220422070144.1043697-2-sw@weilnetz.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  subprojects/libvhost-user/libvhost-user.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/subprojects/libvhost-user/libvhost-user.c b/subprojects/libvhost-user/libvhost-user.c
index ffed4729a3dc..d9a6e3e5560f 100644
--- a/subprojects/libvhost-user/libvhost-user.c
+++ b/subprojects/libvhost-user/libvhost-user.c
@@ -651,7 +651,7 @@ generate_faults(VuDev *dev) {
            if (ioctl(dev->postcopy_ufd, UFFDIO_REGISTER, &reg_struct)) {
              vu_panic(dev, "%s: Failed to userfault region %d "
-                          "@%p + size:%zx offset: %zx: (ufd=%d)%s\n",
+                          "@%" PRIx64 " + size:%zx offset: %zx: (ufd=%d)%s\n",
                       __func__, i,
                       dev_region->size, dev_region->mmap_offset,

They all need PRIx64:

typedef struct VuDevRegion {
    /* Guest Physical address. */
    uint64_t gpa;
    /* Memory region size. */
    uint64_t size;
    /* QEMU virtual address (userspace). */
    uint64_t qva;
    /* Starting offset in our mmaped space. */
    uint64_t mmap_offset;
    /* Start address of mmaped space. */
    uint64_t mmap_addr;
} VuDevRegion;

Could you fix your patch?

The patch fixes one error ("%p"). The two "%zx" are old errors which I did not notice because they are only relevant for platforms with sizeof(void *) != sizeof(uint64_t), and 32 bit Windows builds don't compile libvhost-user. So we need an additional patch which fixes the "%zx" before patch 06/10 which adds the format attribute is applied.

Stefan, I suggest to merge the trivial branch without patch 06/10. That should fix the build failure and fixes at least some of the format errors. Then a patch which fixes the remaining format errors can be applied later together with the omitted patch 06/10.



reply via email to

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