]> git.proxmox.com Git - qemu.git/commit
qapi-visit.py: Implement 'base' for unions
authorKevin Wolf <kwolf@redhat.com>
Tue, 2 Jul 2013 14:20:04 +0000 (16:20 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 26 Jul 2013 18:17:15 +0000 (20:17 +0200)
commit0aef92b90d24858eea1ebd52a51bc31563f1fb52
treed41e0d093c6536a269911b9bc498fd453ad64a5a
parentd131c897f3dea8b76d7a487af0f7f5f11d0500a3
qapi-visit.py: Implement 'base' for unions

This implements the visitor part of base types for unions. Parsed into
QMP, this example schema definition...

    { 'type': 'BlockOptionsBase', 'data': { 'read-only': 'bool' } }
    { 'type': 'BlockOptionsQcow2, 'data': { 'lazy-refcounts': 'bool' } }

    { 'union': 'BlockOptions',
      'base': 'BlockOptionsBase',
      'data': {
          'raw': 'BlockOptionsRaw'
          'qcow2': 'BlockOptionsQcow2'
      } }

...would describe the following JSON object:

    { "type": "qcow2",
      "read-only": true,
      "data": { "lazy-refcounts": false } }

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
scripts/qapi-visit.py