qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v4 2/2] qemu.py: cleanup and fixes


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v4 2/2] qemu.py: cleanup and fixes
Date: Tue, 25 Jul 2017 14:45:12 +0100
User-agent: Mutt/1.8.3 (2017-05-23)

On Mon, Jul 24, 2017 at 02:44:38PM +0200, Amador Pahim wrote:
> is_running():
> - Use Popen.poll() instead of Popen.returncode to check whether
>   the VM is running or not.
> 
> exitcode():
> - Use Popen.poll() instead of Popen.returncode to return an updated
> exit code.
> 
> _load_io_log():
> - Add a try/except to prevent raising exception when qemu io file
> does not exist.
> 
> launch():
> - If VM is already running, do nothing.
> - If vm is not running but was not cleaned up, call shutdown()
>   before launching again.
> - Offload the core of this method to _launch().
> - Load the args and try to call _launch().
> - Make sure we cleanup on exception.
> - On exception, print an error message with the qemu command line
>   and output.
> 
> _launch():
> - Execute _pre_launch(), subprocess.Popen() and self._post_launch().
> - No try/except here. Any exceptions will be handled by the caller.
> 
> shutdown():
> - Make sure self._popen is not None before calling self._popen.wait().
> - Cleanup the message on negative exit codes.
> - Always execute self._load_io_log() and self._post_shutdown().
> 
> Signed-off-by: Amador Pahim <address@hidden>

Please break this up into logical changes and include the rationale for
making them.  The commit description should explain "why" rather than
"what" the code change is.

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]