From: Amador Pahim Date: Mon, 22 Jan 2018 20:50:32 +0000 (+0100) Subject: qemu.py: cleanup redundant calls in launch() X-Git-Tag: v2.12.0-rc0~111^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c58b535f8396f7ab71dc7074713c99ec042da95b;p=thirdparty%2Fqemu.git qemu.py: cleanup redundant calls in launch() Now that shutdown() is guaranteed to always execute self._load_io_log() and self._post_shutdown(), their calls in 'except' became redundant and we can safely replace it by a call to shutdown(). Reviewed-by: Fam Zheng Reviewed-by: Eduardo Habkost Signed-off-by: Amador Pahim Message-Id: <20180122205033.24893-6-apahim@redhat.com> Signed-off-by: Eduardo Habkost --- diff --git a/scripts/qemu.py b/scripts/qemu.py index dcb4f0ffe64..09db6249a33 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -215,11 +215,7 @@ class QEMUMachine(object): try: self._launch() except: - if self.is_running(): - self._popen.kill() - self._popen.wait() - self._load_io_log() - self._post_shutdown() + self.shutdown() LOG.debug('Error launching VM') if self._qemu_full_args: