Nir Soffer has uploaded a new change for review.

Change subject: virt: Use new concurrent.thread() utility
......................................................................

virt: Use new concurrent.thread() utility

This patch updates virt subsystem to use the new utility.

Behavior changes:
- vm.Vm creation threads is protected from silent failures

This patch does not modify some threads inheriting from threading.Thread
instead of having a threading.Thread instance (migration.py, vm.py).

Change-Id: Ibc0c22fee4b2fbebaaedeaadc62418f7905037bd
Relates-To: https://bugzilla.redhat.com/1141422
Signed-off-by: Nir Soffer <[email protected]>
---
M vdsm/v2v.py
M vdsm/virt/vm.py
2 files changed, 5 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/55/45555/1

diff --git a/vdsm/v2v.py b/vdsm/v2v.py
index cdd831b..437fa86 100644
--- a/vdsm/v2v.py
+++ b/vdsm/v2v.py
@@ -36,11 +36,12 @@
 
 import libvirt
 
+from vdsm import concurrent
 from vdsm.constants import P_VDSM_RUN
 from vdsm.define import errCode, doneCode
 from vdsm import libvirtconnection, response
 from vdsm.infra import zombiereaper
-from vdsm.utils import traceback, CommandPath, execCmd, NICENESS, IOCLASS
+from vdsm.utils import CommandPath, execCmd, NICENESS, IOCLASS
 
 import caps
 
@@ -362,8 +363,7 @@
         return obj
 
     def start(self):
-        t = threading.Thread(target=self._run_command)
-        t.daemon = True
+        t = concurrent.thread(self._run_command)
         t.start()
 
     @property
@@ -393,7 +393,6 @@
         with password_file(self._id, self._passwd_file, self._password):
             self._run()
 
-    @traceback(msg="Error importing vm")
     def _run(self):
         try:
             self._import()
diff --git a/vdsm/virt/vm.py b/vdsm/virt/vm.py
index 90e6652..987313c 100644
--- a/vdsm/virt/vm.py
+++ b/vdsm/virt/vm.py
@@ -34,6 +34,7 @@
 import libvirt
 
 # vdsm imports
+from vdsm import concurrent
 from vdsm import constants
 from vdsm import libvirtconnection
 from vdsm import netinfo
@@ -265,7 +266,7 @@
         self._confLock = threading.Lock()
         self._jobsLock = threading.Lock()
         self._statusLock = threading.Lock()
-        self._creationThread = threading.Thread(target=self._startUnderlyingVm)
+        self._creationThread = concurrent.thread(self._startUnderlyingVm)
         if 'migrationDest' in self.conf:
             self._lastStatus = vmstatus.MIGRATION_DESTINATION
         elif 'restoreState' in self.conf:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc0c22fee4b2fbebaaedeaadc62418f7905037bd
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to