From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608293543; cv=none; d=zohomail.com; s=zohoarc; b=J83E/+Yq+gb2fd0ALnM0+1ZAavmM/uyNUuE67oDrQE7p2R+5vyfPz7vabCDXBumooW6iX1PgDfTdiJtgU+/HYt9Rtu7DuBfniMVVGRS5pK6zQnCGgn91ofrI4crBRFg5pa8h3g+EiE/E7SwRxorPs2uyY20JD7CxbNfGQ7hAUtI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608293543; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yw2cvNcKfmp0Ylzx3Br660U7TBEexUolRU1FHjRAq4k=; b=gHaX9aNjhxw4lxZ3qJwesw6w4+KhW8C1wd2NEh8ElG541XZm0OaeRi3q0GC0+zgWd0RE0ZVci3FYc8eioXGTgVL7lXUm19oGwwNIA3Z0e0ALbPf/iJ6l+9UxSsdGT9OpstYLztPvNGtI0Ei+cgYSkip+/x2fhVRy7DovMJkcw7g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 16082935431171017.2090848479181; Fri, 18 Dec 2020 04:12:23 -0800 (PST) Received: from localhost ([::1]:46124 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEcP-0003M6-Uj for importer@patchew.org; Fri, 18 Dec 2020 07:12:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38074) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEaz-0001Yn-9Y for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:10:53 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29566) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEax-0001ZU-Aw for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:10:53 -0500 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-292-bZCaSi6aNj6Mx47hlE1Lew-1; Fri, 18 Dec 2020 07:10:48 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 999DF8049C5; Fri, 18 Dec 2020 12:10:47 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9EF8260C47; Fri, 18 Dec 2020 12:10:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293450; 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: in-reply-to:in-reply-to:references:references; bh=yw2cvNcKfmp0Ylzx3Br660U7TBEexUolRU1FHjRAq4k=; b=ZWXWdtzrjYLrSeoKOH/rXSWrdyCxnBRupRsqwWD1AYV3+oMnO0+jzoDvkoUiZArn/aiqCz 4kINNgonWpTBpIge4GeFuX0Q3Ogbx82ybUr0ppCMoRxLEHhYxiT1yiUN6qrk0/P9G93z8M uiRgCaKU1uBLFm/pxf6/DY4xENYJDyc= X-MC-Unique: bZCaSi6aNj6Mx47hlE1Lew-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 01/17] iotests/210: Fix reference output Date: Fri, 18 Dec 2020 13:10:25 +0100 Message-Id: <20201218121041.299788-2-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Max Reitz Commit 8b1170012b1 has added a global maximum disk length for the block layer, so the error message when creating an overly large disk has changed. Fixes: 8b1170012b1de6649c66ac1887f4df7e312abf3b ("block: introduce BDRV_MAX_LENGTH") Signed-off-by: Max Reitz Message-Id: <20201214175158.299919-1-mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Kevin Wolf --- tests/qemu-iotests/210.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/210.out b/tests/qemu-iotests/210.out index a5e88e2a82..dc1a3c9786 100644 --- a/tests/qemu-iotests/210.out +++ b/tests/qemu-iotests/210.out @@ -182,7 +182,7 @@ Job failed: The requested file size is too large =3D=3D=3D Resize image with invalid sizes =3D=3D=3D =20 {"execute": "block_resize", "arguments": {"node-name": "node1", "size": 92= 23372036854775296}} -{"error": {"class": "GenericError", "desc": "The requested file size is to= o large"}} +{"error": {"class": "GenericError", "desc": "Required too big image size, = it must be not greater than 9223372035781033984"}} {"execute": "block_resize", "arguments": {"node-name": "node1", "size": 92= 23372036854775808}} {"error": {"class": "GenericError", "desc": "Invalid parameter type for 's= ize', expected: integer"}} {"execute": "block_resize", "arguments": {"node-name": "node1", "size": 18= 446744073709551104}} --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608293771; cv=none; d=zohomail.com; s=zohoarc; b=dXjKskQftD9OmBsxfVjM2kl0tQA9TNbC73Ojoo9C4EqPn4d/1iR35nSeuQBtSAdODB+PGAknsT0AmbIuAXq5TF5tuwrqVDNlDn+9huMccJATKPa8GOlJ/8D6uZmrR9quzO8V/2iljpaiiTfTFPUl76+oS+RJxSaVKnWZeLLDtWg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608293771; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2yYfj+3UAF3EBVjBlM6EZF6ZxpDVAIpo0eDHVbH38mY=; b=Fb+t2Qz36H5d2PJxv0xfVOEu/QTMKEeOk8RpYzgSZ8WpZgvUBuA/lcTAXul5rJ05oB4xagpBUXX/SNn6/B7LTFBfoSQPpgt8RrMQJRl2Y2bR0NcT9U4n9/Ot3OTU0VaK+R8hb4LJvkbpHTZ00015bnNJj1smgweWPzUKihYOFmU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 160829377162115.185416711160997; Fri, 18 Dec 2020 04:16:11 -0800 (PST) Received: from localhost ([::1]:54578 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEg5-0006mw-43 for importer@patchew.org; Fri, 18 Dec 2020 07:16:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEb1-0001b7-JF for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:10:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50164) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEaz-0001a7-Nb for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:10:55 -0500 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-594-NrlOz-pHPHOfFQb9-pCTsA-1; Fri, 18 Dec 2020 07:10:50 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F2FC68049D7; Fri, 18 Dec 2020 12:10:48 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id E34E460C47; Fri, 18 Dec 2020 12:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293452; 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: in-reply-to:in-reply-to:references:references; bh=2yYfj+3UAF3EBVjBlM6EZF6ZxpDVAIpo0eDHVbH38mY=; b=hD9DA4LDzDtNy/cvAPKwM2N2k4cX85xjJ9sZDEmLq5t5k63NTjaFX3wL3H5iF+u+qiqa6K Q0wL9pmq+F2ChXrHTDViNihFsYjl14oCptVsbetLaAaiNIAPKXug9jQzYiNnguoLj7g1lA p5lKUAtyE86Zv//uvUOduSo0wtazKg0= X-MC-Unique: NrlOz-pHPHOfFQb9-pCTsA-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 02/17] hw/block/nand: Decommission the NAND museum Date: Fri, 18 Dec 2020 13:10:26 +0100 Message-Id: <20201218121041.299788-3-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Philippe Mathieu-Daud=C3=A9 This is the QEMU equivalent of this Linux commit (but 7 years later): https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?= id=3Df7025a43a9da2 The MTD subsystem has its own small museum of ancient NANDs in a form of the CONFIG_MTD_NAND_MUSEUM_IDS configuration option. The museum contains stone age NANDs with 256 bytes pages, as well as iron age NANDs with 512 bytes per page and up to 8MiB page size. It is with great sorrow that I inform you that the museum is being decommissioned. The MTD subsystem is out of budget for Kconfig options and already has too many of them, and there is a general kernel trend to simplify the configuration menu. We remove the stone age exhibits along with closing the museum, but some of the iron age ones are transferred to the regular NAND depot. Namely, only those which have unique device IDs are transferred, and the ones which have conflicting device IDs are removed. The machine using this device are: - axis-dev88 - tosa (via tc6393xb_init) - spitz based (akita, borzoi, terrier) Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201214002620.342384-1-f4bug@amsat.org> Reviewed-by: Peter Maydell Signed-off-by: Kevin Wolf --- hw/block/nand.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/hw/block/nand.c b/hw/block/nand.c index 1d7a48a2ec..9ed54a0a92 100644 --- a/hw/block/nand.c +++ b/hw/block/nand.c @@ -137,7 +137,7 @@ static void mem_and(uint8_t *dest, const uint8_t *src, = size_t n) # define ADDR_SHIFT 16 # include "nand.c" =20 -/* Information based on Linux drivers/mtd/nand/nand_ids.c */ +/* Information based on Linux drivers/mtd/nand/raw/nand_ids.c */ static const struct { int size; int width; @@ -147,21 +147,11 @@ static const struct { } nand_flash_ids[0x100] =3D { [0 ... 0xff] =3D { 0 }, =20 - [0x6e] =3D { 1, 8, 8, 4, 0 }, - [0x64] =3D { 2, 8, 8, 4, 0 }, [0x6b] =3D { 4, 8, 9, 4, 0 }, - [0xe8] =3D { 1, 8, 8, 4, 0 }, - [0xec] =3D { 1, 8, 8, 4, 0 }, - [0xea] =3D { 2, 8, 8, 4, 0 }, - [0xd5] =3D { 4, 8, 9, 4, 0 }, [0xe3] =3D { 4, 8, 9, 4, 0 }, [0xe5] =3D { 4, 8, 9, 4, 0 }, [0xd6] =3D { 8, 8, 9, 4, 0 }, - - [0x39] =3D { 8, 8, 9, 4, 0 }, [0xe6] =3D { 8, 8, 9, 4, 0 }, - [0x49] =3D { 8, 16, 9, 4, NAND_BUSWIDTH_16 }, - [0x59] =3D { 8, 16, 9, 4, NAND_BUSWIDTH_16 }, =20 [0x33] =3D { 16, 8, 9, 5, 0 }, [0x73] =3D { 16, 8, 9, 5, 0 }, --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608293792; cv=none; d=zohomail.com; s=zohoarc; b=CwcmwAOBjbEhKoXb4v+DiNydvFS7AZ3XFRtfJzHX4aAarQeknzlYw37QSvAaUpTJZyIVm+OVspBk6TtRWChe5f5PO7T44YhFQA1N0VohWJlbxE5i+4RM0vl75SP/spjYUoFssHji0GCS48NXU8QSBd9QnTSRjLnP5c6c6do6yYA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608293792; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cgeJ1nQ7g533ibC3sWYAbQubgI6V1FPOQAg/ML3ilmE=; b=fHPO7GKkqWU3GT4GE3keRZ+ok/MYmDRr75RO0+FVybHBa0Qi3lku5JVXct4La3PJd74Psp647OvMy4VVMcqrYZiEZitPR1kWg/hxMoE2w1dJ3ah9U10R3OZo6e5ITuboBrpNTjyJCjuvH4QHDglUvsq1Rav+Uz83wDHipidCwEI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608293792897406.30809899011626; Fri, 18 Dec 2020 04:16:32 -0800 (PST) Received: from localhost ([::1]:56012 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEgR-0007Vj-Po for importer@patchew.org; Fri, 18 Dec 2020 07:16:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEb2-0001bR-9Y for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:10:56 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25108) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEb0-0001am-2b for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:10:56 -0500 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-22-KXXWkifbNQ6Ld8UZIVBeSQ-1; Fri, 18 Dec 2020 07:10:51 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6819C8049C7; Fri, 18 Dec 2020 12:10:50 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71D2060C15; Fri, 18 Dec 2020 12:10:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293453; 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: in-reply-to:in-reply-to:references:references; bh=cgeJ1nQ7g533ibC3sWYAbQubgI6V1FPOQAg/ML3ilmE=; b=DruFsLgstEwEyjRiA4HnHeJyzt3jtLI8PAqzUjBreMbxSYQJWkVT9ENd+Mr5yZsls/WUlZ E/sU0RMRCReISk9oJJTTr1hCQUEuVYuBOVnbFVjf3WvK383r1KiUttSzG6QPzpgMoU+7PK wJVkTSjb6jVLWdHYcrsj0HHpeARK6iQ= X-MC-Unique: KXXWkifbNQ6Ld8UZIVBeSQ-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 03/17] block/nfs: fix int overflow in nfs_client_open_qdict Date: Fri, 18 Dec 2020 13:10:27 +0100 Message-Id: <20201218121041.299788-4-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Peter Lieven nfs_client_open returns the file size in sectors. This effectively makes it impossible to open files larger than 1TB. Fixes: c22a03454544c2a08f1107c5cc8481a5574533d5 Cc: qemu-stable@nongnu.org Signed-off-by: Peter Lieven Message-Id: <20201209121735.16437-1-pl@kamp.de> Reviewed-by: Stefano Garzarella Signed-off-by: Kevin Wolf --- block/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nfs.c b/block/nfs.c index 77905f516d..8c1968bb41 100644 --- a/block/nfs.c +++ b/block/nfs.c @@ -592,7 +592,7 @@ static int64_t nfs_client_open_qdict(NFSClient *client,= QDict *options, int flags, int open_flags, Error **er= rp) { BlockdevOptionsNfs *opts; - int ret; + int64_t ret; =20 opts =3D nfs_options_qdict_to_qapi(options, errp); if (opts =3D=3D NULL) { --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608293549; cv=none; d=zohomail.com; s=zohoarc; b=XJU3nnOqj7S5pR4DaXRKi38HZO7djQUlKLAVbR/U4JoarwQXlZbe6yzp5kc5TaUxA0y8uJy2w/AuvheFK9vZ/Yv2KmTOl99SfTGRUNwV+8I24KV5lGnWa6lyaomwMFby/PDbSDPEbUuWbzBlyqYidIWwAzq8oQfQDid45Jv+KKA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608293549; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=m7YjE6Nqq0vyEEWPBLNf1cU5hU8TszmJo3sETgWuWbI=; b=kUP10n8qPrI9f72E8/s0qQt+SKFf4A9xJoq6MJS6hspeRXhN61xrK4cFCmCBDXX33FsUlvH0iWswhKmUWOW3d9mRFNtwledqDRg0p/wiZUhqd2+uFyKv4outX44uccrbabWN1Y/w2Zyy1V8+jb12YmvICAhpqquYaGgZQsdiqDw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608293549245172.89488249233784; Fri, 18 Dec 2020 04:12:29 -0800 (PST) Received: from localhost ([::1]:46438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEcU-0003Tv-4J for importer@patchew.org; Fri, 18 Dec 2020 07:12:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38180) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEb4-0001dx-Qp for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:10:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34580) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEb1-0001bL-LQ for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:10:58 -0500 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-589-0DXF6W5dODeGA4WLq0xYLg-1; Fri, 18 Dec 2020 07:10:53 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9EC18049C3; Fri, 18 Dec 2020 12:10:51 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id B1B3E60C47; Fri, 18 Dec 2020 12:10:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293455; 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: in-reply-to:in-reply-to:references:references; bh=m7YjE6Nqq0vyEEWPBLNf1cU5hU8TszmJo3sETgWuWbI=; b=jNdJTywmwzSUJxfQefP89dpdscis2JiSPvwOrpePaicQ4QtSkR7XVFWIdipF3yvH6WC1hW pcGWJyMjIyKWmkOnYATsyKK5PsIt9HoL14FKRcyMRcEVPpW8X63+y18il6Vo6FiVLeGCCU NbCaf0Y5l2LAofSak4waPkg7a870rFE= X-MC-Unique: 0DXF6W5dODeGA4WLq0xYLg-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 04/17] docs: generate qemu-storage-daemon-qmp-ref(7) man page Date: Fri, 18 Dec 2020 13:10:28 +0100 Message-Id: <20201218121041.299788-5-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Although individual qemu-storage-daemon QMP commands are identical to QEMU QMP commands, qemu-storage-daemon only supports a subset of QEMU's QMP commands. Generate a manual page of just the commands supported by qemu-storage-daemon so that users know exactly what is available in qemu-storage-daemon. Add an h1 heading in storage-daemon/qapi/qapi-schema.json so that block-core.json is at the h2 heading level. Signed-off-by: Stefan Hajnoczi Message-Id: <20201209103802.350848-2-stefanha@redhat.com> Signed-off-by: Kevin Wolf --- docs/interop/conf.py | 2 ++ docs/interop/index.rst | 1 + docs/interop/qemu-storage-daemon-qmp-ref.rst | 13 +++++++++++++ docs/meson.build | 1 + storage-daemon/qapi/qapi-schema.json | 3 +++ 5 files changed, 20 insertions(+) create mode 100644 docs/interop/qemu-storage-daemon-qmp-ref.rst diff --git a/docs/interop/conf.py b/docs/interop/conf.py index 2634ca3410..f4370aaa13 100644 --- a/docs/interop/conf.py +++ b/docs/interop/conf.py @@ -23,4 +23,6 @@ man_pages =3D [ [], 7), ('qemu-qmp-ref', 'qemu-qmp-ref', 'QEMU QMP Reference Manual', [], 7), + ('qemu-storage-daemon-qmp-ref', 'qemu-storage-daemon-qmp-ref', + 'QEMU Storage Daemon QMP Reference Manual', [], 7), ] diff --git a/docs/interop/index.rst b/docs/interop/index.rst index cd78d679d8..95d56495f6 100644 --- a/docs/interop/index.rst +++ b/docs/interop/index.rst @@ -20,6 +20,7 @@ Contents: qemu-ga qemu-ga-ref qemu-qmp-ref + qemu-storage-daemon-qmp-ref vhost-user vhost-user-gpu vhost-vdpa diff --git a/docs/interop/qemu-storage-daemon-qmp-ref.rst b/docs/interop/qe= mu-storage-daemon-qmp-ref.rst new file mode 100644 index 0000000000..caf9dad23a --- /dev/null +++ b/docs/interop/qemu-storage-daemon-qmp-ref.rst @@ -0,0 +1,13 @@ +QEMU Storage Daemon QMP Reference Manual +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +.. + TODO: the old Texinfo manual used to note that this manual + is GPL-v2-or-later. We should make that reader-visible + both here and in our Sphinx manuals more generally. + +.. + TODO: display the QEMU version, both here and in our Sphinx manuals + more generally. + +.. qapi-doc:: storage-daemon/qapi/qapi-schema.json diff --git a/docs/meson.build b/docs/meson.build index bb8fe4c9e4..71641b4fe0 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -56,6 +56,7 @@ if build_docs 'qemu-ga.8': (have_tools ? 'man8' : ''), 'qemu-ga-ref.7': 'man7', 'qemu-qmp-ref.7': 'man7', + 'qemu-storage-daemon-qmp-ref.7': (have_tools ? 'man7' : ''), }, 'tools': { 'qemu-img.1': (have_tools ? 'man1' : ''), diff --git a/storage-daemon/qapi/qapi-schema.json b/storage-daemon/qapi/qap= i-schema.json index c6ad5ae1e3..28117c3aac 100644 --- a/storage-daemon/qapi/qapi-schema.json +++ b/storage-daemon/qapi/qapi-schema.json @@ -15,6 +15,9 @@ =20 { 'include': '../../qapi/pragma.json' } =20 +## +# =3D Block devices +## { 'include': '../../qapi/block-core.json' } { 'include': '../../qapi/block-export.json' } { 'include': '../../qapi/char.json' } --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608293779; cv=none; d=zohomail.com; s=zohoarc; b=PQfjYLk5jZOreyszvHjqbUtYKpF8aTrDDGr3nG9ArbxVWqmL3QYG2Ho5vQQXf1nV1U6qtFRbVO72zGuFCL2pIL5K3qDn5wJbotAkd7NFnCs+PASROBFtOj7aC/5lxMcdxSq9m5nffkSwsY48802RXE4mfiUrUT5ZPSHZdB0BTHo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608293779; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=u/b18CKbvndxJjxomILQZwK1m781skeruMSUzJF/HYQ=; b=Wp9fgNtFClQtpjmKj+PJ7X+QCod89l1YD65rb6eDF8D9BPbVQPDrKWBu19VghRVd4RelbVPVdAh9QV7DMWvHnBanBfu5b0BFdvPBlmhjlwZhxSRw98WaE//gfakoXoNzXtnk5iXXWNnW1+t0m+ywBufNLgG6Ergl4Ggf142emyc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608293779983325.07501207978316; Fri, 18 Dec 2020 04:16:19 -0800 (PST) Received: from localhost ([::1]:55354 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEgE-0007CS-NH for importer@patchew.org; Fri, 18 Dec 2020 07:16:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEb6-0001hd-JC for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49496) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEb2-0001cI-Nd for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:00 -0500 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-63-ELgbNRBeMvuz2mu-0KKfFw-1; Fri, 18 Dec 2020 07:10:54 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EAC391005504; Fri, 18 Dec 2020 12:10:52 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3C1F60C15; Fri, 18 Dec 2020 12:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293456; 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: in-reply-to:in-reply-to:references:references; bh=u/b18CKbvndxJjxomILQZwK1m781skeruMSUzJF/HYQ=; b=HQbIPADybCTgttJ/aMy1Ak7F4vLSzAJNrn3YEeGrpBWMUwEIazEI6sSjQNX8V7/MyBAuYA 1RNOILNoSssUbEf7oTjGudFSYVQP2VUwrdal4o7vIh46azvvpRCA9Exq2aAebWtp+nVgms QULO1jRI5xc+qCdEv49098GlUaFCUQQ= X-MC-Unique: ELgbNRBeMvuz2mu-0KKfFw-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 05/17] docs: add qemu-storage-daemon(1) man page Date: Fri, 18 Dec 2020 13:10:29 +0100 Message-Id: <20201218121041.299788-6-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Stefan Hajnoczi Document the qemu-storage-daemon tool. Most of the command-line options are identical to their QEMU counterparts. Perhaps Sphinx hxtool integration could be extended to extract documentation for individual command-line options so they can be shared. For now the qemu-storage-daemon simply refers to the qemu(1) man page where the command-line options are identical. Signed-off-by: Stefan Hajnoczi Message-Id: <20201209103802.350848-3-stefanha@redhat.com> Signed-off-by: Kevin Wolf --- docs/tools/conf.py | 2 + docs/tools/index.rst | 1 + docs/tools/qemu-storage-daemon.rst | 148 +++++++++++++++++++++++++++++ 3 files changed, 151 insertions(+) create mode 100644 docs/tools/qemu-storage-daemon.rst diff --git a/docs/tools/conf.py b/docs/tools/conf.py index 4760d36ff2..7072d99324 100644 --- a/docs/tools/conf.py +++ b/docs/tools/conf.py @@ -20,6 +20,8 @@ html_theme_options['description'] =3D \ man_pages =3D [ ('qemu-img', 'qemu-img', u'QEMU disk image utility', ['Fabrice Bellard'], 1), + ('qemu-storage-daemon', 'qemu-storage-daemon', u'QEMU storage daemon', + [], 1), ('qemu-nbd', 'qemu-nbd', u'QEMU Disk Network Block Device Server', ['Anthony Liguori '], 8), ('qemu-pr-helper', 'qemu-pr-helper', 'QEMU persistent reservation help= er', diff --git a/docs/tools/index.rst b/docs/tools/index.rst index b99f86c7c6..3a5829c17a 100644 --- a/docs/tools/index.rst +++ b/docs/tools/index.rst @@ -11,6 +11,7 @@ Contents: :maxdepth: 2 =20 qemu-img + qemu-storage-daemon qemu-nbd qemu-pr-helper qemu-trace-stap diff --git a/docs/tools/qemu-storage-daemon.rst b/docs/tools/qemu-storage-d= aemon.rst new file mode 100644 index 0000000000..f63627eaf6 --- /dev/null +++ b/docs/tools/qemu-storage-daemon.rst @@ -0,0 +1,148 @@ +QEMU Storage Daemon +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Synopsis +-------- + +**qemu-storage-daemon** [options] + +Description +----------- + +qemu-storage-daemon provides disk image functionality from QEMU, qemu-img,= and +qemu-nbd in a long-running process controlled via QMP commands without run= ning +a virtual machine. It can export disk images, run block job operations, and +perform other disk-related operations. The daemon is controlled via a QMP +monitor and initial configuration from the command-line. + +The daemon offers the following subset of QEMU features: + +* Block nodes +* Block jobs +* Block exports +* Throttle groups +* Character devices +* Crypto and secrets +* QMP +* IOThreads + +Commands can be sent over a QEMU Monitor Protocol (QMP) connection. See the +:manpage:`qemu-storage-daemon-qmp-ref(7)` manual page for a description of= the +commands. + +The daemon runs until it is stopped using the ``quit`` QMP command or +SIGINT/SIGHUP/SIGTERM. + +**Warning:** Never modify images in use by a running virtual machine or any +other process; this may destroy the image. Also, be aware that querying an +image that is being modified by another process may encounter inconsistent +state. + +Options +------- + +.. program:: qemu-storage-daemon + +Standard options: + +.. option:: -h, --help + + Display help and exit + +.. option:: -V, --version + + Display version information and exit + +.. option:: -T, --trace [[enable=3D]PATTERN][,events=3DFILE][,file=3DFILE] + + .. include:: ../qemu-option-trace.rst.inc + +.. option:: --blockdev BLOCKDEVDEF + + is a block node definition. See the :manpage:`qemu(1)` manual page for a + description of block node properties and the :manpage:`qemu-block-driver= s(7)` + manual page for a description of driver-specific parameters. + +.. option:: --chardev CHARDEVDEF + + is a character device definition. See the :manpage:`qemu(1)` manual page= for + a description of character device properties. A common character device + definition configures a UNIX domain socket:: + + --chardev socket,id=3Dchar1,path=3D/tmp/qmp.sock,server,nowait + +.. option:: --export [type=3D]nbd,id=3D,node-name=3D[,name= =3D][,writable=3Don|off][,bitmap=3D] + --export [type=3D]vhost-user-blk,id=3D,node-name=3D,addr.= type=3Dunix,addr.path=3D[,writable=3Don|off][,logical-block-si= ze=3D][,num-queues=3D] + --export [type=3D]vhost-user-blk,id=3D,node-name=3D,addr.= type=3Dfd,addr.str=3D[,writable=3Don|off][,logical-block-size=3D][,num-queues=3D] + + is a block export definition. ``node-name`` is the block node that shoul= d be + exported. ``writable`` determines whether or not the export allows write + requests for modifying data (the default is off). + + The ``nbd`` export type requires ``--nbd-server`` (see below). ``name`` = is + the NBD export name. ``bitmap`` is the name of a dirty bitmap reachable = from + the block node, so the NBD client can use NBD_OPT_SET_META_CONTEXT with = the + metadata context name "qemu:dirty-bitmap:BITMAP" to inspect the bitmap. + + The ``vhost-user-blk`` export type takes a vhost-user socket address on = which + it accept incoming connections. Both + ``addr.type=3Dunix,addr.path=3D`` for UNIX domain sockets a= nd + ``addr.type=3Dfd,addr.str=3D`` for file descriptor passing are suppo= rted. + ``logical-block-size`` sets the logical block size in bytes (the default= is + 512). ``num-queues`` sets the number of virtqueues (the default is 1). + +.. option:: --monitor MONITORDEF + + is a QMP monitor definition. See the :manpage:`qemu(1)` manual page for + a description of QMP monitor properties. A common QMP monitor definition + configures a monitor on character device ``char1``:: + + --monitor chardev=3Dchar1 + +.. option:: --nbd-server addr.type=3Dinet,addr.host=3D,addr.port=3D<= port>[,tls-creds=3D][,tls-authz=3D][,max-connections=3D] + --nbd-server addr.type=3Dunix,addr.path=3D[,tls-creds=3D][,tls= -authz=3D][,max-connections=3D] + + is a server for NBD exports. Both TCP and UNIX domain sockets are suppor= ted. + TLS encryption can be configured using ``--object`` tls-creds-* and auth= z-* + secrets (see below). + + To configure an NBD server on UNIX domain socket path ``/tmp/nbd.sock``:: + + --nbd-server addr.type=3Dunix,addr.path=3D/tmp/nbd.sock + +.. option:: --object help + --object ,help + --object [,=3D...] + + is a QEMU user creatable object definition. List object types with ``hel= p``. + List object properties with ``,help``. See the :manpage:`qemu(1)` + manual page for a description of the object properties. + +Examples +-------- +Launch the daemon with QMP monitor socket ``qmp.sock`` so clients can exec= ute +QMP commands:: + + $ qemu-storage-daemon \ + --chardev socket,path=3Dqmp.sock,server,nowait,id=3Dchar1 \ + --monitor chardev=3Dchar1 + +Export raw image file ``disk.img`` over NBD UNIX domain socket ``nbd.sock`= `:: + + $ qemu-storage-daemon \ + --blockdev driver=3Dfile,node-name=3Ddisk,filename=3Ddisk.img \ + --nbd-server addr.type=3Dunix,addr.path=3Dnbd.sock \ + --export type=3Dnbd,id=3Dexport,node-name=3Ddisk,writable=3Don + +Export a qcow2 image file ``disk.qcow2`` as a vhosts-user-blk device over = UNIX +domain socket ``vhost-user-blk.sock``:: + + $ qemu-storage-daemon \ + --blockdev driver=3Dfile,node-name=3Dfile,filename=3Ddisk.qcow2 \ + --blockdev driver=3Dqcow2,node-name=3Dqcow2,file=3Dfile \ + --export type=3Dvhost-user-blk,id=3Dexport,addr.type=3Dunix,addr.pat= h=3Dvhost-user-blk.sock,node-name=3Dqcow2 + +See also +-------- + +:manpage:`qemu(1)`, :manpage:`qemu-block-drivers(7)`, :manpage:`qemu-stora= ge-daemon-qmp-ref(7)` --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608293560; cv=none; d=zohomail.com; s=zohoarc; b=IK4HTez8zTNqUo11dmtXUCqSNEhAIFF7faeFIwINrgOykl/r011c8v8X+KQKfHCBsBZ3Q5++5xAkUth9eRAdX41SRyvVSBWAY9P0EVP+nPIjlJ6sbDt6vLXEwvZRaTZqsodpCYfs5a25gBhooB8Z8D4TErWDHaiQSosR06E3ufw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608293560; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9bXSjMFhnK3KRuZwSkGmvSVGzZQJgcjXl2wklsYBL7U=; b=P5zRKRsA6M0JSBc+3EzV9l8zJ/P+As8yhe0NNpJwOGBfxB63GnnjKLy8JbZuX5RSQcpjEtMuIbk/wpYUDJGqIpmSS6fdlLxTmcFpBd6JOsIz84YZUfWWhE4/eLtf34ehpP6Ms3691XOIArpN2zqRdoNxTgM+LxPu9LhwEiiEayc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608293560103463.6077041737477; Fri, 18 Dec 2020 04:12:40 -0800 (PST) Received: from localhost ([::1]:47002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEch-0003hV-0P for importer@patchew.org; Fri, 18 Dec 2020 07:12:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38392) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbB-0001qg-MW for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:05 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:50036) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEb6-0001fH-6u for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:05 -0500 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-238-Nnp-ZrYENk2z2zhJCZSvOg-1; Fri, 18 Dec 2020 07:10:55 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39009CE642; Fri, 18 Dec 2020 12:10:54 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FA8F60C15; Fri, 18 Dec 2020 12:10:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293459; 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: in-reply-to:in-reply-to:references:references; bh=9bXSjMFhnK3KRuZwSkGmvSVGzZQJgcjXl2wklsYBL7U=; b=F7vKDOIoRFV5+j3K4juRkSlnEulkBnSrsEzEgXL2SZ1JEK2QDNb8Isd1QBKbmLKNcM1Oy2 8pQCQ9UjkkQmGzDnkuMEAzRMwF78y7kbjh2YXUrbqDlBSFhb8/aTcMwbYBQEN+wT/yRV2K op++ERdoHjc4ceyd+IrRwhBpIRTAAJE= X-MC-Unique: Nnp-ZrYENk2z2zhJCZSvOg-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 06/17] MAINTAINERS: add Kevin Wolf as storage daemon maintainer Date: Fri, 18 Dec 2020 13:10:30 +0100 Message-Id: <20201218121041.299788-7-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" 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=63.128.21.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Stefan Hajnoczi The MAINTAINERS file was not updated when the storage daemon was merged. Signed-off-by: Stefan Hajnoczi Acked-by: Kevin Wolf Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20201209103802.350848-4-stefanha@redhat.com> Signed-off-by: Kevin Wolf --- MAINTAINERS | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 1e7c8f0488..0e139d9612 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2165,6 +2165,15 @@ F: qobject/block-qdict.c F: tests/check-block-qdict.c T: git https://repo.or.cz/qemu/kevin.git block =20 +Storage daemon +M: Kevin Wolf +L: qemu-block@nongnu.org +S: Supported +F: storage-daemon/ +F: docs/interop/qemu-storage-daemon-qmp-ref.rst +F: docs/tools/qemu-storage-daemon.rst +T: git https://repo.or.cz/qemu/kevin.git block + Block I/O path M: Stefan Hajnoczi M: Fam Zheng --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608293970; cv=none; d=zohomail.com; s=zohoarc; b=ehHRSLLBolgTWLPYC3x/VHibuv2uhr2g7Aj1kBtnj/xzRFgUFQ1ANHOocbRA8BnPVmedc++gFCk1vhgt37LEjHQ1rb4QqyspL/zvDmnKoF5jspU1LJBzdppYY26SM9nDtVNmjLG6nzl5dnLMpxqv2PQXTKJPLW2hkqD1CIeaPEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608293970; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=S7tOIEeirGXlxkGsf9Qlnd3pkP40MD7zbMOvzjGi6Nc=; b=VFIDewHXBtdJN0B4ejnkq3ZgtLiLEPHQWdiFsj+Z1YSbB1TCscF8/IXGbnhTNZ9+IzXjrYPXB+gcRqOV0dGSaB8iBAJPFuPGUYL5mYG2ggXR2CEBs4UjlUf9g6IGhZLy3Aweo9Ky0rPISXj/j8eq0ZTqB/ruSF5vZeJD8ZFB5QI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608293970978829.1369995014788; Fri, 18 Dec 2020 04:19:30 -0800 (PST) Received: from localhost ([::1]:35412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEjJ-0002R0-Om for importer@patchew.org; Fri, 18 Dec 2020 07:19:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38350) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEb9-0001n4-Pr for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33805) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEb5-0001ee-Q4 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:03 -0500 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-131-L0vZoJkMMAi6hu0zrTHA4w-1; Fri, 18 Dec 2020 07:10:56 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 976C5CE646; Fri, 18 Dec 2020 12:10:55 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8332260C15; Fri, 18 Dec 2020 12:10:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293458; 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: in-reply-to:in-reply-to:references:references; bh=S7tOIEeirGXlxkGsf9Qlnd3pkP40MD7zbMOvzjGi6Nc=; b=MIQgXE5PECRcr8wGj1TcKp2/S+52UeVuPcd7MSzjQqEx3Vp/8IYYc7f2tIsej1zU6q7eub qyxIjLVhhkvK1k+E5jsJ/maDyhkMlKL8BMjS9/S2Vr7M2iUyCdpXDr96k9dUHoFJP/XzHr 6ClUehvy3KzMzwkFyoEA1ohGp4Y5/xU= X-MC-Unique: L0vZoJkMMAi6hu0zrTHA4w-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 07/17] iotests: make _filter_qom_path more strict Date: Fri, 18 Dec 2020 13:10:31 +0100 Message-Id: <20201218121041.299788-8-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy According to original commit, that added this filter (627f607e3dddb2), the problematic thing in qom path is device[NUMBER], not the whole path. Seems that tracking the other parts of the path in iotest output is not bad. Let's make _filter_qom_path stricter. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20201216095205.526235-2-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/186.out | 56 ++++++++++++++++---------------- tests/qemu-iotests/common.filter | 2 +- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tests/qemu-iotests/186.out b/tests/qemu-iotests/186.out index 5b3504042a..01530040e5 100644 --- a/tests/qemu-iotests/186.out +++ b/tests/qemu-iotests/186.out @@ -7,7 +7,7 @@ Testing: -device floppy QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block /machine/peripheral-anon/device[1]: [not inserted] - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed (qemu) quit =20 @@ -23,7 +23,7 @@ Testing: -device ide-cd QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block /machine/peripheral-anon/device[1]: [not inserted] - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed (qemu) quit =20 @@ -39,7 +39,7 @@ Testing: -device scsi-cd QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block /machine/peripheral-anon/device[1]: [not inserted] - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed (qemu) quit =20 @@ -58,7 +58,7 @@ Testing: -blockdev driver=3Dnull-co,read-zeroes=3Don,node= -name=3Dnull -device ide-hd,d QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: json:{"read-zeroes": true, "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Cache mode: writeback (qemu) quit =20 @@ -74,7 +74,7 @@ Testing: -blockdev driver=3Dnull-co,read-zeroes=3Don,node= -name=3Dnull -device scsi-hd, QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: json:{"read-zeroes": true, "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Cache mode: writeback (qemu) quit =20 @@ -90,7 +90,7 @@ Testing: -blockdev driver=3Dnull-co,read-zeroes=3Don,node= -name=3Dnull -device virtio-b QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: json:{"read-zeroes": true, "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N]/virtio-backend Cache mode: writeback (qemu) quit =20 @@ -98,7 +98,7 @@ Testing: -blockdev driver=3Dnull-co,read-zeroes=3Don,node= -name=3Dnull -device virtio-b QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: json:{"read-zeroes": true, "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral/qdev_id/virtio-backend Cache mode: writeback (qemu) quit =20 @@ -106,7 +106,7 @@ Testing: -blockdev driver=3Dnull-co,read-zeroes=3Don,no= de-name=3Dnull -device floppy,d QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: json:{"read-zeroes": true, "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -124,7 +124,7 @@ Testing: -blockdev driver=3Dnull-co,read-zeroes=3Don,no= de-name=3Dnull -device ide-cd,d QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: json:{"read-zeroes": true, "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -142,7 +142,7 @@ Testing: -blockdev driver=3Dnull-co,read-zeroes=3Don,no= de-name=3Dnull -device scsi-cd, QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block null: json:{"read-zeroes": true, "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -191,7 +191,7 @@ none0 (null): json:{"read-zeroes": "on", "driver": "nul= l-co"} (null-co) Cache mode: writeback =20 null: json:{"read-zeroes": "on", "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral/qdev_id/virtio-backend Cache mode: writeback (qemu) quit =20 @@ -241,7 +241,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,read-zeroes= =3Don,node-name=3Dnull -device ide QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): json:{"read-zeroes": "on", "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Cache mode: writeback (qemu) quit =20 @@ -257,7 +257,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,read-zeroes= =3Don,node-name=3Dnull -device scs QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): json:{"read-zeroes": "on", "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Cache mode: writeback (qemu) quit =20 @@ -273,7 +273,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,read-zeroes= =3Don,node-name=3Dnull -device vir QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): json:{"read-zeroes": "on", "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N]/virtio-backend Cache mode: writeback (qemu) quit =20 @@ -281,7 +281,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,read-zeroes= =3Don,node-name=3Dnull -device vir QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): json:{"read-zeroes": "on", "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral/qdev_id/virtio-backend Cache mode: writeback (qemu) quit =20 @@ -289,7 +289,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,read-zeroes= =3Don,node-name=3Dnull -device flo QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): json:{"read-zeroes": "on", "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -307,7 +307,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,read-zeroes= =3Don,node-name=3Dnull -device ide QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): json:{"read-zeroes": "on", "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -325,7 +325,7 @@ Testing: -drive if=3Dnone,driver=3Dnull-co,read-zeroes= =3Don,node-name=3Dnull -device scs QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0 (null): json:{"read-zeroes": "on", "driver": "null-co"} (null-co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -353,7 +353,7 @@ Testing: -drive if=3Dnone -device floppy,drive=3Dnone0 QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0: [not inserted] - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed (qemu) quit =20 @@ -369,7 +369,7 @@ Testing: -drive if=3Dnone -device ide-cd,drive=3Dnone0 QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0: [not inserted] - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed (qemu) quit =20 @@ -385,7 +385,7 @@ Testing: -drive if=3Dnone -device scsi-cd,drive=3Dnone0 QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block none0: [not inserted] - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed (qemu) quit =20 @@ -404,7 +404,7 @@ Testing: -drive if=3Dfloppy QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block floppy0: [not inserted] - Attached to: PATH + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed (qemu) quit =20 @@ -412,7 +412,7 @@ Testing: -drive if=3Dfloppy,driver=3Dnull-co,read-zeroe= s=3Don QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block floppy0 (NODE_NAME): json:{"read-zeroes": "on", "driver": "null-co"} (null= -co) - Attached to: PATH + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -421,7 +421,7 @@ Testing: -drive if=3Dide,driver=3Dnull-co,read-zeroes= =3Don QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block ide0-hd0 (NODE_NAME): json:{"read-zeroes": "on", "driver": "null-co"} (nul= l-co) - Attached to: PATH + Attached to: /machine/unattached/device[N] Cache mode: writeback (qemu) quit =20 @@ -429,7 +429,7 @@ Testing: -drive if=3Dide,media=3Dcdrom QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block ide0-cd0: [not inserted] - Attached to: PATH + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed (qemu) quit =20 @@ -437,7 +437,7 @@ Testing: -drive if=3Dide,driver=3Dnull-co,read-zeroes= =3Don,media=3Dcdrom QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block ide0-cd0 (NODE_NAME): json:{"read-zeroes": "on", "driver": "null-co"} (nul= l-co, read-only) - Attached to: PATH + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback (qemu) quit @@ -446,7 +446,7 @@ Testing: -drive if=3Dvirtio,driver=3Dnull-co,read-zeroe= s=3Don QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block virtio0 (NODE_NAME): json:{"read-zeroes": "on", "driver": "null-co"} (null= -co) - Attached to: PATH + Attached to: /machine/peripheral-anon/device[N]/virtio-backend Cache mode: writeback (qemu) quit =20 @@ -454,7 +454,7 @@ Testing: -drive if=3Dpflash,driver=3Dnull-co,read-zeroe= s=3Don,size=3D1M QEMU X.Y.Z monitor - type 'help' for more information (qemu) info block pflash0 (NODE_NAME): json:{"read-zeroes": "on", "driver": "null-co", "size= ": "1M"} (null-co) - Attached to: PATH + Attached to: /machine/system.flash0 Cache mode: writeback (qemu) quit =20 diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.f= ilter index 172ea5752e..268b749e2f 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter @@ -37,7 +37,7 @@ _filter_generated_node_ids() =20 _filter_qom_path() { - $SED -e 's#\(Attached to: *\) /.*#\1 PATH#' + $SED -e '/Attached to:/s/\device[[0-9]\+\]/device[N]/g' } =20 # replace occurrences of the actual TEST_DIR value with TEST_DIR --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608293797; cv=none; d=zohomail.com; s=zohoarc; b=RsgBgTp+ciwq0PUI82QWJLY4UdKmcKB4glzboPzej9YNhqnSroJAnKloKPaCzy8UTtGBjb/9Gcpm2yanhFCfapAqq9W0fiPUdysDKFqZmmN6dV3SMNnaro+pGcO8pD+DpSTKBXUDWb/b1RRyWMpPTZISRGqSoJ8zStPRtewUQNQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608293797; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Muf0TDRCzmdZoE/3AMBHwfHe2irMWfqcsEU5yXnhwx8=; b=K7Qi8l59BqZVFmA0DyLQqnuw3JC+vZDeUN/23Ek7Yl9uTG7RvYTfL3osvprBDX03gu5fnZoNlugXCwXSbmC9yoxYM3UFQlHIxXeZMj40fUGX6vxxWn+LjPxeW0oa2GhCRwgN/hQgmPj8pifV2BsCjBa512PBIVvaCvMBNflLkiY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 160829379763829.386139201624587; Fri, 18 Dec 2020 04:16:37 -0800 (PST) Received: from localhost ([::1]:56356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEgW-0007eS-E3 for importer@patchew.org; Fri, 18 Dec 2020 07:16:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbF-0001z3-CH for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34768) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEb6-0001g3-SZ for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:09 -0500 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-390-NhG8FTRJMCKQYyN1BIXdYA-1; Fri, 18 Dec 2020 07:10:58 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 130E6107ACE4; Fri, 18 Dec 2020 12:10:57 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id E206A60C15; Fri, 18 Dec 2020 12:10:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293460; 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: in-reply-to:in-reply-to:references:references; bh=Muf0TDRCzmdZoE/3AMBHwfHe2irMWfqcsEU5yXnhwx8=; b=bPyc5ys0Bz8Y/dbGHRpI1xqbpYDi4kr6X9NWG+CtRkwbQACCzzq2GxWxoFEk2FZNJAdIXL uAATNb19stCHYavUUHYgRg5I1zgPVy1fF2fpiCNxr4W/tShjmK8pPFEshmHd2PVulfxDLY QvGVN+smKHd1cag86/hi1P5KsvF26l8= X-MC-Unique: NhG8FTRJMCKQYyN1BIXdYA-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 08/17] iotests:172: use _filter_qom_path Date: Fri, 18 Dec 2020 13:10:32 +0100 Message-Id: <20201218121041.299788-9-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Vladimir Sementsov-Ogievskiy device[NUMBER] thing in QOM path is not stable and tracking it during code modifications is not fun. Let's filter it like it's already done in iotest 186. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20201216095205.526235-3-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf --- tests/qemu-iotests/172 | 2 +- tests/qemu-iotests/172.out | 152 ++++++++++++++++++------------------- 2 files changed, 77 insertions(+), 77 deletions(-) diff --git a/tests/qemu-iotests/172 b/tests/qemu-iotests/172 index 3abfa72948..b45782e8db 100755 --- a/tests/qemu-iotests/172 +++ b/tests/qemu-iotests/172 @@ -73,7 +73,7 @@ check_floppy_qtree() (QEMU_OPTIONS=3D"" do_run_qemu "$@" | _filter_testdir |_filter_generated_node_ids | _filter_hmp | sed -ne '/^ dev: isa-fdc/,/^ dev:/{x;p};/^[a-z][= ^ ]* (NODE_NAME):* /,/^(qemu)$/{p}') 2>&1 | - _filter_win32 | _filter_qemu + _filter_win32 | _filter_qemu | _filter_qom_path } =20 check_cache_mode() diff --git a/tests/qemu-iotests/172.out b/tests/qemu-iotests/172.out index cca2894af0..2cd4a8fd83 100644 --- a/tests/qemu-iotests/172.out +++ b/tests/qemu-iotests/172.out @@ -63,12 +63,12 @@ Testing: -fda TEST_DIR/t.qcow2 share-rw =3D false drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -114,16 +114,16 @@ Testing: -fdb TEST_DIR/t.qcow2 share-rw =3D false drive-type =3D "288" floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[16] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[23] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 floppy0: [not inserted] - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -169,17 +169,17 @@ Testing: -fda TEST_DIR/t.qcow2 -fdb TEST_DIR/t.qcow2.2 share-rw =3D false drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 floppy1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/unattached/device[16] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[23] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -255,12 +255,12 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 share-rw =3D false drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -306,16 +306,16 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2,i= ndex=3D1 share-rw =3D false drive-type =3D "288" floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[16] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[23] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 floppy0: [not inserted] - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -361,17 +361,17 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2 -= drive if=3Dfloppy,file=3DTEST_DIR/t share-rw =3D false drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 floppy1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/unattached/device[16] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[23] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -411,12 +411,12 @@ Use -device floppy,unit=3D0,drive=3D... instead. share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -453,12 +453,12 @@ Use -device floppy,unit=3D1,drive=3D... instead. share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -508,17 +508,17 @@ Use -device floppy,unit=3D1,drive=3D... instead. share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/unattached/device[16] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[23] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -556,12 +556,12 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0 share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[21] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -596,12 +596,12 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -de= vice floppy,drive=3Dnone0,unit=3D1 share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[21] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -647,17 +647,17 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -dr= ive if=3Dnone,file=3DTEST_DIR/t.qco share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[1] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[21] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -708,17 +708,17 @@ Use -device floppy,unit=3D1,drive=3D... instead. share-rw =3D false drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[16] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[23] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -766,17 +766,17 @@ Use -device floppy,unit=3D0,drive=3D... instead. share-rw =3D false drive-type =3D "144" floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[16] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[23] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -838,17 +838,17 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=3Dnone,file= =3DTEST_DIR/t.qcow2.2 -device fl share-rw =3D false drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -894,17 +894,17 @@ Testing: -fda TEST_DIR/t.qcow2 -drive if=3Dnone,file= =3DTEST_DIR/t.qcow2.2 -device fl share-rw =3D false drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -950,17 +950,17 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=3Dnone,file= =3DTEST_DIR/t.qcow2.2 -device fl share-rw =3D false drive-type =3D "144" floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1006,17 +1006,17 @@ Testing: -fdb TEST_DIR/t.qcow2 -drive if=3Dnone,fil= e=3DTEST_DIR/t.qcow2.2 -device fl share-rw =3D false drive-type =3D "144" floppy1 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1071,17 +1071,17 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2= -drive if=3Dnone,file=3DTEST_DIR/t.q share-rw =3D false drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1127,17 +1127,17 @@ Testing: -drive if=3Dfloppy,file=3DTEST_DIR/t.qcow2= -drive if=3Dnone,file=3DTEST_DIR/t.q share-rw =3D false drive-type =3D "144" floppy0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none0 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1191,17 +1191,17 @@ Use -device floppy,unit=3D0,drive=3D... instead. share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1249,17 +1249,17 @@ Use -device floppy,unit=3D0,drive=3D... instead. share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1307,17 +1307,17 @@ Use -device floppy,unit=3D1,drive=3D... instead. share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1365,17 +1365,17 @@ Use -device floppy,unit=3D1,drive=3D... instead. share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/unattached/device[15] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 none1 (NODE_NAME): TEST_DIR/t.qcow2.2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[22] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1410,12 +1410,12 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -= global floppy.drive=3Dnone0 -device share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[21] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1603,12 +1603,12 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -= device floppy,drive=3Dnone0,drive-t share-rw =3D false drive-type =3D "120" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[21] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1643,12 +1643,12 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -= device floppy,drive=3Dnone0,drive-t share-rw =3D false drive-type =3D "288" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[21] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1686,12 +1686,12 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -= device floppy,drive=3Dnone0,logical share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[21] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] @@ -1726,12 +1726,12 @@ Testing: -drive if=3Dnone,file=3DTEST_DIR/t.qcow2 -= device floppy,drive=3Dnone0,physica share-rw =3D false drive-type =3D "144" none0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) - Attached to: /machine/peripheral-anon/device[0] + Attached to: /machine/peripheral-anon/device[N] Removable device: not locked, tray closed Cache mode: writeback =20 ide1-cd0: [not inserted] - Attached to: /machine/unattached/device[21] + Attached to: /machine/unattached/device[N] Removable device: not locked, tray closed =20 sd0: [not inserted] --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608294099; cv=none; d=zohomail.com; s=zohoarc; b=dwyGkfyXYqzSdyjCFyMP7Wg8INS222cexAZ0srrCI780wDUsjxnN16XkdLK2sCNHhfrgzsDE2Axr2wm7fkIg3tDa+evQkYS5at3sIIjran5mCKmNZ6/rNHLRchuMirSW+DY21zEj1tLPd6cAl/5YLYCJNhM+EAmoDYEsaQK4rWo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608294099; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0JcHwn3ghW6GtFPCujJbF4ZHfrin0ItMgun5PY9w4B0=; b=NBtInGoUBol1U/+iPWnwGc1K6jJtK4i4aYP65ihOD8XpduVUggavLEWpRKVhwr8ZdyrTkgeyOwzYS+Q2LB6gwFqtLgUZZV6UH4wjhRIzBCqBYXEVikAv3RHYrCYcdMPcZc7Txk4LifbndA/NxTayRVfXpODLronecb7YB5uvv04= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608294099540572.9943004309316; Fri, 18 Dec 2020 04:21:39 -0800 (PST) Received: from localhost ([::1]:44568 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqElO-0006Cy-5w for importer@patchew.org; Fri, 18 Dec 2020 07:21:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbF-0001xj-QN for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57841) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEb8-0001h6-8C for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:08 -0500 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-370-PsKnXg0SPcakET0DmsEtRw-1; Fri, 18 Dec 2020 07:10:59 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51A2A1934102; Fri, 18 Dec 2020 12:10:58 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C1E960C15; Fri, 18 Dec 2020 12:10:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293461; 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: in-reply-to:in-reply-to:references:references; bh=0JcHwn3ghW6GtFPCujJbF4ZHfrin0ItMgun5PY9w4B0=; b=EP5WeZh86+iJdvkv/IpLVJA2/3JoV0hPcT80H0xs+/ONkZIsDSfvlCrm6iTlM6qHpqyQTh jIRtPdptA/jqL0Ak0lEgaCA3i2mpEXurQb7ZmSeOucIRE5XPCOpDNl4mRF4dakFwvBIa+W xCrtnPy4LnSBJpbb8lJGwRlE9QCNIxc= X-MC-Unique: PsKnXg0SPcakET0DmsEtRw-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 09/17] block/vpc: Make vpc_open() read the full dynamic header Date: Fri, 18 Dec 2020 13:10:33 +0100 Message-Id: <20201218121041.299788-10-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Markus Armbruster The dynamic header's size is 1024 bytes. vpc_open() reads only the 512 bytes of the dynamic header into buf[]. Works, because it doesn't actually access the second half. However, a colleague told me that GCC 11 warns: ../block/vpc.c:358:51: error: array subscript 'struct VHDDynDiskHeader[= 0]' is partly outside array bounds of 'uint8_t[512]' [-Werror=3Darray-bound= s] Clean up to read the full header. Rename buf[] to dyndisk_header_buf[] while there. Signed-off-by: Markus Armbruster Message-Id: <20201217162003.1102738-2-armbru@redhat.com> Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vpc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 1ab55f9287..2fcf3f6283 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -220,7 +220,7 @@ static int vpc_open(BlockDriverState *bs, QDict *option= s, int flags, QemuOpts *opts =3D NULL; Error *local_err =3D NULL; bool use_chs; - uint8_t buf[HEADER_SIZE]; + uint8_t dyndisk_header_buf[1024]; uint32_t checksum; uint64_t computed_size; uint64_t pagetable_size; @@ -340,14 +340,14 @@ static int vpc_open(BlockDriverState *bs, QDict *opti= ons, int flags, } =20 if (disk_type =3D=3D VHD_DYNAMIC) { - ret =3D bdrv_pread(bs->file, be64_to_cpu(footer->data_offset), buf, - HEADER_SIZE); + ret =3D bdrv_pread(bs->file, be64_to_cpu(footer->data_offset), + dyndisk_header_buf, 1024); if (ret < 0) { error_setg(errp, "Error reading dynamic VHD header"); goto fail; } =20 - dyndisk_header =3D (VHDDynDiskHeader *) buf; + dyndisk_header =3D (VHDDynDiskHeader *)dyndisk_header_buf; =20 if (strncmp(dyndisk_header->magic, "cxsparse", 8)) { error_setg(errp, "Invalid header magic"); --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608294007; cv=none; d=zohomail.com; s=zohoarc; b=DeOY/kqWm688yhLXtMyCAxBq7T8bH7WeChVp9tbz3NQc36micjEIyst1EuI7SwQpwmWh3GqzkmrdiSqHQtiukgB4uT0M4EAl60/NtU03Q1Kj090U3tsqBCDgmS/ILEwOuOALwrSUGfvdjFI97DXuCZjBLZoDhPs5pZG5ll1y5Oc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608294007; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ccgIRhdO0U4GBPLzwo7rPz7AchOlZZI+p/DMXQC/T08=; b=E7pweQ53Fk/GCb3qGehQdaAONDF97o9vN06XSTQXaMdHabX5wUAqp6rLka9laR546CL/zK6RvGrFJ/fJGQZNZe4X1DSpR9EYAjmdZxIF78ql29y6t+pDn2DxVDwBAT+Uz8hTjnWQzx4n782+UXJ1Ufhd2k8tCOlMq5QOKu3m8NE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608294007281667.9221101105186; Fri, 18 Dec 2020 04:20:07 -0800 (PST) Received: from localhost ([::1]:37228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEjo-00039p-0R for importer@patchew.org; Fri, 18 Dec 2020 07:20:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38556) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbJ-0002AI-Rz for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30698) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEbA-0001ju-L2 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:13 -0500 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-490-4v1kXlpaNwSVFmv_bOqMUA-1; Fri, 18 Dec 2020 07:11:01 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 91E5B8049CA; Fri, 18 Dec 2020 12:10:59 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A5B960C15; Fri, 18 Dec 2020 12:10:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293463; 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: in-reply-to:in-reply-to:references:references; bh=ccgIRhdO0U4GBPLzwo7rPz7AchOlZZI+p/DMXQC/T08=; b=LEb+VXT5DsHzas+umZcAbyVUYtN6izpwGAg6ZSBtX3hSjLWzNc0kXv2YuOUhYBo+M8m4Ki Rwe94aIG4+1slSd2AnMOR/aOKxObAvW1ds5qZUfJIgmyVvYt+rXMGlZRe6iKSGhDmPkp85 2Kv7uC9juHBHO9B0lxOjGEgByyFHdlw= X-MC-Unique: 4v1kXlpaNwSVFmv_bOqMUA-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 10/17] block/vpc: Don't abuse the footer buffer as BAT sector buffer Date: Fri, 18 Dec 2020 13:10:34 +0100 Message-Id: <20201218121041.299788-11-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Markus Armbruster create_dynamic_disk() takes a buffer holding the footer as first argument. It writes out the footer (512 bytes), then reuses the buffer to initialize and write out the dynamic header (1024 bytes), then reuses it again to initialize and write out BAT sectors (512). Works, because the caller passes a buffer that is large enough for all three purposes. I hate that. Use a separate buffer for writing out BAT sectors. The next commit will do the same for the dynamic header. Signed-off-by: Markus Armbruster Message-Id: <20201217162003.1102738-3-armbru@redhat.com> Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vpc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 2fcf3f6283..d18ecc3da1 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -824,6 +824,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8= _t *buf, { VHDDynDiskHeader *dyndisk_header =3D (VHDDynDiskHeader *) buf; + uint8_t bat_sector[512]; size_t block_size, num_bat_entries; int i; int ret; @@ -847,9 +848,9 @@ static int create_dynamic_disk(BlockBackend *blk, uint8= _t *buf, /* Write the initial BAT */ offset =3D 3 * 512; =20 - memset(buf, 0xFF, 512); + memset(bat_sector, 0xFF, 512); for (i =3D 0; i < DIV_ROUND_UP(num_bat_entries * 4, 512); i++) { - ret =3D blk_pwrite(blk, offset, buf, 512, 0); + ret =3D blk_pwrite(blk, offset, bat_sector, 512, 0); if (ret < 0) { goto fail; } --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608294018; cv=none; d=zohomail.com; s=zohoarc; b=nPKiy3HEK+w+zEaUYAnBj9hek/9RQt8wGxI9wfX4rrEzaHAKh9qSzSs40+DvpiW5jp27liM3zBvD86LcAbvt9q8Iw//PGeUILs/HIy6O34KHnN3D2TdCzKS6IvPJJi9e7f3WX2MDLVUG+H0SG1n47Owhx4vORjrW+EntICYrpoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608294018; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5+JvrztsiNE0o4lp3dJ5S5dpQZJKrmddZv4FOjOzbjY=; b=BKpIw+yvoyhH8wL9XwjNO3F4erS/MBmW7k/5U7d9tAqf8iMfsgOEs1waq8Bhd//x1VH5TnN6JzLqXyxcElGjTMX/lsNfmhLrWuNo2E/YXJKYfI2/ogNdG03+YVe2BWN/2A1BnxYHUsgbKL5b1oJHV3xpzZEScZko/lEuyeq2Ibo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608294018432704.3558558395254; Fri, 18 Dec 2020 04:20:18 -0800 (PST) Received: from localhost ([::1]:38286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEk5-0003bG-8h for importer@patchew.org; Fri, 18 Dec 2020 07:20:17 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbL-0002DO-2V for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:40013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEbA-0001kB-MV for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:14 -0500 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-474-fHqzalPmMfqP_M4eZdsJkw-1; Fri, 18 Dec 2020 07:11:01 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CFD9B8049CD; Fri, 18 Dec 2020 12:11:00 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id D966360C15; Fri, 18 Dec 2020 12:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293463; 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: in-reply-to:in-reply-to:references:references; bh=5+JvrztsiNE0o4lp3dJ5S5dpQZJKrmddZv4FOjOzbjY=; b=isNB2x9COXyiB5gRNW7f5M4e4sUMwkzXSr3IUObFgqENdI1qg/iYoPrKQJw/6xqh/XlFB8 hBFsAp9ZJDpUIBdTN/dick5irx9eZZQiRo5gTSBYdaKGlFZ1Ru8B2C9h04iZp4mVGLVIIQ QziqYwPqhkmmupXt6qjnl/xJXFCEP44= X-MC-Unique: fHqzalPmMfqP_M4eZdsJkw-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 11/17] block/vpc: Don't abuse the footer buffer for dynamic header Date: Fri, 18 Dec 2020 13:10:35 +0100 Message-Id: <20201218121041.299788-12-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Markus Armbruster create_dynamic_disk() takes a buffer holding the footer as first argument. It writes out the footer (512 bytes), then reuses the buffer to initialize and write out the dynamic header (1024 bytes). Works, because the caller passes a buffer that is large enough for both purposes. I hate that. Use a separate buffer for the dynamic header, and adjust the caller's buffer. Signed-off-by: Markus Armbruster Message-Id: <20201217162003.1102738-4-armbru@redhat.com> Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vpc.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index d18ecc3da1..34186640ee 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -822,8 +822,9 @@ static int calculate_geometry(int64_t total_sectors, ui= nt16_t *cyls, static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf, int64_t total_sectors) { + uint8_t dyndisk_header_buf[1024]; VHDDynDiskHeader *dyndisk_header =3D - (VHDDynDiskHeader *) buf; + (VHDDynDiskHeader *)dyndisk_header_buf; uint8_t bat_sector[512]; size_t block_size, num_bat_entries; int i; @@ -858,7 +859,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8= _t *buf, } =20 /* Prepare the Dynamic Disk Header */ - memset(buf, 0, 1024); + memset(dyndisk_header_buf, 0, 1024); =20 memcpy(dyndisk_header->magic, "cxsparse", 8); =20 @@ -872,12 +873,13 @@ static int create_dynamic_disk(BlockBackend *blk, uin= t8_t *buf, dyndisk_header->block_size =3D cpu_to_be32(block_size); dyndisk_header->max_table_entries =3D cpu_to_be32(num_bat_entries); =20 - dyndisk_header->checksum =3D cpu_to_be32(vpc_checksum(buf, 1024)); + dyndisk_header->checksum =3D cpu_to_be32(vpc_checksum(dyndisk_header_b= uf, + 1024)); =20 /* Write the header */ offset =3D 512; =20 - ret =3D blk_pwrite(blk, offset, buf, 1024, 0); + ret =3D blk_pwrite(blk, offset, dyndisk_header_buf, 1024, 0); if (ret < 0) { goto fail; } @@ -972,8 +974,8 @@ static int coroutine_fn vpc_co_create(BlockdevCreateOpt= ions *opts, BlockBackend *blk =3D NULL; BlockDriverState *bs =3D NULL; =20 - uint8_t buf[1024]; - VHDFooter *footer =3D (VHDFooter *) buf; + uint8_t footer_buf[HEADER_SIZE]; + VHDFooter *footer =3D (VHDFooter *)footer_buf; uint16_t cyls =3D 0; uint8_t heads =3D 0; uint8_t secs_per_cyl =3D 0; @@ -1036,7 +1038,7 @@ static int coroutine_fn vpc_co_create(BlockdevCreateO= ptions *opts, } =20 /* Prepare the Hard Disk Footer */ - memset(buf, 0, 1024); + memset(footer_buf, 0, HEADER_SIZE); =20 memcpy(footer->creator, "conectix", 8); if (vpc_opts->force_size) { @@ -1069,15 +1071,15 @@ static int coroutine_fn vpc_co_create(BlockdevCreat= eOptions *opts, qemu_uuid_generate(&uuid); footer->uuid =3D uuid; =20 - footer->checksum =3D cpu_to_be32(vpc_checksum(buf, HEADER_SIZE)); + footer->checksum =3D cpu_to_be32(vpc_checksum(footer_buf, HEADER_SIZE)= ); =20 if (disk_type =3D=3D VHD_DYNAMIC) { - ret =3D create_dynamic_disk(blk, buf, total_sectors); + ret =3D create_dynamic_disk(blk, footer_buf, total_sectors); if (ret < 0) { error_setg(errp, "Unable to create or write VHD header"); } } else { - ret =3D create_fixed_disk(blk, buf, total_size, errp); + ret =3D create_fixed_disk(blk, footer_buf, total_size, errp); } =20 out: --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608294143; cv=none; d=zohomail.com; s=zohoarc; b=FLdFP36VCpli477hEOX22okJnkhjpsF8gpWjU2ea/jZYN6INFcd4qePYJXE1cG5I6n/CWrQaXwzRNoNdXoFbpM6DKWQMAmAtbvE8JHK+9feJ8dbDrVlIX98kiPi7VtOlho2RC7jumg0LKaM9xMbSMGElsgAMnlHV20LMtbZ6ato= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608294143; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iiyFzX1uGNZkkVncyCvvoOsJkGvjk1pt0aymIDy5anw=; b=gDfDaQguoHKdp08wnetfE4OROid2LZntXEcdHUX9CwaRG1FscJ5jC4p+u4Vou4pF9QUX98zfdU3TWKVYRhYOIeLfBq2uVGBJb3Enrzi2laTAbNo2CHux45wPSamS4jdlQygbH6bGiSITCeJoTh830JQT7eI7wVxEaMPoUhwkPUo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608294143173464.82288334232544; Fri, 18 Dec 2020 04:22:23 -0800 (PST) Received: from localhost ([::1]:46562 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEm6-00071Q-0w for importer@patchew.org; Fri, 18 Dec 2020 07:22:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbM-0002GD-8x for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:16 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:54040) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEbC-0001lU-15 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:15 -0500 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-255-br8CJ00WP1qsYvGqLgYG1g-1; Fri, 18 Dec 2020 07:11:03 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1C69C1934103; Fri, 18 Dec 2020 12:11:02 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 246BB60C15; Fri, 18 Dec 2020 12:11:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293465; 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: in-reply-to:in-reply-to:references:references; bh=iiyFzX1uGNZkkVncyCvvoOsJkGvjk1pt0aymIDy5anw=; b=RlQyhC6IEVFN1Zuj9MD6gdonk9KRSxcTD3uTjusMDO9oK2DtuyJEHEfRmWu1Hj9CQnWcwW A1l49PKLn1bNPRTGvCpCOr56KepjxmYyqodp+GW2S5/Q5BZGbyFLN//7SRZVsZw/wl0Pdt 4TY1aXwt0+zTJWqPa65TTBpjpOGs88E= X-MC-Unique: br8CJ00WP1qsYvGqLgYG1g-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 12/17] block/vpc: Make vpc_checksum() take void * Date: Fri, 18 Dec 2020 13:10:36 +0100 Message-Id: <20201218121041.299788-13-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Markus Armbruster Some of the next commits will checksum structs. Change vpc_checksum() to take void * instead of uint8_t, to save us pointless casts to uint8_t *. Signed-off-by: Markus Armbruster Message-Id: <20201217162003.1102738-5-armbru@redhat.com> Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vpc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/vpc.c b/block/vpc.c index 34186640ee..5af9837806 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -172,8 +172,9 @@ static QemuOptsList vpc_runtime_opts =3D { =20 static QemuOptsList vpc_create_opts; =20 -static uint32_t vpc_checksum(uint8_t *buf, size_t size) +static uint32_t vpc_checksum(void *p, size_t size) { + uint8_t *buf =3D p; uint32_t res =3D 0; int i; =20 --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608294231; cv=none; d=zohomail.com; s=zohoarc; b=CaayGHsay4rwZbCx3AQLLITp5x+iKbwACSpP/BAxDPALOCRHbNLQdzls+kCI1jQPkELSHj64jsAPe0SNgT955uZgcHGyh1x9ow1qvjWls2Q1cZpglfRtbVF1dX9ubiT4D/igVa5XvlZW5wBALP8kDgststG1CqczhQebviSRXbE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608294231; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YRmMeCcGQMDzkRryMyFzSGEn7nxI1791TXbxIqE+klw=; b=PDvDAjyLPusXp8bF4Ub2Nu5j7h8iOciXYGFxsqmzCB6tteSssGEflXfLcFMArqHlski9IPA42nBObs5cR1ApPcIw0ex3wMOGvwRFEUOyJZfYytVkTrZVctvlBULE5bYf8NRl+EaeygSa7PBP5zzetqoSiTmx6qwwxDDKrlsT+x4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608294231682264.70035404372254; Fri, 18 Dec 2020 04:23:51 -0800 (PST) Received: from localhost ([::1]:50802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEnW-0000NG-O2 for importer@patchew.org; Fri, 18 Dec 2020 07:23:50 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbN-0002IR-FT for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56832) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEbF-0001no-Qc for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:17 -0500 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-333-nwY_MFw3OX6VXboK7Ia89w-1; Fri, 18 Dec 2020 07:11:04 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5BECF801817; Fri, 18 Dec 2020 12:11:03 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6506960C15; Fri, 18 Dec 2020 12:11:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293469; 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: in-reply-to:in-reply-to:references:references; bh=YRmMeCcGQMDzkRryMyFzSGEn7nxI1791TXbxIqE+klw=; b=JWvfIE1wjYjes6WQMOa87osPdJfABuXbFMawDk1p5ooTJdaMwrVfliUmPesMJlVSkAIjss 5pdISn3s1m9Wzeb7awD0vDJtlvQH93eysRxYzHX6uL36Ez2KOT5cfHS38E+3PI3rIEdYSX /ZeM/JniW1dFdZExjQV71K1OJortHIM= X-MC-Unique: nwY_MFw3OX6VXboK7Ia89w-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 13/17] block/vpc: Pad VHDDynDiskHeader, replace uint8_t[] buffers Date: Fri, 18 Dec 2020 13:10:37 +0100 Message-Id: <20201218121041.299788-14-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Markus Armbruster Pad VHDDynDiskHeader as specified in the "Virtual Hard Disk Image Format Specification" version 1.0[*]. Change dynamic disk header buffers from uint8_t[1024] to VHDDynDiskHeader. Their size remains the same. The VHDDynDiskHeader * variables pointing to a VHDDynDiskHeader variable right next to it are now silly. Eliminate them. [*] http://download.microsoft.com/download/f/f/e/ffef50a5-07dd-4cf8-aaa3-44= 2c0673a029/Virtual%20Hard%20Disk%20Format%20Spec_10_18_06.doc Signed-off-by: Markus Armbruster Message-Id: <20201217162003.1102738-6-armbru@redhat.com> Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vpc.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 5af9837806..08a0f710ad 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -127,8 +127,11 @@ typedef struct vhd_dyndisk_header { uint32_t reserved; uint64_t data_offset; } parent_locator[8]; + uint8_t reserved2[256]; } QEMU_PACKED VHDDynDiskHeader; =20 +QEMU_BUILD_BUG_ON(sizeof(VHDDynDiskHeader) !=3D 1024); + typedef struct BDRVVPCState { CoMutex lock; uint8_t footer_buf[HEADER_SIZE]; @@ -217,11 +220,10 @@ static int vpc_open(BlockDriverState *bs, QDict *opti= ons, int flags, BDRVVPCState *s =3D bs->opaque; int i; VHDFooter *footer; - VHDDynDiskHeader *dyndisk_header; QemuOpts *opts =3D NULL; Error *local_err =3D NULL; bool use_chs; - uint8_t dyndisk_header_buf[1024]; + VHDDynDiskHeader dyndisk_header; uint32_t checksum; uint64_t computed_size; uint64_t pagetable_size; @@ -342,21 +344,19 @@ static int vpc_open(BlockDriverState *bs, QDict *opti= ons, int flags, =20 if (disk_type =3D=3D VHD_DYNAMIC) { ret =3D bdrv_pread(bs->file, be64_to_cpu(footer->data_offset), - dyndisk_header_buf, 1024); + &dyndisk_header, 1024); if (ret < 0) { error_setg(errp, "Error reading dynamic VHD header"); goto fail; } =20 - dyndisk_header =3D (VHDDynDiskHeader *)dyndisk_header_buf; - - if (strncmp(dyndisk_header->magic, "cxsparse", 8)) { + if (strncmp(dyndisk_header.magic, "cxsparse", 8)) { error_setg(errp, "Invalid header magic"); ret =3D -EINVAL; goto fail; } =20 - s->block_size =3D be32_to_cpu(dyndisk_header->block_size); + s->block_size =3D be32_to_cpu(dyndisk_header.block_size); if (!is_power_of_2(s->block_size) || s->block_size < BDRV_SECTOR_S= IZE) { error_setg(errp, "Invalid block size %" PRIu32, s->block_size); ret =3D -EINVAL; @@ -364,7 +364,7 @@ static int vpc_open(BlockDriverState *bs, QDict *option= s, int flags, } s->bitmap_size =3D ((s->block_size / (8 * 512)) + 511) & ~511; =20 - s->max_table_entries =3D be32_to_cpu(dyndisk_header->max_table_ent= ries); + s->max_table_entries =3D be32_to_cpu(dyndisk_header.max_table_entr= ies); =20 if ((bs->total_sectors * 512) / s->block_size > 0xffffffffU) { error_setg(errp, "Too many blocks"); @@ -396,7 +396,7 @@ static int vpc_open(BlockDriverState *bs, QDict *option= s, int flags, goto fail; } =20 - s->bat_offset =3D be64_to_cpu(dyndisk_header->table_offset); + s->bat_offset =3D be64_to_cpu(dyndisk_header.table_offset); =20 ret =3D bdrv_pread(bs->file, s->bat_offset, s->pagetable, pagetable_size); @@ -823,9 +823,7 @@ static int calculate_geometry(int64_t total_sectors, ui= nt16_t *cyls, static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf, int64_t total_sectors) { - uint8_t dyndisk_header_buf[1024]; - VHDDynDiskHeader *dyndisk_header =3D - (VHDDynDiskHeader *)dyndisk_header_buf; + VHDDynDiskHeader dyndisk_header; uint8_t bat_sector[512]; size_t block_size, num_bat_entries; int i; @@ -860,27 +858,26 @@ static int create_dynamic_disk(BlockBackend *blk, uin= t8_t *buf, } =20 /* Prepare the Dynamic Disk Header */ - memset(dyndisk_header_buf, 0, 1024); + memset(&dyndisk_header, 0, 1024); =20 - memcpy(dyndisk_header->magic, "cxsparse", 8); + memcpy(dyndisk_header.magic, "cxsparse", 8); =20 /* * Note: The spec is actually wrong here for data_offset, it says * 0xFFFFFFFF, but MS tools expect all 64 bits to be set. */ - dyndisk_header->data_offset =3D cpu_to_be64(0xFFFFFFFFFFFFFFFFULL); - dyndisk_header->table_offset =3D cpu_to_be64(3 * 512); - dyndisk_header->version =3D cpu_to_be32(0x00010000); - dyndisk_header->block_size =3D cpu_to_be32(block_size); - dyndisk_header->max_table_entries =3D cpu_to_be32(num_bat_entries); + dyndisk_header.data_offset =3D cpu_to_be64(0xFFFFFFFFFFFFFFFFULL); + dyndisk_header.table_offset =3D cpu_to_be64(3 * 512); + dyndisk_header.version =3D cpu_to_be32(0x00010000); + dyndisk_header.block_size =3D cpu_to_be32(block_size); + dyndisk_header.max_table_entries =3D cpu_to_be32(num_bat_entries); =20 - dyndisk_header->checksum =3D cpu_to_be32(vpc_checksum(dyndisk_header_b= uf, - 1024)); + dyndisk_header.checksum =3D cpu_to_be32(vpc_checksum(&dyndisk_header, = 1024)); =20 /* Write the header */ offset =3D 512; =20 - ret =3D blk_pwrite(blk, offset, dyndisk_header_buf, 1024, 0); + ret =3D blk_pwrite(blk, offset, &dyndisk_header, 1024, 0); if (ret < 0) { goto fail; } --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608294356; cv=none; d=zohomail.com; s=zohoarc; b=Tq0m+fA86c6W0M2ryMXrYgKfAYVebEYBgYLD2q4ZrNrAe1vGnLLOErD5xH9NGQFvbqBwRbcVpd7Xg4KjONqJgpuehcqIYHE2Q9MGe+FLqkq/uZBwTl5ShNR6jCH517XpWI8YHmL8Unt6fdA4AGou3EelgcLU+B+SHFbXth/mZPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608294356; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hkHmyO0iIjgZL0/9EIN1YC5n0Zms/kjiKaU++URa19A=; b=YFZYPTHIuT7QW+bxMxu1iUJARUHacaWqDelDPXF40pvbTEiogF2vPCu2nJMYu+zexr3nAKKjyG424BuVsUAEK/NzfFmWCZwBP3nAvIUtmmKqQfSZSOq5DXaUB+l6T/jtOwMHOZG1G9R3VVVM4sYymXwlLG9wl9YnV8AYeECZShk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608294356824542.6625401148142; Fri, 18 Dec 2020 04:25:56 -0800 (PST) Received: from localhost ([::1]:52938 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEpX-0001K3-O8 for importer@patchew.org; Fri, 18 Dec 2020 07:25:55 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38666) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbN-0002Io-OV for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:17 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53673) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEbG-0001on-Mp for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:17 -0500 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-169-1Z9uGFXCOYiXVuAcqt_Log-1; Fri, 18 Dec 2020 07:11:07 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BD4341081B24; Fri, 18 Dec 2020 12:11:06 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4C5160C15; Fri, 18 Dec 2020 12:11:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293470; 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: in-reply-to:in-reply-to:references:references; bh=hkHmyO0iIjgZL0/9EIN1YC5n0Zms/kjiKaU++URa19A=; b=b2cI2N3tM1gsj2y6hvjYA9x7Uf/yDjsA/hfCL7FoBM8Nlddi33t9ZWa/UsPyzvZS1jzTFs Rh1ZcZ/ACmEd5QWkED02/2bLwcYD8f+9/hPOgGTkjbJ6d0JQiNll9aQpNHPviNllQqKiGZ 0qSomHsj79jScoHMkAzYhLfH5RSooiM= X-MC-Unique: 1Z9uGFXCOYiXVuAcqt_Log-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 14/17] block/vpc: Use sizeof() instead of 1024 for dynamic header size Date: Fri, 18 Dec 2020 13:10:38 +0100 Message-Id: <20201218121041.299788-15-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20201217162003.1102738-7-armbru@redhat.com> Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vpc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 08a0f710ad..6cb656ac82 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -344,7 +344,7 @@ static int vpc_open(BlockDriverState *bs, QDict *option= s, int flags, =20 if (disk_type =3D=3D VHD_DYNAMIC) { ret =3D bdrv_pread(bs->file, be64_to_cpu(footer->data_offset), - &dyndisk_header, 1024); + &dyndisk_header, sizeof(dyndisk_header)); if (ret < 0) { error_setg(errp, "Error reading dynamic VHD header"); goto fail; @@ -858,7 +858,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8= _t *buf, } =20 /* Prepare the Dynamic Disk Header */ - memset(&dyndisk_header, 0, 1024); + memset(&dyndisk_header, 0, sizeof(dyndisk_header)); =20 memcpy(dyndisk_header.magic, "cxsparse", 8); =20 @@ -872,12 +872,13 @@ static int create_dynamic_disk(BlockBackend *blk, uin= t8_t *buf, dyndisk_header.block_size =3D cpu_to_be32(block_size); dyndisk_header.max_table_entries =3D cpu_to_be32(num_bat_entries); =20 - dyndisk_header.checksum =3D cpu_to_be32(vpc_checksum(&dyndisk_header, = 1024)); + dyndisk_header.checksum =3D cpu_to_be32( + vpc_checksum(&dyndisk_header, sizeof(dyndisk_header))); =20 /* Write the header */ offset =3D 512; =20 - ret =3D blk_pwrite(blk, offset, &dyndisk_header, 1024, 0); + ret =3D blk_pwrite(blk, offset, &dyndisk_header, sizeof(dyndisk_header= ), 0); if (ret < 0) { goto fail; } --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608294042; cv=none; d=zohomail.com; s=zohoarc; b=JMt3FQV6BtOrwNJSbq4XZi55s551y4t0/mE52CKM68FBXQdcA86bDHbiQtjtAm4FJhbHZV7nqbKGDSsflH5gS/HwZoQpDYBWN1mTnsmPmB3JeKjgRAdS9VzmRY6vQo7kZu7RIMzHcwk4snwFC0mU/DfiWAxh0IsMBW7a+Wj1dA4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608294042; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VNU9wEdtvAYeHBDT9VOXtRfUDNYB3yonysL8ZLXIECY=; b=Z+xyieNjcD20O9Q7hgZPmv6sXnflOAm9rbxsZalFwu30wTxKMwAWD2/DN4YNWenXHDvYF4vYGX7E6OCztq3aih9syX444qyegfA/tWvmdXvVNUEToxLIPSUha+lwFhaJip0gIAzkmIeHrso2CtR89WognGIM0No/li9btBa6Uj8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608294042196291.98822187913686; Fri, 18 Dec 2020 04:20:42 -0800 (PST) Received: from localhost ([::1]:40020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEkS-0004IF-0F for importer@patchew.org; Fri, 18 Dec 2020 07:20:40 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbc-0002qO-5j for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:38190) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEbL-0001qm-91 for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:31 -0500 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-257-aNvyHcNUPkScMfDoSZgOEQ-1; Fri, 18 Dec 2020 07:11:11 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 34FFC107ACF5; Fri, 18 Dec 2020 12:11:10 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1240F60C47; Fri, 18 Dec 2020 12:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293474; 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: in-reply-to:in-reply-to:references:references; bh=VNU9wEdtvAYeHBDT9VOXtRfUDNYB3yonysL8ZLXIECY=; b=K3kbSBa8/oAYlJC7vk4DHUnkrHA4mBKrw+MrR31iPkBf5tHWCTmsWJtYsQllOLVTrWdobd el/8WWQZn2yxaN/xRSMkjU2/ctREUY2R87/onVdhiPlAlBeQgS2gUOTvx6G7KKrSaX8Q5O rcM5IIIgWBpZ9MJ7EsiNjfqN0BtuVe4= X-MC-Unique: aNvyHcNUPkScMfDoSZgOEQ-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 15/17] block/vpc: Pad VHDFooter, replace uint8_t[] buffers Date: Fri, 18 Dec 2020 13:10:39 +0100 Message-Id: <20201218121041.299788-16-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Markus Armbruster Pad VHDFooter as specified in the "Virtual Hard Disk Image Format Specification" version 1.0[*]. Change footer buffers from uint8_t[HEADER_SIZE] to VHDFooter. Their size remains the same. The VHDFooter * variables pointing to a VHDFooter variable right next to it are now silly. Eliminate them, and shorten the remaining variables' names. Most variables pointing to s->footer are now also silly. Eliminate them, too. [*] http://download.microsoft.com/download/f/f/e/ffef50a5-07dd-4cf8-aaa3-44= 2c0673a029/Virtual%20Hard%20Disk%20Format%20Spec_10_18_06.doc Signed-off-by: Markus Armbruster Message-Id: <20201217162003.1102738-8-armbru@redhat.com> Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vpc.c | 77 +++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index 6cb656ac82..f3ea92dcb0 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -95,8 +95,11 @@ typedef struct vhd_footer { QemuUUID uuid; =20 uint8_t in_saved_state; + uint8_t reserved[427]; } QEMU_PACKED VHDFooter; =20 +QEMU_BUILD_BUG_ON(sizeof(VHDFooter) !=3D 512); + typedef struct vhd_dyndisk_header { char magic[8]; /* "cxsparse" */ =20 @@ -134,7 +137,7 @@ QEMU_BUILD_BUG_ON(sizeof(VHDDynDiskHeader) !=3D 1024); =20 typedef struct BDRVVPCState { CoMutex lock; - uint8_t footer_buf[HEADER_SIZE]; + VHDFooter footer; uint64_t free_data_block_offset; int max_table_entries; uint32_t *pagetable; @@ -250,13 +253,13 @@ static int vpc_open(BlockDriverState *bs, QDict *opti= ons, int flags, goto fail; } =20 - ret =3D bdrv_pread(bs->file, 0, s->footer_buf, HEADER_SIZE); + ret =3D bdrv_pread(bs->file, 0, &s->footer, HEADER_SIZE); if (ret < 0) { error_setg(errp, "Unable to read VHD header"); goto fail; } =20 - footer =3D (VHDFooter *) s->footer_buf; + footer =3D &s->footer; if (strncmp(footer->creator, "conectix", 8)) { int64_t offset =3D bdrv_getlength(bs->file->bs); if (offset < 0) { @@ -270,7 +273,7 @@ static int vpc_open(BlockDriverState *bs, QDict *option= s, int flags, } =20 /* If a fixed disk, the footer is found only at the end of the fil= e */ - ret =3D bdrv_pread(bs->file, offset-HEADER_SIZE, s->footer_buf, + ret =3D bdrv_pread(bs->file, offset - HEADER_SIZE, footer, HEADER_SIZE); if (ret < 0) { goto fail; @@ -285,7 +288,7 @@ static int vpc_open(BlockDriverState *bs, QDict *option= s, int flags, =20 checksum =3D be32_to_cpu(footer->checksum); footer->checksum =3D 0; - if (vpc_checksum(s->footer_buf, HEADER_SIZE) !=3D checksum) { + if (vpc_checksum(footer, HEADER_SIZE) !=3D checksum) { error_setg(errp, "Incorrect header checksum"); ret =3D -EINVAL; goto fail; @@ -535,7 +538,7 @@ static int rewrite_footer(BlockDriverState *bs) BDRVVPCState *s =3D bs->opaque; int64_t offset =3D s->free_data_block_offset; =20 - ret =3D bdrv_pwrite_sync(bs->file, offset, s->footer_buf, HEADER_SIZE); + ret =3D bdrv_pwrite_sync(bs->file, offset, &s->footer, HEADER_SIZE); if (ret < 0) return ret; =20 @@ -598,9 +601,8 @@ fail: static int vpc_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) { BDRVVPCState *s =3D (BDRVVPCState *)bs->opaque; - VHDFooter *footer =3D (VHDFooter *) s->footer_buf; =20 - if (be32_to_cpu(footer->type) !=3D VHD_FIXED) { + if (be32_to_cpu(s->footer.type) !=3D VHD_FIXED) { bdi->cluster_size =3D s->block_size; } =20 @@ -616,10 +618,9 @@ vpc_co_preadv(BlockDriverState *bs, uint64_t offset, u= int64_t bytes, int64_t image_offset; int64_t n_bytes; int64_t bytes_done =3D 0; - VHDFooter *footer =3D (VHDFooter *) s->footer_buf; QEMUIOVector local_qiov; =20 - if (be32_to_cpu(footer->type) =3D=3D VHD_FIXED) { + if (be32_to_cpu(s->footer.type) =3D=3D VHD_FIXED) { return bdrv_co_preadv(bs->file, offset, bytes, qiov, 0); } =20 @@ -667,10 +668,9 @@ vpc_co_pwritev(BlockDriverState *bs, uint64_t offset, = uint64_t bytes, int64_t n_bytes; int64_t bytes_done =3D 0; int ret =3D 0; - VHDFooter *footer =3D (VHDFooter *) s->footer_buf; QEMUIOVector local_qiov; =20 - if (be32_to_cpu(footer->type) =3D=3D VHD_FIXED) { + if (be32_to_cpu(s->footer.type) =3D=3D VHD_FIXED) { return bdrv_co_pwritev(bs->file, offset, bytes, qiov, 0); } =20 @@ -724,13 +724,12 @@ static int coroutine_fn vpc_co_block_status(BlockDriv= erState *bs, BlockDriverState **file) { BDRVVPCState *s =3D bs->opaque; - VHDFooter *footer =3D (VHDFooter*) s->footer_buf; int64_t image_offset; bool allocated; int ret; int64_t n; =20 - if (be32_to_cpu(footer->type) =3D=3D VHD_FIXED) { + if (be32_to_cpu(s->footer.type) =3D=3D VHD_FIXED) { *pnum =3D bytes; *map =3D offset; *file =3D bs->file->bs; @@ -973,8 +972,7 @@ static int coroutine_fn vpc_co_create(BlockdevCreateOpt= ions *opts, BlockBackend *blk =3D NULL; BlockDriverState *bs =3D NULL; =20 - uint8_t footer_buf[HEADER_SIZE]; - VHDFooter *footer =3D (VHDFooter *)footer_buf; + VHDFooter footer; uint16_t cyls =3D 0; uint8_t heads =3D 0; uint8_t secs_per_cyl =3D 0; @@ -1037,48 +1035,48 @@ static int coroutine_fn vpc_co_create(BlockdevCreat= eOptions *opts, } =20 /* Prepare the Hard Disk Footer */ - memset(footer_buf, 0, HEADER_SIZE); + memset(&footer, 0, HEADER_SIZE); =20 - memcpy(footer->creator, "conectix", 8); + memcpy(footer.creator, "conectix", 8); if (vpc_opts->force_size) { - memcpy(footer->creator_app, "qem2", 4); + memcpy(footer.creator_app, "qem2", 4); } else { - memcpy(footer->creator_app, "qemu", 4); + memcpy(footer.creator_app, "qemu", 4); } - memcpy(footer->creator_os, "Wi2k", 4); + memcpy(footer.creator_os, "Wi2k", 4); =20 - footer->features =3D cpu_to_be32(0x02); - footer->version =3D cpu_to_be32(0x00010000); + footer.features =3D cpu_to_be32(0x02); + footer.version =3D cpu_to_be32(0x00010000); if (disk_type =3D=3D VHD_DYNAMIC) { - footer->data_offset =3D cpu_to_be64(HEADER_SIZE); + footer.data_offset =3D cpu_to_be64(HEADER_SIZE); } else { - footer->data_offset =3D cpu_to_be64(0xFFFFFFFFFFFFFFFFULL); + footer.data_offset =3D cpu_to_be64(0xFFFFFFFFFFFFFFFFULL); } - footer->timestamp =3D cpu_to_be32(time(NULL) - VHD_TIMESTAMP_BASE); + footer.timestamp =3D cpu_to_be32(time(NULL) - VHD_TIMESTAMP_BASE); =20 /* Version of Virtual PC 2007 */ - footer->major =3D cpu_to_be16(0x0005); - footer->minor =3D cpu_to_be16(0x0003); - footer->orig_size =3D cpu_to_be64(total_size); - footer->current_size =3D cpu_to_be64(total_size); - footer->cyls =3D cpu_to_be16(cyls); - footer->heads =3D heads; - footer->secs_per_cyl =3D secs_per_cyl; + footer.major =3D cpu_to_be16(0x0005); + footer.minor =3D cpu_to_be16(0x0003); + footer.orig_size =3D cpu_to_be64(total_size); + footer.current_size =3D cpu_to_be64(total_size); + footer.cyls =3D cpu_to_be16(cyls); + footer.heads =3D heads; + footer.secs_per_cyl =3D secs_per_cyl; =20 - footer->type =3D cpu_to_be32(disk_type); + footer.type =3D cpu_to_be32(disk_type); =20 qemu_uuid_generate(&uuid); - footer->uuid =3D uuid; + footer.uuid =3D uuid; =20 - footer->checksum =3D cpu_to_be32(vpc_checksum(footer_buf, HEADER_SIZE)= ); + footer.checksum =3D cpu_to_be32(vpc_checksum(&footer, HEADER_SIZE)); =20 if (disk_type =3D=3D VHD_DYNAMIC) { - ret =3D create_dynamic_disk(blk, footer_buf, total_sectors); + ret =3D create_dynamic_disk(blk, (uint8_t *)&footer, total_sectors= ); if (ret < 0) { error_setg(errp, "Unable to create or write VHD header"); } } else { - ret =3D create_fixed_disk(blk, footer_buf, total_size, errp); + ret =3D create_fixed_disk(blk, (uint8_t *)&footer, total_size, err= p); } =20 out: @@ -1172,9 +1170,8 @@ fail: static int vpc_has_zero_init(BlockDriverState *bs) { BDRVVPCState *s =3D bs->opaque; - VHDFooter *footer =3D (VHDFooter *) s->footer_buf; =20 - if (be32_to_cpu(footer->type) =3D=3D VHD_FIXED) { + if (be32_to_cpu(s->footer.type) =3D=3D VHD_FIXED) { return bdrv_has_zero_init(bs->file->bs); } else { return 1; --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608294455; cv=none; d=zohomail.com; s=zohoarc; b=FV+6SDcLBKmPNk/LcMmr4DDHnXIJ988mvhSUn9eTwLNwEQkcUcZ9Y+66JuWG8jP33b0CM9sDVQ98EjzI9Bdwneqga8G8/djTFBy69di2ctqAtPj+56piPJb1gxF9bDf3gduznJc0lfoTfCJabVLzdjCWHtqHJVWsS2NmyCukvuk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608294455; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=dtv681FiifTGkIk6FqX0mYBECn5c7ppLd1/TuguWmpM=; b=JSwbgSI23yhZKfYXfbXYXEW7wano1g3rqbE/bhTuAehRZVSdFX+WhzKF/WGj/OLeBvVcKt8rg0nPTgaGQbvt36pKKF707lNV9YtV31tUGbFRVPOxVYP3mpSTnHrvoW+93J0hl0JqVfEvJ/dWEQVL9UCRqxVIV0x9/1uvApjF+Ck= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608294455108377.72729400171363; Fri, 18 Dec 2020 04:27:35 -0800 (PST) Received: from localhost ([::1]:55480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEr7-0002Vo-J3 for importer@patchew.org; Fri, 18 Dec 2020 07:27:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbR-0002RX-6p for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:21 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49521) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEbO-0001sG-Cj for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:20 -0500 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-337-Kkq1eWliMICHcJA4b23jyg-1; Fri, 18 Dec 2020 07:11:12 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 75E9A100C604; Fri, 18 Dec 2020 12:11:11 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7E62B60C15; Fri, 18 Dec 2020 12:11:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293476; 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: in-reply-to:in-reply-to:references:references; bh=dtv681FiifTGkIk6FqX0mYBECn5c7ppLd1/TuguWmpM=; b=Ss15jLyVuCN0cBMVv7uPqNXN1ISHBLr/DC8KN+Yh9NL53mB8DlkWSntd+dI08BBoQsRCHH K6yS+TChANLA9EWZpXjw98tZ2WgEkFSgIe4sXfsEEKEu0m5G4z6PvjHkGHjMU5tZTBM+Rh Am8H186TYyWdBke9wv8S/f1hqSIhVTE= X-MC-Unique: Kkq1eWliMICHcJA4b23jyg-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 16/17] block/vpc: Pass footer buffers as VHDFooter * instead of uint8_t * Date: Fri, 18 Dec 2020 13:10:40 +0100 Message-Id: <20201218121041.299788-17-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=216.205.24.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20201217162003.1102738-9-armbru@redhat.com> Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vpc.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index f3ea92dcb0..aac13788df 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -819,7 +819,7 @@ static int calculate_geometry(int64_t total_sectors, ui= nt16_t *cyls, return 0; } =20 -static int create_dynamic_disk(BlockBackend *blk, uint8_t *buf, +static int create_dynamic_disk(BlockBackend *blk, VHDFooter *footer, int64_t total_sectors) { VHDDynDiskHeader dyndisk_header; @@ -833,13 +833,13 @@ static int create_dynamic_disk(BlockBackend *blk, uin= t8_t *buf, block_size =3D 0x200000; num_bat_entries =3D DIV_ROUND_UP(total_sectors, block_size / 512); =20 - ret =3D blk_pwrite(blk, offset, buf, HEADER_SIZE, 0); + ret =3D blk_pwrite(blk, offset, footer, HEADER_SIZE, 0); if (ret < 0) { goto fail; } =20 offset =3D 1536 + ((num_bat_entries * 4 + 511) & ~511); - ret =3D blk_pwrite(blk, offset, buf, HEADER_SIZE, 0); + ret =3D blk_pwrite(blk, offset, footer, HEADER_SIZE, 0); if (ret < 0) { goto fail; } @@ -887,7 +887,7 @@ static int create_dynamic_disk(BlockBackend *blk, uint8= _t *buf, return ret; } =20 -static int create_fixed_disk(BlockBackend *blk, uint8_t *buf, +static int create_fixed_disk(BlockBackend *blk, VHDFooter *footer, int64_t total_size, Error **errp) { int ret; @@ -900,7 +900,7 @@ static int create_fixed_disk(BlockBackend *blk, uint8_t= *buf, return ret; } =20 - ret =3D blk_pwrite(blk, total_size - HEADER_SIZE, buf, HEADER_SIZE, 0); + ret =3D blk_pwrite(blk, total_size - HEADER_SIZE, footer, HEADER_SIZE,= 0); if (ret < 0) { error_setg_errno(errp, -ret, "Unable to write VHD header"); return ret; @@ -1071,12 +1071,12 @@ static int coroutine_fn vpc_co_create(BlockdevCreat= eOptions *opts, footer.checksum =3D cpu_to_be32(vpc_checksum(&footer, HEADER_SIZE)); =20 if (disk_type =3D=3D VHD_DYNAMIC) { - ret =3D create_dynamic_disk(blk, (uint8_t *)&footer, total_sectors= ); + ret =3D create_dynamic_disk(blk, &footer, total_sectors); if (ret < 0) { error_setg(errp, "Unable to create or write VHD header"); } } else { - ret =3D create_fixed_disk(blk, (uint8_t *)&footer, total_size, err= p); + ret =3D create_fixed_disk(blk, &footer, total_size, errp); } =20 out: --=20 2.29.2 From nobody Sat May 18 19:24:31 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608294122; cv=none; d=zohomail.com; s=zohoarc; b=i29nO7XudD6NYrspohQKwqWWB2GHQVJ+98DnJUGloNJaIcbMglNNHqDhsd5467GXtPWSehhdx6PiY6XY/T/lR1CDrIfXmKBoII1aR9wYR5R067caLscS97KerKeaKYAy0JO0Edvb4mt2Fb8pLyumxsbUgBnOkm+XLSV+fhtmUNI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608294122; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=puxntvppp0T1qFlDEg2+gUZpGGfdzPcyF7BigHe2XyQ=; b=DPU6eh6Rflvxtk64p2iOb2UmuaVpctmhm+QdsIwNHqqhTqA6R2NRCSyalxqRrNb0xzOH9t9HoQlc6NN6o8A0umqqTUMxXp7Z4xcP6AnZ3PmmkjCXO7643bZXjyczIVkcO7/NGivT3VNqMsMAg9BhnTBjwcvWFXV7VXtK5jzHVig= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass 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 1608294122026180.45405610351918; Fri, 18 Dec 2020 04:22:02 -0800 (PST) Received: from localhost ([::1]:46224 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kqEll-0006ru-0u for importer@patchew.org; Fri, 18 Dec 2020 07:22:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kqEbP-0002Ng-PY for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47262) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kqEbN-0001rf-Rh for qemu-devel@nongnu.org; Fri, 18 Dec 2020 07:11:19 -0500 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-360-2Pl1QptVO-KvSQmntSG1EA-1; Fri, 18 Dec 2020 07:11:13 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B6B8F107ACE6; Fri, 18 Dec 2020 12:11:12 +0000 (UTC) Received: from merkur.fritz.box (ovpn-115-34.ams2.redhat.com [10.36.115.34]) by smtp.corp.redhat.com (Postfix) with ESMTP id BF27F60C15; Fri, 18 Dec 2020 12:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608293476; 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: in-reply-to:in-reply-to:references:references; bh=puxntvppp0T1qFlDEg2+gUZpGGfdzPcyF7BigHe2XyQ=; b=iawZ4KRREkQ/Z9ltNkiCikQvBJkND8hGBXaVDoYfwRDYG3GfRW+KC69DWaafxOLYXXxoHR Sb+kGSeCpbuyHW0gppltOZHG21c9wGtOX85s04sdGv7L8qIDL3GX1wq3F0fOp9Ra4RAlFp NbQfNT4jjIZ7fHwn65nH1Wwd7cPsyrc= X-MC-Unique: 2Pl1QptVO-KvSQmntSG1EA-1 From: Kevin Wolf To: qemu-block@nongnu.org Subject: [PULL 17/17] block/vpc: Use sizeof() instead of HEADER_SIZE for footer size Date: Fri, 18 Dec 2020 13:10:41 +0100 Message-Id: <20201218121041.299788-18-kwolf@redhat.com> In-Reply-To: <20201218121041.299788-1-kwolf@redhat.com> References: <20201218121041.299788-1-kwolf@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=kwolf@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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=63.128.21.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: kwolf@redhat.com, peter.maydell@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Markus Armbruster Signed-off-by: Markus Armbruster Message-Id: <20201217162003.1102738-10-armbru@redhat.com> Reviewed-by: Max Reitz Signed-off-by: Kevin Wolf --- block/vpc.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/block/vpc.c b/block/vpc.c index aac13788df..17a705b482 100644 --- a/block/vpc.c +++ b/block/vpc.c @@ -39,8 +39,6 @@ =20 /**************************************************************/ =20 -#define HEADER_SIZE 512 - //#define CACHE =20 enum vhd_type { @@ -253,7 +251,7 @@ static int vpc_open(BlockDriverState *bs, QDict *option= s, int flags, goto fail; } =20 - ret =3D bdrv_pread(bs->file, 0, &s->footer, HEADER_SIZE); + ret =3D bdrv_pread(bs->file, 0, &s->footer, sizeof(s->footer)); if (ret < 0) { error_setg(errp, "Unable to read VHD header"); goto fail; @@ -266,15 +264,15 @@ static int vpc_open(BlockDriverState *bs, QDict *opti= ons, int flags, ret =3D offset; error_setg(errp, "Invalid file size"); goto fail; - } else if (offset < HEADER_SIZE) { + } else if (offset < sizeof(*footer)) { ret =3D -EINVAL; error_setg(errp, "File too small for a VHD header"); goto fail; } =20 /* If a fixed disk, the footer is found only at the end of the fil= e */ - ret =3D bdrv_pread(bs->file, offset - HEADER_SIZE, footer, - HEADER_SIZE); + ret =3D bdrv_pread(bs->file, offset - sizeof(*footer), + footer, sizeof(*footer)); if (ret < 0) { goto fail; } @@ -288,7 +286,7 @@ static int vpc_open(BlockDriverState *bs, QDict *option= s, int flags, =20 checksum =3D be32_to_cpu(footer->checksum); footer->checksum =3D 0; - if (vpc_checksum(footer, HEADER_SIZE) !=3D checksum) { + if (vpc_checksum(footer, sizeof(*footer)) !=3D checksum) { error_setg(errp, "Incorrect header checksum"); ret =3D -EINVAL; goto fail; @@ -538,7 +536,7 @@ static int rewrite_footer(BlockDriverState *bs) BDRVVPCState *s =3D bs->opaque; int64_t offset =3D s->free_data_block_offset; =20 - ret =3D bdrv_pwrite_sync(bs->file, offset, &s->footer, HEADER_SIZE); + ret =3D bdrv_pwrite_sync(bs->file, offset, &s->footer, sizeof(s->foote= r)); if (ret < 0) return ret; =20 @@ -833,13 +831,13 @@ static int create_dynamic_disk(BlockBackend *blk, VHD= Footer *footer, block_size =3D 0x200000; num_bat_entries =3D DIV_ROUND_UP(total_sectors, block_size / 512); =20 - ret =3D blk_pwrite(blk, offset, footer, HEADER_SIZE, 0); + ret =3D blk_pwrite(blk, offset, footer, sizeof(*footer), 0); if (ret < 0) { goto fail; } =20 offset =3D 1536 + ((num_bat_entries * 4 + 511) & ~511); - ret =3D blk_pwrite(blk, offset, footer, HEADER_SIZE, 0); + ret =3D blk_pwrite(blk, offset, footer, sizeof(*footer), 0); if (ret < 0) { goto fail; } @@ -893,14 +891,15 @@ static int create_fixed_disk(BlockBackend *blk, VHDFo= oter *footer, int ret; =20 /* Add footer to total size */ - total_size +=3D HEADER_SIZE; + total_size +=3D sizeof(*footer); =20 ret =3D blk_truncate(blk, total_size, false, PREALLOC_MODE_OFF, 0, err= p); if (ret < 0) { return ret; } =20 - ret =3D blk_pwrite(blk, total_size - HEADER_SIZE, footer, HEADER_SIZE,= 0); + ret =3D blk_pwrite(blk, total_size - sizeof(*footer), + footer, sizeof(*footer), 0); if (ret < 0) { error_setg_errno(errp, -ret, "Unable to write VHD header"); return ret; @@ -1035,7 +1034,7 @@ static int coroutine_fn vpc_co_create(BlockdevCreateO= ptions *opts, } =20 /* Prepare the Hard Disk Footer */ - memset(&footer, 0, HEADER_SIZE); + memset(&footer, 0, sizeof(footer)); =20 memcpy(footer.creator, "conectix", 8); if (vpc_opts->force_size) { @@ -1048,7 +1047,7 @@ static int coroutine_fn vpc_co_create(BlockdevCreateO= ptions *opts, footer.features =3D cpu_to_be32(0x02); footer.version =3D cpu_to_be32(0x00010000); if (disk_type =3D=3D VHD_DYNAMIC) { - footer.data_offset =3D cpu_to_be64(HEADER_SIZE); + footer.data_offset =3D cpu_to_be64(sizeof(footer)); } else { footer.data_offset =3D cpu_to_be64(0xFFFFFFFFFFFFFFFFULL); } @@ -1068,7 +1067,7 @@ static int coroutine_fn vpc_co_create(BlockdevCreateO= ptions *opts, qemu_uuid_generate(&uuid); footer.uuid =3D uuid; =20 - footer.checksum =3D cpu_to_be32(vpc_checksum(&footer, HEADER_SIZE)); + footer.checksum =3D cpu_to_be32(vpc_checksum(&footer, sizeof(footer))); =20 if (disk_type =3D=3D VHD_DYNAMIC) { ret =3D create_dynamic_disk(blk, &footer, total_sectors); --=20 2.29.2