From 14abb9b3e13dbfa99eee7461147684404255fb8e Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Wed, 14 Mar 2018 13:42:01 -0700 Subject: [PATCH] libvirt: Undefine NVRAM when undefining domain This is apparently necessary on aarch64, we get an error from libvirt otherwise. Signed-off-by: Adam Williamson --- createhdds.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/createhdds.py b/createhdds.py index 81a59ae..94c0ef0 100755 --- a/createhdds.py +++ b/createhdds.py @@ -248,7 +248,7 @@ class VirtInstallImage(object): except libvirt.libvirtError: # domain may not be running, so this is fine pass - dom.undefine() + dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM) except libvirt.libvirtError: # domain may not exist, so this is fine pass @@ -321,7 +321,7 @@ class VirtInstallImage(object): # maybe it died already pass try: - dom.undefine() + dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM) except libvirt.libvirtError: pass conn.close() @@ -351,7 +351,7 @@ class VirtInstallImage(object): # the domain os.rename(tmpfile, self.filename) os.chmod(self.filename, 0o644) - dom.undefine() + dom.undefineFlags(libvirt.VIR_DOMAIN_UNDEFINE_NVRAM) conn.close() except: # if anything went wrong, we want to wipe the temp file