From patchwork Mon Aug 8 13:05:25 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 1044012 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p78D5jhB028518 for ; Mon, 8 Aug 2011 13:05:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753850Ab1HHNFl (ORCPT ); Mon, 8 Aug 2011 09:05:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49755 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753800Ab1HHNFk (ORCPT ); Mon, 8 Aug 2011 09:05:40 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p78D5d3K004820 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 8 Aug 2011 09:05:39 -0400 Received: from localhost ([10.3.113.14]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p78D5b35008480; Mon, 8 Aug 2011 09:05:38 -0400 From: Amit Shah To: Lucas Meneghel Rodrigues Cc: autotest@test.kernel.org, kvm list , Amit Shah Subject: [PATCH] kvm: balloon: test multiple devices Date: Mon, 8 Aug 2011 18:35:25 +0530 Message-Id: <0bf3d2e9b2aa2f8a0a13bc1d7f8d8f312ee1ee8f.1312808173.git.amit.shah@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 08 Aug 2011 13:05:45 +0000 (UTC) Multiple balloon devices should not be allowed. Check if the qemu we're running under has the right fixes. Signed-off-by: Amit Shah --- 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