[libvirt] [test-API PATCH 2/7] lib: fix streamAPI class
Peter Krempa
pkrempa at redhat.com
Thu Mar 22 09:01:46 UTC 2012
On 03/21/2012 04:45 PM, Guannan Ren wrote:
> On 03/21/2012 08:46 PM, Peter Krempa wrote:
>> The streamAPI class that encapsulates work with libvirt's streams was
>> fundamentaly broken:
>> - each call to one of the methods created a new stream and
>> performed the call
>> - some methods called virStream methods with different numbers
>> of arguments
>> - there was no way to extract the actual libvirt stream object
> thanks for the patch.
>
>> ---
>> lib/streamAPI.py | 52
>> ++++++++++++++++++++++++++--------------------------
>> 1 files changed, 26 insertions(+), 26 deletions(-)
>>
>> diff --git a/lib/streamAPI.py b/lib/streamAPI.py
>> index bc7d217..69e183e 100644
>> --- a/lib/streamAPI.py
>> +++ b/lib/streamAPI.py
>> @@ -38,76 +38,76 @@ append_path(result.group(0))
>> import exception
>>
>>
>> - def eventAddCallback(self, flag = 0, cb, opaque):
>> + def eventAddCallback(self, cb, opaque):
>
> The API need an argument event to pass in which is virEventHandleType
> VIR_EVENT_HANDLE_READABLE = 1
> VIR_EVENT_HANDLE_WRITABLE = 2
> VIR_EVENT_HANDLE_ERROR = 4
> VIR_EVENT_HANDLE_HANGUP = 8
>
> We could just overdefine it in streamAPI.py which make use of them
> easier for
> writing testcase.
> It's not a good idea to import libvirt.py directly in testcases.
Oh, in this case I'll need to redefine the virConsoleFlags enum in the
domainAPI too as I'm importing libvirt.py in my (not yet published )
test that deals with consoles.
Peter
More information about the libvir-list
mailing list