aboutsummaryrefslogtreecommitdiff
path: root/blockdev.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2015-11-06 16:27:06 +0100
committerKevin Wolf <kwolf@redhat.com>2015-11-11 16:22:47 +0100
commit24fb4133001e1f54a526f0927837f30c1507169a (patch)
treeef1ae268d491e4a2ac4c040e403e5d926b51cb67 /blockdev.c
parentf1f57066573e832438cd87600310589fa9cee202 (diff)
downloadqemu-24fb4133001e1f54a526f0927837f30c1507169a.zip
qemu-24fb4133001e1f54a526f0927837f30c1507169a.tar.gz
qemu-24fb4133001e1f54a526f0927837f30c1507169a.tar.bz2
qmp: Introduce blockdev-change-medium
Introduce a new QMP command 'blockdev-change-medium' which is intended to replace the 'change' command for block devices. The existing function qmp_change_blockdev() is accordingly renamed to qmp_blockdev_change_medium(). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'blockdev.c')
-rw-r--r--blockdev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/blockdev.c b/blockdev.c
index 53d4edf..b3a958c 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -2143,8 +2143,9 @@ void qmp_blockdev_insert_medium(const char *device, const char *node_name,
qmp_blockdev_insert_anon_medium(device, bs, errp);
}
-void qmp_change_blockdev(const char *device, const char *filename,
- const char *format, Error **errp)
+void qmp_blockdev_change_medium(const char *device, const char *filename,
+ bool has_format, const char *format,
+ Error **errp)
{
BlockBackend *blk;
BlockDriverState *medium_bs = NULL;
@@ -2165,7 +2166,7 @@ void qmp_change_blockdev(const char *device, const char *filename,
bdrv_flags = blk_get_open_flags_from_root_state(blk);
- if (format) {
+ if (has_format) {
options = qdict_new();
qdict_put(options, "driver", qstring_from_str(format));
}