qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: aliguori@us.ibm.com
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 12/19] console: vga_hw_screen_dump_ptr: take Error argument
Date: Wed,  5 Sep 2012 15:58:39 -0300	[thread overview]
Message-ID: <1346871526-25342-13-git-send-email-lcapitulino@redhat.com> (raw)
In-Reply-To: <1346871526-25342-1-git-send-email-lcapitulino@redhat.com>

All devices that register a screen dump callback via
graphic_console_init() are updated.

The new argument is not used in this commit. Error handling will
be added to each device individually later.

This change is a preparation to convert the screendump command
to the QAPI.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 console.c       |  2 +-
 console.h       |  4 +++-
 hw/blizzard.c   |  2 +-
 hw/g364fb.c     |  3 ++-
 hw/omap_lcdc.c  |  3 ++-
 hw/qxl.c        |  5 +++--
 hw/tcx.c        | 12 ++++++++----
 hw/vga.c        |  6 ++++--
 hw/vmware_vga.c |  5 +++--
 9 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/console.c b/console.c
index 3b5cabb..8228773 100644
--- a/console.c
+++ b/console.c
@@ -190,7 +190,7 @@ void vga_hw_screen_dump(const char *filename)
         console_select(0);
     }
     if (consoles[0] && consoles[0]->hw_screen_dump) {
-        consoles[0]->hw_screen_dump(consoles[0]->hw, filename, cswitch);
+        consoles[0]->hw_screen_dump(consoles[0]->hw, filename, cswitch, NULL);
     } else {
         error_report("screen dump not implemented");
     }
diff --git a/console.h b/console.h
index c702b23..fd68ecc 100644
--- a/console.h
+++ b/console.h
@@ -7,6 +7,7 @@
 #include "monitor.h"
 #include "trace.h"
 #include "qapi-types.h"
+#include "error.h"
 
 /* keyboard/mouse support */
 
@@ -344,7 +345,8 @@ static inline void console_write_ch(console_ch_t *dest, uint32_t ch)
 
 typedef void (*vga_hw_update_ptr)(void *);
 typedef void (*vga_hw_invalidate_ptr)(void *);
-typedef void (*vga_hw_screen_dump_ptr)(void *, const char *, bool cswitch);
+typedef void (*vga_hw_screen_dump_ptr)(void *, const char *, bool cswitch,
+                                       Error **errp);
 typedef void (*vga_hw_text_update_ptr)(void *, console_ch_t *);
 
 DisplayState *graphic_console_init(vga_hw_update_ptr update,
diff --git a/hw/blizzard.c b/hw/blizzard.c
index 29074c4..a2b9053 100644
--- a/hw/blizzard.c
+++ b/hw/blizzard.c
@@ -933,7 +933,7 @@ static void blizzard_update_display(void *opaque)
 }
 
 static void blizzard_screen_dump(void *opaque, const char *filename,
-                                 bool cswitch)
+                                 bool cswitch, Error **errp)
 {
     BlizzardState *s = (BlizzardState *) opaque;
 
diff --git a/hw/g364fb.c b/hw/g364fb.c
index 3a0b68f..498154b 100644
--- a/hw/g364fb.c
+++ b/hw/g364fb.c
@@ -289,7 +289,8 @@ static void g364fb_reset(G364State *s)
     g364fb_invalidate_display(s);
 }
 
-static void g364fb_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void g364fb_screen_dump(void *opaque, const char *filename, bool cswitch,
+                               Error **errp)
 {
     G364State *s = opaque;
     int y, x;
diff --git a/hw/omap_lcdc.c b/hw/omap_lcdc.c
index 4a08e9d..39b78cd 100644
--- a/hw/omap_lcdc.c
+++ b/hw/omap_lcdc.c
@@ -264,7 +264,8 @@ static int ppm_save(const char *filename, uint8_t *data,
     return 0;
 }
 
-static void omap_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void omap_screen_dump(void *opaque, const char *filename, bool cswitch,
+                             Error **errp)
 {
     struct omap_lcd_panel_s *omap_lcd = opaque;
 
diff --git a/hw/qxl.c b/hw/qxl.c
index c2dd3b4..46a929d 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1595,7 +1595,8 @@ static void qxl_hw_invalidate(void *opaque)
     vga->invalidate(vga);
 }
 
-static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch,
+                               Error **errp)
 {
     PCIQXLDevice *qxl = opaque;
     VGACommonState *vga = &qxl->vga;
@@ -1607,7 +1608,7 @@ static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch)
         ppm_save(filename, qxl->ssd.ds->surface);
         break;
     case QXL_MODE_VGA:
