432cb7
From e0e4f01c6f4fb5881960f72ae4e80951b711131e Mon Sep 17 00:00:00 2001
432cb7
From: Stefano Garzarella <sgarzare@redhat.com>
432cb7
Date: Thu, 24 Mar 2022 16:04:57 +0100
432cb7
Subject: [PATCH 1/5] RHEL: disable "seqpacket" for "vhost-vsock-device" in
432cb7
 rhel8.6.0
432cb7
MIME-Version: 1.0
432cb7
Content-Type: text/plain; charset=UTF-8
432cb7
Content-Transfer-Encoding: 8bit
432cb7
432cb7
RH-Author: Stefano Garzarella <sgarzare@redhat.com>
432cb7
RH-MergeRequest: 136: RHEL: disable "seqpacket" for "vhost-vsock-device" in rhel8.6.0 [rhel-8.7.0]
432cb7
RH-Commit: [1/1] d82ea09e123679521503689f7d9af1c03dc71bfc
432cb7
RH-Bugzilla: 2068202
432cb7
RH-Acked-by: Jason Wang <None>
432cb7
RH-Acked-by: Eugenio PĂ©rez <None>
432cb7
RH-Acked-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
432cb7
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
432cb7
432cb7
vhost-vsock device in RHEL 8 kernels doesn't support seqpacket.
432cb7
To avoid problems when migrating a VM from RHEL 9 host, we need to
432cb7
disable it in rhel8-* machine types.
432cb7
432cb7
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
432cb7
---
432cb7
 hw/core/machine.c          | 10 ++++++++++
432cb7
 hw/i386/pc_piix.c          |  2 ++
432cb7
 hw/i386/pc_q35.c           |  2 ++
432cb7
 hw/s390x/s390-virtio-ccw.c |  1 +
432cb7
 include/hw/boards.h        |  3 +++
432cb7
 5 files changed, 18 insertions(+)
432cb7
432cb7
diff --git a/hw/core/machine.c b/hw/core/machine.c
432cb7
index 024b025fc2..76fcabec7a 100644
432cb7
--- a/hw/core/machine.c
432cb7
+++ b/hw/core/machine.c
432cb7
@@ -37,6 +37,16 @@
432cb7
 #include "hw/virtio/virtio.h"
432cb7
 #include "hw/virtio/virtio-pci.h"
432cb7
 
432cb7
+GlobalProperty hw_compat_rhel_8_6[] = {
432cb7
+    /* hw_compat_rhel_8_6 bz 2068202 */
432cb7
+    /*
432cb7
+     * vhost-vsock device in RHEL 8 kernels doesn't support seqpacket, so
432cb7
+     * we need do disable it downstream on the latest hw_compat_rhel_8.
432cb7
+     */
432cb7
+    { "vhost-vsock-device", "seqpacket", "off" },
432cb7
+};
432cb7
+const size_t hw_compat_rhel_8_6_len = G_N_ELEMENTS(hw_compat_rhel_8_6);
432cb7
+
432cb7
 /*
432cb7
  * Mostly the same as hw_compat_6_0 and hw_compat_6_1
432cb7
  */
432cb7
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
432cb7
index f03a8f0db8..ab6d03e07a 100644
432cb7
--- a/hw/i386/pc_piix.c
432cb7
+++ b/hw/i386/pc_piix.c
432cb7
@@ -998,6 +998,8 @@ static void pc_machine_rhel760_options(MachineClass *m)
432cb7
     pcmc->kvmclock_create_always = false;
432cb7
     /* From pc_i440fx_5_1_machine_options() */
432cb7
     pcmc->pci_root_uid = 1;
432cb7
+    compat_props_add(m->compat_props, hw_compat_rhel_8_6,
432cb7
+                     hw_compat_rhel_8_6_len);
432cb7
     compat_props_add(m->compat_props, hw_compat_rhel_8_5,
432cb7
                      hw_compat_rhel_8_5_len);
432cb7
     compat_props_add(m->compat_props, pc_rhel_8_5_compat,
432cb7
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
432cb7
index 5559261d9e..882fe7a68d 100644
432cb7
--- a/hw/i386/pc_q35.c
432cb7
+++ b/hw/i386/pc_q35.c
432cb7
@@ -658,6 +658,8 @@ static void pc_q35_machine_rhel860_options(MachineClass *m)
432cb7
     m->desc = "RHEL-8.6.0 PC (Q35 + ICH9, 2009)";
432cb7
     pcmc->smbios_stream_product = "RHEL-AV";
432cb7
     pcmc->smbios_stream_version = "8.6.0";
432cb7
+    compat_props_add(m->compat_props, hw_compat_rhel_8_6,
432cb7
+                     hw_compat_rhel_8_6_len);
432cb7
 }
432cb7
 
432cb7
 DEFINE_PC_MACHINE(q35_rhel860, "pc-q35-rhel8.6.0", pc_q35_init_rhel860,
432cb7
diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
432cb7
index 9795eb9406..bec270598b 100644
432cb7
--- a/hw/s390x/s390-virtio-ccw.c
432cb7
+++ b/hw/s390x/s390-virtio-ccw.c
432cb7
@@ -1109,6 +1109,7 @@ static void ccw_machine_rhel860_instance_options(MachineState *machine)
432cb7
 
432cb7
 static void ccw_machine_rhel860_class_options(MachineClass *mc)
432cb7
 {
432cb7
+    compat_props_add(mc->compat_props, hw_compat_rhel_8_6, hw_compat_rhel_8_6_len);
432cb7
 }
432cb7
 DEFINE_CCW_MACHINE(rhel860, "rhel8.6.0", true);
432cb7
 
432cb7
diff --git a/include/hw/boards.h b/include/hw/boards.h
432cb7
index 04e8759815..4ddb798144 100644
432cb7
--- a/include/hw/boards.h
432cb7
+++ b/include/hw/boards.h
432cb7
@@ -443,6 +443,9 @@ extern const size_t hw_compat_2_2_len;
432cb7
 extern GlobalProperty hw_compat_2_1[];
432cb7
 extern const size_t hw_compat_2_1_len;
432cb7
 
432cb7
+extern GlobalProperty hw_compat_rhel_8_6[];
432cb7
+extern const size_t hw_compat_rhel_8_6_len;
432cb7
+
432cb7
 extern GlobalProperty hw_compat_rhel_8_5[];
432cb7
 extern const size_t hw_compat_rhel_8_5_len;
432cb7
 
432cb7
-- 
432cb7
2.27.0
432cb7