On Mon, Feb 15, 2021 at 05:04:24PM -0500, John Snow wrote: > On 2/11/21 5:01 PM, Cleber Rosa wrote: > > Closing a file that is open for writing, and then reading from it > > sounds like a better idea than the opposite, given that the content > > will be flushed. > > > > Reference: https://docs.python.org/3/library/io.html#io.IOBase.close > > Signed-off-by: Cleber Rosa <cr...@redhat.com> > > --- > > python/qemu/machine.py | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/python/qemu/machine.py b/python/qemu/machine.py > > index 7a40f4604b..6e44bda337 100644 > > --- a/python/qemu/machine.py > > +++ b/python/qemu/machine.py > > @@ -337,12 +337,12 @@ class QEMUMachine: > > Is there a way to improve context for python functions? What method is this > in? etc. > > > self._qmp.close() > > self._qmp_connection = None > > - self._load_io_log() > > - > > if self._qemu_log_file is not None: > > self._qemu_log_file.close() > > self._qemu_log_file = None > > + self._load_io_log() > > + > > self._qemu_log_path = None > > if self._temp_dir is not None: > > > > Yeh, seems fine, though as wainer points out the interdependencies between > _load_io_log, _qemu_log_file and _qemu_log_path are not all strictly clear, > so it seems fragile. >
Yep, agreed. This was a first, conservative change. Expect more later. > But, this is more correct than it was, so: > > Reviewed-by: John Snow <js...@redhat.com> Thanks, - Cleber
signature.asc
Description: PGP signature