diff mbox

hmp: fix block_set_io_throttle

Message ID 20170120230359.4244-1-eblake@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Blake Jan. 20, 2017, 11:03 p.m. UTC
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>
---

 hmp.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Stefan Hajnoczi Jan. 23, 2017, 11:27 a.m. UTC | #1
On Fri, Jan 20, 2017 at 05:03:59PM -0600, Eric Blake wrote:
> 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>
> ---
> 
>  hmp.c | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Dr. David Alan Gilbert Feb. 21, 2017, 3:10 p.m. UTC | #2
* Eric Blake (eblake@redhat.com) wrote:
> 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>

Queued for HMP

> ---
> 
>  hmp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hmp.c b/hmp.c
> index b869617..a3dc9d6 100644
> --- a/hmp.c
> +++ b/hmp.c
> @@ -1551,6 +1551,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"),
> -- 
> 2.9.3
> 
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox

Patch

diff --git a/hmp.c b/hmp.c
index b869617..a3dc9d6 100644
--- a/hmp.c
+++ b/hmp.c
@@ -1551,6 +1551,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"),