[PATCH] qemu_blockjob: Remove image metadata on blockcommit

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When doing a blockcommit, the base and possibly top parent are
relabelled in qemuDomainBlockCommit(). However, once the block
job is finished, we need to remove the secdriver metadata
(XATTRs) created at the beginning.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1741456

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_blockjob.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
index a991309ee7..47715f12f6 100644
--- a/src/qemu/qemu_blockjob.c
+++ b/src/qemu/qemu_blockjob.c
@@ -677,6 +677,25 @@ qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverPtr driver,
             }
 
             virObjectUnref(disk->mirror);
+        } else if (job->type == QEMU_BLOCKJOB_TYPE_COMMIT) {
+            if (qemuSecurityMoveImageMetadata(driver, vm,
+                                              job->data.commit.base, NULL) < 0) {
+                VIR_WARN("Unable to remove disk metadata on "
+                         "vm %s from %s (disk target %s)",
+                         vm->def->name,
+                         NULLSTR(job->data.commit.base->path),
+                         disk->dst);
+            }
+            if (job->data.commit.topparent &&
+                job->data.commit.topparent != disk->src &&
+                qemuSecurityMoveImageMetadata(driver, vm,
+                                              job->data.commit.topparent, NULL) < 0) {
+                VIR_WARN("Unable to remove disk metadata on "
+                         "vm %s from %s (disk target %s)",
+                         vm->def->name,
+                         NULLSTR(job->data.commit.topparent->path),
+                         disk->dst);
+            }
         }
     }
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux