From patchwork Fri Jul 12 11:50:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 11042155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A0001395 for ; Fri, 12 Jul 2019 11:51:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35B6328B50 for ; Fri, 12 Jul 2019 11:51:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 242C828B4C; Fri, 12 Jul 2019 11:51:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 777FB28B4C for ; Fri, 12 Jul 2019 11:51:08 +0000 (UTC) Received: from localhost ([::1]:48554 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlu4x-0008GZ-P4 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 12 Jul 2019 07:51:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57489) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hlu4p-0007qt-AT for qemu-devel@nongnu.org; Fri, 12 Jul 2019 07:51:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hlu4o-0000Sb-5n for qemu-devel@nongnu.org; Fri, 12 Jul 2019 07:50:59 -0400 Received: from mail.weilnetz.de ([37.120.169.71]:39812 helo=v2201612906741603.powersrv.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hlu4n-0000RS-VV for qemu-devel@nongnu.org; Fri, 12 Jul 2019 07:50:58 -0400 Received: from localhost (localhost [127.0.0.1]) by v2201612906741603.powersrv.de (Postfix) with ESMTP id 40ED3DB85E1; Fri, 12 Jul 2019 13:50:56 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at v2201612906741603.powersrv.de Received: from v2201612906741603.powersrv.de ([127.0.0.1]) by localhost (v2201612906741603.powersrv.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TymlN2B7Tr19; Fri, 12 Jul 2019 13:50:55 +0200 (CEST) Received: from qemu.weilnetz.de (qemu.weilnetz.de [188.68.58.204]) by v2201612906741603.powersrv.de (Postfix) with ESMTP id 8AD06DB7E87; Fri, 12 Jul 2019 13:50:55 +0200 (CEST) Received: by qemu.weilnetz.de (Postfix, from userid 1000) id 7B45146004F; Fri, 12 Jul 2019 13:50:55 +0200 (CEST) From: Stefan Weil To: qemu-devel@nongnu.org Date: Fri, 12 Jul 2019 13:50:24 +0200 Message-Id: <20190712115024.2659-1-sw@weilnetz.de> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 37.120.169.71 Subject: [Qemu-devel] [PATCH v2] libvhost-user: Add missing GCC_FMT_ATTR and fix three format errors X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Stefan Hajnoczi , Stefan Weil Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Stefan Weil Reviewed-by: Stefan Hajnoczi --- v2: - Show different value in "Guest says [...]" (suggested by Marc-André Lureau) - Fix more format errors for 32 bit builds (reported by Philippe Mathieu-Daudé) Philippe, I did not get the additional errors on x86_64. Regards Stefan contrib/libvhost-user/libvhost-user.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/libvhost-user.c index 4b36e35a82..3b5520a77f 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,8 @@ 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:%" PRIx64 + " offset: %" PRIx64 ": (ufd=%d)%s\n", __func__, i, dev_region->mmap_addr, dev_region->size, dev_region->mmap_offset, @@ -1753,7 +1754,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", *head); return false; } @@ -1812,7 +1813,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; }