Fixed to abide domain seclabel model='dac' override

Signed-off-by: Cole Robinson <[email protected]>
---
 src/qemu/qemu_migration.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 33cc0f0ffe..9b172f47a0 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -7251,6 +7251,8 @@ qemuMigrationSrcToSparseFile(virDomainObj *vm,
     int directFlag = 0;
     bool needUnlink = false;
     int ret;
+    uid_t uid;
+    gid_t gid;
 
     /* When using directio with mapped-ram, qemu needs two fds. One with
      * O_DIRECT set writing the memory, and another without it set for
@@ -7262,7 +7264,8 @@ qemuMigrationSrcToSparseFile(virDomainObj *vm,
                            _("bypass cache unsupported by this system"));
             return -1;
         }
-        directFd = virQEMUFileOpenAs(cfg->user, cfg->group, false, path,
+        qemuDomainGetImageIds(cfg, vm->def, NULL, NULL, &uid, &gid);
+        directFd = virQEMUFileOpenAs(uid, gid, false, path,
                            O_WRONLY | directFlag, &needUnlink);
 
         if (directFd < 0)
-- 
2.53.0

Reply via email to