From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48402) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrWFJ-000153-Lw for qemu-devel@nongnu.org; Fri, 13 Dec 2013 12:09:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VrWFD-0007a8-Jy for qemu-devel@nongnu.org; Fri, 13 Dec 2013 12:09:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:7662) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VrWFD-0007a3-Ap for qemu-devel@nongnu.org; Fri, 13 Dec 2013 12:09:43 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBDH9fYW002842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 13 Dec 2013 12:09:42 -0500 From: Max Reitz Date: Fri, 13 Dec 2013 18:10:11 +0100 Message-Id: <1386954633-28905-1-git-send-email-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v3 00/21] blkdebug/blkverify: Allow QMP configuration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Fam Zheng , Stefan Hajnoczi , Max Reitz Currently, the configuration of blkdebug and blkverify is done through the "filename" alone. There is now way of manually choosing blkdebug or blkverify as a driver and using a normal image filename. In the case of blkdebug, the filename starts with the protocol prefix, follows up with the name of a configuration file and ends with the name of the image file. In the case of blkverify, the filename starts with the protocol prefix, follows up with the raw reference image filename and ends with the name of the image file. This patch allows the configuration of both drivers completely through QMP and accordingly command-line options. The driver has to be selected through the driver option (or similar), the image filename may be given either as the filename itself or through a x.filename option, where "x" depends on the driver. Further options may be required depending on the driver. In case of blkverify, the test image may be specified either through the filename or as a BlockdevRef reference through the "test" option. The raw image is referenced as "raw". In case of blkdebug, one may either set the "config" option to the filename of a configuration file, or the content of the configuration file may be given directly (as options). The image filename is either specified as the filename or referenced through the "image" option. v5: - Addressed Fam's comments: - Patch 4: Asserted against prefix == NULL in qdict_flatten_qlist() - Patch 4: Support other types than QDicts and QLists in QLists in qdict_flatten_qlist() - Patch 4: Modified comment above qdict_flatten() to include the functionality of qdict_flatten_qlist() - Patch 8 (now patch 9): Removed goto fail; in favor of directly returning in the if (reference) patch - this fixes a double QDECREF(options) as well as two bs dereferences with bs being NULL - Patch 21 (now patch 22): Added reason for not using Python to the commit message - Added patch 5: Cleans up qdict_flatten_qdict() which contains a now unused delete variable backport diff against v3: Key: [----] : patches are identical [####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively 001/22:[----] [--] 'blkdebug: Use errp for read_config()' 002/22:[----] [--] 'blkdebug: Don't require sophisticated filename' 003/22:[----] [--] 'qdict: Add qdict_array_split()' 004/22:[0015] [FC] 'qapi: extend qdict_flatten() for QLists' 005/22:[down] 'qdict: Remove delete from qdict_flatten_qdict()' 006/22:[----] [--] 'qemu-option: Add qemu_config_parse_qdict()' 007/22:[----] [--] 'blkdebug: Always call read_config()' 008/22:[----] [--] 'blkdebug: Use command-line in read_config()' 009/22:[0006] [FC] 'block: Allow reference for bdrv_file_open()' 010/22:[----] [--] 'block: Pass reference to bdrv_file_open()' 011/22:[----] [--] 'block: Allow block devices without files' 012/22:[----] [--] 'block: Allow recursive "file"s' 013/22:[----] [--] 'qemu-iotests: Fix output of test 051' 014/22:[----] [--] 'blockdev: Move "file" to legacy_opts' 015/22:[----] [--] 'blkdebug: Allow command-line file configuration' 016/22:[----] [--] 'blkdebug: Make filename optional' 017/22:[----] [--] 'blkverify: Allow command-line configuration' 018/22:[----] [--] 'blkverify: Don't require protocol filename' 019/22:[----] [--] 'blkdebug: Alias "errno" as "error"' 020/22:[----] [--] 'qapi: QMP interface for blkdebug and blkverify' 021/22:[----] [--] 'qemu-io: Make filename optional' 022/22:[----] [--] 'iotests: Test new blkdebug/blkverify interface' v4: - Fixed a memleak in qdict_flatten_qlist() in patch 4 v3: - The first few patches are probably similar to the ones from the previous series; but it's probably best to see this series as a completely new one. Max Reitz (22): blkdebug: Use errp for read_config() blkdebug: Don't require sophisticated filename qdict: Add qdict_array_split() qapi: extend qdict_flatten() for QLists qdict: Remove delete from qdict_flatten_qdict() qemu-option: Add qemu_config_parse_qdict() blkdebug: Always call read_config() blkdebug: Use command-line in read_config() block: Allow reference for bdrv_file_open() block: Pass reference to bdrv_file_open() block: Allow block devices without files block: Allow recursive "file"s qemu-iotests: Fix output of test 051 blockdev: Move "file" to legacy_opts blkdebug: Allow command-line file configuration blkdebug: Make filename optional blkverify: Allow command-line configuration blkverify: Don't require protocol filename blkdebug: Alias "errno" as "error" qapi: QMP interface for blkdebug and blkverify qemu-io: Make filename optional iotests: Test new blkdebug/blkverify interface block.c | 56 ++++++++++--- block/blkdebug.c | 90 ++++++++++++++------ block/blkverify.c | 65 ++++++++++----- block/cow.c | 3 +- block/qcow.c | 3 +- block/qcow2.c | 2 +- block/qed.c | 4 +- block/sheepdog.c | 4 +- block/vhdx.c | 2 +- block/vmdk.c | 4 +- blockdev.c | 19 +++-- include/block/block.h | 3 +- include/qapi/qmp/qdict.h | 1 + include/qemu/config-file.h | 6 ++ qapi-schema.json | 94 ++++++++++++++++++++- qemu-io.c | 10 ++- qobject/qdict.c | 111 ++++++++++++++++++++----- tests/qemu-iotests/051.out | 2 +- tests/qemu-iotests/071 | 201 +++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/071.out | 73 ++++++++++++++++ tests/qemu-iotests/group | 1 + util/qemu-config.c | 95 +++++++++++++++++++++ 22 files changed, 741 insertions(+), 108 deletions(-) create mode 100755 tests/qemu-iotests/071 create mode 100644 tests/qemu-iotests/071.out -- 1.8.5.1