[libvirt] [PATCH] fix virsh's regression

Wen Congyang wency at cn.fujitsu.com
Thu Apr 28 04:38:30 UTC 2011


At 04/28/2011 11:08 AM, Eric Blake Write:
> On 04/25/2011 09:03 PM, Wen Congyang wrote:
>> This patch does the following things:
>> 1. The return value of cmdSchedInfoUpdate() can be -1, 0 and 1. So the
>>    type of return value should be int not bool.(This function is not a
>>    entry of a virsh command, but the name of this function likes cmdXXX)
> 
> Phooey - mass replacement makes for a patch that's too hard to review,
> and indeed snuck in this regression.
> 
>>
>> 2. The type of cmdSchedinfo()'s, cmdFreecell()'s, cmdPoolList()'s and
>>    cmdVolList()'s return value is bool not int, so change the type of
>>    variable ret_val, func_ret and functionReturn.
> 
> Not quite as serious (int holds bool), but still worth fixing.
> 
>>
>> 3. Add a variable functionReturn for cmdMigrate(), cmdAttachInterface(),
>>    cmdDetachInterface(), cmdAttachDisk() and cmdDetachDisk() to save the
>>    return value.
>>
>> 4. Change the type of variable ret in the function cmdAttachDevice(),
>>    cmdDetachDevice(), cmdUpdateDevice(), cmdAttachInterface(),
>>    cmdDetachInterface(), cmdAttachDisk() and cmdDetachDisk() to int, as
>>    we use it to save the return value of virXXX() and the type of virXXX()'s
>>    return value is int not bool.
> 
> Also a regression.  Thanks for catching these.
> 
>>
>> 5. Do some cleanup when virBuff.error is 1.
>>
>> The bug 1-4 were introduced by commit b56fa5bb.
>>
>> ---
>>  tools/virsh.c |   63 +++++++++++++++++++++++++++++---------------------------
>>  1 files changed, 33 insertions(+), 30 deletions(-)
> 
> ACK.  And I'm glad I pushed my patch as early as I did in the release
> cycle, to let us catch these sort of issues pre-release.

Thanks, pushed.

> 




More information about the libvir-list mailing list