From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53075) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ablKh-00068g-Kw for qemu-devel@nongnu.org; Fri, 04 Mar 2016 03:43:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ablKg-0005Vs-Is for qemu-devel@nongnu.org; Fri, 04 Mar 2016 03:43:35 -0500 Message-ID: <1457081004.4468.4.camel@redhat.com> From: Andrea Bolognani Date: Fri, 04 Mar 2016 09:43:24 +0100 In-Reply-To: <20160304025255.GF30973@pxdev.xzpeter.org> References: <1456993272-32292-1-git-send-email-peterx@redhat.com> <1456993272-32292-4-git-send-email-peterx@redhat.com> <1457007587.4468.2.camel@redhat.com> <20160304025255.GF30973@pxdev.xzpeter.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 3/3] arm: implement query-gic-capability List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: wei@redhat.com, peter.maydell@linaro.org, drjones@redhat.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com, qemu-devel@nongnu.org, qemu-arm@nongnu.org On Fri, 2016-03-04 at 10:52 +0800, Peter Xu wrote: > > Sorry for not catching this earlier, but I'm afraid this is not > > going to work -- libvirt doesn't pass either -enable-kvm or the > > machine option accel=3Dkvm when probing for capabilities, which > > means that, with the current implementation, it will only get > > information about emulated GIC. > >=C2=A0 > > Is there a way to make probing work without requiring KVM to > > be enabled? > Ah.. If so, this is a good point... >=C2=A0 > I can do this, but I just feel it a bit hacky if I do ioctl()s > directly in one QMP command handle: >=C2=A0 > qmp_query_gic_capability() > { >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0kvm =3D open("/dev/kvm"); >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0vm =3D ioctl(KVM_CREATE_VM); >=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0...test create devices using KVM_CREATE_DE= VICE ioctls... >=C2=A0 >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0close(vm); >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0close(kvm); > } >=C2=A0 > Rather than leveraging current KVMState stuffs (of course, I can > make things a little bit prettier than above...). >=C2=A0 > Another way to do is to generalize kvm_init() maybe? That's some > work too. >=C2=A0 > Andrea, do you know how much effort we need to add this support for > libvirt, say, we can specify "accel=3D" or "-enable-kvm" as extra > parameter when probing? I'm afraid this is not going to be possible for the same reason we have to use '-M none' when probing: at that point in time, we simply have no idea what the guests will look like. Actually, it's the other way around, in that the result of probing (host and domain capabilities) will influence the guest configuration created by the user / management tool. And we definitely can't use 'accel=3Dkvm' unconditionally, because then we won't be able to probe eg. the qemu-system-aarch64 binary installed on a x86_64 host. Cheers. --=C2=A0 Andrea Bolognani Software Engineer - Virtualization Team