[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] libvhost-user: Add missing GCC_FMT_ATTR and fix
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH] libvhost-user: Add missing GCC_FMT_ATTR and fix three format errors |
Date: |
Fri, 12 Jul 2019 12:32:04 +0400 |
On Fri, Jul 12, 2019 at 12:25 PM Stefan Weil <address@hidden> wrote:
>
> Signed-off-by: Stefan Weil <address@hidden>
> ---
> contrib/libvhost-user/libvhost-user.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/contrib/libvhost-user/libvhost-user.c
> b/contrib/libvhost-user/libvhost-user.c
> index 4b36e35a82..59b3202979 100644
> --- a/contrib/libvhost-user/libvhost-user.c
> +++ b/contrib/libvhost-user/libvhost-user.c
> @@ -142,7 +142,7 @@ vu_request_to_string(unsigned int req)
> }
> }
>
> -static void
> +static void GCC_FMT_ATTR(2, 3)
> vu_panic(VuDev *dev, const char *msg, ...)
> {
> char *buf = NULL;
> @@ -661,7 +661,7 @@ vu_set_mem_table_exec_postcopy(VuDev *dev, VhostUserMsg
> *vmsg)
>
> if (ioctl(dev->postcopy_ufd, UFFDIO_REGISTER, ®_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->mmap_addr,
> dev_region->size, dev_region->mmap_offset,
> @@ -1753,7 +1753,7 @@ virtqueue_get_head(VuDev *dev, VuVirtq *vq,
>
> /* If their number is silly, that's a fatal mistake. */
> if (*head >= vq->vring.num) {
> - vu_panic(dev, "Guest says index %u is available", head);
> + vu_panic(dev, "Guest says index %u is available", idx);
The original version (hw/virtio/virtio.c) print *head. The message
isn't great, but I would rather stay consistent for now.
other than that,
Reviewed-by: Marc-André Lureau <address@hidden>
> return false;
> }
>
> @@ -1812,7 +1812,7 @@ virtqueue_read_next_desc(VuDev *dev, struct vring_desc
> *desc,
> smp_wmb();
>
> if (*next >= max) {
> - vu_panic(dev, "Desc next is %u", next);
> + vu_panic(dev, "Desc next is %u", *next);
> return VIRTQUEUE_READ_DESC_ERROR;
> }
>
> --
> 2.20.1
>
>
--
Marc-André Lureau