summaryrefslogtreecommitdiff
path: root/qapi/block-core.json
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2014-07-01 09:52:16 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2014-07-01 10:46:38 +0200
commitfa40e65622352012dccd435147f28161375a6815 (patch)
treeae1694c491dc6a2f5737939e829dc9ccc95f232b /qapi/block-core.json
parent4e855baabfb548067b618808c32dc413d40e0bc7 (diff)
downloadqemu-fa40e65622352012dccd435147f28161375a6815.zip
block: add QAPI command to allow live backing file change
This allows a user to make a live change to the backing file recorded in an open image. The image file to modify can be specified 2 ways: 1) image filename 2) image node-name Note: this does not cause the backing file itself to be reopened; it merely changes the backing filename in the image file structure, and in internal BDS structures. It is the responsibility of the user to pass a filename string that can be resolved when the image chain is reopened, and the filename string is not validated. A good analogy for this command is that it is a live version of 'qemu-img rebase -u', with respect to changing the backing file string. [Jeff is offline so I respun this patch in his absence. Dropped image filename since using node-name is preferred and this is a new command. No need to introduce the limitations of finding images by filename. --Stefan] Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qapi/block-core.json')
-rw-r--r--qapi/block-core.json26
1 files changed, 26 insertions, 0 deletions
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 6a697f1458..aa1252778c 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -680,6 +680,32 @@
'data': 'BlockdevSnapshot' }
##
+# @change-backing-file
+#
+# 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.
+#
+# @image-node-name: The name of the block driver state node of the
+# image to modify.
+#
+# @device: The name of the device that owns image-node-name.
+#
+# @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.
+#
+# Since: 2.1
+##
+{ 'command': 'change-backing-file',
+ 'data': { 'device': 'str', 'image-node-name': 'str',
+ 'backing-file': 'str' } }
+
+##
# @block-commit
#
# Live commit of data from overlay image nodes into backing nodes - i.e.,