因此,有一个 Python 脚本允许从常用的 shell 连接到 QEMU 监视器。我必须下载来自 QEMU 源代码树的一堆文件,并添加-qmp unix:./qmp-sock,server,nowait
到 vm 命令行。它已连接,但我无法使其工作。
$ qmp-shell qmp-sock
Welcome to the QMP low-level shell!
Connected to QEMU 1.5.3
(QEMU) help
{u'error': {u'class': u'CommandNotFound', u'desc': u'The command help has not been found'}}
(QEMU) query-
query-balloon query-fdsets query-status
query-block query-kvm query-target
query-block-jobs query-machines query-tpm
query-blockstats query-mice query-tpm-models
query-chardev query-migrate query-tpm-types
query-command-line-options query-migrate-cache-size query-uuid
query-commands query-migrate-capabilities query-version
query-cpu-definitions query-name query-vnc
query-cpus query-pci
query-events query-spice
(QEMU) query-kvm
{u'return': {u'enabled': True, u'present': True}}
(QEMU) info block
Error while parsing command line: list index out of range
command format: <command-name> [arg-name1=arg1] ... [arg-nameN=argN]
(QEMU) info
{u'error': {u'class': u'CommandNotFound', u'desc': u'The command info has not been found'}}
(QEMU) exit
{u'error': {u'class': u'CommandNotFound', u'desc': u'The command exit has not been found'}}
(QEMU)
答案1
假设其qmp-shell
工作方式与远程登录到 QMP 套接字并直接发送 JSON 命令相同,则您需要发出该命令。在执行该命令之前,qmp_capabilities
其他命令均不起作用,并且会导致引用的“CommandNotFound”错误。qmp
请参阅 qemu wiki 页面定量分子泵了解详情。