[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 09/11] hw/xenpv: Restrict Xen Para-virtualized machine to Xen accelerator
- To: qemu-devel@xxxxxxxxxx
- From: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
- Date: Fri, 19 Feb 2021 18:38:45 +0100
- Authentication-results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@xxxxxxxxxx
- Cc: Aurelien Jarno <aurelien@xxxxxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, qemu-ppc@xxxxxxxxxx, qemu-s390x@xxxxxxxxxx, Halil Pasic <pasic@xxxxxxxxxxxxx>, Huacai Chen <chenhuacai@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Marcel Apfelbaum <marcel.apfelbaum@xxxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, qemu-arm@xxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Paolo Bonzini <pbonzini@xxxxxxxxxx>, kvm@xxxxxxxxxxxxxxx, BALATON Zoltan <balaton@xxxxxxxxxx>, Leif Lindholm <leif@xxxxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Radoslaw Biernacki <rad@xxxxxxxxxxxx>, Alistair Francis <alistair@xxxxxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Thomas Huth <thuth@xxxxxxxxxx>, Jiaxun Yang <jiaxun.yang@xxxxxxxxxxx>, Hervé Poussineau <hpoussin@xxxxxxxxxxx>, Greg Kurz <groug@xxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxx>, Cornelia Huck <cohuck@xxxxxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, David Hildenbrand <david@xxxxxxxxxx>, Mark Cave-Ayland <mark.cave-ayland@xxxxxxxxxxxx>, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxxx>, Philippe Mathieu-Daudé <f4bug@xxxxxxxxx>, Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
- Delivery-date: Fri, 19 Feb 2021 17:39:51 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
When started with other accelerator than Xen, the XenPV machine
fails with a criptic message:
$ qemu-system-x86_64 -M xenpv,accel=kvm
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=kvm
qemu-system-x86_64: invalid accelerator 'kvm' for machine xenpv
Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
---
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);
}
+static const char *valid_accels[] = {
+ "xen", NULL
+};
+
static void xenpv_machine_init(MachineClass *mc)
{
mc->desc = "Xen Para-virtualized PC";
mc->init = xen_init_pv;
mc->max_cpus = 1;
mc->default_machine_opts = "accel=xen";
+ mc->valid_accelerators = valid_accels;
}
DEFINE_MACHINE("xenpv", xenpv_machine_init)
--
2.26.2
|