On 02/22/2012 06:46 PM, Lucas Meneghel Rodrigues wrote:
> On 02/22/2012 01:47 AM, tangchen wrote:
>> Hi~
>>
>> Any comment on this patch?
>> Thanks:)
> Applied:
>
> https://github.com/autotest/autotest/commit/4b8e75f9f44494c47c7bd68540777ad1e30b99db
>
> Thanks!
>
>> On 02/16/2012 03:11 PM, tangchen wrote:
>>> This patch adds 3 member functions for libvirt_vm:
>>> 1) get_id()
>>> 2) get_uuid()
>>> 3) get_xml()
>>>
>>> Signed-off-by: Tang Chen<[email protected]>
>>> ---
>>> client/virt/libvirt_vm.py | 22 ++++++++++++++++++++++
>>> 1 files changed, 22 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/client/virt/libvirt_vm.py b/client/virt/libvirt_vm.py
>>> index 85021d9..c7a99b5 100644
>>> --- a/client/virt/libvirt_vm.py
>>> +++ b/client/virt/libvirt_vm.py
>>> @@ -106,6 +106,11 @@ def virsh_domstate(name, uri = ""):
We instantiated class VM with 'uri' then pass it to each wrapper function,
Is the 'uri' parameter necessary? whether we may define a VIRSH_CMD
class to initialize it then directly use it in each wrapper function
instead of
a extra parameter?
Regards
Alex
>>> """
>>> return virsh_cmd("domstate %s" % name, uri)
>>>
>>> +def virsh_domid(name, uri = ""):
>>> + """
>>> + Return VM's ID.
>>> + """
>>> + return virsh_cmd("domid %s" % (name), uri)
>>>
>>> def virsh_uuid(name, uri = ""):
>>> """
>>> @@ -445,6 +450,23 @@ class VM(virt_vm.BaseVM):
>>> """
>>> return virsh_domstate(self.name, self.connect_uri)
>>>
>>> + def get_uuid(self):
>>> + """
>>> + Return VM's UUID.
>>> + """
>>> + return virsh_uuid(self.name, self.connect_uri)
>>> +
>>> + def get_id(self):
>>> + """
>>> + Return VM's ID.
>>> + """
>>> + return virsh_domid(self.name, self.connect_uri)
>>> +
>>> + def get_xml(self):
>>> + """
>>> + Return VM's xml file.
>>> + """
>>> + return virsh_dumpxml(self.name, self.connect_uri)
>>>
>>> def clone(self, name=None, params=None, root_dir=None,
>>> address_cache=None,
>>> copy_state=False):
> _______________________________________________
> Autotest mailing list
> [email protected]
> http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest