Skip to content

RFC qapi changes in preparation for blockdev-add

Kevin Wolf qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest11 patches 20 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11qapi-types.py: Split off generate_struct_fields()scripts/qapi-types.py+13 -61 reply
2/11qapi-types.py: Implement 'base' for unionsscripts/qapi-types.py+18 -22 replies
3/11qapi-visit.py: Split off generate_visit_struct_fields()scripts/qapi-visit.py+34 -281 reply
4/11qapi-visit.py: Implement 'base' for unionsscripts/qapi-visit.py+28 -51 reply
5/11qapi: Add visitor for implicit structsinclude/qapi/visitor-impl.h include/qapi/visitor.h qapi/qapi-visit-core.c +1 more+37 -02 replies
6/11qapi: Flat unions with arbitrary discriminatorscripts/qapi-types.py scripts/qapi-visit.py+70 -311 reply
7/11qapi: Add consume argument to qmp_input_get_object()qapi/qmp-input-visitor.c+10 -91 reply
8/11qapi: Anonymous unionsinclude/qapi/qmp/qobject.h include/qapi/visitor-impl.h include/qapi/visitor.h +6 more+148 -03 replies
9/11Implement qdict_flatten()include/qapi/qmp/qdict.h qobject/qdict.c+48 -02 replies
10/11block: Allow "driver" option on the top levelblock.c blockdev.c+17 -101 reply
11/11block: Implement 'blockdev-add' QMP commandblockdev.c qapi-schema.json qmp-commands.hx+67 -03 replies

Reviews trailers per patch

7 of 11 patches have a Reviewed-by or Acked-by.

PatchEric Blake
1/11R-b
2/11R-b
3/11R-b
4/11R-b
5/11R-b
6/11
7/11R-b
8/11
9/11
10/11R-b
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [Qemu-devel] [RFC PATCH 00/11] qapi changes in preparation for blockdev-add

The goal of this series is to make QAPI ready to handle mostly unions in a less verbose way so that a future -blockdev command line option can be a direct mapping of the structure used by a blockdev-add QMP command. This series implements everything that I think is needed for this on the QAPI side. The block layer side is still lacking, but good enough that I could actually add a block device using the new command; the problem is here mostly that many -drive options aren't supported yet.

To give you an idea of what the interface looks like in the end, this is what you can pass now in theory (the block layer just won't like the read-only option and error out...):

{ "execute": "blockdev-add",

  "arguments": {
      "options": {
        "driver": "qcow2",
        "read-only": true,
        "lazy-refcounts": true,
        "file": {
            "driver": "file",
            "read-only": false,
            "filename": "/home/kwolf/images/hd.img"
        }
      }
    }

}

Kevin Wolf (11):
qapi-types.py: Split off generate_struct_fields() qapi-types.py: Implement 'base' for unions qapi-visit.py: Split off generate_visit_struct_fields() qapi-visit.py: Implement 'base' for unions
qapi: Add visitor for implicit structs
qapi: Flat unions with arbitrary discriminator
qapi: Add consume argument to qmp_input_get_object()
qapi: Anonymous unions
Implement qdict_flatten()
block: Allow "driver" option on the top level [WIP] block: Implement 'blockdev-add' QMP command

 block.c                     |   7 ++
 blockdev.c                  |  52 ++++++++++---
 include/qapi/qmp/qdict.h    |   1 +
 include/qapi/qmp/qobject.h  |   1 +
 include/qapi/visitor-impl.h |   6 ++
 include/qapi/visitor.h      |   6 ++
 qapi-schema.json            |  29 +++++++
 qapi/qapi-visit-core.c      |  25 +++++++
 qapi/qmp-input-visitor.c    |  47 +++++++++---
 qmp-commands.hx             |   6 ++
 qobject/qdict.c             |  47 ++++++++++++
 qobject/qjson.c             |   2 +
 scripts/qapi-types.py       |  83 ++++++++++++++++++--
 scripts/qapi-visit.py       | 179 ++++++++++++++++++++++++++++++++++++--------
 scripts/qapi.py             |  28 +++++++
 15 files changed, 459 insertions(+), 60 deletions(-)
Signature · 1 line
1.8.1.4