[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC 1/3] error: don't rely on pointer comparison
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH RFC 1/3] error: don't rely on pointer comparisons |
Date: |
Tue, 16 Jun 2015 08:50:58 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 |
On 06/16/2015 08:45 AM, Eric Blake wrote:
> On 06/16/2015 06:53 AM, Michael S. Tsirkin wrote:
>> makes it possible to copy error_abort pointers,
>> not just pass them on directly.
>>
>> Signed-off-by: Michael S. Tsirkin <address@hidden>
>> ---
>> util/error.c | 16 +++++++++++-----
>> 1 file changed, 11 insertions(+), 5 deletions(-)
>
> Where is this patch needed?
>
> Is the goal to allow:
>
> Error err = error_abort;
Oh, my bad for not double checking the layers of indirection involved.
The above comment makes no sense type-wise, since error_abort is already
'Error *', and &error_abort is 'Error **'.
>
> as a way to statically initialize err via copy to behave the same as the
> global error_abort?
>
> But that's not how you were using it in patch 3. There, you were
> initializing Error *, so using &error_abort is still useful there, and
> pointer equality still suffices.
>
> I don't see a convincing use for this patch.
And I retract that, because now I do see the use.
Error *local_err = ...;
as a way to set an abort-on-error pointer requires that we have more
than just a global error_abort abort-on-error pointer, but that any
number of pointers all resolve to something with embedded properties.
Sorry for the confusion on my part, and:
Reviewed-by: Eric Blake <address@hidden>
>
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature