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 <awilliam@redhat.com>
This commit is contained in:
Adam Williamson 2017-08-30 17:29:59 -04:00
parent e112047296
commit ba1dd56896

View File

@ -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: