fc5c27b
>From 5c0219c6cef769a5748705d489376ea618486a17 Mon Sep 17 00:00:00 2001
13f703f
From: Alon Levy <alevy@redhat.com>
13f703f
Date: Wed, 6 Jul 2011 13:40:29 +0200
fc5c27b
Subject: [PATCH 18/28] qxl: make qxl_guest_bug take variable arguments
13f703f
13f703f
Signed-off-by: Alon Levy <alevy@redhat.com>
13f703f
---
13f703f
 hw/qxl.c |    9 +++++++--
13f703f
 hw/qxl.h |    2 +-
13f703f
 2 files changed, 8 insertions(+), 3 deletions(-)
13f703f
13f703f
diff --git a/hw/qxl.c b/hw/qxl.c
13f703f
index 28c8b5d..c50eaf9 100644
13f703f
--- a/hw/qxl.c
13f703f
+++ b/hw/qxl.c
13f703f
@@ -125,13 +125,18 @@ static void qxl_reset_memslots(PCIQXLDevice *d);
13f703f
 static void qxl_reset_surfaces(PCIQXLDevice *d);
13f703f
 static void qxl_ring_set_dirty(PCIQXLDevice *qxl);
13f703f
 
13f703f
-void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg)
13f703f
+void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
13f703f
 {
13f703f
 #if SPICE_INTERFACE_QXL_MINOR >= 1
13f703f
     qxl_send_events(qxl, QXL_INTERRUPT_ERROR);
13f703f
 #endif
13f703f
     if (qxl->guestdebug) {
13f703f
-        fprintf(stderr, "qxl-%d: guest bug: %s\n", qxl->id, msg);
13f703f
+        va_list ap;
13f703f
+        va_start(ap, msg);
13f703f
+        fprintf(stderr, "qxl-%d: guest bug: ", qxl->id);
13f703f
+        vfprintf(stderr, msg, ap);
13f703f
+        fprintf(stderr, "\n");
13f703f
+        va_end(ap);
13f703f
     }
13f703f
 }
13f703f
 
13f703f
diff --git a/hw/qxl.h b/hw/qxl.h
13f703f
index 5db9aae..32ca5a0 100644
13f703f
--- a/hw/qxl.h
13f703f
+++ b/hw/qxl.h
13f703f
@@ -99,7 +99,7 @@ typedef struct PCIQXLDevice {
13f703f
 
13f703f
 /* qxl.c */
13f703f
 void *qxl_phys2virt(PCIQXLDevice *qxl, QXLPHYSICAL phys, int group_id);
13f703f
-void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg);
13f703f
+void qxl_guest_bug(PCIQXLDevice *qxl, const char *msg, ...);
13f703f
 
13f703f
 void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id,
13f703f
                            struct QXLRect *area, struct QXLRect *dirty_rects,
13f703f
-- 
13f703f
1.7.5.1
13f703f