From nobody Sat Nov 1 07:55:22 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 15093362097741018.4986552714116; Sun, 29 Oct 2017 21:03:29 -0700 (PDT) Received: from localhost ([::1]:38581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e91IA-00069c-TD for importer@patchew.org; Mon, 30 Oct 2017 00:03:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40408) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e91HL-0005sJ-Ej for qemu-devel@nongnu.org; Mon, 30 Oct 2017 00:02:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e91HF-0003Mp-JR for qemu-devel@nongnu.org; Mon, 30 Oct 2017 00:02:23 -0400 Received: from mail-qk0-x241.google.com ([2607:f8b0:400d:c09::241]:45700) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e91HF-0003Ma-Ek for qemu-devel@nongnu.org; Mon, 30 Oct 2017 00:02:17 -0400 Received: by mail-qk0-x241.google.com with SMTP id f199so14630666qke.2 for ; Sun, 29 Oct 2017 21:02:17 -0700 (PDT) Received: from x1.local ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id e43sm9662937qte.74.2017.10.29.21.02.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 29 Oct 2017 21:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LDK38lmnP71Ak6RoxgTKcm/h4AM4dhF/LA96O1V9Hw0=; b=dKqOfPnwr8VWMajv3Loi0dNGM6e23siOcOOYUYUupqAeEUf1aHjw5tYTEvMomkoOhC jiO5Q1j5g8x1kcFlDBug65Nm/chx5Pt1xaJZsoZ7z0QFIg+2GnPd110lA1SwwNzZn+wZ FbXOoj/5gyfq9hO2SulIBTGR2qDn7AiDWJsX+e6HCGKWRKCDe7jaldjVqPRhrvgzpLOd +8h7QMwTv48MLEePl61MJ3F1PvJHCI5iRJqygvbNGS+4eJAQYFg6Q4CIX6TWn/MzXCHg d23o0276RPZHA3gUlN4IHrlSElzeT5OP0mEtGGILF+/N5Z6WhSTOocB/9DKZ7eoftGHL bxgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=LDK38lmnP71Ak6RoxgTKcm/h4AM4dhF/LA96O1V9Hw0=; b=MludHJ76vEwtkEWosohU5rJDFQEfOMs4lqFIGm6GQlTdTcucMDk7zVyqlYzOBWh3tq XzQvksaZtiomiilPM4p6bdDEPZiR7esaAopo3t3vF+a644ah9Oizz5HvDl1JefnMF7QX uCi1k1IDqGLrJ32o12+VGJc5MAVU9A9/qnWdzBRGPsVj1h/jghYST0OO+c1BfSTXsDvk O6SnLZCKXZnl9j4ODRHOdc70LzVH2ktZ54dxYeebEIC3L3sEj1T99bLvE4ohPw+qUuLA rJpvB6oSs2Nrhw9gGtaPyssKDrVpgv7CZvaN67fhkWxtNwYpxAbXfSQs3nsdoU2wOImC MyOA== X-Gm-Message-State: AMCzsaUvpdYPYAYxDcHI/O6/ZFXhninwR4WUi2tC0o2EnHohRsAcdR51 DJivJlVtP3mWcaJKv5rpojo= X-Google-Smtp-Source: ABhQp+SogRytAD+NhZSWR2VweUZoBmwb8lXoVGt2FwE7VCEmALxyjZWdWq5oCp/yp73bxZ82OQDgOg== X-Received: by 10.55.73.70 with SMTP id w67mr11646605qka.215.1509336136785; Sun, 29 Oct 2017 21:02:16 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Paolo Bonzini , Thomas Huth , Eduardo Habkost , Peter Xu , Markus Armbruster , Stefano Stabellini , Anthony Perard Date: Mon, 30 Oct 2017 01:00:56 -0300 Message-Id: <20171030040056.11780-1-f4bug@amsat.org> X-Mailer: git-send-email 2.15.0.rc2 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::241 Subject: [Qemu-devel] [RFC PATCH] vl: only display available accelerators 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: Richard Henderson , "Emilio G . Cota" , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 examples configuring with '--enable-kvm --disable-tcg' - before $ qemu-system-x86_64 -accel help Possible accelerators: kvm, xen, hax, tcg $ qemu-system-x86_64 -accel tcg qemu-system-x86_64: -machine accel=3Dtcg: No accelerator found # qemu-system-x86_64 -accel hax qemu-system-x86_64: -machine accel=3Dhax: No accelerator found # qemu-system-x86_64 -accel xen xencall: error: Could not obtain handle on privileged command interface: = 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 permitted - after $ qemu-system-x86_64 -accel help Possible accelerators: kvm Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- RFC because: - I don't think this is the nicest way, too much #ifdef'fery in main() - I'm not sure the correct use of CONFIG_KVM_IS_POSSIBLE - shouldn't CONFIG_XEN/CONFIG_HAX be as poisoned as CONFIG_KVM? vl.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/vl.c b/vl.c index ec299099ff..13fce86a6e 100644 --- a/vl.c +++ b/vl.c @@ -3883,7 +3883,20 @@ int main(int argc, char **argv, char **envp) optarg, true); optarg =3D qemu_opt_get(accel_opts, "accel"); if (!optarg || is_help_option(optarg)) { - error_printf("Possible accelerators: kvm, xen, hax, tc= g\n"); + error_printf("Possible accelerators: "); +#ifdef CONFIG_KVM_IS_POSSIBLE + error_printf("kvm "); +#endif +#ifdef CONFIG_XEN + error_printf("xen "); +#endif +#ifdef CONFIG_HAX + error_printf("hax "); +#endif +#ifdef CONFIG_TCG + error_printf("tcg "); +#endif + error_printf("\n"); exit(0); } opts =3D qemu_opts_create(qemu_find_opts("machine"), NULL, --=20 2.15.0.rc2