qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] qmp-events: fix GUEST_PANICKED description form


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] qmp-events: fix GUEST_PANICKED description formatting
Date: Mon, 20 Feb 2017 19:10:04 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0


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

[Prev in Thread] Current Thread [Next in Thread]