From: Max Reitz Date: Thu, 10 Apr 2014 17:36:25 +0000 (+0200) Subject: block-commit: speed is an optional parameter X-Git-Tag: qemu-xen-4.5.0-rc1~34^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=5450466394c95cea8b661fb197ed215a4ab5d700;p=qemu-upstream-4.5-testing.git block-commit: speed is an optional parameter As speed is an optional parameter for the QMP block-commit command, it should be set to 0 if not given (as it is undefined if has_speed is false), that is, the speed should not be limited. Cc: qemu-stable@nongnu.org Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Fam Zheng Signed-off-by: Kevin Wolf --- diff --git a/blockdev.c b/blockdev.c index c3422a1d4..5dd01ea14 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1876,6 +1876,10 @@ void qmp_block_commit(const char *device, */ BlockdevOnError on_error = BLOCKDEV_ON_ERROR_REPORT; + if (!has_speed) { + speed = 0; + } + /* drain all i/o before commits */ bdrv_drain_all();