diff mbox

[PULL,4/4] block-commit: speed is an optional parameter

Message ID 1397219952-26807-5-git-send-email-kwolf@redhat.com
State New
Headers show

Commit Message

Kevin Wolf April 11, 2014, 12:39 p.m. UTC
From: Max Reitz <mreitz@redhat.com>

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 <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 blockdev.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/blockdev.c b/blockdev.c
index c3422a1..5dd01ea 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();