[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH V1 07/32] savevm: QMP command for cprinfo
From: |
Steven Sistare |
Subject: |
Re: [PATCH V1 07/32] savevm: QMP command for cprinfo |
Date: |
Thu, 30 Jul 2020 14:02:46 -0400 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 7/30/2020 12:17 PM, Eric Blake wrote:
> On 7/30/20 10:14 AM, Steve Sistare wrote:
>> Provide the cprinfo QMP command. This returns a string with a space-
>> separated list of modes supported by cprsave, and can be used by clients
>> as a feature test to check if the running QEMU instance supports cprsave.
>
> When you've already got array support in the QMP language, why are you making
> the user parse a string into an array after the fact?
Will fix as you suggest, thanks. I had HMP on the brain - Steve
>> Syntax:
>> {'command':'cprinfo', 'returns':'str'}
>>
>> Signed-off-by: Steve Sistare <steven.sistare@oracle.com>
>> ---
>
>> +++ b/qapi/migration.json
>> @@ -1623,6 +1623,15 @@
>> 'data': { 'device-id': 'str' } }
>> ##
>> +# @cprinfo:
>> +#
>> +# Return a space-delimited list of modes supported by the cprsave command
>> +#
>> +# Since 5.0
>> +##
>> +{ 'command': 'cprinfo', 'returns': 'str' }
>
> Returning a 'str' is non-extensible. The fact that you had to edit the
> whitelist is proof that you should have done something better. I recommend:
>
> { 'command': 'cprinfo', 'returns': { 'modes': [ 'CprMode' ] }
>
> using the CprMode enum I proposed earlier.
>
>> +
>> +##
>> # @cprsave:
>> #
>> # Create a checkpoint of the virtual machine device state in @file.
>> diff --git a/qapi/pragma.json b/qapi/pragma.json
>> index cffae27..43bdb39 100644
>> --- a/qapi/pragma.json
>> +++ b/qapi/pragma.json
>> @@ -5,6 +5,7 @@
>> { 'pragma': {
>> # Commands allowed to return a non-dictionary:
>> 'returns-whitelist': [
>> + 'cprinfo',
>
> This should not be needed. Design the return value correctly in the first
> place.
>
>> 'human-monitor-command',
>> 'qom-get',
>> 'query-migrate-cache-size',
>>
>
- [PATCH V1 00/32] Live Update, Steve Sistare, 2020/07/30
- [PATCH V1 07/32] savevm: QMP command for cprinfo, Steve Sistare, 2020/07/30
- [PATCH V1 04/32] savevm: HMP Command for cprsave, Steve Sistare, 2020/07/30
- [PATCH V1 03/32] savevm: QMP command for cprsave, Steve Sistare, 2020/07/30
- [PATCH V1 10/32] kvmclock: restore paused KVM clock, Steve Sistare, 2020/07/30
- [PATCH V1 01/32] savevm: add vmstate handler iterators, Steve Sistare, 2020/07/30
- [PATCH V1 08/32] savevm: HMP command for cprinfo, Steve Sistare, 2020/07/30
- [PATCH V1 06/32] savevm: HMP Command for cprload, Steve Sistare, 2020/07/30
- [PATCH V1 11/32] cpu: disable ticks when suspended, Steve Sistare, 2020/07/30
- [PATCH V1 12/32] vl: pause option, Steve Sistare, 2020/07/30