Monitor
- Ctrl-L (form feed) can be used to clear the screen in the monitor.
- More commands support command-line completion.
Block devices in system emulation
- Filenames can be JSON objects preceded by "json:", for example json:{'driver':'raw','file.filename':'test.img'}. This new syntax can be used in the file property for -drive, but also in qemu-io, qemu-img or backing file names.
- The new "change-backing-file" QMP command modifies the backing filename of a block device, as well as serving as a witness of a new optional "backing-file" option to "block-stream" and "block-commit".
{ "execute" : "change-backing-file", "arguments": { "device":"drive-virtio-disk0", "image-node-name":"node01", "backing-file":"/storage/ubuntu-base.img" } }
ex) device name & image-node-name are specified in
/usr/local/bin/qemu-system-x86_64 --enable-kvm -smp 2 -m 1024 -drive file=test.img,format=qcow2,id=drive-virtio-disk0,if=none,node-name=node01 -device virtio-blk-pci,scsi=on,drive=drive-virtio-disk0 -qmp tcp:localhost:4444,server,nowait
EQMP
{
.name = "change-backing-file",
.args_type = "device:s,image-node-name:s,backing-file:s",
.mhandler.cmd_new = qmp_marshal_input_change_backing_file,
},
SQMP
change-backing-file
-------------------
Since: 2.1
Change the backing file in the image file metadata. This does not cause
QEMU to reopen the image file to reparse the backing filename (it may,
however, perform a reopen to change permissions from r/o -> r/w -> r/o,
if needed). The new backing file string is written into the image file
metadata, and the QEMU internal strings are updated.
Arguments:
- "image-node-name": The name of the block driver state node of the
image to modify. The "device" is argument is used to
verify "image-node-name" is in the chain described by
"device".
(json-string, optional)
- "device": The name of the device.
(json-string)
- "backing-file": The string to write as the backing file. This string is
not validated, so care should be taken when specifying
the string or the image chain may not be able to be
reopened again.
(json-string)
PCIe
- Basic hot-plug/hot-unplug support for Q35 machine.
사용법
{ "execute": "qmp_capabilities" }
{ "execute" : "change-backing-file", "arguments": { "device":"drive-virtio-disk0", "image-node-name":"node01", "backing-file":"/storage/ubuntu-base.img" } }
참조: http://wiki.qemu.org/ChangeLog/2.1