diff options
Diffstat (limited to 'meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-8.1/0004-xen-when-unplugging-emulated-devices-skip-virtio-dev.patch')
-rw-r--r-- | meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-8.1/0004-xen-when-unplugging-emulated-devices-skip-virtio-dev.patch | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-8.1/0004-xen-when-unplugging-emulated-devices-skip-virtio-dev.patch b/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-8.1/0004-xen-when-unplugging-emulated-devices-skip-virtio-dev.patch new file mode 100644 index 00000000..da2f042b --- /dev/null +++ b/meta-xilinx-virtualization/recipes-devtools/qemu/qemu-xilinx-8.1/0004-xen-when-unplugging-emulated-devices-skip-virtio-dev.patch | |||
@@ -0,0 +1,70 @@ | |||
1 | From 02507086b3ad9beb9c669aae54fcb4857cd61ef8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Juergen Gross <jgross@suse.com> | ||
3 | Date: Tue, 16 Mar 2021 14:00:33 +0100 | ||
4 | Subject: [PATCH 04/11] xen: when unplugging emulated devices skip virtio | ||
5 | devices | ||
6 | |||
7 | Virtio devices should never be unplugged at boot time, as they are | ||
8 | similar to pci passthrough devices. | ||
9 | |||
10 | Signed-off-by: Juergen Gross <jgross@suse.com> | ||
11 | Signed-off-by: Vikram Garhwal <vikram.garhwal@amd.com> | ||
12 | --- | ||
13 | docs/system/i386/xen.rst | 3 --- | ||
14 | hw/i386/xen/xen_platform.c | 10 ++++++++-- | ||
15 | 2 files changed, 8 insertions(+), 5 deletions(-) | ||
16 | |||
17 | diff --git a/docs/system/i386/xen.rst b/docs/system/i386/xen.rst | ||
18 | index f06765e88c..b86d57af6e 100644 | ||
19 | --- a/docs/system/i386/xen.rst | ||
20 | +++ b/docs/system/i386/xen.rst | ||
21 | @@ -52,9 +52,6 @@ It is necessary to use the pc machine type, as the q35 machine uses AHCI instead | ||
22 | of legacy IDE, and AHCI disks are not unplugged through the Xen PV unplug | ||
23 | mechanism. | ||
24 | |||
25 | -VirtIO devices can also be used; Linux guests may need to be dissuaded from | ||
26 | -umplugging them by adding 'xen_emul_unplug=never' on their command line. | ||
27 | - | ||
28 | Properties | ||
29 | ---------- | ||
30 | |||
31 | diff --git a/hw/i386/xen/xen_platform.c b/hw/i386/xen/xen_platform.c | ||
32 | index 17457ff3de..0187b73eeb 100644 | ||
33 | --- a/hw/i386/xen/xen_platform.c | ||
34 | +++ b/hw/i386/xen/xen_platform.c | ||
35 | @@ -28,6 +28,7 @@ | ||
36 | #include "hw/ide/pci.h" | ||
37 | #include "hw/pci/pci.h" | ||
38 | #include "migration/vmstate.h" | ||
39 | +#include "hw/virtio/virtio-bus.h" | ||
40 | #include "net/net.h" | ||
41 | #include "trace.h" | ||
42 | #include "sysemu/xen.h" | ||
43 | @@ -129,10 +130,11 @@ static bool pci_device_is_passthrough(PCIDevice *d) | ||
44 | |||
45 | static void unplug_nic(PCIBus *b, PCIDevice *d, void *o) | ||
46 | { | ||
47 | - /* We have to ignore passthrough devices */ | ||
48 | + /* We have to ignore passthrough devices and virtio devices. */ | ||
49 | if (pci_get_word(d->config + PCI_CLASS_DEVICE) == | ||
50 | PCI_CLASS_NETWORK_ETHERNET | ||
51 | - && !pci_device_is_passthrough(d)) { | ||
52 | + && !pci_device_is_passthrough(d) | ||
53 | + && !qdev_get_child_bus(&d->qdev, TYPE_VIRTIO_BUS)) { | ||
54 | object_unparent(OBJECT(d)); | ||
55 | } | ||
56 | } | ||
57 | @@ -208,6 +210,10 @@ static void unplug_disks(PCIBus *b, PCIDevice *d, void *opaque) | ||
58 | /* We have to ignore passthrough devices */ | ||
59 | if (pci_device_is_passthrough(d)) | ||
60 | return; | ||
61 | + /* Ignore virtio devices */ | ||
62 | + if (qdev_get_child_bus(&d->qdev, TYPE_VIRTIO_BUS)) { | ||
63 | + return; | ||
64 | + } | ||
65 | |||
66 | switch (pci_get_word(d->config + PCI_CLASS_DEVICE)) { | ||
67 | case PCI_CLASS_STORAGE_IDE: | ||
68 | -- | ||
69 | 2.39.2 | ||
70 | |||