Signed-off-by: Yanbing Du <[email protected]>
---
virttest/virsh.py | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 49 insertions(+), 0 deletions(-)
diff --git a/virttest/virsh.py b/virttest/virsh.py
index f847d92..32991e6 100644
--- a/virttest/virsh.py
+++ b/virttest/virsh.py
@@ -1557,3 +1557,52 @@ def cpu_stats(name, options, **dargs):
cmd += " %s" % options
return command(cmd, **dargs)
+
+
+def blockcopy(name, path, dest, options, **dargs):
+ """
+ Start a block copy operation.
+
+ @param name: name of domain
+ @param path: fully-qualified path or target of disk
+ @param dest: path of the copy to create
+ @param options: options of blockcopy
+ @param dargs: standardized virsh function API keywords
+ @return: CmdResult instance
+ """
+ cmd = "blockcopy %s %s %s" % (name, path, dest)
+ if options:
+ cmd += " %s" % options
+ return command(cmd, **dargs)
+
+
+def blockpull(name, path, options, **dargs):
+ """
+ Populate a disk from its backing image.
+ @param name: name of domain
+ @param path: fully-qualified path or target of disk
+ @param options: options of blockpull
+ @param dargs: standardized virsh function API keywords
+ @return: CmdResult instance
+ """
+ cmd = "blockpull %s %s" % (name, path)
+ if options:
+ cmd += " %s" % options
+ return command(cmd, **dargs)
+
+
+def blockjob(name, path, options, **dargs):
+ """
+ Manage active block operations
+ @param name: name of domain
+ @param path: fully-qualified path or target of disk
+ @param options: options of blockjob
+ @param dargs: standardized virsh function API keywords
+ @return: CmdResult instance
+ """
+ cmd = "blockjob %s %s" % (name, path)
+ if options:
+ cmd += " %s" % options
+ return command(cmd, **dargs)
+
+
--
1.7.1
_______________________________________________
Virt-test-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-test-devel