From patchwork Fri Jul 14 23:43:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 107835 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp1556185qge; Fri, 14 Jul 2017 16:43:19 -0700 (PDT) X-Received: by 10.55.18.132 with SMTP id 4mr9395836qks.231.1500075799921; Fri, 14 Jul 2017 16:43:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1500075799; cv=none; d=google.com; s=arc-20160816; b=HW1IuBCCJH0IZWyi7cKuMowBK89qv4tRBYfOTLqErsATH+i+qk4u4J8FkHCPRUNUJ4 WCuwtyz5JubfKAiPrTC+NWCuIyZKvenaIjyp0AqUrHG2aUC7w9Te7blASki5jTXlkpyt oGm9UuQWlwT4SDLYVDTgTfWQsi8c3GdEAsnSfAs2YIuHt7R7aTUclZCE/gqI6aGWEiXq akAOAoiW3MWlxb3ZBi/9KtjipeDhjPH+5Kw5eZ1LTFQeo3AQ/gTosZ18U95n+3eGEdjF nMKTpWm3Db3sAlhShqwuUm9eIKCgLF2R6h+G1fjhdtVmnSn3yEjPczYRwW4sla1hw3O6 Jhxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to:dkim-filter :dmarc-filter:arc-authentication-results; bh=cntwkne7UHnwy0q+CsQskD7UbQhPW6wX3nO5r/MZXdI=; b=ZXWPucRvLcqWr5sX0PWcMqk87ZPRa8MGD5vsUkKGM9vM4dPGGYIBfgXCqFVQ7mudDn TLbw/XYbxSsCUu9+nLGqoJyhV2d3bfaK/VwHKfe7Wl3TXr8nowSaZnJhEoxSCisskaMj VbJrDe8EWXxMZjR8EZeZUvuejptQjN5ZQScnP5NzRYmVx2nfD2B9fBG54ZXow6y6mOPa KSdEMGXypEMgi824Kt1GZq6vEliigUNhJ98XPD12VB14AUUKCPDR0AK6NKLnd1DHIrOC 4ljJeMcUQzm6F6uamjmZe4rALKcbLXq5jmKeti14+qHdniDzKr0OalOSl2uWaBW0+cSt 60ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id d123si8858471qka.329.2017.07.14.16.43.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Jul 2017 16:43:19 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 258B93345BA; Fri, 14 Jul 2017 23:43:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 258B93345BA Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=libvir-list-bounces@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 258B93345BA Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5BC1719654; Fri, 14 Jul 2017 23:43:17 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 14FA44A492; Fri, 14 Jul 2017 23:43:16 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v6ENhDjp023216 for ; Fri, 14 Jul 2017 19:43:13 -0400 Received: by smtp.corp.redhat.com (Postfix) id AFBF81840D; Fri, 14 Jul 2017 23:43:13 +0000 (UTC) Delivered-To: libvirt-list@redhat.com Received: from colepc.redhat.com (ovpn-116-206.phx2.redhat.com [10.3.116.206]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55F2C62920; Fri, 14 Jul 2017 23:43:13 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 14 Jul 2017 19:43:04 -0400 Message-Id: <342548c53a7b35880b906f7f5c37c996facd107b.1500075702.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/3] tests: add qemu x86 kvm 32-on-64 test X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 14 Jul 2017 23:43:18 +0000 (UTC) There's some specific logic in qemuBuildCpuCommandLine to support auto adding -cpu qemu 32 for arch=i686 with an x86_64 qemu-kvm binary. Add a test case for it Signed-off-by: Cole Robinson --- .../qemuxml2argv-x86-kvm-32-on-64.args | 21 +++++++++++++++++++++ .../qemuxml2argv-x86-kvm-32-on-64.xml | 13 +++++++++++++ tests/qemuxml2argvtest.c | 1 + tests/testutilsqemu.c | 18 ++++++++++++++++-- 4 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml -- 2.13.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args b/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args new file mode 100644 index 000000000..5fdeaf843 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.args @@ -0,0 +1,21 @@ +LC_ALL=C \ +PATH=/bin \ +HOME=/home/test \ +USER=test \ +LOGNAME=test \ +QEMU_AUDIO_DRV=none \ +/usr/bin/qemu-kvm \ +-name kvm \ +-S \ +-machine pc,accel=kvm \ +-cpu qemu32 \ +-m 4096 \ +-smp 1,sockets=1,cores=1,threads=1 \ +-uuid d091ea82-29e6-2e34-3005-f02617b36e87 \ +-nographic \ +-nodefaults \ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-kvm/monitor.sock,server,\ +nowait \ +-mon chardev=charmonitor,id=monitor,mode=readline \ +-no-acpi \ +-boot c diff --git a/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml b/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml new file mode 100644 index 000000000..2939cec15 --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-x86-kvm-32-on-64.xml @@ -0,0 +1,13 @@ + + kvm + d091ea82-29e6-2e34-3005-f02617b36e87 + 4194304 + + hvm + + + /usr/bin/qemu-kvm + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 302c9c892..ef5a9b0dc 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -690,6 +690,7 @@ mymain(void) DO_TEST("kvm", QEMU_CAPS_MACHINE_OPT); DO_TEST("default-kvm-host-arch", QEMU_CAPS_MACHINE_OPT); DO_TEST("default-qemu-host-arch", QEMU_CAPS_MACHINE_OPT); + DO_TEST("x86-kvm-32-on-64", QEMU_CAPS_MACHINE_OPT); DO_TEST("boot-cdrom", NONE); DO_TEST("boot-network", NONE); DO_TEST("boot-floppy", NONE); diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index ee4853841..d1290fdde 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -111,7 +111,8 @@ typedef enum { TEST_UTILS_QEMU_BIN_ARM, TEST_UTILS_QEMU_BIN_PPC64, TEST_UTILS_QEMU_BIN_PPC, - TEST_UTILS_QEMU_BIN_S390X + TEST_UTILS_QEMU_BIN_S390X, + TEST_UTILS_QEMU_BIN_KVM, } QEMUBinType; static const char *QEMUBinList[] = { @@ -121,7 +122,8 @@ static const char *QEMUBinList[] = { "/usr/bin/qemu-system-arm", "/usr/bin/qemu-system-ppc64", "/usr/bin/qemu-system-ppc", - "/usr/bin/qemu-system-s390x" + "/usr/bin/qemu-system-s390x", + "/usr/bin/qemu-kvm", }; @@ -215,6 +217,18 @@ testQemuAddI686Guest(virCapsPtr caps) machines)) goto error; + machines = NULL; + if (!(machines = testQemuAllocMachines(&nmachines))) + goto error; + + if (!virCapabilitiesAddGuestDomain(guest, + VIR_DOMAIN_VIRT_KVM, + QEMUBinList[TEST_UTILS_QEMU_BIN_KVM], + NULL, + nmachines, + machines)) + goto error; + return 0; error: