thanks your infomation , I will contact with liyang
On 12/03/13 22:01, Fergus Yu wrote:
On 03/12/2013 11:06 AM, [email protected] wrote:
From: whuang <[email protected]>
Signed-off-by: whuang <[email protected]>
---
virttest/virsh.py | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/virttest/virsh.py b/virttest/virsh.py
index f847d92..cb6d0af 100644
--- a/virttest/virsh.py
+++ b/virttest/virsh.py
@@ -1557,3 +1557,58 @@ def cpu_stats(name, options, **dargs):
cmd += " %s" % options
return command(cmd, **dargs)
+
+def change_media(name, device, source, options, **dargs):
+ """
+ Change media of CD or floppy drive.
+
+ @param: name: VM's name.
+ @param: path: Fully-qualified path or target of disk device
+ @param: source: source of the media
+ @param: options: command change_media options.
+ @param: dargs: standardized virsh function API keywords
+ @return: CmdResult instance
+ """
+ cmd = "change-media %s %s %s" % (name, device, source)
+ if options:
+ cmd += " %s " % options
+ logging.debug("virsh cmd = change-media %s" % cmd)
+ return command(cmd, **dargs)
+
+def attach_disk(name, option="", **dargs):
+ """
+ Attach a Disk to VM.
+
+ @param: name: name of guest
+ @param: option: options to pass to command
+ @param: dargs: standardized virsh function API keywords
+ @return: CmdResult object
+ """
+ cmd = "attach-disk "
+
+ if name:
+ cmd += "--domain %s" % name
+ if option:
+ cmd += " %s" % option
+
+ return command(cmd, **dargs)
+
+def update_device(name, file, option="", **dargs):
+ """
+ Update VMs device.
+
+ @param: name: name of guest
+ @param: file: xml file
+ @param: option: options to pass to command
+ @param: dargs: standardized virsh function API keywords
+ @return: CmdResult object
+ """
+ cmd = "update-device "
+
+ if name and file:
+ cmd += "--domain %s --file %s " % (name, file)
+ if option:
+ cmd += " %s" % option
+ logging.debug("virsh cmd = update-device %s" % cmd)
+ return command(cmd, **dargs)
+
It seems that liyang has sent patches about update_device().
To avoid conflicting work, you may contact him and make a general
version of virsh functions with him.
Thanks
Yu Mingfei
--
Best Regards!
Wenlong Huang
IRC Account: wenlong
Phone: 62608117 / 15011214521
_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel