[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v0] fsdev: QMP interface for throttling
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v0] fsdev: QMP interface for throttling |
Date: |
Tue, 21 Mar 2017 09:38:19 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 03/21/2017 04:44 AM, Pradeep Jagadeesh wrote:
>>
>> You're introducing this struct in 2.10, so this member is not since 1.7.
>> Either that, or you're copying-and-pasting when you should be sharing
>> code and reusing an existing struct.
> Hmm..copied the block devices code, I will correct it.
> I thought of reusing the code, but the whole struct from block devices
> can not be used, as there is one member called "group" that is not used
> in case of 9p.
Then make a common base type with the common fields, and have the block
devices use a subtype that reuses the base type and adds the additional
field 'group'.
> Also this needs lot of changes even in case of block
> devices. Because I may need to rename the structure as IOThrottle or
> something like that.
Yes, type names may have a ripple effect. But when done as a series,
separating the mechanical changes from the semantic changes, it's still
fairly easy to review, and worth it in the long run.
> Shall I reuse the code and avoid setting the group member in case of 9p?
> What do you think?
Better than avoiding the group member by avoiding it is avoiding it by
not having it in the type, by using type inheritance to your advantage.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature