yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
a83cc2
From 1e69dbe01e1cad1680723e1bc086cc52a1772c17 Mon Sep 17 00:00:00 2001
a83cc2
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
a83cc2
Date: Wed, 11 Aug 2021 08:40:38 -0400
a83cc2
Subject: [PATCH 27/39] audio: Never send migration section
a83cc2
MIME-Version: 1.0
a83cc2
Content-Type: text/plain; charset=UTF-8
a83cc2
Content-Transfer-Encoding: 8bit
a83cc2
a83cc2
RH-Author: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
RH-MergeRequest: 35: Synchronize with RHEL-AV 8.5 release 28 to RHEL 9
a83cc2
RH-Commit: [4/4] 0b6ec114a3573ac7efcbe5ab3094d8020899c82d (mrezanin/centos-src-qemu-kvm)
a83cc2
RH-Bugzilla: 1957194
a83cc2
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
a83cc2
a83cc2
The audio migration vmstate is empty, and always has been; we can't
a83cc2
just remove it though because an old qemu might send it us.
a83cc2
Changes with -audiodev now mean it's sometimes created when it didn't
a83cc2
used to be, and can confuse migration to old qemu.
a83cc2
a83cc2
Change it so that vmstate_audio is never sent; if it's received it
a83cc2
should still be accepted, and old qemu's shouldn't be too upset if it's
a83cc2
missing.
a83cc2
a83cc2
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
a83cc2
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
a83cc2
Tested-by: Daniel P. Berrangé <berrange@redhat.com>
a83cc2
Message-Id: <20210809170956.78536-1-dgilbert@redhat.com>
a83cc2
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
a83cc2
(cherry picked from commit da77adbaf619c4d170cb42d769145ad1803fbad9)
a83cc2
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
a83cc2
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
a83cc2
---
a83cc2
 audio/audio.c | 10 ++++++++++
a83cc2
 1 file changed, 10 insertions(+)
a83cc2
a83cc2
diff --git a/audio/audio.c b/audio/audio.c
a83cc2
index 534278edfe..fa724ea8e0 100644
a83cc2
--- a/audio/audio.c
a83cc2
+++ b/audio/audio.c
a83cc2
@@ -1621,10 +1621,20 @@ void audio_cleanup(void)
a83cc2
     }
a83cc2
 }
a83cc2
 
a83cc2
+static bool vmstate_audio_needed(void *opaque)
a83cc2
+{
a83cc2
+    /*
a83cc2
+     * Never needed, this vmstate only exists in case
a83cc2
+     * an old qemu sends it to us.
a83cc2
+     */
a83cc2
+    return false;
a83cc2
+}
a83cc2
+
a83cc2
 static const VMStateDescription vmstate_audio = {
a83cc2
     .name = "audio",
a83cc2
     .version_id = 1,
a83cc2
     .minimum_version_id = 1,
a83cc2
+    .needed = vmstate_audio_needed,
a83cc2
     .fields = (VMStateField[]) {
a83cc2
         VMSTATE_END_OF_LIST()
a83cc2
     }
a83cc2
-- 
a83cc2
2.27.0
a83cc2