-        vga->screen_dump(vga, filename, cswitch);
+        vga->screen_dump(vga, filename, cswitch, errp);
         break;
     default:
         break;
diff --git a/hw/tcx.c b/hw/tcx.c
index ac7dcb4..74a7085 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -56,8 +56,10 @@ typedef struct TCXState {
     uint8_t dac_index, dac_state;
 } TCXState;
 
-static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch);
-static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch);
+static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch,
+                            Error **errp);
+static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch,
+                            Error **errp);
 
 static void tcx_set_dirty(TCXState *s)
 {
@@ -574,7 +576,8 @@ static int tcx_init1(SysBusDevice *dev)
     return 0;
 }
 
-static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch,
+                            Error **errp)
 {
     TCXState *s = opaque;
     FILE *f;
@@ -601,7 +604,8 @@ static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch)
     return;
 }
 
-static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch,
+                              Error **errp)
 {
     TCXState *s = opaque;
     FILE *f;
diff --git a/hw/vga.c b/hw/vga.c
index f82ced8..dd703cf 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -166,7 +166,8 @@ static uint32_t expand4[256];
 static uint16_t expand2[256];
 static uint8_t expand4to8[16];
 
-static void vga_screen_dump(void *opaque, const char *filename, bool cswitch);
+static void vga_screen_dump(void *opaque, const char *filename, bool cswitch,
+                            Error **errp);
 
 static void vga_update_memory_access(VGACommonState *s)
 {
@@ -2435,7 +2436,8 @@ int ppm_save(const char *filename, struct DisplaySurface *ds)
 
 /* save the vga display in a PPM image even if no display is
    available */
-static void vga_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void vga_screen_dump(void *opaque, const char *filename, bool cswitch,
+                            Error **errp)
 {
     VGACommonState *s = opaque;
 
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index f5e4f44..29750e1 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -1003,11 +1003,12 @@ static void vmsvga_invalidate_display(void *opaque)
 
 /* save the vga display in a PPM image even if no display is
    available */
-static void vmsvga_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void vmsvga_screen_dump(void *opaque, const char *filename, bool cswitch,
+                               Error **errp)
 {
     struct vmsvga_state_s *s = opaque;
     if (!s->enable) {
-        s->vga.screen_dump(&s->vga, filename, cswitch);
+        s->vga.screen_dump(&s->vga, filename, cswitch, errp);
         return;
     }
 
-- 
1.7.11.2.249.g31c7954.dirty

  parent reply	other threads:[~2012-09-05 18:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05 18:58 [Qemu-devel] [PULL 00/19]: QMP queue Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 01/19] Add support for pretty-printing response in qmp-shell Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 02/19] fix doc of using raw values with sendkey Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 03/19] monitor: rename keyname '<' to 'less' Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 04/19] hmp: rename arguments Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 05/19] qapi: generate list struct and visit_list for enum Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 06/19] qapi: add the QKeyCode enum Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 07/19] monitor: move key_defs[] table and introduce two help functions Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 08/19] qapi: convert sendkey Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 09/19] qapi: Fix potential NULL pointer segfault Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 10/19] json-parser: " Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 11/19] error: add error_setg() Luiz Capitulino
2012-09-05 18:58 ` Luiz Capitulino [this message]
2012-09-05 18:58 ` [Qemu-devel] [PATCH 13/19] qapi: convert screendump Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 14/19] vga: ppm_save(): add error handling Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 15/19] omap_lcdc: rename ppm_save() to omap_ppm_save() Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 16/19] omap_lcdc: omap_ppm_save(): add error handling Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 17/19] g364fb: g364fb_screen_dump(): " Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 18/19] tcx: tcx24_screen_dump(): " Luiz Capitulino
2012-09-05 18:58 ` [Qemu-devel] [PATCH 19/19] tcx: tcx_screen_dump(): " Luiz Capitulino
2012-09-10 13:18 ` [Qemu-devel] [PULL 00/19]: QMP queue Aurelien Jarno

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1346871526-25342-13-git-send-email-lcapitulino@redhat.com \
    --to=lcapitulino@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).