]> git.proxmox.com Git - mirror_qemu.git/commit - blockdev.c
block: Add an 'x-blockdev-reopen' QMP command
authorAlberto Garcia <berto@igalia.com>
Tue, 12 Mar 2019 16:48:51 +0000 (18:48 +0200)
committerKevin Wolf <kwolf@redhat.com>
Tue, 12 Mar 2019 19:30:14 +0000 (20:30 +0100)
commit1479c730c7c9405f854d927e90f0c2e7bd8a1fa5
treee5276468311bf010c4017708692cc547cf6c7d40
parent5019aece2a1827f1c5fafdd8ea76a57c3a78dd89
block: Add an 'x-blockdev-reopen' QMP command

This command allows reopening an arbitrary BlockDriverState with a
new set of options. Some options (e.g node-name) cannot be changed
and some block drivers don't allow reopening, but otherwise this
command is modelled after 'blockdev-add' and the state of the reopened
BlockDriverState should generally be the same as if it had just been
added by 'blockdev-add' with the same set of options.

One notable exception is the 'backing' option: 'x-blockdev-reopen'
requires that it is always present unless the BlockDriverState in
question doesn't have a current or default backing file.

This command allows reconfiguring the graph by using the appropriate
options to change the children of a node. At the moment it's possible
to change a backing file by setting the 'backing' option to the name
of the new node, but it should also be possible to add a similar
functionality to other block drivers (e.g. Quorum, blkverify).

Although the API is unlikely to change, this command is marked
experimental for the time being so there's room to see if the
semantics need changes.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev.c
qapi/block-core.json