[libvirt] [PATCH] Set owner and group for file used for saving domain

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

 



virsh save a domain created by libvirt and it hangs with the log message "sh: /home/newguest: Permission denied".

---
 src/qemu/qemu_driver.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 30003e6..a2d9534 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -3415,6 +3415,11 @@ static int qemudDomainSave(virDomainPtr dom,
         goto endjob;
     }
 
+    if (qemuDomainSetFileOwnership(dom->conn, path, driver->user,
+                                                    driver->group) < 0 ) {
+        goto endjob;
+    }
+
     if (safewrite(fd, &header, sizeof(header)) != sizeof(header)) {
         qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
                          "%s", _("failed to write save header"));
-- 
1.5.4.5


-- 
Cheers!

Anoop
Linux Technology Center, IBM

--
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]