Multiple balloon devices should not be allowed.  Check if the qemu we're
running under has the right fixes.

Signed-off-by: Amit Shah <amit.s...@redhat.com>
---
 client/tests/kvm/tests/balloon_check.py |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/client/tests/kvm/tests/balloon_check.py 
b/client/tests/kvm/tests/balloon_check.py
index 0b7f0f4..d79ed13 100644
--- a/client/tests/kvm/tests/balloon_check.py
+++ b/client/tests/kvm/tests/balloon_check.py
@@ -64,6 +64,18 @@ def run_balloon_check(test, params, env):
             fail += 1
         return fail
 
+    def multiple_devices():
+        """
+        Hot-plugging multiple balloon devices isn't allowed.
+        Ensure qemu fails hot-plugging a second device.
+        """
+        try:
+            vm.monitor.cmd("device_add virtio-balloon-pci")
+        except kvm_monitor.MonitorError, e:
+            # This is good.
+            return 0
+        logging.error("Multiple balloon devices allowed by this version of 
qemu")
+        return 1
 
     fail = 0
     vm = env.get_vm(params["main_vm"])
@@ -100,6 +112,8 @@ def run_balloon_check(test, params, env):
     # we won't trigger guest OOM killer while running multiple iterations
     fail += balloon_memory(vm_assigned_mem)
 
+    fail += multiple_devices()
+
     # Close stablished session
     session.close()
     # Check if any failures happen during the whole test
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to