From ba1dd56896329c4daa9f49d61f859c1e7980ae09 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 30 Aug 2017 17:29:59 -0400 Subject: [PATCH] Ensure domain is taken down when we exhaust retries This was just an oversight - we don't destroy and undefine the 'createhdds' domain on the path where the final retry to create an image times out, we just wipe the temp file and exit. So we leave a qemu process sitting around until createhdds runs again (and, on openQA production, exhausting swap space). Signed-off-by: Adam Williamson --- createhdds.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/createhdds.py b/createhdds.py index 3d9940a..15603cd 100755 --- a/createhdds.py +++ b/createhdds.py @@ -305,6 +305,9 @@ class VirtInstallImage(object): ret = subprocess.call(args, timeout=3600) except subprocess.TimeoutExpired: logger.warning("Image creation timed out!") + dom.destroy() + dom.undefine() + conn.close() if os.path.isfile(tmpfile): os.remove(tmpfile) if retries: