qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [PATCH v5 10/21] qmp: Add support of "dirty-bitmap" syn


From: Eric Blake
Subject: Re: [Qemu-block] [PATCH v5 10/21] qmp: Add support of "dirty-bitmap" sync mode for drive-backup
Date: Fri, 17 Apr 2015 17:10:19 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 04/17/2015 05:02 PM, John Snow wrote:

>>>   { 'type': 'DriveBackup',
>>>     'data': { 'device': 'str', 'target': 'str', '*format': 'str',
>>>               'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
>>> -            '*speed': 'int',
>>> +            '*speed': 'int', '*bitmap': 'str',
>>
>> Looks okay.  Is it an error if bitmap is supplied, but mode is not
>> dirty-bitmap?  Likewise, if mode is dirty-bitmap but bitmap is not
>> supplied?
>>
> 
> Yes:

Then we _could_ do this as a flat union (here, using a shorthand syntax
of anonymous inline types, although qapi does not yet support it):

{ 'type': 'DriveBackupBase',
  'data': { 'device': 'str', 'target': 'str', '*format': 'str',
    'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
    '*speed': 'int', '*on-source-error': 'BlockdevOnError',
    '*on-target-error': 'BlockdevOnError' } }
{ 'union': 'DriveBackup', 'base': 'DriveBackupBase',
  'discriminator': 'sync',
  'data': { 'top': {}, 'full': {}, 'none': {},
            'dirty-bitmap': { 'bitmap': 'str' } } }

which would enforce that 'bitmap' be present exactly when
'sync':'dirty-bitmap'.  But that's probably overkill; I don't expect you
to do it (especially since qapi shorthand for anonymous inline types is
not there yet).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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