Marcin Mirecki has uploaded a new change for review.

Change subject: virt: Collect vm start flags from device hooks when running vm
......................................................................

virt: Collect vm start flags from device hooks when running vm

Change-Id: I554e304027ea25340634e8def5ddeef99d98a10a
Bug-Url: https://bugzilla.redhat.com/1314371
Signed-off-by: mirecki <mmire...@redhat.com>
---
M vdsm/virt/vm.py
1 file changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/38/57538/1

diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 202cf55..09b5cd8 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -1965,7 +1965,10 @@
                 self._connection.lookupByUUIDString(self.id),
                 self._timeoutExperienced)
         else:
-            domxml = hooks.before_vm_start(self._buildDomainXML(), self.conf)
+            # _buildDomainXML invokes the device hooks
+            domain_xml = self._buildDomainXML()
+            self._update_vm_launch_flags_from_file(self.id)
+            domxml = hooks.before_vm_start(domain_xml, self.conf)
             # TODO: this is debug information. For 3.6.x we still need to
             # see the XML even with 'info' as default level.
             self.log.info(domxml)
@@ -1994,6 +1997,16 @@
         if initDomain:
             self._domDependentInit()
 
+    def _update_vm_launch_flags_from_file(self, vm_id):
+        launchfile = "/var/run/vdsm/hook/" + vm_id + "/launchflags"
+        if os.path.isfile(launchfile):
+            new_conf_dict = {}
+            with open(launchfile) as f:
+                for line in f:
+                    (key, val) = line.split()
+                    new_conf_dict[key] = val
+            self.conf.update(new_conf_dict)
+
     def _updateDevices(self, devices):
         """
         Update self.conf with updated devices


-- 
To view, visit https://gerrit.ovirt.org/57538
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I554e304027ea25340634e8def5ddeef99d98a10a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Marcin Mirecki <mmire...@redhat.com>
_______________________________________________
vdsm-patches mailing list
vdsm-patches@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to