aboutsummaryrefslogtreecommitdiff
path: root/hw/i386
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw@amazon.co.uk>2023-01-17 13:51:22 +0000
committerDavid Woodhouse <dwmw@amazon.co.uk>2023-03-01 09:08:26 +0000
commitbdfdb74882b6cff4cc7f6f0f91cd3b34ee8e2216 (patch)
treef3adc905c8bae36c9802d70352837155cdffb618 /hw/i386
parentf3341e7b91548c38d484285307c23b8f9ce73307 (diff)
downloadqemu-bdfdb74882b6cff4cc7f6f0f91cd3b34ee8e2216.zip
qemu-bdfdb74882b6cff4cc7f6f0f91cd3b34ee8e2216.tar.gz
qemu-bdfdb74882b6cff4cc7f6f0f91cd3b34ee8e2216.tar.bz2
hw/xen: Automatically add xen-platform PCI device for emulated Xen guests
It isn't strictly mandatory but Linux guests at least will only map their grant tables over the dummy BAR that it provides, and don't have sufficient wit to map them in any other unused part of their guest address space. So include it by default for minimal surprise factor. As I come to document "how to run a Xen guest in QEMU", this means one fewer thing to tell the user about, according to the mantra of "if it needs documenting, fix it first, then document what remains". Signed-off-by: David Woodhouse <dwmw@amazon.co.uk> Reviewed-by: Paul Durrant <paul@xen.org>
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/pc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index f4a08cc..fd17ce7 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1315,6 +1315,9 @@ void pc_basic_device_init(struct PCMachineState *pcms,
#ifdef CONFIG_XEN_EMU
if (xen_mode == XEN_EMULATE) {
xen_evtchn_connect_gsis(gsi);
+ if (pcms->bus) {
+ pci_create_simple(pcms->bus, -1, "xen-platform");
+ }
}
#endif