yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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