On 5/10/2017 9:56 PM, Eric Blake wrote:
On 05/10/2017 03:41 AM, Pradeep Jagadeesh wrote:
This patch factor out the duplicate qmp throttle interface code
that was present in both block and fsdev device files.
Signed-off-by: Pradeep Jagadeesh <pradeep.jagade...@huawei.com>
---
blockdev.c | 53 +++-------------------------------------
hmp.c | 21 +++++++++++-----
include/qemu/throttle-options.h | 2 ++
util/throttle-options.c | 54 +++++++++++++++++++++++++++++++++++++++++
4 files changed, 74 insertions(+), 56 deletions(-)
+++ b/include/qemu/throttle-options.h
@@ -94,4 +94,6 @@
void parse_io_throttle_options(ThrottleConfig *, QemuOpts *);
+void qmp_set_io_throttle(ThrottleConfig *, IOThrottle *);
I don't think this is the right name for this function. You are not
adding a new QMP command (you didn't modify a .json file to add
'set-io-throttle'). As mentioned in patch 1/4, you can probably reuse
the existing util/throttle.c instead of throttle-options.c, and name
this something starting with throttle_ rather than with qmp_.
OK
-Pradeep