From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eCQPo-0003IY-90 for qemu-devel@nongnu.org; Wed, 08 Nov 2017 08:29:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eCQPk-0005h6-8P for qemu-devel@nongnu.org; Wed, 08 Nov 2017 08:29:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:35052) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eCQPk-0005gr-1x for qemu-devel@nongnu.org; Wed, 08 Nov 2017 08:29:08 -0500 Date: Wed, 8 Nov 2017 13:28:57 +0000 From: "Daniel P. Berrange" Message-ID: <20171108132857.GT12670@redhat.com> Reply-To: "Daniel P. Berrange" References: <20171030040056.11780-1-f4bug@amsat.org> <20171030082029.GY2993@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20171030082029.GY2993@localhost.localdomain> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [RFC PATCH] vl: only display available accelerators List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Thomas Huth , Stefano Stabellini , Markus Armbruster , Peter Xu , qemu-devel@nongnu.org, "Emilio G . Cota" , Anthony Perard , Paolo Bonzini , Richard Henderson On Mon, Oct 30, 2017 at 09:20:29AM +0100, Eduardo Habkost wrote: > On Mon, Oct 30, 2017 at 01:00:56AM -0300, Philippe Mathieu-Daud=C3=A9 w= rote: > > examples configuring with '--enable-kvm --disable-tcg' > >=20 > > - before > >=20 > > $ qemu-system-x86_64 -accel help > > Possible accelerators: kvm, xen, hax, tcg > >=20 > > $ qemu-system-x86_64 -accel tcg > > qemu-system-x86_64: -machine accel=3Dtcg: No accelerator found > >=20 > > # qemu-system-x86_64 -accel hax > > qemu-system-x86_64: -machine accel=3Dhax: No accelerator found > >=20 > > # qemu-system-x86_64 -accel xen > > xencall: error: Could not obtain handle on privileged command inter= face: No such file or directory > > xen be core: xen be core: can't open xen interface > > can't open xen interface > > qemu-system-x86_64: failed to initialize Xen: Operation not permitt= ed > >=20 > > - after > >=20 > > $ qemu-system-x86_64 -accel help > > Possible accelerators: kvm > >=20 > > Signed-off-by: Philippe Mathieu-Daud=C3=A9 > > --- > > RFC because: > > - I don't think this is the nicest way, too much #ifdef'fery in m= ain() >=20 > I suggest using object_class_get_list(TYPE_ACCEL, false). And check the result of the available() method on the returned classes too, to filter the results. Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :|