> > + /* > > + * 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