[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/4] ui: add qapi parser for -dis
Re: [Qemu-trivial] [Qemu-devel] [PATCH 1/4] ui: add qapi parser for -display
Thu, 19 Apr 2018 21:57:21 +0200
> > + /*
> > + * 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.