From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6kcK-00076k-57 for qemu-devel@nongnu.org; Tue, 15 Nov 2016 15:46:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6kcH-0002HQ-1S for qemu-devel@nongnu.org; Tue, 15 Nov 2016 15:46:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58454) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c6kcG-0002HH-SP for qemu-devel@nongnu.org; Tue, 15 Nov 2016 15:46:04 -0500 References: <20161115110956.5393749d@bahia> <20161115155642.345d1863@bahia> <44b410d5-907c-cff9-0366-a86718bb0352@redhat.com> <20161115174338.GI2038@work-vm> <20161115191306.216341b9@bahia> <81408cfa-c1a2-ce87-8a31-4ae94d49fbfe@redhat.com> <094a2d0a-41ab-c871-7862-1e04cef6fa45@redhat.com> <18c4e391-f38a-e5fe-c957-571af9a24f80@redhat.com> From: Laurent Vivier Message-ID: <54bb7d42-7fdc-f37b-0ff5-bd965a87562f@redhat.com> Date: Tue, 15 Nov 2016 21:45:58 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] QEMU postcopy-test failing on ppc64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , Thomas Huth , Greg Kurz , "Dr. David Alan Gilbert" Cc: Stefan Hajnoczi , Andrea Arcangeli , qemu-devel On 15/11/2016 21:44, Laurent Vivier wrote: > > > On 15/11/2016 21:39, Laurent Vivier wrote: >> >> >> On 15/11/2016 20:00, Eric Blake wrote: >>> On 11/15/2016 12:48 PM, Thomas Huth wrote: >>> >>>>> Even for Power, I'd prefer to keep KVM since the problem only happens with >>>>> KVM PR which isn't the preferred way to do KVM on bare metal... until this >>>>> get fixed, I'd rather suggest people to run make check with KVM HV. >>>> >>>> OK ... what do you think about a patch like this: >>>> >>>> diff --git a/tests/postcopy-test.c b/tests/postcopy-test.c >>>> --- a/tests/postcopy-test.c >>>> +++ b/tests/postcopy-test.c >>>> @@ -380,17 +380,19 @@ static void test_migrate(void) >>>> " -incoming %s", >>>> tmpfs, bootpath, uri); >>>> } else if (strcmp(arch, "ppc64") == 0) { >>>> + const char *accel; >>>> init_bootfile_ppc(bootpath); >>>> - cmd_src = g_strdup_printf("-machine accel=kvm:tcg -m 256M" >>>> + accel = system("/sbin/lsmod | grep -q kvm_hv") ? "tcg" : "kvm:tcg"; >>> >>> Unsafe use of system() (all I have to do is stick a counterfeit 'grep' >>> earlier on my PATH to mess you up). Is there a safer way to grab that >>> information without having to call out to the shell? >> >> I think trying to open "/dev/kvm" would be enough to know if kvm is >> available or not. > > OK, I've missed you want to check KVM HV only... So, I think you can check for "/sys/module/kvm_hv" Laurent