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

Re: [libvirt] [PATCH] error: avoid API breakage with vmware



On 12/22/2010 07:01 AM, Chris Lalancette wrote:
> On 12/21/10 - 03:12:43PM, Eric Blake wrote:
>> Fix glitch in commit cddd2a06 (thankfully post-0.8.6, so no
>> released version has the glitch).
>>
>> Document and try to workaround glitch in commit 46e9b0f (in 0.8.0,
>> which invalidated 6 virErrorNumber dating back to 0.7.1).
>>
>> Thankfully, my audit did not find any other glitches until pre-0.1.0
>> days.  I'm not sure how to add a syntax-check off the top of my
>> head, but hopefully the explicit numbering will make people think
>> twice about renumbering in the future.
>>
>> * include/libvirt/virterror.h (virErrorDomain): Avoid inserting
>> new values in the middle, and add explicit numbering to help avoid
>> this in the future.
>> (virErrorNumber): Add explicit numbering, and document the snafu.
>> * src/remote/remote_driver.c (remoteIO): Compensate for the snafu.
> 
> Thanks for looking at this, Eric.
> 
>> +++ b/src/remote/remote_driver.c
>> @@ -10371,8 +10371,36 @@ remoteIO(virConnectPtr conn,
>>          return -1;
>>
>>  cleanup:
>> -    DEBUG("All done with our call %d %p %p", thiscall->proc_nr, priv->waitDispatch, thiscall);
>> +    DEBUG("All done with our call %d %p %p", thiscall->proc_nr,
>> +          priv->waitDispatch, thiscall);
>>      if (thiscall->mode == REMOTE_MODE_ERROR) {
>> +        /* Interop for virErrorNumber glitch in 0.8.0, if server is
>> +         * 0.7.1 through 0.7.7 */

I tweaked this comment to refer to the pseudocode in virterror.h,

> Clever.  Make sure it is of the right "domain", and if not, you know you are
> talking to an older server.  At first I thought it was confusing, but this
> will do the right thing in *almost* all situations, so I like it.
> 
> ACK to this; as DV says, maybe we can make a "make check" or
> "make syntax-check" to automatically catch it in the future, but this at least
> fixes the current breakage.

then pushed the result.

-- 
Eric Blake   eblake redhat com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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