From nobody Mon May 20 23:24:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.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=nutanix.com ARC-Seal: i=1; a=rsa-sha256; t=1596794738; cv=none; d=zohomail.com; s=zohoarc; b=F3tbM18swJXXlQBKwfghPmMZ6gRQObG5zvNMbEONTfmuGzrfFOI+FhktjxmduyqaekP4fwPLLjO6ECR2UkDc6Eyyxe9Ng1daVgo/hSzWjVI0wVMxch43w0Nb4sMG3rPwVEDFYDNl3fQqNNvyOhUCWLKdnHW3K4fioXSgQ3IwjIc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596794738; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=EJ7gXKm+dF7hUMEmQAYNZk1RRM4eLdL+UyukHy3qQIk=; b=JHuuHXKDFX00RUa/hc/1nZ/uPQbQNjRlz0mvoYUK/xi3sKNlB2DlHReqs4gEUctbvSkN4FzVX2M5ie62hCtrilugUyIU28OdXYc9FHtgVY2hBtUAlWqnZYb4sBEFq3EAxECfHoVJTZj9Sm1Ebmph6eOwAA/AQqlwWrK6EMYv6m8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.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 (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1596794738070988.4787306394448; Fri, 7 Aug 2020 03:05:38 -0700 (PDT) Received: from localhost ([::1]:51084 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k3zFo-0000Up-Qj for importer@patchew.org; Fri, 07 Aug 2020 06:05:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3zDj-0005Ng-TG for qemu-devel@nongnu.org; Fri, 07 Aug 2020 06:03:27 -0400 Received: from o1.dev.nutanix.com ([198.21.4.205]:53379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k3zDi-0006Wv-93 for qemu-devel@nongnu.org; Fri, 07 Aug 2020 06:03:27 -0400 Received: by filterdrecv-p3iad2-d8cc6d457-vbbww with SMTP id filterdrecv-p3iad2-d8cc6d457-vbbww-18-5F2D26EA-11D 2020-08-07 10:03:22.963194328 +0000 UTC m=+748498.735243532 Received: from swapnil-ingle.ubvm.nutanix.com (unknown) by ismtpd0007p1sjc2.sendgrid.net (SG) with ESMTP id qTXmY0oaTBmf1YzBgfibpg Fri, 07 Aug 2020 10:03:22.716 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sendgrid.net; h=from:subject:to:cc:content-type:content-transfer-encoding; s=smtpapi; bh=EJ7gXKm+dF7hUMEmQAYNZk1RRM4eLdL+UyukHy3qQIk=; b=PYvKwbhdf4tUHcwUfieJ2t+u+Lhbf6SNx0vZ3Tma2P1XKXxy3Ry4lNLzgv/i1vQrvgsL 8wqZvWkjNQhJpSTENFFEs8nCZ6aqSTdx8xug3hmkNSPXp88tC6rAlw7J1hxhqoP4bU4nbq JpDR60aaDCd58bRaKvx/Jel8yJ+bY28cE= From: Swapnil Ingle Subject: [PATCH v2] block/vhdx: Support vhdx image only with 512 bytes logical sector size Date: Fri, 07 Aug 2020 10:03:23 +0000 (UTC) Message-Id: <1596794594-44531-1-git-send-email-swapnil.ingle@nutanix.com> X-Mailer: git-send-email 1.8.3.1 X-SG-EID: =?us-ascii?Q?F2ZUz17l2INJHYm1t3SgcUlF+k0ID8lTNwkAb5HHXc8fLM5LiKzEftZo2hMPsh?= =?us-ascii?Q?g8C4Vps0UmhpJRBoOufhCJs4fp0VRL94dwjCvG0?= =?us-ascii?Q?xA21GUZktfi=2FHrxgxopmi9IryiHTEMbof67wir+?= =?us-ascii?Q?n4RqU=2FciB+TYrYnb1nY2MkffztFb5YXsI0pjNM7?= =?us-ascii?Q?aGYI5Kep09MSr2irukEra=2FStnQwQKxLT7+aUFAq?= =?us-ascii?Q?FCbVoqxySibEZj1oYTb1ThHUFeJxNBKp6Ve+9Py?= =?us-ascii?Q?w4I5nVbGFyIdXb5REwK+g=3D=3D?= To: qemu-devel@nongnu.org Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.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; Received-SPF: pass client-ip=198.21.4.205; envelope-from=bounces+17973240-45d5-qemu-devel=nongnu.org@sendgrid.net; helo=o1.dev.nutanix.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/07 06:03:23 X-ACL-Warn: Detected OS = Linux 3.11 and newer [fuzzy] X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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 , Swapnil Ingle , "open list:VHDX" , Jeff Cody , Max Reitz , philmd@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" block/vhdx uses qemu block layer where sector size is always 512 bytes. This may have issues with 4K logical sector sized vhdx image. For e.g qemu-img convert on such images fails with following assert: $qemu-img convert -f vhdx -O raw 4KTest1.vhdx test.raw qemu-img: util/iov.c:388: qiov_slice: Assertion `offset + len <=3D qiov->size' failed. Aborted This patch adds an check to return ENOTSUP for vhdx images which have logical sector size other than 512 bytes. Signed-off-by: Swapnil Ingle --- v2: Fixed commit message, suggested by Philippe Mathieu-Daude --- block/vhdx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/vhdx.c b/block/vhdx.c index 791eb90..356ec4c 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -816,9 +816,9 @@ static int vhdx_parse_metadata(BlockDriverState *bs, BD= RVVHDXState *s) goto exit; } =20 - /* only 2 supported sector sizes */ - if (s->logical_sector_size !=3D 512 && s->logical_sector_size !=3D 409= 6) { - ret =3D -EINVAL; + /* Currently we only support 512 */ + if (s->logical_sector_size !=3D 512) { + ret =3D -ENOTSUP; goto exit; } =20 --=20 2.9.3