render / rpms / libvirt

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