This commit simplifies and fixes a number of problems in the Python
QEMUMonitorProtocol example class.
It's almost a rewrite and it DOES BREAK the qmp-shell script (which
is going to be fixed in the next commit).
However, I'm not going to split this in different commits because it
could get up to 10 commits, it's really not worth it for a simple
demo class.
Highlights:
o TCP sockets support
o QMP events support
o Add documentation
o Fix a number of unhandled errors
o Simplify methods that send commands to the Monitor
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Remove the arbitrary limitation of 1024 characters per return string and
read complete lines instead. Required for device_show.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This is a very simple shell written in Python for demonstration
purposes.
Unfortunately it's a bit awkward right now, as the user has
to specify the arguments names and the printed data can be
a raw dictionary or list, like the following example:
(QEMU) pci_add pci_addr=auto type=nic
{u'slot': 5, u'bus': 0, u'domain': 0, u'function': 0}
(QEMU)
It's worth to note that the shell is broken into two files.
One is the shell itself, the other is the QMP class which
handles the communication with QEMU.
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>