[Kimchi-devel] [PATCH] Specify user when changing VM disks permission

Crístian Viana vianac at linux.vnet.ibm.com
Fri Mar 20 14:45:49 UTC 2015


Before starting a virtual machine, Kimchi updates the VM disks
permissions so libvirt can read them appropriately. However, the correct
user isn't being passed as a parameter, and the function never actually
changes the file's ACL to something useful.

Set the correct user when changing disk files' permissions.

Signed-off-by: Crístian Viana <vianac at linux.vnet.ibm.com>
---
 src/kimchi/model/vms.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index 4c5f443..86c173f 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -33,6 +33,7 @@ from kimchi import model, vnc
 from kimchi.config import READONLY_POOL_TYPE, config
 from kimchi.exception import InvalidOperation, InvalidParameter
 from kimchi.exception import NotFoundError, OperationFailed
+from kimchi.kvmusertests import UserTests
 from kimchi.model.config import CapabilitiesModel
 from kimchi.model.tasks import TaskModel
 from kimchi.model.templates import TemplateModel
@@ -946,8 +947,10 @@ class VMModel(object):
         xml = dom.XMLDesc(0)
         xpath = "/domain/devices/disk[@device='cdrom']/source/@file"
         isofiles = xpath_get_text(xml, xpath)
+
+        user = UserTests.probe_user()
         for iso in isofiles:
-            run_setfacl_set_attr(iso)
+            run_setfacl_set_attr(iso, user=user)
 
         dom = self.get_vm(name, self.conn)
         try:
-- 
2.1.0




More information about the Kimchi-devel mailing list