render / rpms / libvirt

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