@@ -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
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.shah@redhat.com> --- client/tests/kvm/tests/balloon_check.py | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-)