render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
fbe740
From 1246cae822ca95a8392463631af1126d915eaf5e Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <1246cae822ca95a8392463631af1126d915eaf5e@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Mon, 16 Mar 2020 22:11:51 +0100
fbe740
Subject: [PATCH] qemuDomainDeviceDiskDefPostParseRestoreSecAlias: Hardcode
fbe740
 restored aliases
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
In order to be able to change the function generating the alias and thus
fbe740
also the aliases itself, we must hardcode the old format for the case of
fbe740
upgrading form libvirt which didn't record them in the status XML yet.
fbe740
fbe740
Note that this code path is tested by
fbe740
'tests/qemustatusxml2xmldata/disk-secinfo-upgrade-in.xml'
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
(cherry picked from commit 95a8c4332dd42ab6a558117a07134a7fdb2ce8f4)
fbe740
fbe740
 Conflicts:
fbe740
	src/qemu/qemu_domain.c
fbe740
        Global cleanups from ae9f630e502 not backported.
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1804750
fbe740
Message-Id: <4b880854049d398ffe424b811af69f4b1a074c9d.1584391726.git.pkrempa@redhat.com>
fbe740
Reviewed-by: Ján Tomko <jtomko@redhat.com>
fbe740
---
fbe740
 src/qemu/qemu_domain.c | 6 ++----
fbe740
 1 file changed, 2 insertions(+), 4 deletions(-)
fbe740
fbe740
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
fbe740
index 6221e7090f..897e21726a 100644
fbe740
--- a/src/qemu/qemu_domain.c
fbe740
+++ b/src/qemu/qemu_domain.c
fbe740
@@ -9062,16 +9062,14 @@ qemuDomainDeviceDiskDefPostParseRestoreSecAlias(virDomainDiskDefPtr disk,
fbe740
     }
fbe740
 
fbe740
     if (restoreAuthSecret) {
fbe740
-        if (!(authalias = qemuDomainGetSecretAESAlias(disk->info.alias, false)))
fbe740
-            goto cleanup;
fbe740
+        authalias = g_strdup_printf("%s-secret0", disk->info.alias);
fbe740
 
fbe740
         if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->secinfo, &authalias) < 0)
fbe740
             goto cleanup;
fbe740
     }
fbe740
 
fbe740
     if (restoreEncSecret) {
fbe740
-        if (!(encalias = qemuDomainGetSecretAESAlias(disk->info.alias, true)))
fbe740
-            goto cleanup;
fbe740
+        encalias = g_strdup_printf("%s-luks-secret0", disk->info.alias);
fbe740
 
fbe740
         if (qemuStorageSourcePrivateDataAssignSecinfo(&priv->encinfo, &encalias) < 0)
fbe740
             goto cleanup;
fbe740
-- 
fbe740
2.25.1
fbe740