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 <apa...@redhat.com>
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.
signature.asc
Description: PGP signature