This patch adds python scripts for basic handling of QEMU Machine
Protocol connection for use with vfio_user. Basic low-level connection
and error handling added as extended socket class.
QMPClient: Wrapper class for handling connection with QMP was added.
Protected class method _receive relies on the fact, that QMP always
sends command 'in one line' - each one is always terminated with CRLF.
https://github.com/qemu/qemu/blob/master/docs/interop/qmp-spec.txt
Usage example, command line calls:
1) Without event parameter:
```json
{
"request": {
"execute": "device-list-properties",
"arguments": {
"typename": "vfiouser-0-1-1"
}
}
}
```
2) With event parameter specified. Specifying 'event'
parameter will set script to block wait for occurrence
of such one after a valid execution of specified request:
```json
{
"event": {
"event": "DEVICE_DELETED",
"data": {
"device": "vfiouser-0-1-1"
}
},
"request": {
"execute": "device_del",
"arguments": {
"id": "vfiouser-0-1-1"
}
}
}
```
Signed-off-by: mionsz <milosz.linkiewicz@intel.com>
Change-Id: I7a548f61d31097ad425994b2ea4bac8bc6800b5b
Signed-off-by: Sebastian Brzezinka <sebastian.brzezinka@intel.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11106
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com>
Reviewed-by: Konrad Sztyber <konrad.sztyber@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>