Trees | Indices | Help |
|
---|
|
Connection to the QEMU Monitor using the QEMU Monitor Protocol (QMP).
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
QmpMessage |
|
||
|
|||
|
|||
dict |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
list of dicts |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
_FIRST_MESSAGE_KEY = "QMP"
|
|||
_EVENT_KEY = "event"
|
|||
_ERROR_KEY = "error"
|
|||
_RETURN_KEY = "return"
|
|||
ACTUAL_KEY = "actual"
|
|||
_ACTUAL_KEY = "actual"
|
|||
_ERROR_CLASS_KEY = "class"
|
|||
_ERROR_DESC_KEY = "desc"
|
|||
_EXECUTE_KEY = "execute"
|
|||
_ARGUMENTS_KEY = "arguments"
|
|||
_VERSION_KEY = "version"
|
|||
_PACKAGE_KEY = "package"
|
|||
_QEMU_KEY = "qemu"
|
|||
_CAPABILITIES_COMMAND = "qmp_capabilities"
|
|||
_QUERY_COMMANDS = "query-commands"
|
|||
_MESSAGE_END_TOKEN = "\r\n"
|
|||
_DEVICE_ATTRIBUTES = ["driver", "id", "bus", "addr", "channel"
|
|||
Inherited from |
|
|||
Inherited from |
|
Instantiates the MonitorSocket object.
|
Connects to the QMP monitor. Connects to the UNIX socket and makes sure that we can actually send and receive data to the kvm instance via QMP.
|
Extract and parse a QMP message from the given buffer. Seeks for a QMP message in the given buf. If found, it parses it and returns it together with the rest of the characters in the buf. If no message is found, returns None and the whole buffer.
|
Receives a message from QMP and decodes the received JSON object.
|
Encodes and sends a message to KVM using QMP.
|
Executes a QMP command and returns the response of the server.
|
Parse the QMP response If error key found in the response message raise HypervisorError. Ignore any async event and thus return the response message related to command. |
Hot-add a NIC First pass the tapfds, then netdev_add and then device_add
|
Hot-del a NIC
|
Hot-add a disk Try opening the device to obtain a fd and pass it with SCM_RIGHTS. This will be omitted in case of userspace access mode (open will fail). Then use blockdev-add QMP command or drive_add_fn() callback if any. The add the guest device.
|
Hot-del a Disk Note that drive_del is not supported yet in qmp and thus should be invoked from HMP.
|
Get the block devices of a running instance. The query-block QMP command returns a list of dictionaries including information for each virtual disk. For example: [{"device": "disk-049f140d", "inserted": {"file": ..., "image": ...}}]
|
Check if a specific device exists or not on a running instance. It first checks the PCI devices and then the block devices.
|
Get the first available PCI slot of a running instance.
|
Check if disk hotplug is possible Hotplug is *not* supported in case:
|
Check if NIC hotplug is possible Hotplug is *not* supported in case:
|
Wrapper around the getfd qmp command Use fdsend to send an fd to a running process via SCM_RIGHTS and then use the getfd qmp command to name it properly so that it can be used later by NIC hotplugging.
|
Wrapper around add-fd qmp command Use fdsend to send fd to a running process via SCM_RIGHTS and then add-fd qmp command to add it to an fdset so that it can be used later by disk hotplugging.
|
Wrapper around remove-fd qmp command Remove the file descriptor previously passed. After qemu has dup'd the fd (e.g. during disk hotplug), it can be safely removed. |
|
_DEVICE_ATTRIBUTES
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Apr 12 13:38:45 2016 | http://epydoc.sourceforge.net |