From patchwork Tue Feb 11 16:03:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 1236359 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=XNW80XD4; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48H6yv0HY7z9sP7 for ; Wed, 12 Feb 2020 03:04:05 +1100 (AEDT) Received: from localhost ([::1]:52284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1Y14-000866-7H for incoming@patchwork.ozlabs.org; Tue, 11 Feb 2020 11:04:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50126) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j1Y0Z-00083l-Ur for qemu-devel@nongnu.org; Tue, 11 Feb 2020 11:03:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j1Y0V-0005DN-5H for qemu-devel@nongnu.org; Tue, 11 Feb 2020 11:03:31 -0500 Received: from us-smtp-1.mimecast.com ([205.139.110.61]:27285 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j1Y0U-0005Ae-QF for qemu-devel@nongnu.org; Tue, 11 Feb 2020 11:03:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581437005; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=C/C3DFLKOff+u8tqd5nj4EtQC62OiWFmBEjl7KJljQI=; b=XNW80XD4p7mZokKteYM0Kl8rJe4c1JWQ5n7PHeZcYr0LXMb61BVLSon5oCDEn+oe110nx9 guAlxp8HcAbQtn8uLkUv/RAkq9JuXOBQBZueybLN5AdgcMOK5+ZNg0XClza0deaY5H2meo /rTIcAyF+b4lRVUU1KwPKWYQxTCd/UI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-162-xbKoimazMYeUYaxMn_FsfA-1; Tue, 11 Feb 2020 11:03:23 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7AB9610054E3; Tue, 11 Feb 2020 16:03:22 +0000 (UTC) Received: from localhost (unknown [10.36.118.99]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4843426FB6; Tue, 11 Feb 2020 16:03:18 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PATCH v3 0/4] luks: add qemu-img measure support Date: Tue, 11 Feb 2020 16:03:14 +0000 Message-Id: <20200211160318.453650-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: xbKoimazMYeUYaxMn_FsfA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 205.139.110.61 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Stefan Hajnoczi , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" v3: * Move payload offset calculation function to crypto/block.c [Max] * Zero/unallocated blocks always require disk space on encrypted files [Max] * Update qemu-iotests 178 output when changing qemu-img measure command-line options v2: * Fix uint64_t <-> size_t type mismatch in block_crypto_measure() so that 32-bit builds pass This patch series adds qemu-img measure support to the "luks" block driver. We just need to take into account the LUKS header when sizing the image. Stefan Hajnoczi (4): luks: extract qcrypto_block_calculate_payload_offset() luks: implement .bdrv_measure() qemu-img: allow qemu-img measure --object without a filename iotests: add 282 luks qemu-img measure test block/crypto.c | 62 +++++++++++++++++++++ block/qcow2.c | 74 +++++++------------------ crypto/block.c | 40 ++++++++++++++ include/crypto/block.h | 22 ++++++++ qemu-img.c | 6 +-- tests/qemu-iotests/178 | 2 +- tests/qemu-iotests/178.out.qcow2 | 8 +-- tests/qemu-iotests/178.out.raw | 8 +-- tests/qemu-iotests/282 | 93 ++++++++++++++++++++++++++++++++ tests/qemu-iotests/282.out | 30 +++++++++++ tests/qemu-iotests/group | 1 + 11 files changed, 278 insertions(+), 68 deletions(-) create mode 100755 tests/qemu-iotests/282 create mode 100644 tests/qemu-iotests/282.out