Signed-off-by: Yu Mingfei<[email protected]>
---
 client/virt/virsh.py |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/client/virt/virsh.py b/client/virt/virsh.py
index 1305d85..3eb3854 100644
--- a/client/virt/virsh.py
+++ b/client/virt/virsh.py
@@ -1110,3 +1110,23 @@ def has_help_command(cmd, options='', **dargs):
     @return: True/False
     """
     return bool(help_command(options, cache=True, **dargs).count(cmd))
+
+
+def setmem(name, size, options="", **dargs):
+    """
+    Change the current memory allocation in the guest domain.
+
+    @param name: name of domain.
+    @param size: the memory size to set.
+    @param options: options of command virsh setmem, it can be
+                --config/--live/--current or mix them.
+    """
+
+    cmd = "setmem"
+    if name:
+        cmd += " --domain %s" % name
+    if size:
+        cmd += " %s" % size
+    if options:
+        cmd += " %s" % options
+    return command(cmd, **dargs)
--
1.7.1


--
Best Regards
Yu Mingfei

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to