On 16/02/2017 20:36, Eric Blake wrote:
> On that grounds, you already need the 'if (info)' for more than just the
> free, so this code motion is no longer quite as important.  But now I'm
> noticing that it looks weird because you are freeing an input parameter.
>  Generally, transfer semantics like that are screwy - it's probably
> better if the caller of qemu_system_guest_panicked() is the one freeing
> info, rather than requiring that the caller pass in malloc'd memory that
> gets freed as a side effect and must not be referenced afterwards in the
> caller.  In other words, I think the code motion is unnecessary, but
> that the qapi_free_GuestPanicInformation() call is probably in the wrong
> function to begin with.

Even better then would be to just pass a CPUState* and let
qemu_system_guest_panicked get the GuestPanicInformation via the QOM
property.

But for 2.9, we only need to change the union.  Eric, can you do that
for us since my QAPI-fu is limited?

Paolo

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to