From nobody Mon Feb 9 18:44:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1613756386; cv=none; d=zohomail.com; s=zohoarc; b=I4fn6Ovu6ax/0YF4LTgMvr75wgwr9gVhFWHXniks3WfNeWreTFgvN4onPqefttiA4GCEEunS4E6pc086ylOYlhxF3XYzU1fCEhVvtIu/RI3O/lIE6Hgpwe8uDg9507YCUnG0JaUhPHkGr8qqKP+IxZ1gjMLGa1X2fuetKXPKgBg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1613756386; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=m89dmrSplgkgoyBA9XFoMMYsKZX69TbxEanq9oDkcW0=; b=D0KCvcDqOSeECpFwS3zSL9wb5dMU6jfJUwOLahOFfu0YsBv17aMEqRkjGP+tvROx5WC+koXz12SRI364cdmvEnip64nXlKX1AtYiZ7PyC+g1T1uyOyRQt7yURep+1DQi4ITQcfwRjRE+ba6GI4272Wys2Kk1/Ydgqp2A6i5/hyw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 161375638609443.583088541511074; Fri, 19 Feb 2021 09:39:46 -0800 (PST) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-21-wzx01V73NLecSZpa5zPX4Q-1; Fri, 19 Feb 2021 12:39:43 -0500 Received: by mail-wm1-f72.google.com with SMTP id s192so2790109wme.6 for ; Fri, 19 Feb 2021 09:39:43 -0800 (PST) Return-Path: Return-Path: Received: from localhost.localdomain (68.red-83-57-175.dynamicip.rima-tde.net. [83.57.175.68]) by smtp.gmail.com with ESMTPSA id b72sm13082236wmd.4.2021.02.19.09.39.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Feb 2021 09:39:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1613756385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=m89dmrSplgkgoyBA9XFoMMYsKZX69TbxEanq9oDkcW0=; b=JEKKxhMc4fPJKMm8IN1nbv2+K5pOJGMwCJpYZ3by1SgsbEYLRuEpDK//Q2ZmcQHmTlZe5h 0pVMeyHrg6cpiUfX90g3lutN3L4jh+VYpMbz12nyaUoBkiAs7aw68Qdhu8VkoWFUJYhe0+ Cc7PtECKSByiWWyKTW/d6gqn9e9Nxqo= X-MC-Unique: wzx01V73NLecSZpa5zPX4Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m89dmrSplgkgoyBA9XFoMMYsKZX69TbxEanq9oDkcW0=; b=O9COslrh8rvzBPnNnIrceCaEHlY0i/7AHuTB/jDwI3tYmIuXcWbPwNiuJP9iNylS9+ RAj9gMC6IaqvZyS6OKIHghBp2NhrNLL2mihPF4bCw+7ipkjOnil7ldN0FeAT9LP8AjlA U76bE99Q+FFAF9iMukV9IGATur5MBaMz17L3CsERZ/jXYtuj1irAP0F9+/g492/jiup7 b8+Nwy144+gzDJz2QSP+YHQ4MJi2Cr91lyjJwKJjni/AwsX2pM424GPZShkN45Mgzn20 Jd75oMWuj5E/hcTDRrWtfZoSvTfBIHVZVmAm2ImVjordwKo3BRP+L3rgpY2B1k4A2AtT 1mRA== X-Gm-Message-State: AOAM532fvesMVkyu9mTdbLo4i0WwTpAEgIwyiDc54QCkUS+z3Ujf4Bh8 qIXZjCSQqIx6KNJWX2EVD7D8Kfa9aILlosAwbIP6qgFOQceRuUXP1o7h3Ap42eK6KjT285nyDCS yA1EmQKtORWyMkA== X-Received: by 2002:a1c:c6:: with SMTP id 189mr9272336wma.128.1613756382377; Fri, 19 Feb 2021 09:39:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfL/zeX1Twd/41yRwfBzbYwswnUhtDRMBecaJ3a8NHeinaw0+wzScyZWOOrq01liX3KOGGMQ== X-Received: by 2002:a1c:c6:: with SMTP id 189mr9272291wma.128.1613756382214; Fri, 19 Feb 2021 09:39:42 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Aurelien Jarno , Peter Maydell , Anthony Perard , qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, Halil Pasic , Huacai Chen , xen-devel@lists.xenproject.org, Marcel Apfelbaum , David Gibson , qemu-arm@nongnu.org, Stefano Stabellini , Paolo Bonzini , kvm@vger.kernel.org, BALATON Zoltan , Leif Lindholm , Richard Henderson , Radoslaw Biernacki , Alistair Francis , Paul Durrant , Eduardo Habkost , "Michael S. Tsirkin" , Thomas Huth , Jiaxun Yang , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Greg Kurz , Christian Borntraeger , Cornelia Huck , "Edgar E. Iglesias" , David Hildenbrand , Mark Cave-Ayland , Aleksandar Rikalo , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 09/11] hw/xenpv: Restrict Xen Para-virtualized machine to Xen accelerator Date: Fri, 19 Feb 2021 18:38:45 +0100 Message-Id: <20210219173847.2054123-10-philmd@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210219173847.2054123-1-philmd@redhat.com> References: <20210219173847.2054123-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) When started with other accelerator than Xen, the XenPV machine fails with a criptic message: $ qemu-system-x86_64 -M xenpv,accel=3Dkvm xen be core: can't connect to xenstored qemu-system-x86_64: xen_init_pv: xen backend core setup failed By restricting it to Xen, we display a clearer error message: $ qemu-system-x86_64 -M xenpv,accel=3Dkvm qemu-system-x86_64: invalid accelerator 'kvm' for machine xenpv Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Paul Durrant --- hw/xenpv/xen_machine_pv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hw/xenpv/xen_machine_pv.c b/hw/xenpv/xen_machine_pv.c index 8df575a457c..d7747bcec98 100644 --- a/hw/xenpv/xen_machine_pv.c +++ b/hw/xenpv/xen_machine_pv.c @@ -86,12 +86,17 @@ static void xen_init_pv(MachineState *machine) atexit(xen_config_cleanup); } =20 +static const char *valid_accels[] =3D { + "xen", NULL +}; + static void xenpv_machine_init(MachineClass *mc) { mc->desc =3D "Xen Para-virtualized PC"; mc->init =3D xen_init_pv; mc->max_cpus =3D 1; mc->default_machine_opts =3D "accel=3Dxen"; + mc->valid_accelerators =3D valid_accels; } =20 DEFINE_MACHINE("xenpv", xenpv_machine_init) --=20 2.26.2