qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Capitulino <lcapitulino@redhat.com>
To: Alon Levy <alevy@redhat.com>
Cc: mlureau@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 3/5] qapi: convert screendump
Date: Thu, 15 Mar 2012 11:55:31 -0300	[thread overview]
Message-ID: <20120315115531.3f63b29a@doriath.home> (raw)
In-Reply-To: <1331765714-26209-4-git-send-email-alevy@redhat.com>

On Thu, 15 Mar 2012 00:55:12 +0200
Alon Levy <alevy@redhat.com> wrote:

> Signed-off-by: Alon Levy <alevy@redhat.com>
> ---
>  hmp-commands.hx  |    3 +--
>  hmp.c            |    8 ++++++++
>  hmp.h            |    1 +
>  monitor.c        |    8 --------
>  qapi-schema.json |   13 +++++++++++++
>  qmp-commands.hx  |    5 +----
>  qmp.c            |    5 +++++
>  7 files changed, 29 insertions(+), 14 deletions(-)
> 
> diff --git a/hmp-commands.hx b/hmp-commands.hx
> index 6980214..d26421a 100644
> --- a/hmp-commands.hx
> +++ b/hmp-commands.hx
> @@ -194,8 +194,7 @@ ETEXI
>          .args_type  = "filename:F",
>          .params     = "filename",
>          .help       = "save screen into PPM image 'filename'",
> -        .user_print = monitor_user_noop,
> -        .mhandler.cmd_new = do_screen_dump,
> +        .mhandler.cmd = hmp_screendump,
>      },
>  
>  STEXI
> diff --git a/hmp.c b/hmp.c
> index 290c43d..42dc79a 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -860,3 +860,11 @@ void hmp_block_job_cancel(Monitor *mon, const QDict *qdict)
>  
>      hmp_handle_error(mon, &error);
>  }
> +
> +void hmp_screendump(Monitor *mon, const QDict *qdict)
> +{
> +    Error *err = NULL;
> +
> +    qmp_screendump(qdict_get_str(qdict, "filename"), &err);
> +    hmp_handle_error(mon, &err);
> +}
> diff --git a/hmp.h b/hmp.h
> index 5409464..25d123f 100644
> --- a/hmp.h
> +++ b/hmp.h
> @@ -59,5 +59,6 @@ void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict);
>  void hmp_block_stream(Monitor *mon, const QDict *qdict);
>  void hmp_block_job_set_speed(Monitor *mon, const QDict *qdict);
>  void hmp_block_job_cancel(Monitor *mon, const QDict *qdict);
> +void hmp_screendump(Monitor *mon, const QDict *qdict);
>  
>  #endif
> diff --git a/monitor.c b/monitor.c
> index 79399ab..f79ce9a 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -893,14 +893,6 @@ static int client_migrate_info(Monitor *mon, const QDict *qdict,
>      return -1;
>  }
>  
> -static int do_screen_dump(Monitor *mon, const QDict *qdict, QObject **ret_data)
> -{
> -    Error *errp = NULL;
> -
> -    vga_hw_screen_dump(qdict_get_str(qdict, "filename"), &errp);
> -    return 0;
> -}
> -
>  static void do_logfile(Monitor *mon, const QDict *qdict)
>  {
>      cpu_set_log_filename(qdict_get_str(qdict, "filename"));
> diff --git a/qapi-schema.json b/qapi-schema.json
> index 04fa84f..4f251ca 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -1663,3 +1663,16 @@
>  { 'command': 'qom-list-types',
>    'data': { '*implements': 'str', '*abstract': 'bool' },
>    'returns': [ 'ObjectTypeInfo' ] }
> +
> +##
> +# @screendump:
> +#
> +# Write a PPM of the VGA screen to a file.
> +#
> +# @filename: the name of a new PPM file to create to store the image
> +#
> +# Returns: Nothing on success

Note that you have to document all the _possible_ errors. Look for other
examples in this file.

> +#
> +# Since: 1.1
> +##
> +{ 'command': 'screendump', 'data': {'filename': 'str'} }
> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index dfe8a5b..5fe57fd 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx
> @@ -146,10 +146,7 @@ EQMP
>      {
>          .name       = "screendump",
>          .args_type  = "filename:F",
> -        .params     = "filename",
> -        .help       = "save screen into PPM image 'filename'",
> -        .user_print = monitor_user_noop,
> -        .mhandler.cmd_new = do_screen_dump,
> +        .mhandler.cmd_new = qmp_marshal_input_screendump,
>      },
>  
>  SQMP
> diff --git a/qmp.c b/qmp.c
> index a182b51..086cec8 100644
> --- a/qmp.c
> +++ b/qmp.c
> @@ -415,3 +415,8 @@ ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
>  
>      return ret;
>  }
> +
> +void qmp_screendump(const char *filename, Error **errp)
> +{
> +    vga_hw_screen_dump(filename, errp);
> +}

  reply	other threads:[~2012-03-15 14:55 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14 22:55 [Qemu-devel] [PATCH v2 0/5] screendump qapi convertion Alon Levy
2012-03-14 22:55 ` [Qemu-devel] [PATCH v2 1/5] error: add error_set_file_open_failed Alon Levy
2012-03-15 14:52   ` Luiz Capitulino
2012-03-15 15:21     ` Alon Levy
2012-03-15 16:00       ` Luiz Capitulino
2012-03-14 22:55 ` [Qemu-devel] [PATCH v2 2/5] vga_hw_screen_dump: add Error** param Alon Levy
2012-03-15 14:54   ` Luiz Capitulino
2012-03-15 15:22     ` Alon Levy
2012-03-14 22:55 ` [Qemu-devel] [PATCH v2 3/5] qapi: convert screendump Alon Levy
2012-03-15 14:55   ` Luiz Capitulino [this message]
2012-03-15 15:23     ` Alon Levy
2012-03-14 22:55 ` [Qemu-devel] [PATCH v2 4/5] vga: ppm_save(): Return error on failure Alon Levy
2012-03-14 22:55 ` [Qemu-devel] [PATCH v2 5/5] blockdev: use error_set_file_open_failed Alon Levy
2012-03-15 14:56   ` Luiz Capitulino
2012-03-15 15:23     ` Alon Levy
2012-03-18 18:29 ` [Qemu-devel] [PATCH v3 0/5] screendump qapi convertion Alon Levy
2012-03-18 18:29   ` [Qemu-devel] [PATCH v3 1/5] qerror: add error codes for fopen failure Alon Levy
2012-03-23 14:21     ` Luiz Capitulino
2012-03-23 19:53       ` Alon Levy
2012-03-23 20:48         ` Luiz Capitulino
2012-03-26 18:44       ` Alon Levy
2012-03-26 18:51       ` Alon Levy
2012-03-18 18:29   ` [Qemu-devel] [PATCH v3 2/5] add qemu_fopen_err Alon Levy
2012-03-23 14:22     ` Luiz Capitulino
2012-03-23 19:55       ` Alon Levy
2012-03-18 18:29   ` [Qemu-devel] [PATCH v3 3/5] vga_hw_screen_dump: add Error** param Alon Levy
2012-03-18 18:29   ` [Qemu-devel] [PATCH v3 4/5] qapi: convert screendump Alon Levy
2012-03-23 14:25     ` Luiz Capitulino
2012-03-18 18:29   ` [Qemu-devel] [PATCH v3 5/5] vga: ppm_save(): Return error on failure Alon Levy
2012-03-23 14:27     ` Luiz Capitulino
2012-03-23 19:54       ` Alon Levy

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=20120315115531.3f63b29a@doriath.home \
    --to=lcapitulino@redhat.com \
    --cc=alevy@redhat.com \
    --cc=mlureau@redhat.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).