thebeanogamer / rpms / qemu-kvm

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