« Previous | Next » 

Revision 37628f11


Added by Stefan Hajnoczi over 10 years ago

QMP: add server mode to QEMUMonitorProtocol

QEMU supports socket chardevs that establish connections like a server
or a client. The QEMUMonitorProtocol class only supports connecting as
a client. It is not possible to connect race-free when launching QEMU
since trying to connect before QEMU has bound and is listening on the
socket results in failure.

Add the QEMUMonitorProtocol(server=True) argument to bind and listen on
the socket. The QEMU process can then be launched and connects to the
already existing QMP socket without a race condition:

qmp = qmp.QEMUMonitorProtocol(monitor_path, server=True)
popen = subprocess.Popen(args)

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Luiz Capitulino <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences