qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 10/10] migration/dirtyrate: Implement qmp_cal_dirty_rate()


From: Zheng Chuan
Subject: Re: [PATCH v3 10/10] migration/dirtyrate: Implement qmp_cal_dirty_rate()/qmp_get_dirty_rate() function
Date: Fri, 21 Aug 2020 18:00:03 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0


On 2020/8/21 2:00, Dr. David Alan Gilbert wrote:
> * Eric Blake (eblake@redhat.com) wrote:
>> On 8/16/20 10:20 PM, Chuan Zheng wrote:
>>> Implement qmp_cal_dirty_rate()/qmp_get_dirty_rate() function which could be 
>>> called
>>>
>>> Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
>>> ---
>>
>>> +++ b/qapi/migration.json
>>> @@ -1621,3 +1621,45 @@
>>>   ##
>>>   { 'event': 'UNPLUG_PRIMARY',
>>>     'data': { 'device-id': 'str' } }
>>> +
>>> +##
>>> +# @DirtyRateInfo:
>>> +#
>>> +# Information about current dirty page rate of vm.
>>> +#
>>> +# @dirty-rate: @dirtyrate describing the dirty page rate of vm
>>> +#          in units of MB/s.
>>> +#          If this field return '-1', it means querying is not
>>> +#          start or not complete.
>>> +#
>>> +# @status: @status containing dirtyrate query status includes
>>> +#       status with 'not start measuring' or
>>> +#       'Still measuring' or 'measured'(since 5.2)
>>
>> Missing space before (
>>
>>> +##
>>> +{ 'struct': 'DirtyRateInfo',
>>> +  'data': {'dirty-rate': 'int64',
>>> +           'status': 'str'} }
>>
>> Based on your description, this should be an enum type rather than an
>> open-coded string.  Something like:
>>
>> { 'enum': 'DirtyRateStatus', 'data': [ 'unstarted', 'measuring', 'measured'
>> ] }
>> { 'struct': 'DirtyRateInfo', 'data': { 'dirty-rate': 'int64', 'status':
>> 'DirtyRateStatus' } }
> 
> Yes, and if you do that I think you'll find qmp would automatically
> define a C enum type for you, so you don't need to define the
> CalculatingDirtyRateStage yourself;   see how MigrationStatus works.
> 
> Dave
> 
Sure, it could be better,will fix it in V4:)
> 
>>
>>> +
>>> +##
>>> +# @calc-dirty-rate:
>>> +#
>>> +# start calculating dirty page rate for vm
>>> +#
>>> +# @calc-time: time in units of second for sample dirty pages
>>> +#
>>> +# Since: 5.2
>>> +#
>>> +# Example:
>>> +#   {"command": "cal-dirty-rate", "data": {"calc-time": 1} }
>>> +#
>>> +##
>>> +{ 'command': 'calc-dirty-rate', 'data': {'calc-time': 'int64'} }
>>> +
>>> +##
>>> +# @query-dirty-rate:
>>> +#
>>> +# query dirty page rate in units of MB/s for vm
>>> +#
>>> +# Since: 5.2
>>> +##
>>> +{ 'command': 'query-dirty-rate', 'returns': 'DirtyRateInfo' }
>>>
>>
>> -- 
>> Eric Blake, Principal Software Engineer
>> Red Hat, Inc.           +1-919-301-3226
>> Virtualization:  qemu.org | libvirt.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]