[PATCH 3/3] qemu: backup: Write TLS cert and secret object aliases into status XML

Peter Krempa posted 3 patches 4 years, 2 months ago
[PATCH 3/3] qemu: backup: Write TLS cert and secret object aliases into status XML
Posted by Peter Krempa 4 years, 2 months ago
We've put the aliases into the backup job definition after the status
XML was already writted so they didn't appear in the on-disk state.

Move the code putting them into the private definition earlier, so that
the status XML update done by saving blockjobs already writes them out.

Also add a note notifying that the block job status update writes the
status XML.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1870488
Fixes: 423576679a5
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_backup.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c
index 2f1a612803..4e61a5e52b 100644
--- a/src/qemu/qemu_backup.c
+++ b/src/qemu/qemu_backup.c
@@ -825,6 +825,9 @@ qemuBackupBegin(virDomainObjPtr vm,
         goto endjob;

     job_started = true;
+    priv->backup->tlsAlias = g_steal_pointer(&tlsAlias);
+    priv->backup->tlsSecretAlias = g_steal_pointer(&tlsSecretAlias);
+    /* qemuBackupDiskStarted saves the status XML */
     qemuBackupDiskStarted(vm, dd, ndd);

     if (chk) {
@@ -848,9 +851,6 @@ qemuBackupBegin(virDomainObjPtr vm,
         }
     }

-    priv->backup->tlsAlias = g_steal_pointer(&tlsAlias);
-    priv->backup->tlsSecretAlias = g_steal_pointer(&tlsSecretAlias);
-
     ret = 0;

  endjob:
-- 
2.26.2

Re: [PATCH 3/3] qemu: backup: Write TLS cert and secret object aliases into status XML
Posted by Ján Tomko 4 years, 2 months ago
On a Monday in 2020, Peter Krempa wrote:
>We've put the aliases into the backup job definition after the status
>XML was already writted so they didn't appear in the on-disk state.

s/writted/written/

>
>Move the code putting them into the private definition earlier, so that
>the status XML update done by saving blockjobs already writes them out.
>
>Also add a note notifying that the block job status update writes the
>status XML.
>
>Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1870488
>Fixes: 423576679a5
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_backup.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano