]> git.proxmox.com Git - mirror_qemu.git/commit - python/qemu/machine/machine.py
python/qemu: Add set_qmp_monitor() to QEMUMachine
authorWainer dos Santos Moschetta <wainersm@redhat.com>
Wed, 11 Dec 2019 18:55:35 +0000 (13:55 -0500)
committerCleber Rosa <crosa@redhat.com>
Mon, 16 Dec 2019 15:59:50 +0000 (10:59 -0500)
commit74b56bb5539553d93908d6acb2bc2c5e2f019f7d
tree088aa01817fdbb85466006c4f291b0fe2c5a4942
parent83de0ea4ad0e3bbc20c6f0911a71966b2ec7773c
python/qemu: Add set_qmp_monitor() to QEMUMachine

The QEMUMachine VM has a monitor setup on which an QMP
connection is always attempted on _post_launch() (executed
by launch()). In case the QEMU process immediatly exits
then the qmp.accept() (used to establish the connection) stalls
until it reaches timeout and consequently an exception raises.

That behavior is undesirable when, for instance, it needs to
gather information from the QEMU binary ($ qemu -cpu list) or a
test which launches the VM expecting its failure.

This patch adds the set_qmp_monitor() method to QEMUMachine that
allows turn off the creation of the monitor machinery on VM launch.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Cleber Rosa <crosa@redhat.com>
Message-Id: <20191211185536.16962-2-wainersm@redhat.com>
[Cleber: trivial indentation fix]
Signed-off-by: Cleber Rosa <crosa@redhat.com>
python/qemu/machine.py