qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, 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 21:57:21 +0200	[thread overview]
Message-ID: <20180419195721.r3salb5hd3w2plr4@sirius.home.kraxel.org> (raw)
In-Reply-To: <8fc65111-4c2f-9e07-3e4a-c95a6d52b29f@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?

Didn't know QAPI_CLONE_MEMBERS() exists.  Yes, probably more
future-proof to just use that instead of adding that comment.
Will look into that for v2.

cheers,
  Gerd

  reply	other threads:[~2018-04-19 19: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
2018-04-19 19:57     ` Gerd Hoffmann [this message]
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=20180419195721.r3salb5hd3w2plr4@sirius.home.kraxel.org \
    --to=kraxel@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@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).