yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-s390x-pci-mark-zpci-devices-as-unmigratable.patch

ae23c9
From 1b270931bb1743918638b9e6f003b2f2a95f0685 Mon Sep 17 00:00:00 2001
ae23c9
From: Cornelia Huck <cohuck@redhat.com>
ae23c9
Date: Wed, 17 Apr 2019 13:57:35 +0100
ae23c9
Subject: [PATCH 18/24] s390x/pci: mark zpci devices as unmigratable
ae23c9
ae23c9
RH-Author: Cornelia Huck <cohuck@redhat.com>
ae23c9
Message-id: <20190417135741.25297-19-cohuck@redhat.com>
ae23c9
Patchwork-id: 85796
ae23c9
O-Subject: [RHEL-8.1.0 qemu-kvm PATCH v2 18/24] s390x/pci: mark zpci devices as unmigratable
ae23c9
Bugzilla: 1699070
ae23c9
RH-Acked-by: David Hildenbrand <david@redhat.com>
ae23c9
RH-Acked-by: Thomas Huth <thuth@redhat.com>
ae23c9
RH-Acked-by: Jens Freimann <jfreimann@redhat.com>
ae23c9
ae23c9
We currently don't migrate any state for zpci devices, which are
ae23c9
coupled with standard pci devices. This means funny things happen
ae23c9
when we e.g. try to migrate with a virtio-pci device but the s390x-
ae23c9
specific zpci state is not migrated (vfio-pci is not affected, as
ae23c9
it is not migratable anyway.)
ae23c9
ae23c9
Until this is fixed, mark zpci devices as unmigratable.
ae23c9
ae23c9
Reported-by: David Hildenbrand <david@redhat.com>
ae23c9
Reviewed-by: David Hildenbrand <david@redhat.com>
ae23c9
Reviewed-by: Collin Walling <walling@linux.ibm.com>
ae23c9
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ae23c9
(cherry picked from commit aede5d5dfc5f3e4ea7467b28c51fda2f8945d117)
ae23c9
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
ae23c9
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
ae23c9
---
ae23c9
 hw/s390x/s390-pci-bus.c | 10 ++++++++++
ae23c9
 1 file changed, 10 insertions(+)
ae23c9
ae23c9
diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
ae23c9
index 97d3eb8..07a286a 100644
ae23c9
--- a/hw/s390x/s390-pci-bus.c
ae23c9
+++ b/hw/s390x/s390-pci-bus.c
ae23c9
@@ -1256,6 +1256,15 @@ static Property s390_pci_device_properties[] = {
ae23c9
     DEFINE_PROP_END_OF_LIST(),
ae23c9
 };
ae23c9
 
ae23c9
+static const VMStateDescription s390_pci_device_vmstate = {
ae23c9
+    .name = TYPE_S390_PCI_DEVICE,
ae23c9
+    /*
ae23c9
+     * TODO: add state handling here, so migration works at least with
ae23c9
+     * emulated pci devices on s390x
ae23c9
+     */
ae23c9
+    .unmigratable = 1,
ae23c9
+};
ae23c9
+
ae23c9
 static void s390_pci_device_class_init(ObjectClass *klass, void *data)
ae23c9
 {
ae23c9
     DeviceClass *dc = DEVICE_CLASS(klass);
ae23c9
@@ -1266,6 +1275,7 @@ static void s390_pci_device_class_init(ObjectClass *klass, void *data)
ae23c9
     dc->bus_type = TYPE_S390_PCI_BUS;
ae23c9
     dc->realize = s390_pci_device_realize;
ae23c9
     dc->props = s390_pci_device_properties;
ae23c9
+    dc->vmsd = &s390_pci_device_vmstate;
ae23c9
 }
ae23c9
 
ae23c9
 static const TypeInfo s390_pci_device_info = {
ae23c9
-- 
ae23c9
1.8.3.1
ae23c9