Message ID | 20170901112829.2571-8-apahim@redhat.com |
---|---|
State | New |
Headers | show |
Series | scripts/qemu.py fixes and cleanups | expand |
On Fri, 09/01 13:28, Amador Pahim wrote: > We are opening the _qemu_log_path during the launch() but we are > forgetting to close it. > > This patch makes sure we will close the self._qemu_log_path during the > cleanup (post_shutdown()). > > Signed-off-by: Amador Pahim <apahim@redhat.com> > --- > scripts/qemu.py | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/scripts/qemu.py b/scripts/qemu.py > index c26e1412f9..1b77fec48b 100644 > --- a/scripts/qemu.py > +++ b/scripts/qemu.py > @@ -153,6 +153,9 @@ class QEMUMachine(object): > self._qmp.accept() > > def _post_shutdown(self): > + if self._qemu_log_fd is not None: > + self._qemu_log_fd.close() > + > while self._created_files: > self._remove_if_exists(self._created_files.pop()) > > -- > 2.13.5 > Reviewed-by: Fam Zheng <famz@redhat.com>
diff --git a/scripts/qemu.py b/scripts/qemu.py index c26e1412f9..1b77fec48b 100644 --- a/scripts/qemu.py +++ b/scripts/qemu.py @@ -153,6 +153,9 @@ class QEMUMachine(object): self._qmp.accept() def _post_shutdown(self): + if self._qemu_log_fd is not None: + self._qemu_log_fd.close() + while self._created_files: self._remove_if_exists(self._created_files.pop())
We are opening the _qemu_log_path during the launch() but we are forgetting to close it. This patch makes sure we will close the self._qemu_log_path during the cleanup (post_shutdown()). Signed-off-by: Amador Pahim <apahim@redhat.com> --- scripts/qemu.py | 3 +++ 1 file changed, 3 insertions(+)