From nobody Sat Oct 25 13:08:05 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1516271600691845.2559962493171; Thu, 18 Jan 2018 02:33:20 -0800 (PST) Received: from localhost ([::1]:49977 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec7VS-0002mg-Cr for importer@patchew.org; Thu, 18 Jan 2018 05:33:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34321) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec7UL-0002J2-F9 for qemu-devel@nongnu.org; Thu, 18 Jan 2018 05:32:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ec7UH-0000JO-I4 for qemu-devel@nongnu.org; Thu, 18 Jan 2018 05:32:05 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42312) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ec7U5-0000BR-LX; Thu, 18 Jan 2018 05:31:49 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A31B9D56E9; Thu, 18 Jan 2018 10:31:48 +0000 (UTC) Received: from t460.redhat.com (unknown [10.33.36.61]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE5107E240; Thu, 18 Jan 2018 10:31:45 +0000 (UTC) From: "Daniel P. Berrange" To: qemu-devel@nongnu.org Date: Thu, 18 Jan 2018 10:31:43 +0000 Message-Id: <20180118103143.11780-1-berrange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Thu, 18 Jan 2018 10:31:48 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] block: implement the bdrv_reopen_prepare helper for LUKS driver 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: Kevin Wolf , qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If the bdrv_reopen_prepare helper isn't provided, the qemu-img commit command fails to re-open the base layer after committing changes into it. Provide a no-op implementation for the LUKS driver, since there is not any custom work that needs doing to re-open it. Signed-off-by: Daniel P. Berrange --- block/crypto.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/block/crypto.c b/block/crypto.c index 60ddf8623e..bb9a8f5376 100644 --- a/block/crypto.c +++ b/block/crypto.c @@ -382,6 +382,12 @@ static void block_crypto_close(BlockDriverState *bs) qcrypto_block_free(crypto->block); } =20 +static int block_crypto_reopen_prepare(BDRVReopenState *state, + BlockReopenQueue *queue, Error **er= rp) +{ + /* nothing needs checking */ + return 0; +} =20 /* * 1 MB bounce buffer gives good performance / memory tradeoff @@ -620,6 +626,7 @@ BlockDriver bdrv_crypto_luks =3D { .bdrv_truncate =3D block_crypto_truncate, .create_opts =3D &block_crypto_create_opts_luks, =20 + .bdrv_reopen_prepare =3D block_crypto_reopen_prepare, .bdrv_refresh_limits =3D block_crypto_refresh_limits, .bdrv_co_preadv =3D block_crypto_co_preadv, .bdrv_co_pwritev =3D block_crypto_co_pwritev, --=20 2.14.3