[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 3/4] qmp: refactor duplicate code
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v4 3/4] qmp: refactor duplicate code |
Date: |
Wed, 10 May 2017 14:56:01 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 |
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 <address@hidden>
> ---
> 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_.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
[Qemu-devel] [PATCH v4 2/4] qmp: Create IOThrottle structure, Pradeep Jagadeesh, 2017/05/10
[Qemu-devel] [PATCH v4 3/4] qmp: refactor duplicate code, Pradeep Jagadeesh, 2017/05/10
[Qemu-devel] [PATCH v4 4/4] fsdev: QMP interface for throttling, Pradeep Jagadeesh, 2017/05/10
- Re: [Qemu-devel] [PATCH v4 4/4] fsdev: QMP interface for throttling, Eric Blake, 2017/05/10
- Re: [Qemu-devel] [PATCH v4 4/4] fsdev: QMP interface for throttling, Pradeep Jagadeesh, 2017/05/17
- Re: [Qemu-devel] [PATCH v4 4/4] fsdev: QMP interface for throttling, Eric Blake, 2017/05/17
- Re: [Qemu-devel] [PATCH v4 4/4] fsdev: QMP interface for throttling, Greg Kurz, 2017/05/17
- Re: [Qemu-devel] [PATCH v4 4/4] fsdev: QMP interface for throttling, Eric Blake, 2017/05/17
- Re: [Qemu-devel] [PATCH v4 4/4] fsdev: QMP interface for throttling, Pradeep Jagadeesh, 2017/05/18