]> git.proxmox.com Git - mirror_qemu.git/commitdiff
hmp: fix block_set_io_throttle
authorEric Blake <eblake@redhat.com>
Fri, 20 Jan 2017 23:03:59 +0000 (17:03 -0600)
committerDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 21 Feb 2017 18:29:00 +0000 (18:29 +0000)
Commit 7a9877a made the 'device' parameter to BlockIOThrottle
optional, favoring 'id' instead.  But it forgot to update the
HMP usage to set has_device, which makes all attempts to change
throttling via HMP fail with "Need exactly one of 'device' and 'id'"

CC: qemu-stable@nongnu.org
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20170120230359.4244-1-eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
hmp.c

diff --git a/hmp.c b/hmp.c
index 2bc4f062bb0dff78526bae1ec4e8a997d6a9d5a1..0c805967e682c05f9a6561e2f2d3529e00d7d534 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -1552,6 +1552,7 @@ void hmp_block_set_io_throttle(Monitor *mon, const QDict *qdict)
 {
     Error *err = NULL;
     BlockIOThrottle throttle = {
+        .has_device = true,
         .device = (char *) qdict_get_str(qdict, "device"),
         .bps = qdict_get_int(qdict, "bps"),
         .bps_rd = qdict_get_int(qdict, "bps_rd"),