From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59596) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwUcM-000207-IZ for qemu-devel@nongnu.org; Tue, 09 Jul 2013 05:53:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UwUcK-0007Sy-LI for qemu-devel@nongnu.org; Tue, 09 Jul 2013 05:53:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:61677) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UwUcK-0007Sn-E9 for qemu-devel@nongnu.org; Tue, 09 Jul 2013 05:53:52 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r699rpI2031220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 9 Jul 2013 05:53:51 -0400 From: Kevin Wolf Date: Tue, 9 Jul 2013 11:53:26 +0200 Message-Id: <1373363617-4723-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [RFC PATCH 00/11] qapi changes in preparation for blockdev-add List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, armbru@redhat.com, stefanha@redhat.com, lcapitulino@redhat.com 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(-) -- 1.8.1.4