From nobody Thu May 16 07:10:40 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1556802634; cv=none; d=zoho.com; s=zohoarc; b=IHd8qmE4UD05PNk6KQJ/W73V/tpuafTkisGpV+tqrRyBCHGF/td53iog9R4E7MCs2BRoBMbNdjbbrj8Dv6AnBdVWRAA55Tdd2Qdf9DFAc9XukIousRjBtT81HI3k2PKqEhJD5uB3to5S+jqeyRPjxDz7ButNnFQb22xEZZiiVEs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1556802634; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=sErMukjrtGgSh3mHJoEGKWH+RlxHAVP8rjvTiiBwq5I=; b=QAOMchM2PtBI6fipHxPZoLPkk6Q+5uNtm4p28AW+I6kEOEYtu9shffU7NWINxk0IoHxZSb9RUEYS/ZPw3qJehMPKQhkAN2MhsdYei2zxs0cCri+8f1zD/S9ROS6+KCr+wnDBtEUAOY6XI2VHLzB7mooQE4n0gGMuNOTA7F8/JI0= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1556802634959343.49922792223026; Thu, 2 May 2019 06:10:34 -0700 (PDT) Received: from localhost ([127.0.0.1]:50947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMBTi-0005AI-8c for importer@patchew.org; Thu, 02 May 2019 09:10:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53007) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMBSO-0004YS-OX for qemu-devel@nongnu.org; Thu, 02 May 2019 09:09:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMBSN-0006IQ-Mm for qemu-devel@nongnu.org; Thu, 02 May 2019 09:09:00 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:57118) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hMBSD-0005xn-TS; Thu, 02 May 2019 09:08:51 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x42D3YLj182956; Thu, 2 May 2019 13:08:39 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2s6xhygeyk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 May 2019 13:08:39 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x42D7eCR160126; Thu, 2 May 2019 13:08:39 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3030.oracle.com with ESMTP id 2s7p89rg2v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 02 May 2019 13:08:39 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x42D8cNB024451; Thu, 2 May 2019 13:08:38 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 02 May 2019 06:08:37 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=sErMukjrtGgSh3mHJoEGKWH+RlxHAVP8rjvTiiBwq5I=; b=gurmdCO80754jWAZLKo/hJREscSi5oV6sno4/YiaeLuRir9IpzS1DlIy6jQL7BFDnl3v tsUR+BPk3hMnHZfPeW58Zw3+5clCNsuipWVYu3Gz9EFjkIILoUbIkT7I1S19ZC8JE6Ie ULpPhNi8mtl+UUjHum60rIcpHeClPz0Zyq54iUg4Pg/wFg8QYdSFe0O7Gb/oUuoZuRPF HsJTKMtTaln97OK7TAkj1dwQEJfS0zfgBNrag+vDnMzfovpVcKOTmoe/MUQgDYh+b2XY d5ObdNR6VfooqV+/zdH7yE7xMM9S0qZX3pGLO4hOzilE7x2Rbc3iJSffegWWptiBqPJC mA== From: Sam Eiderman To: kwolf@redhat.com, mreitz@redhat.com, qemu-block@nongnu.org, qemu-devel@nongnu.org, thuth@redhat.com, fam@euphon.net, eblake@redhat.com Date: Thu, 2 May 2019 16:08:22 +0300 Message-Id: <20190502130822.46858-2-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190502130822.46858-1-shmuel.eiderman@oracle.com> References: <20190502130822.46858-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9244 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905020091 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9244 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905020091 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 Subject: [Qemu-devel] [PATCH v2] vmdk: Set vmdk parent backing_format to vmdk 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: shmuel.eiderman@oracle.com, arbel.moshe@oracle.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit b69864e ("vmdk: Support version=3D3 in VMDK descriptor files") fixed the probe function to correctly guess vmdk descriptors with version=3D3. This solves the issue where vmdk snapshot with parent vmdk descriptor containing "version=3D3" would be treated as raw instead vmdk. In the future case where a new vmdk version is introduced, we will again experience this issue, even if the user will provide "-f vmdk" it will only apply to the tip image and not to the underlying "misprobed" parent image. The code in vmdk.c already assumes that the backing file of vmdk must be vmdk (see vmdk_is_cid_valid which returns 0 if backing file is not vmdk). So let's make it official by supplying the backing_format as vmdk. Reviewed-by: Mark Kanda Reviewed-By: Liran Alon Reviewed-by: Arbel Moshe Signed-off-by: Shmuel Eiderman --- block/vmdk.c | 2 ++ tests/qemu-iotests/110 | 6 +++--- tests/qemu-iotests/126 | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 8dec6ef767..de8cb859f8 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -397,6 +397,8 @@ static int vmdk_parent_open(BlockDriverState *bs) pstrcpy(bs->auto_backing_file, end_name - p_name + 1, p_name); pstrcpy(bs->backing_file, sizeof(bs->backing_file), bs->auto_backing_file); + pstrcpy(bs->backing_format, sizeof(bs->backing_format), + "vmdk"); } =20 out: diff --git a/tests/qemu-iotests/110 b/tests/qemu-iotests/110 index fad672c1ae..982569dbc5 100755 --- a/tests/qemu-iotests/110 +++ b/tests/qemu-iotests/110 @@ -54,7 +54,7 @@ _make_test_img -b "$TEST_IMG_REL.base" 64M # qemu should be able to reconstruct the filename, so relative backing nam= es # should work TEST_IMG=3D"json:{'driver':'$IMGFMT','file':{'driver':'file','filename':'$= TEST_IMG'}}" \ - _img_info | _filter_img_info + _img_info | _filter_img_info | grep -v "backing file format" =20 echo echo '=3D=3D=3D Non-reconstructable filename =3D=3D=3D' @@ -78,7 +78,7 @@ TEST_IMG=3D"json:{ } ] } -}" _img_info | _filter_img_info +}" _img_info | _filter_img_info | grep -v "backing file format" =20 echo echo '=3D=3D=3D Backing name is always relative to the backed image =3D=3D= =3D' @@ -110,7 +110,7 @@ TEST_IMG=3D"json:{ } ] } -}" _img_info | _filter_img_info +}" _img_info | _filter_img_info | grep -v "backing file format" =20 =20 # success, all done diff --git a/tests/qemu-iotests/126 b/tests/qemu-iotests/126 index 96dc048d59..1f7618c8a5 100755 --- a/tests/qemu-iotests/126 +++ b/tests/qemu-iotests/126 @@ -63,7 +63,7 @@ TEST_IMG=3D$BASE_IMG _make_test_img 64M TEST_IMG=3D$TOP_IMG _make_test_img -b ./image:base.$IMGFMT =20 # The default cluster size depends on the image format -TEST_IMG=3D$TOP_IMG _img_info | grep -v 'cluster_size' +TEST_IMG=3D$TOP_IMG _img_info | grep -v 'cluster_size\|backing file format' =20 _rm_test_img "$BASE_IMG" _rm_test_img "$TOP_IMG" @@ -79,7 +79,7 @@ TOP_IMG=3D"file:image:top.$IMGFMT" TEST_IMG=3D$BASE_IMG _make_test_img 64M TEST_IMG=3D$TOP_IMG _make_test_img -b "$BASE_IMG" =20 -TEST_IMG=3D$TOP_IMG _img_info | grep -v 'cluster_size' +TEST_IMG=3D$TOP_IMG _img_info | grep -v 'cluster_size\|backing file format' =20 _rm_test_img "$BASE_IMG" _rm_test_img "image:top.$IMGFMT" --=20 2.13.3