qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Michael Tokarev <mjt@tls.msk.ru>,
	Laurent Vivier <laurent@vivier.eu>,
	Markus Armbruster <armbru@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 1/4] ui: add qapi parser for -display
Date: Thu, 19 Apr 2018 10:57:12 -0500	[thread overview]
Message-ID: <8fc65111-4c2f-9e07-3e4a-c95a6d52b29f@redhat.com> (raw)
In-Reply-To: <20180419132026.5494-2-kraxel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 993 bytes --]

On 04/19/2018 08:20 AM, Gerd Hoffmann wrote:
> Add parse_display_qapi() function which parses the -display command line
> using a qapi visitor for DisplayOptions.  Wire up as default catch in
> parse_display().
> 
> Improves the error message for unknown display types.
> 
> Also enables json as -display argument, i.e. -display "{ 'type': 'gtk' }"
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---

> +
> +    /*
> +     * We don't have any dynamically allocated stuff inside
> +     * DisplayOptions, so we can simply copy the struct content and
> +     * free opts without ending up with pointers pointing into
> +     * nowhere.
> +     */
> +    dpy = *opts;
> +    qapi_free_DisplayOptions(opts);

That's risky; would it be better to use QAPI_CLONE_MEMBERS() to not have
to worry about if we add a pointer in the future?

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  reply	other threads:[~2018-04-19 15:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-19 13:20 [Qemu-devel] [PATCH 0/4] ui: use qapi-based parser for most -display options Gerd Hoffmann
2018-04-19 13:20 ` [Qemu-devel] [PATCH 1/4] ui: add qapi parser for -display Gerd Hoffmann
2018-04-19 15:57   ` Eric Blake [this message]
2018-04-19 19:57     ` Gerd Hoffmann
2018-07-26 12:45   ` Markus Armbruster
2018-08-24  6:30     ` Markus Armbruster
2018-08-24  6:51       ` Gerd Hoffmann
2018-08-27 10:02       ` Gerd Hoffmann
2018-04-19 13:20 ` [Qemu-devel] [PATCH 2/4] ui: switch trivial displays to qapi parser Gerd Hoffmann
2018-04-19 13:20 ` [Qemu-devel] [PATCH 3/4] ui: switch gtk display " Gerd Hoffmann
2018-04-19 13:20 ` [Qemu-devel] [PATCH 4/4] ui: document non-qapi parser cases Gerd Hoffmann

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=8fc65111-4c2f-9e07-3e4a-c95a6d52b29f@redhat.com \
    --to=eblake@redhat.com \
    --cc=armbru@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=laurent@vivier.eu \
    --cc=mjt@tls.msk.ru \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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).