render / rpms / libvirt

Forked from rpms/libvirt 7 months ago
Clone
acda74
From b6eb914119af7e724cbee27951cfba0a6afb3b97 Mon Sep 17 00:00:00 2001
acda74
Message-Id: <b6eb914119af7e724cbee27951cfba0a6afb3b97@dist-git>
acda74
From: Peter Krempa <pkrempa@redhat.com>
acda74
Date: Thu, 19 Jan 2023 15:06:11 +0100
acda74
Subject: [PATCH] qemu: hotplug: Remove legacy quirk for 'dimm' address
acda74
 generation
acda74
acda74
Commit b7798a07f93 (in fall of 2016) changed the way we generate aliases
acda74
for 'dimm' memory devices as the alias itself is part of the migration
acda74
stream section naming and thus must be treated as ABI.
acda74
acda74
The code added compatibility layer for VMs with memory hotplug started
acda74
with the old scheme to prevent from generating wrong aliases. The
acda74
compatibility layer broke though later when 'nvdimm' and 'pmem' devices
acda74
were introduced as it wrongly detected them as old configuration.
acda74
acda74
Now rather than attempting to fix the legacy compat layer to treat other
acda74
devices properly we'll be better off simply removing it as it's
acda74
extremely unlikely that somebody has a VM started in 2016 running with
acda74
today's libvirt and attempts to hotplug more memory.
acda74
acda74
This fixes a corner case when a user hot-adds a 'dimm' into a VM with a
acda74
'dimm' and a 'nvdimm' after restart of libvirtd and then attempts to
acda74
migrate the VM.
acda74
acda74
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2158701
acda74
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
acda74
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
acda74
(cherry picked from commit 50ce3463d514950350143f03e8421c8c31889c5d)
acda74
---
acda74
 src/qemu/qemu_hotplug.c | 4 +---
acda74
 1 file changed, 1 insertion(+), 3 deletions(-)
acda74
acda74
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
acda74
index 026e1ee5ad..5840504d13 100644
acda74
--- a/src/qemu/qemu_hotplug.c
acda74
+++ b/src/qemu/qemu_hotplug.c
acda74
@@ -2275,9 +2275,7 @@ qemuDomainAttachMemory(virQEMUDriver *driver,
acda74
         goto cleanup;
acda74
     releaseaddr = true;
acda74
 
acda74
-    /* in cases where we are using a VM with aliases generated according to the
acda74
-     * index of the memory device we need to keep continue using that scheme */
acda74
-    if (qemuAssignDeviceMemoryAlias(vm->def, mem, priv->memAliasOrderMismatch) < 0)
acda74
+    if (qemuAssignDeviceMemoryAlias(vm->def, mem, false) < 0)
acda74
         goto cleanup;
acda74
 
acda74
     objalias = g_strdup_printf("mem%s", mem->info.alias);
acda74
-- 
acda74
2.39.1
acda74