diff options
| author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2026-08-28 16:04:19 +0400 |
|---|---|---|
| committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2026-08-29 12:07:44 +0400 |
| commit | 1f8d06ef42a70c34eb931f573b5e7ecdb663d6ba (patch) | |
| tree | 8f00a7a188a6ceee778751cb55334506912e6729 /qapi | |
| parent | 3c0c7bfeba92c4de83410629b6a5378c4189d9d6 (diff) | |
| download | qemu-1f8d06ef42a70c34eb931f573b5e7ecdb663d6ba.tar.gz qemu-1f8d06ef42a70c34eb931f573b5e7ecdb663d6ba.zip | |
block: add x-qemu-io QMP command
Add an x-qemu-io QMP command that runs qemu-io commands on block
devices. The command accepts a device name (block backend name,
node-name, or qdev ID) and a qemu-io command string.
Refactor hmp_qemu_io() to be a thin wrapper around the new QMP
command, following the standard HMP-over-QMP pattern used by other
block commands.
This change is also required for the qtest qemu-io command in the
following patch.
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20260828-qemu-no-hmp-v5-22-9227de146347@redhat.com>
Diffstat (limited to 'qapi')
| -rw-r--r-- | qapi/block.json | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/qapi/block.json b/qapi/block.json index 46955bbb3e..012a9d7333 100644 --- a/qapi/block.json +++ b/qapi/block.json @@ -603,3 +603,37 @@ '*boundaries-zap': ['uint64'], '*boundaries-flush': ['uint64'] }, 'allow-preconfig': true } + +## +# @x-qemu-io: +# +# Run a qemu-io command on a block device. Take either a block +# backend name or a qdev ID to identify the device. +# +# @device: the block backend name, node-name to run the +# command on. +# +# @qdev: the qdev ID of the block device to run the +# command on. +# +# @command: the qemu-io command string to execute. +# +# Features: +# +# @unstable: This command is for testing only. +# +# Since: 11.2 +# +# .. qmp-example:: +# +# -> { "execute": "x-qemu-io", +# "arguments": { "device": "virtio0", +# "command": "read 0 512" } } +# <- { "return": {} } +## +{ 'command': 'x-qemu-io', + 'data': { '*device': 'str', + '*qdev': 'str', + 'command': 'str' }, + 'features': [ 'unstable' ], + 'allow-preconfig': true } |
