From patchwork Wed Jan 30 17:51:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Shinkevich X-Patchwork-Id: 10789125 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6575914E1 for ; Wed, 30 Jan 2019 17:58:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 552D42F845 for ; Wed, 30 Jan 2019 17:58:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48DA62FCC0; Wed, 30 Jan 2019 17:58:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D2E812F845 for ; Wed, 30 Jan 2019 17:58:09 +0000 (UTC) Received: from localhost ([127.0.0.1]:42156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gou7l-0002bT-0G for patchwork-qemu-devel@patchwork.kernel.org; Wed, 30 Jan 2019 12:58:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gou1Z-0006Of-0S for qemu-devel@nongnu.org; Wed, 30 Jan 2019 12:51:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gou1V-0000AA-9s for qemu-devel@nongnu.org; Wed, 30 Jan 2019 12:51:43 -0500 Received: from relay.sw.ru ([185.231.240.75]:48706) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gou1R-00007K-BK; Wed, 30 Jan 2019 12:51:39 -0500 Received: from [172.16.25.136] (helo=localhost.sw.ru) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gou1L-00052o-FL; Wed, 30 Jan 2019 20:51:31 +0300 From: Andrey Shinkevich To: qemu-devel@nongnu.org, qemu-block@nongnu.org Date: Wed, 30 Jan 2019 20:51:27 +0300 Message-Id: <1548870690-647481-1-git-send-email-andrey.shinkevich@virtuozzo.com> X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 185.231.240.75 Subject: [Qemu-devel] [PATCH v10 0/3] qemu-img info lists bitmap directory entries X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, armbru@redhat.com, mreitz@redhat.com, andrey.shinkevich@virtuozzo.com, den@openvz.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP v10: The 'struct Error' parameter was added to the function prototype bdrv_query_image_info(). The code refactoring of the function get_bitmap_info_flags(). The comments to the structures ImageInfoSpecificQCow2 and Qcow2BitmapInfo in the file qapi/block-core.json were corrected. The changes in the *.out files of the tests 060, 065 082, 198 and 206 were discarded. The new test 239 was enriched by adding human readable format output and by checking the output with bitmap extra parameters, such as non-persistent and disabled. v9: The new test 239 of the qemu-iotests set was amended to show the bitmaps being added and to demonstrate the bitmap flag "in-use". The version #9 was discussed with the message ID: <1548705688-1027522-1-git-send-email-andrey.shinkevich@virtuozzo.com> v8: The output benchmark files for the qemu-iotests, namely 060, 065 082, 198 and 206, were modified to show the bitmap extension for the qemu specific information. A new test file 239 was added to the test set that checks the output for the fields of the bitmap section. The backward compatibility of the output for images of the version 2 of qcow2 was added. v7: A description was added to the function qcow2_get_bitmap_info_list(). In the function qcow2_get_specific_info(), the comment was modified so that we ignore any error in obtaining the list of bitmaps to pass the rest of QCOW2 specific information to a caller. v6: '[PATCH v6] qemu-img info lists bitmap directory entries'. The error handling logic for the bitmaps empty list was reversed. v5: '[PATCH v5] qemu-img info lists bitmap directory entries'. The error handling logic for the bitmaps empty list was fixed and documented. v4: '[PATCH v4] qemu-img info lists bitmap directory entries'. Unknown flags are checked with the mask BME_RESERVED_FLAGS. The code minor refactoring was made. v3: '[PATCH v3] qemu-img info lists bitmap directory entries'. Now, qcow2_get_bitmap_info_list() is invoked under the condition of QCOW version #3 to avoid memory leaks in case of QCOW version #2. Furthermore, qcow2_get_bitmap_info_list() checks the number of existing bitmaps. So, if no bitmap exists, no bitmap error message is printed in the output. The data type of the bitmap 'granularity' parameter was left as 'uint32' because bitmap_list_load() returns error if granularity_bits is grater than 31. v2: '[PATCH v2] qemu-img info lists bitmap directory entries'. The targeted version of the release at 'Since' word of the comments to the new structures changed to 4.0 in the file qapi/block-core.json. A comment to the 'bitmaps' new member was supplied. The 'unknown flags' parameter was introduced to indicate presence of QCOW2 bitmap unknown flags, if any. The word 'dirty' was removed from the code and from the comments as we list all the bitmaps. The 'bitmaps' printed parameter was removed for the release versions earlier than 3.x. The example of the output was moved above the 'Signed-off-by' line. The first version was '[PATCH] qemu-img info lists bitmap directory entries'. Andrey Shinkevich (3): bdrv_query_image_info Error parameter added qemu-img info lists bitmap directory entries qemu-img info: bitmaps extension new test 239 block.c | 5 +- block/crypto.c | 4 +- block/qapi.c | 7 ++- block/qcow2-bitmap.c | 77 +++++++++++++++++++++++++++ block/qcow2.c | 20 ++++++- block/qcow2.h | 2 + block/vmdk.c | 3 +- include/block/block.h | 3 +- include/block/block_int.h | 3 +- qapi/block-core.json | 40 +++++++++++++- qemu-io-cmds.c | 7 ++- tests/qemu-iotests/239 | 74 ++++++++++++++++++++++++++ tests/qemu-iotests/239.out | 130 +++++++++++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/group | 1 + 14 files changed, 364 insertions(+), 12 deletions(-) create mode 100755 tests/qemu-iotests/239 create mode 100644 tests/qemu-iotests/239.out