From patchwork Wed Nov 16 10:14:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 9431215 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29A8D60471 for ; Wed, 16 Nov 2016 10:14:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2085028E5D for ; Wed, 16 Nov 2016 10:14:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1522C28EAC; Wed, 16 Nov 2016 10:14:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B44CC28E5D for ; Wed, 16 Nov 2016 10:14:35 +0000 (UTC) Received: from localhost ([::1]:51643 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6xEh-00008J-1G for patchwork-qemu-devel@patchwork.kernel.org; Wed, 16 Nov 2016 05:14:35 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6xEN-000082-IY for qemu-devel@nongnu.org; Wed, 16 Nov 2016 05:14:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6xEK-0003RR-Bc for qemu-devel@nongnu.org; Wed, 16 Nov 2016 05:14:15 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40682) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6xEK-0003RL-6B; Wed, 16 Nov 2016 05:14:12 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 34A7881239; Wed, 16 Nov 2016 10:14:11 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-33.ams2.redhat.com [10.36.116.33]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAGAE6UW029009; Wed, 16 Nov 2016 05:14:08 -0500 From: Thomas Huth To: David Gibson , qemu-ppc@nongnu.org, Laurent Vivier , "Dr. David Alan Gilbert" , Stefan Hajnoczi Date: Wed, 16 Nov 2016 11:14:06 +0100 Message-Id: <1479291246-29969-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Wed, 16 Nov 2016 10:14:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2] tests/postcopy: Use KVM on ppc64 only if it is KVM-HV X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrea Arcangeli , qemu-devel@nongnu.org, Greg Kurz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The ppc64 postcopy test does not work with KVM-PR, and it is also causing annoying warning messages when run on a x86 host. So let's use KVM here only if we know that we're running with KVM-HV (which automatically also means that we're running on a ppc64 host), and use TCG otherwise. Signed-off-by: Thomas Huth --- v2: - Check also /dev/kvm to make sure that we're allowed to access KVM - Use only "accel=kvm" instead of "accel=kvm:tcg" if we feel confident that we're running with KVM-HV and can use it tests/postcopy-test.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/postcopy-test.c b/tests/postcopy-test.c index d6613c5..e4f0f3f 100644 --- a/tests/postcopy-test.c +++ b/tests/postcopy-test.c @@ -380,17 +380,27 @@ static void test_migrate(void) " -incoming %s", tmpfs, bootpath, uri); } else if (strcmp(arch, "ppc64") == 0) { + const char *accel = "tcg"; + + /* + * We preferably want to test with KVM, but on ppc64, the test only + * works with kvm-hv, not with kvm-pr, so we check that here first + */ + if (access("/sys/module/kvm_hv", F_OK) == 0 && + access("/dev/kvm", R_OK | W_OK) == 0) { + accel = "kvm"; + } init_bootfile_ppc(bootpath); - cmd_src = g_strdup_printf("-machine accel=kvm:tcg -m 256M" + cmd_src = g_strdup_printf("-machine accel=%s -m 256M" " -name pcsource,debug-threads=on" " -serial file:%s/src_serial" " -drive file=%s,if=pflash,format=raw", - tmpfs, bootpath); - cmd_dst = g_strdup_printf("-machine accel=kvm:tcg -m 256M" + accel, tmpfs, bootpath); + cmd_dst = g_strdup_printf("-machine accel=%s -m 256M" " -name pcdest,debug-threads=on" " -serial file:%s/dest_serial" " -incoming %s", - tmpfs, uri); + accel, tmpfs, uri); } else { g_assert_not_reached(); }