Skip to contentSkip to conversation

hmp: fix block_set_io_throttle

PATCH In review Eric Blake 3 participants 3 messages Jan 20, 2017 – Feb 21, 2017

lore
Share & tools
lore

Eric Blake

author
#0 lore raw

PATCH 1/1 hmp: fix block_set_io_throttle

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'"

---

 hmp.c | 1 +
 1 file changed, 1 insertion(+)
hmp.c +1 -0
index b869617..a3dc9d6 100644
@@ -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"),
Signature · 1 line
2.9.3
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Eric Blake

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'"

---

 hmp.c | 1 +
 1 file changed, 1 insertion(+)
#2 lore raw
In reply to Eric Blake
Quoted 7 lines · * Eric Blake ([email protected]) 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'"

Queued for HMP

Quoted 21 lines

---

 hmp.c | 1 +
 1 file changed, 1 insertion(+)
hmp.c +1 -0
index b869617..a3dc9d6 100644
@@ -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"),
Signature · 1 line
2.9.3

--
Dr. David Alan Gilbert / [email protected] / Manchester, UK