From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41015) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhRMD-0002bF-Sh for qemu-devel@nongnu.org; Thu, 14 Jul 2011 15:13:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QhRMA-0000di-Ia for qemu-devel@nongnu.org; Thu, 14 Jul 2011 15:13:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13282) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QhRMA-0000da-38 for qemu-devel@nongnu.org; Thu, 14 Jul 2011 15:13:54 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p6EJDrdW002257 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Jul 2011 15:13:53 -0400 From: Alon Levy Date: Thu, 14 Jul 2011 22:13:16 +0300 Message-Id: <1310670801-14687-8-git-send-email-alevy@redhat.com> In-Reply-To: <1310670801-14687-1-git-send-email-alevy@redhat.com> References: <1310670801-14687-1-git-send-email-alevy@redhat.com> Subject: [Qemu-devel] [PATCHv5 07/12] qxl: make qxl_guest_bug take variable arguments List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: yhalperi@redhat.com, kraxel@redhat.com Signed-off-by: Alon Levy --- hw/qxl.c | 9 +++++++-- hw/qxl.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/hw/qxl.c b/hw/qxl.c index e51851a5..09382f5 100644 --- a/hw/qxl.c +++ b/hw/qxl.c @@ -125,13 +125,18 @@ static void qxl_reset_memslots(PCIQXLDevice *d); static void qxl_reset_surfaces(PCIQXLDevice *d); static void qxl_ring_set_dirty(PCIQXLDevice *qxl); -void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg) +void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, ...) { #if SPICE_INTERFACE_QXL_MINOR >= 1 qxl_send_events(qxl, QXL_INTERRUPT_ERROR); #endif if (qxl->guestdebug) { - fprintf(stderr, "qxl-%d: guest bug: %s\n", qxl->id, msg); + va_list ap; + va_start(ap, msg); + fprintf(stderr, "qxl-%d: guest bug: ", qxl->id); + vfprintf(stderr, msg, ap); + fprintf(stderr, "\n"); + va_end(ap); } } diff --git a/hw/qxl.h b/hw/qxl.h index 5db9aae..32ca5a0 100644 --- a/hw/qxl.h +++ b/hw/qxl.h @@ -99,7 +99,7 @@ typedef struct PCIQXLDevice { /* qxl.c */ void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id); -void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg); +void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, ...); void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id, struct QXLRect *area, struct QXLRect *dirty_rects, -- 1.7.6