[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
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 09/11] hw/xenpv: Restrict Xen Para-virtualized machine to Xen accelerator |
Date: |
Fri, 19 Feb 2021 18:38:45 +0100 |
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@redhat.com>
---
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
- Re: [PATCH v2 05/11] hw/mips: Restrict KVM to the malta & virt machines, (continued)
- [PATCH v2 07/11] hw/s390x: Explicit the s390-ccw-virtio machines support TCG and KVM, Philippe Mathieu-Daudé, 2021/02/19
- [RFC PATCH v2 08/11] hw/i386: Explicit x86 machines support all current accelerators, Philippe Mathieu-Daudé, 2021/02/19
- [PATCH v2 04/11] hw/arm: Restrit KVM to the virt & versal machines, Philippe Mathieu-Daudé, 2021/02/19
- [RFC PATCH v2 06/11] hw/ppc: Restrict KVM to various PPC machines, Philippe Mathieu-Daudé, 2021/02/19
- [PATCH v2 09/11] hw/xenpv: Restrict Xen Para-virtualized machine to Xen accelerator,
Philippe Mathieu-Daudé <=
- [PATCH v2 10/11] hw/board: Only allow TCG accelerator by default, Philippe Mathieu-Daudé, 2021/02/19
- [PATCH v2 11/11] softmmu/vl: Exit gracefully when accelerator is not supported, Philippe Mathieu-Daudé, 2021/02/19