From nobody Thu May 16 09:07:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617108308; cv=none; d=zohomail.com; s=zohoarc; b=IHsdpZOd+jzC+8b0UqTT1/WehGph06CuuW04y35JNIso669y8J29ZsvKk4LU3nOxiBUMOK+kvik/hs88WtCRaNq4AcEIj7Q82YmCe9CNEdMNZcfqZF/+opJBRomCMcIWT5hJmqgbyALUVufNQjs57kL14JYtpOyl2KE5BxRsyYE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617108308; 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=g0XDfaSsuxsoVngEIWBcd0FR+WCi/sksTiZFetGsygU=; b=SaMeSGwntYPQcvwDNDLDh3d95+UFCkbSkeSerLxCXjb7GHCNHp/mPDpEaPTT4rcIr16nnzkixCVRRQcC9KSKLOfXHWWIiUDctcO3yre8Gm4OgMaBC8SzmRFBROVTxgMSB1qCl34yNAIIDGszgmrrOY+V7n6FlKgOMBm4Nqvim9w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617108308426459.03558912402934; Tue, 30 Mar 2021 05:45:08 -0700 (PDT) Received: from localhost ([::1]:52090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRDk3-0004UU-3X for importer@patchew.org; Tue, 30 Mar 2021 08:45:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58206) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfT-0000tI-QV for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:56322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfG-0003MX-8U for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:22 -0400 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-4-0s-DYYrtM8qXBK1aHiDCeA-1; Tue, 30 Mar 2021 08:40:02 -0400 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 C0D3BDF8A7; Tue, 30 Mar 2021 12:40:01 +0000 (UTC) Received: from localhost (ovpn-113-220.ams2.redhat.com [10.36.113.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 59F722AC82; Tue, 30 Mar 2021 12:40:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617108006; 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=g0XDfaSsuxsoVngEIWBcd0FR+WCi/sksTiZFetGsygU=; b=a40XJjA1VZpqusdIVAnJoojP+xUOLTC8uXai9TWKfvtq/JWm67or0WUN2URs1MfOAyNAy2 aXecjfCLCKfQJchvnRhQI0LeMVoXvp7dDzBxGddooy5XIlppKXABP4aAPdUSQncDX3FKnt hHAY13tig6hcJf7gO2T5lGw9l+PcNhs= X-MC-Unique: 0s-DYYrtM8qXBK1aHiDCeA-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 1/9] iotests: Fix typo in iotest 051 Date: Tue, 30 Mar 2021 14:39:49 +0200 Message-Id: <20210330123957.826170-2-mreitz@redhat.com> In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com> References: <20210330123957.826170-1-mreitz@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=mreitz@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=170.10.133.124; envelope-from=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Tao Xu There is an typo in iotest 051, correct it. Signed-off-by: Tao Xu Message-Id: <20210324084321.90952-1-tao3.xu@intel.com> Signed-off-by: Max Reitz --- tests/qemu-iotests/051 | 2 +- tests/qemu-iotests/051.pc.out | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/051 b/tests/qemu-iotests/051 index 333cc81818..7bf29343d7 100755 --- a/tests/qemu-iotests/051 +++ b/tests/qemu-iotests/051 @@ -199,7 +199,7 @@ case "$QEMU_DEFAULT_MACHINE" in # virtio-blk enables the iothread only when the driver initialises= the # device, so a second virtio-blk device can't be added even with t= he # same iothread. virtio-scsi allows this. - run_qemu $iothread -device virtio-blk-pci,drive=3Ddisk,iohtread=3D= iothread0,share-rw=3Don + run_qemu $iothread -device virtio-blk-pci,drive=3Ddisk,iothread=3D= iothread0,share-rw=3Don run_qemu $iothread -device virtio-scsi,id=3Dvirtio-scsi1,iothread= =3Dthread0 -device scsi-hd,bus=3Dvirtio-scsi1.0,drive=3Ddisk,share-rw=3Don ;; *) diff --git a/tests/qemu-iotests/051.pc.out b/tests/qemu-iotests/051.pc.out index e95bd42b8d..afe7632964 100644 --- a/tests/qemu-iotests/051.pc.out +++ b/tests/qemu-iotests/051.pc.out @@ -183,9 +183,9 @@ Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,node-= name=3Ddisk -object iothread,id QEMU X.Y.Z monitor - type 'help' for more information (qemu) QEMU_PROG: -device scsi-hd,bus=3Dvirtio-scsi1.0,drive=3Ddisk,share-= rw=3Don: Cannot change iothread of active block backend =20 -Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,node-name=3Ddisk -object= iothread,id=3Dthread0 -device virtio-scsi,iothread=3Dthread0,id=3Dvirtio-s= csi0 -device scsi-hd,bus=3Dvirtio-scsi0.0,drive=3Ddisk,share-rw=3Don -devic= e virtio-blk-pci,drive=3Ddisk,iohtread=3Diothread0,share-rw=3Don +Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,node-name=3Ddisk -object= iothread,id=3Dthread0 -device virtio-scsi,iothread=3Dthread0,id=3Dvirtio-s= csi0 -device scsi-hd,bus=3Dvirtio-scsi0.0,drive=3Ddisk,share-rw=3Don -devic= e virtio-blk-pci,drive=3Ddisk,iothread=3Diothread0,share-rw=3Don QEMU X.Y.Z monitor - type 'help' for more information -(qemu) QEMU_PROG: -device virtio-blk-pci,drive=3Ddisk,iohtread=3Diothread0= ,share-rw=3Don: Cannot change iothread of active block backend +(qemu) QEMU_PROG: -device virtio-blk-pci,drive=3Ddisk,iothread=3Diothread0= ,share-rw=3Don: Cannot change iothread of active block backend =20 Testing: -drive file=3DTEST_DIR/t.qcow2,if=3Dnone,node-name=3Ddisk -object= iothread,id=3Dthread0 -device virtio-scsi,iothread=3Dthread0,id=3Dvirtio-s= csi0 -device scsi-hd,bus=3Dvirtio-scsi0.0,drive=3Ddisk,share-rw=3Don -devic= e virtio-scsi,id=3Dvirtio-scsi1,iothread=3Dthread0 -device scsi-hd,bus=3Dvi= rtio-scsi1.0,drive=3Ddisk,share-rw=3Don QEMU X.Y.Z monitor - type 'help' for more information --=20 2.29.2 From nobody Thu May 16 09:07:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617108646; cv=none; d=zohomail.com; s=zohoarc; b=i7u8BY9HWSzBIQwiFZnMgjypfH1+80W9gHccX05Ac5zlZ7t0wdJkVPz//QLLGsyZ8ek6VF30sFgCZeKa2lkN6usQPIMVeGibednagXOiEWPoJ9/kNtlCxXzL09L73y760qLqyl1usgePVHBtDex160frgLcQgU/JCGFiUFTWmvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617108646; 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=AwDR5O/JZykM9n2lyE5mqiz6JuRnNahP5Rc4teXnJdE=; b=Ga+OsilTO3rm/3r30fc70sgf8+twh7KVYrqVQRC5d7He6qlXIQCf7lY0fhCl1KGjfazGgN4Bo1i6nHSohGSyKJSBQqEuRIuoD0/YIOucPrrc8l1lv+SrtznlJFPbbzNC97V1q4Afe/iE2BYqt4PvdYdNumeV8QIj27bVQbqeTHI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617108646491825.239062301606; Tue, 30 Mar 2021 05:50:46 -0700 (PDT) Received: from localhost ([::1]:36134 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRDpV-0001Kt-8I for importer@patchew.org; Tue, 30 Mar 2021 08:50:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfV-0000uT-Vl for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27454) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfM-0003Mx-CA for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:25 -0400 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-467-AYkgjKrGOIaETUUet87AHw-1; Tue, 30 Mar 2021 08:40:05 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 02BBE1B18BC3; Tue, 30 Mar 2021 12:40:04 +0000 (UTC) Received: from localhost (ovpn-113-220.ams2.redhat.com [10.36.113.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A3B45C1D1; Tue, 30 Mar 2021 12:40:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617108007; 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=AwDR5O/JZykM9n2lyE5mqiz6JuRnNahP5Rc4teXnJdE=; b=cZBfYY1qeB7K3gGXdVBsr/surEPTy7Deg4U9/fkt2IVS0nMY9KXaeou39ld+dIinal0Rij 7FOViiArGOf7yEPew3avDqdPRIpn8CddTMGo7S8pbMcDvXUOiisx2mpp7P/XLY66V8PZdS NfoSRnIyVbIFR0QGA5s7HkHk8uL6uNo= X-MC-Unique: AYkgjKrGOIaETUUet87AHw-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 2/9] iotests: fix 051.out expected output after error text touchups Date: Tue, 30 Mar 2021 14:39:50 +0200 Message-Id: <20210330123957.826170-3-mreitz@redhat.com> In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com> References: <20210330123957.826170-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@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=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Connor Kuehl A patch was recently applied that touched up some error messages that pertained to key names like 'node-name'. The trouble is it only updated tests/qemu-iotests/051.pc.out and not tests/qemu-iotests/051.out as well. Do that now. Fixes: 785ec4b1b9 ("block: Clarify error messages pertaining to 'node-name'") Signed-off-by: Connor Kuehl Message-Id: <20210318200949.1387703-2-ckuehl@redhat.com> Tested-by: Christian Borntraeger Reviewed-by: John Snow Signed-off-by: Max Reitz --- tests/qemu-iotests/051.out | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/qemu-iotests/051.out b/tests/qemu-iotests/051.out index 437053c839..441f83e41a 100644 --- a/tests/qemu-iotests/051.out +++ b/tests/qemu-iotests/051.out @@ -61,13 +61,13 @@ QEMU X.Y.Z monitor - type 'help' for more information (qemu) quit =20 Testing: -drive file=3DTEST_DIR/t.qcow2,node-name=3D123foo -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3D123foo: Invalid node= name +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3D123foo: Invalid node= -name: '123foo' =20 Testing: -drive file=3DTEST_DIR/t.qcow2,node-name=3D_foo -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3D_foo: Invalid node n= ame +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3D_foo: Invalid node-n= ame: '_foo' =20 Testing: -drive file=3DTEST_DIR/t.qcow2,node-name=3Dfoo#12 -QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3Dfoo#12: Invalid node= name +QEMU_PROG: -drive file=3DTEST_DIR/t.qcow2,node-name=3Dfoo#12: Invalid node= -name: 'foo#12' =20 =20 =3D=3D=3D Device without drive =3D=3D=3D --=20 2.29.2 From nobody Thu May 16 09:07:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617108179; cv=none; d=zohomail.com; s=zohoarc; b=e1g9np1IDmhWHWS3bpGYV90NmfL56n1gd4CWxyDIxgoR349or6RwvzLVjN5IcQtd/JO5MzLLNLbyw8V/ecxnpCVmb7QaOY72Ng4qeXrvS101MJ5aTnFuN12IOYAh0Pydf6L89ePXRA8tIf5VIx1pxyf1lRX9vN4meqdf1uBEbQg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617108179; 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=ElevEDzid7Hb5vvORFVk+u4BuCouWa591e7mqeNJ988=; b=bGwcQ/aiPNqM+dF5sozg2waPX36T6yvR72aVD+s5SdwCjZxou5AbebEYnL7Npke339Rje88vnJntDV9bhW9rNoIhIAtLfgYjFeGO7PXoHXP/5J4AddaHhzxEO8/gRscxMjfgY+EPHLWj6kzT3ZZ/Y7qLc2HkCyZlcV1IonBGvcY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617108179800884.465565628578; Tue, 30 Mar 2021 05:42:59 -0700 (PDT) Received: from localhost ([::1]:47622 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRDhy-0002c5-Im for importer@patchew.org; Tue, 30 Mar 2021 08:42:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfT-0000tJ-QR for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:24302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfI-0003N7-1r for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:22 -0400 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-0SkokXhwP4KghlpfPraujg-1; Tue, 30 Mar 2021 08:40:07 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 404F5107B7C4; Tue, 30 Mar 2021 12:40:06 +0000 (UTC) Received: from localhost (ovpn-113-220.ams2.redhat.com [10.36.113.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B90DC19718; Tue, 30 Mar 2021 12:40:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617108009; 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=ElevEDzid7Hb5vvORFVk+u4BuCouWa591e7mqeNJ988=; b=fHwpcW/8Zo9h6bwzxfHAKU/Z4WCo68Q8BN0+86hzdo5oS7lsyNeSqYM/iBudQ3vyRBxEXc 25ATMXFQT0zPkRMPUf6HpV748dNM6ARFIygueJUb8WnP1xgFelJQ3Al3UBlhHxUt0EvCoy Rlkxve8Lg3JbvZzWRMAuWZzoWAEYtxI= X-MC-Unique: 0SkokXhwP4KghlpfPraujg-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 3/9] iotests/116: Fix reference output Date: Tue, 30 Mar 2021 14:39:51 +0200 Message-Id: <20210330123957.826170-4-mreitz@redhat.com> In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com> References: <20210330123957.826170-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@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=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 15ce94a68ca ("block/qed: bdrv_qed_do_open: deal with errp") has improved the qed driver's error reporting, though sadly did not add a test for it. The good news are: There already is such a test, namely 116. The bad news are: Its reference output was not adjusted, and so now it fails. Let's fix the reference output, which has the nice side effect of demonstrating 15ce94a68ca's improvements. Fixes: 15ce94a68ca6730466c565c3d29971aab3087bf1 ("block/qed: bdrv_qed_do_open: deal with errp") Signed-off-by: Max Reitz Message-Id: <20210326141419.156831-1-mreitz@redhat.com> --- tests/qemu-iotests/116.out | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/qemu-iotests/116.out b/tests/qemu-iotests/116.out index 49f9a261a0..5f6c6fffca 100644 --- a/tests/qemu-iotests/116.out +++ b/tests/qemu-iotests/116.out @@ -2,7 +2,7 @@ QA output created by 116 =20 =3D=3D truncated header cluster =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 -qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed'= : Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: QED table offset is invalid =20 =3D=3D invalid header magic =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 @@ -10,21 +10,21 @@ qemu-io: can't open device TEST_DIR/t.qed: Image not in= QED format =20 =3D=3D invalid cluster size =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 -qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed'= : Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: QED cluster size is invalid =20 =3D=3D invalid table size =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 -qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed'= : Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: QED table size is invalid =20 =3D=3D invalid header size =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 -qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed'= : Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: QED table offset is invalid =20 =3D=3D invalid L1 table offset =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 -qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed'= : Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: QED table offset is invalid =20 =3D=3D invalid image size =3D=3D Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D134217728 -qemu-io: can't open device TEST_DIR/t.qed: Could not open 'TEST_DIR/t.qed'= : Invalid argument +qemu-io: can't open device TEST_DIR/t.qed: QED image size is invalid *** done --=20 2.29.2 From nobody Thu May 16 09:07:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617108526; cv=none; d=zohomail.com; s=zohoarc; b=nBekgBL319h1CkYBsKSuiiHHB+4vXW6FO8K2a80lENCwxSSy6yduyAOaJYu+JwGg7EHm33xb3GC1+039u25zgE2f9dmtLYIhOqkvRPDtH2h7G550sy8Cb22lbnCJgX8+JzvxzEvSlEgu/ZMEHv3r4nI8t3hdjhBoFPkU8EXgC1w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617108526; 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=8B9bGDXpPIpRCRhpVsNkjFGkPYIFt7EGtkbW3KWad+M=; b=MQrFsxfJIL7K1Cefz3OrrmuJBz5TrFta/3VND+ESaHXYVbk9yDj7FFlweE1Pit0mQ8RG2jzSBCSvqjMpvqv3o8VTP0kOh8KjoBsI2FxILOLMKCmQtw0zwZTmJlrPb2idrCDH7249pieHR2dWH4JNZn6gHDLZj8IX8QHxpuaUUwA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617108526941262.79032143000916; Tue, 30 Mar 2021 05:48:46 -0700 (PDT) Received: from localhost ([::1]:57576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRDnZ-0006vm-BO for importer@patchew.org; Tue, 30 Mar 2021 08:48:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfU-0000te-Bb for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:24 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfM-0003Nc-Cx for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:24 -0400 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-343-DQgn2gu5MeeMJT8enLRbMg-1; Tue, 30 Mar 2021 08:40:09 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4121F1B18BC2; Tue, 30 Mar 2021 12:40:08 +0000 (UTC) Received: from localhost (ovpn-113-220.ams2.redhat.com [10.36.113.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D790054272; Tue, 30 Mar 2021 12:40:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617108012; 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=8B9bGDXpPIpRCRhpVsNkjFGkPYIFt7EGtkbW3KWad+M=; b=JJp6I8deENC8dKP6oGeqoKiPTdKUj4H5jWEWtCRYot+Gf3ucA2jnrZBrrmSTsRYuMrbzn5 zU1Vd9ckmGS76wmm7zdrlhXwhXRnwAb+HRoAs/YFoTBAEUKekboOi9au9bPHV3ckQ0bQe/ YcsZULHbcMZ2/OkFxuAOO2CNXAets9I= X-MC-Unique: DQgn2gu5MeeMJT8enLRbMg-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 4/9] qcow2: use external virtual timers Date: Tue, 30 Mar 2021 14:39:52 +0200 Message-Id: <20210330123957.826170-5-mreitz@redhat.com> In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com> References: <20210330123957.826170-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@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=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Pavel Dovgalyuk Regular virtual timers are used to emulate timings related to vCPU and peripheral states. QCOW2 uses timers to clean the cache. These timers should have external flag. In the opposite case they affect the execution and it can't be recorded and replayed. This patch adds external flag to the timer for qcow2 cache clean. Signed-off-by: Pavel Dovgalyuk Reviewed-by: Paolo Bonzini Message-Id: <161700516327.1141158.8366564693714562536.stgit@pasha-ThinkPad-= X280> Signed-off-by: Max Reitz --- block/qcow2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 0db1227ac9..2fb43c6f7e 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -840,9 +840,10 @@ static void cache_clean_timer_init(BlockDriverState *b= s, AioContext *context) { BDRVQcow2State *s =3D bs->opaque; if (s->cache_clean_interval > 0) { - s->cache_clean_timer =3D aio_timer_new(context, QEMU_CLOCK_VIRTUAL, - SCALE_MS, cache_clean_timer_c= b, - bs); + s->cache_clean_timer =3D + aio_timer_new_with_attrs(context, QEMU_CLOCK_VIRTUAL, + SCALE_MS, QEMU_TIMER_ATTR_EXTERNAL, + cache_clean_timer_cb, bs); timer_mod(s->cache_clean_timer, qemu_clock_get_ms(QEMU_CLOCK_VIRTU= AL) + (int64_t) s->cache_clean_interval * 1000); } --=20 2.29.2 From nobody Thu May 16 09:07:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617108652; cv=none; d=zohomail.com; s=zohoarc; b=QHhx8nANKiCMMK66bekzbhmX/yPuFjWDRPuRYwaRkmDIy9bJenRTX3CLHo0aTd62vq0Kb1YllKqyIjbND7rnR9nacHh38y80RPjslLnRnS+5q1m0X+maiIQCpHY1Z2M1s8XTNYxdY4n6T3hL60cZt2THUyfAgP2E5gBHlMwDhlU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617108652; 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=kQje1/FozqUGMuU1hbq0SzlNZFi2tbXPWPzlwvclHbs=; b=gOi1SO0pG+1QFPIl1rzOEPxdyxxkzpGC1VjbqQdjjcyfz0jFi/VjOOskiqHqkMPFwaaQhF8XrouI19ZQPFfdcr7Vdliq60iKhk6jYrFgWqGn+msicrbkFprNhkt79HKtgo+iKR9PsFclt6fFYfhbFTVC66L0aCTqkMvmgNveZ00= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161710865229998.93378571153369; Tue, 30 Mar 2021 05:50:52 -0700 (PDT) Received: from localhost ([::1]:36510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRDpb-0001V1-8b for importer@patchew.org; Tue, 30 Mar 2021 08:50:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58298) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfa-0000yH-2e for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:57177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfM-0003OI-C8 for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:29 -0400 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-576-qL1bOeWHNPi8JIdDRKUn7Q-1; Tue, 30 Mar 2021 08:40:11 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 946AE1B18BC5; Tue, 30 Mar 2021 12:40:10 +0000 (UTC) Received: from localhost (ovpn-113-220.ams2.redhat.com [10.36.113.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F93B19645; Tue, 30 Mar 2021 12:40:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617108013; 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=kQje1/FozqUGMuU1hbq0SzlNZFi2tbXPWPzlwvclHbs=; b=bu+dcd5bcY/R44DbcYc9mkyeWPnj5YY2GS9+eUHy5LG1v8nc0KOfongDuiOFR+ndKvE60R L/lMDeWN/JrI7fXZJ4+E16rSsIhrTeFAmGFGvbKWQ1SuxNrueCMrUfi0mOneyk6AsHG2g9 hftPk4IYk++kkRLU1cqGjiWn+BaNfqo= X-MC-Unique: qL1bOeWHNPi8JIdDRKUn7Q-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 5/9] iotests/046: Filter request length Date: Tue, 30 Mar 2021 14:39:53 +0200 Message-Id: <20210330123957.826170-6-mreitz@redhat.com> In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com> References: <20210330123957.826170-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@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=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" For its concurrent requests, 046 has always filtered the offset, probably because concurrent requests may settle in any order. However, it did not filter the request length, and so if requests with different lengths settle in an unexpected order (notably the longer request before the shorter request), the test fails (for no good reason). Filter the length, too. Signed-off-by: Max Reitz Message-Id: <20200918153323.108932-1-mreitz@redhat.com> --- tests/qemu-iotests/046 | 3 +- tests/qemu-iotests/046.out | 104 ++++++++++++++++++------------------- 2 files changed, 54 insertions(+), 53 deletions(-) diff --git a/tests/qemu-iotests/046 b/tests/qemu-iotests/046 index 50b0678f60..517b162508 100755 --- a/tests/qemu-iotests/046 +++ b/tests/qemu-iotests/046 @@ -187,7 +187,8 @@ EOF } =20 overlay_io | $QEMU_IO blkdebug::"$TEST_IMG" | _filter_qemu_io |\ - sed -e 's/bytes at offset [0-9]*/bytes at offset XXX/g' + sed -e 's/[0-9]*\/[0-9]* bytes at offset [0-9]*/XXX\/XXX bytes at offs= et XXX/g' \ + -e 's/^[0-9]* KiB/XXX KiB/g' =20 echo echo "=3D=3D Verify image content =3D=3D" diff --git a/tests/qemu-iotests/046.out b/tests/qemu-iotests/046.out index 66ad987ab3..b1a03f4041 100644 --- a/tests/qemu-iotests/046.out +++ b/tests/qemu-iotests/046.out @@ -71,74 +71,74 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D644= 2450944 backing_file=3DTEST_DIR =3D=3D Some concurrent requests touching the same cluster =3D=3D blkdebug: Suspended request 'A' blkdebug: Resuming request 'A' -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Suspended request 'A' blkdebug: Resuming request 'A' -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 65536/65536 bytes at offset XXX -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Suspended request 'A' blkdebug: Resuming request 'A' -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 65536/65536 bytes at offset XXX -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 32768/32768 bytes at offset XXX -32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Suspended request 'A' blkdebug: Resuming request 'A' -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 57344/57344 bytes at offset XXX -56 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 4096/4096 bytes at offset XXX -4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 32768/32768 bytes at offset XXX -32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -discard 65536/65536 bytes at offset XXX -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +discard XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Suspended request 'A' blkdebug: Resuming request 'A' -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 57344/57344 bytes at offset XXX -56 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 4096/4096 bytes at offset XXX -4 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 65536/65536 bytes at offset XXX -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -discard 65536/65536 bytes at offset XXX -64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +discard XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Suspended request 'A' blkdebug: Resuming request 'A' -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 57344/57344 bytes at offset XXX -56 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Suspended request 'A' blkdebug: Resuming request 'A' -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 98304/98304 bytes at offset XXX -96 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Suspended request 'A' blkdebug: Resuming request 'A' -wrote 8192/8192 bytes at offset XXX -8 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 81920/81920 bytes at offset XXX -80 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) blkdebug: Suspended request 'A' blkdebug: Resuming request 'A' -wrote 32768/32768 bytes at offset XXX -32 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -wrote 98304/98304 bytes at offset XXX -96 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +wrote XXX/XXX bytes at offset XXX +XXX KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 =3D=3D Verify image content =3D=3D read 65536/65536 bytes at offset 0 --=20 2.29.2 From nobody Thu May 16 09:07:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617108337; cv=none; d=zohomail.com; s=zohoarc; b=W2YKg+5OMimB6XHq3LizocT3XbMkqDRPuQV50/uTrznXSZQ8CB2YcNUUoGhJfKEeEyGYwIviNc93cC3N8h6lkMsb52EShfpBDRdGOr0ByaOA0dOhDpjN3aR+HoNq2L1ExGlMSjYbcYFBiujNz6g9JHEOQKf2s0zCVOVLk67qgYM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617108337; 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=1XB3bbg2K/wiDC0kqo46SHJsuJFQVJXF++lnUQ8jgsA=; b=VqThdINMRZQd7Q7ppHv8xsdczU0izkURnuZPBQ3cixxw5gm62Q5ymDM5i9RkuBn4KD7kUON6xSPyoQRixvnnnR1fQ55Ov9DVLovt6DnNssv5pVQym7qP6JOJwdF9Y1zX4KmnJZ6pNl54km4FdlGz1bTN/RsvOMFT1nMyH+lhYho= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617108337234995.8964486804867; Tue, 30 Mar 2021 05:45:37 -0700 (PDT) Received: from localhost ([::1]:52482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRDkV-0004eG-M8 for importer@patchew.org; Tue, 30 Mar 2021 08:45:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfa-0000y9-1f for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38118) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfP-0003OU-47 for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:29 -0400 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-268-0iiuamm_ORGbnVuBx26Bcg-1; Tue, 30 Mar 2021 08:40:13 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B814B108BD0C; Tue, 30 Mar 2021 12:40:12 +0000 (UTC) Received: from localhost (ovpn-113-220.ams2.redhat.com [10.36.113.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5D1AA669F3; Tue, 30 Mar 2021 12:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617108016; 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=1XB3bbg2K/wiDC0kqo46SHJsuJFQVJXF++lnUQ8jgsA=; b=aNHt9oTQS2MV/MXxhqdq+6mgMRWGmy97haVJcPxRLT28sY/UZ1kFXNPEtp9qOkTpEcj0Op ZBoOixR6OAd9wSYo482UvmCRm5uq1ILHQ1SB9L393AJbH6GIcLIdc9iVV5XI+BAThFkNOH KLI0jfQ5jpbJojWUXX78FBIBw7w0LuA= X-MC-Unique: 0iiuamm_ORGbnVuBx26Bcg-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 6/9] block/mirror: Fix mirror_top's permissions Date: Tue, 30 Mar 2021 14:39:54 +0200 Message-Id: <20210330123957.826170-7-mreitz@redhat.com> In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com> References: <20210330123957.826170-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@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=170.10.133.124; envelope-from=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" mirror_top currently shares all permissions, and takes only the WRITE permission (if some parent has taken that permission, too). That is wrong, though; mirror_top is a filter, so it should take permissions like any other filter does. For example, if the parent needs CONSISTENT_READ, we need to take that, too, and if it cannot share the WRITE permission, we cannot share it either. The exception is when mirror_top is used for active commit, where we cannot take CONSISTENT_READ (because it is deliberately unshared above the base node) and where we must share WRITE (so that it is shared for all images in the backing chain, so the mirror job can take it for the target BB). Signed-off-by: Max Reitz Message-Id: <20210211172242.146671-2-mreitz@redhat.com> Reviewed-by: Eric Blake Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/mirror.c | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/block/mirror.c b/block/mirror.c index 6af02a57c4..d7e54c0ff7 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -89,6 +89,7 @@ typedef struct MirrorBlockJob { typedef struct MirrorBDSOpaque { MirrorBlockJob *job; bool stop; + bool is_commit; } MirrorBDSOpaque; =20 struct MirrorOp { @@ -1522,13 +1523,27 @@ static void bdrv_mirror_top_child_perm(BlockDriverS= tate *bs, BdrvChild *c, return; } =20 - /* Must be able to forward guest writes to the real image */ - *nperm =3D 0; - if (perm & BLK_PERM_WRITE) { - *nperm |=3D BLK_PERM_WRITE; - } + bdrv_default_perms(bs, c, role, reopen_queue, + perm, shared, nperm, nshared); =20 - *nshared =3D BLK_PERM_ALL; + if (s->is_commit) { + /* + * For commit jobs, we cannot take CONSISTENT_READ, because + * that permission is unshared for everything above the base + * node (except for filters on the base node). + * We also have to force-share the WRITE permission, or + * otherwise we would block ourselves at the base node (if + * writes are blocked for a node, they are also blocked for + * its backing file). + * (We could also share RESIZE, because it may be needed for + * the target if its size is less than the top node's; but + * bdrv_default_perms_for_cow() automatically shares RESIZE + * for backing nodes if WRITE is shared, so there is no need + * to do it here.) + */ + *nperm &=3D ~BLK_PERM_CONSISTENT_READ; + *nshared |=3D BLK_PERM_WRITE; + } } =20 /* Dummy node that provides consistent read to its users without requiring= it @@ -1591,6 +1606,8 @@ static BlockJob *mirror_start_job( return NULL; } =20 + target_is_backing =3D bdrv_chain_contains(bs, target); + /* In the case of active commit, add dummy driver to provide consistent * reads on the top, while disabling it in the intermediate nodes, and= make * the backing chain writable. */ @@ -1613,6 +1630,8 @@ static BlockJob *mirror_start_job( bs_opaque =3D g_new0(MirrorBDSOpaque, 1); mirror_top_bs->opaque =3D bs_opaque; =20 + bs_opaque->is_commit =3D target_is_backing; + /* bdrv_append takes ownership of the mirror_top_bs reference, need to= keep * it alive until block_job_create() succeeds even if bs has no parent= . */ bdrv_ref(mirror_top_bs); @@ -1653,7 +1672,6 @@ static BlockJob *mirror_start_job( target_perms =3D BLK_PERM_WRITE; target_shared_perms =3D BLK_PERM_WRITE_UNCHANGED; =20 - target_is_backing =3D bdrv_chain_contains(bs, target); if (target_is_backing) { int64_t bs_size, target_size; bs_size =3D bdrv_getlength(bs); --=20 2.29.2 From nobody Thu May 16 09:07:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617108564; cv=none; d=zohomail.com; s=zohoarc; b=CBsAukJ3okKpJabr+HK7aXU0/aHpMqP03cnbliXrwazxFMvH32+wXTDc8btvsMebfJrRO1jQI2C6EpLbh/mkGSCGTjwV4imW9ZFB9Vg/PLFbjtfrd2HqUFdhAeFgk0OzhtUCLwmUC6QvU6mWwDVoR9dAQllgaHU0XB4CXZrw7PQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617108564; 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=BcV7OFirmTsF/6Vx4L9qORemtTd4108boUdPewlJ840=; b=GeznY9RdVRM6yKRO850G6uT2g9A3rqY0pvEURi/RVyjP/+sWGvXzw5Cs/b4m4e8ngYei8ZFtKCpM14nA1/pgYr/2byXrZpyPmytqLW0ROgulujmC3sP17APFFPJT3kERfbj/lJxwdaDregDb7/PE2k2R3U3hqRjsHwhdiiV+sVc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617108564756562.9500727148273; Tue, 30 Mar 2021 05:49:24 -0700 (PDT) Received: from localhost ([::1]:59220 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRDoB-0007dJ-HF for importer@patchew.org; Tue, 30 Mar 2021 08:49:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58348) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfd-000147-14 for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41019) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfS-0003QL-4F for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:32 -0400 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-346-HEDJC3NRNueQFDhhwveYdg-1; Tue, 30 Mar 2021 08:40:15 -0400 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 D5499DF8A9; Tue, 30 Mar 2021 12:40:14 +0000 (UTC) Received: from localhost (ovpn-113-220.ams2.redhat.com [10.36.113.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 799E12AC85; Tue, 30 Mar 2021 12:40:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617108019; 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=BcV7OFirmTsF/6Vx4L9qORemtTd4108boUdPewlJ840=; b=YY55cID8R2/up8Fk/5VTWClUcMUF7DMjd/Dy25JccsAd1uPvF1Csx96W4ldG/um5NoGvg6 6+wsx9fXhmyckb40hLqfyWyko7LK3eucxzy0tyivPzy3mY5qSF87Tz/Os6lRLlzvZ96/az QDUqw/cpgc+kXLt5GkzHet1PETpKQqQ= X-MC-Unique: HEDJC3NRNueQFDhhwveYdg-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 7/9] qsd: Document FUSE exports Date: Tue, 30 Mar 2021 14:39:55 +0200 Message-Id: <20210330123957.826170-8-mreitz@redhat.com> In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com> References: <20210330123957.826170-1-mreitz@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=mreitz@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=170.10.133.124; envelope-from=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Implementing FUSE exports required no changes to the storage daemon, so we forgot to document them there. Considering that both NBD and vhost-user-blk exports are documented in its man page (and NBD exports in its --help text), we should probably do the same for FUSE. Signed-off-by: Max Reitz Message-Id: <20210217115844.62661-1-mreitz@redhat.com> Reviewed-by: Eric Blake --- docs/tools/qemu-storage-daemon.rst | 19 +++++++++++++++++++ storage-daemon/qemu-storage-daemon.c | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/docs/tools/qemu-storage-daemon.rst b/docs/tools/qemu-storage-d= aemon.rst index 086493ebb3..3ec4bdd914 100644 --- a/docs/tools/qemu-storage-daemon.rst +++ b/docs/tools/qemu-storage-daemon.rst @@ -74,6 +74,7 @@ Standard options: .. 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] + --export [type=3D]fuse,id=3D,node-name=3D,mountpoint=3D[,growable=3Don|off][,writable=3Don|off] =20 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 @@ -92,6 +93,16 @@ Standard options: ``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). =20 + The ``fuse`` export type takes a mount point, which must be a regular fi= le, + on which to export the given block node. That file will not be changed, = it + will just appear to have the block node's content while the export is ac= tive + (very much like mounting a filesystem on a directory does not change wha= t the + directory contains, it only shows a different content while the filesyst= em is + mounted). Consequently, applications that have opened the given file bef= ore + the export became active will continue to see its original content. If + ``growable`` is set, writes after the end of the exported file will grow= the + block node to fit. + .. option:: --monitor MONITORDEF =20 is a QMP monitor definition. See the :manpage:`qemu(1)` manual page for @@ -196,6 +207,14 @@ domain socket ``vhost-user-blk.sock``:: --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 =20 +Export a qcow2 image file ``disk.qcow2`` via FUSE on itself, so the disk i= mage +file will then appear as a raw image:: + + $ qemu-storage-daemon \ + --blockdev driver=3Dfile,node-name=3Dfile,filename=3Ddisk.qcow2 \ + --blockdev driver=3Dqcow2,node-name=3Dqcow2,file=3Dfile \ + --export type=3Dfuse,id=3Dexport,node-name=3Dqcow2,mountpoint=3Ddisk= .qcow2,writable=3Don + See also -------- =20 diff --git a/storage-daemon/qemu-storage-daemon.c b/storage-daemon/qemu-sto= rage-daemon.c index 72900dc2ec..fc8b150629 100644 --- a/storage-daemon/qemu-storage-daemon.c +++ b/storage-daemon/qemu-storage-daemon.c @@ -98,6 +98,10 @@ static void help(void) " export the specified block node over NBD\n" " (requires --nbd-server)\n" "\n" +" --export [type=3D]fuse,id=3D,node-name=3D,mountpoint=3D<= file>\n" +" [,growable=3Don|off][,writable=3Don|off]\n" +" export the specified block node over FUSE\n" +"\n" " --monitor [chardev=3D]name[,mode=3Dcontrol][,pretty[=3Don|off]]\n" " configure a QMP monitor\n" "\n" --=20 2.29.2 From nobody Thu May 16 09:07:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617108783; cv=none; d=zohomail.com; s=zohoarc; b=Rk6eCnNk8JkeW+NZUWSw/V8bxjohNL3DfSIyYRPZlDkllt5LEoGynI3gcAmZwCE3wmCDh8VorVbJOEed1EMSHqt8Zy9O81URYcfGyp1FpS+WehwqTYwS+PMlGC9AfAkgYBFnIgoVf/xYxTpz/gggTMlRpmwx3cyZGwn2j1mED/Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617108783; 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=yHUxUOmr2Qoj4pM9z/cRcpLZAfx5nyjg45qCoUBAHNM=; b=jdTLrODBy71SrbSqAh7RtediNcL1dFYECe0ulEBXLHEhu4FkC4hUko9rwbR3RGlIKielbRJ1BVl/526hlJ4svb916LJ54/vdmF60hcfEYvGsr8bK132eUdUNrRTCpXmDtn+hC1AavV1kprOSVmPXfLKPJpNTF51kVGu3eUfgFzk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617108783769411.1118903122565; Tue, 30 Mar 2021 05:53:03 -0700 (PDT) Received: from localhost ([::1]:42028 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRDri-0003t7-KJ for importer@patchew.org; Tue, 30 Mar 2021 08:53:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfd-00016P-JA for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:33 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:24447) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfS-0003R9-Dw for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:33 -0400 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-256-bbw2bZqkOu6Ob8wrzYGjnA-1; Tue, 30 Mar 2021 08:40:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 84EC1108BD11; Tue, 30 Mar 2021 12:40:17 +0000 (UTC) Received: from localhost (ovpn-113-220.ams2.redhat.com [10.36.113.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 154564F3C6; Tue, 30 Mar 2021 12:40:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617108020; 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=yHUxUOmr2Qoj4pM9z/cRcpLZAfx5nyjg45qCoUBAHNM=; b=SEkNUEmYKowZOOJmCCoGkr6A9hGNPylGfseyClj02t7iuYzd4oQD8nJFc25OdiZ3C/KtJj u2gIt3TktipkdwJWMdf6Q1vdf0zclfQnDiiM4+5gNbo5O3iJasxUVZPhHGA+AUq28dP+ow SWGFgxkSoqhS/EOtZrbwcuHuy1fCXF0= X-MC-Unique: bbw2bZqkOu6Ob8wrzYGjnA-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 8/9] qcow2: Force preallocation with data-file-raw Date: Tue, 30 Mar 2021 14:39:56 +0200 Message-Id: <20210330123957.826170-9-mreitz@redhat.com> In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com> References: <20210330123957.826170-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@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=170.10.133.124; envelope-from=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Setting the qcow2 data-file-raw bit means that you can ignore the qcow2 metadata when reading from the external data file. It does not mean that you have to ignore it, though. Therefore, the data read must be the same regardless of whether you interpret the metadata or whether you ignore it, and thus the L1/L2 tables must all be present and give a 1:1 mapping. This patch changes 244's output: First, the qcow2 file is larger right after creation, because of metadata preallocation. Second, the qemu-img map output changes: Everything that was not explicitly discarded or zeroed is now a data area. Signed-off-by: Max Reitz Message-Id: <20210326145509.163455-2-mreitz@redhat.com> Reviewed-by: Eric Blake --- block/qcow2.c | 34 ++++++++++++++++++++++++++++++++++ tests/qemu-iotests/244.out | 9 ++++----- 2 files changed, 38 insertions(+), 5 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 2fb43c6f7e..9727ae8fe3 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -3503,6 +3503,28 @@ qcow2_co_create(BlockdevCreateOptions *create_option= s, Error **errp) ret =3D -EINVAL; goto out; } + if (qcow2_opts->data_file_raw && + qcow2_opts->preallocation =3D=3D PREALLOC_MODE_OFF) + { + /* + * data-file-raw means that "the external data file can be + * read as a consistent standalone raw image without looking + * at the qcow2 metadata." It does not say that the metadata + * must be ignored, though (and the qcow2 driver in fact does + * not ignore it), so the L1/L2 tables must be present and + * give a 1:1 mapping, so you get the same result regardless + * of whether you look at the metadata or whether you ignore + * it. + */ + qcow2_opts->preallocation =3D PREALLOC_MODE_METADATA; + + /* + * Cannot use preallocation with backing files, but giving a + * backing file when specifying data_file_raw is an error + * anyway. + */ + assert(!qcow2_opts->has_backing_file); + } =20 if (qcow2_opts->data_file) { if (version < 3) { @@ -4238,6 +4260,18 @@ static int coroutine_fn qcow2_co_truncate(BlockDrive= rState *bs, int64_t offset, error_setg_errno(errp, -ret, "Failed to grow the L1 table"); goto fail; } + + if (data_file_is_raw(bs) && prealloc =3D=3D PREALLOC_MODE_OFF) { + /* + * When creating a qcow2 image with data-file-raw, we enforce + * at least prealloc=3Dmetadata, so that the L1/L2 tables are + * fully allocated and reading from the data file will return + * the same data as reading from the qcow2 image. When the + * image is grown, we must consequently preallocate the + * metadata structures to cover the added area. + */ + prealloc =3D PREALLOC_MODE_METADATA; + } } =20 switch (prealloc) { diff --git a/tests/qemu-iotests/244.out b/tests/qemu-iotests/244.out index 7269b4295a..1a3ae31dde 100644 --- a/tests/qemu-iotests/244.out +++ b/tests/qemu-iotests/244.out @@ -83,7 +83,7 @@ qcow2 file size after I/O: 327680 =3D=3D=3D Standalone image with external data file (valid raw) =3D=3D=3D =20 Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D67108864 data_file=3DT= EST_DIR/t.IMGFMT.data data_file_raw=3Don -qcow2 file size before I/O: 196616 +qcow2 file size before I/O: 327680 =20 wrote 4194304/4194304 bytes at offset 1048576 4 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) @@ -93,11 +93,10 @@ wrote 3145728/3145728 bytes at offset 3145728 3 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) No errors were found on the image. =20 -[{ "start": 0, "length": 1048576, "depth": 0, "zero": true, "data": false}, -{ "start": 1048576, "length": 1048576, "depth": 0, "zero": false, "data": = true, "offset": 1048576}, +[{ "start": 0, "length": 2097152, "depth": 0, "zero": false, "data": true,= "offset": 0}, { "start": 2097152, "length": 2097152, "depth": 0, "zero": true, "data": f= alse}, -{ "start": 4194304, "length": 1048576, "depth": 0, "zero": true, "data": f= alse, "offset": 4194304}, -{ "start": 5242880, "length": 61865984, "depth": 0, "zero": true, "data": = false}] +{ "start": 4194304, "length": 2097152, "depth": 0, "zero": true, "data": f= alse, "offset": 4194304}, +{ "start": 6291456, "length": 60817408, "depth": 0, "zero": false, "data":= true, "offset": 6291456}] =20 read 1048576/1048576 bytes at offset 0 1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) --=20 2.29.2 From nobody Thu May 16 09:07:07 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1617108785; cv=none; d=zohomail.com; s=zohoarc; b=QAGcwq+uQLYgSKohU8qsJto9xCWorCFqeNx9N7opeKnjnoKyyKMSBivS7MasHjYMh5sgvBHybyIs4KZcTVS2Qes0jNTrw2So/0fHlmcv5wicn79vuzwvIyKpy+UQGuqYcMftnUUTZ0vOOe3lxra535x6+F+xokwSaIHdagcK4ec= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1617108785; 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=pqZQIms9YMfRAaG1TL/hv7yX/gB0kV4uhCEXI6Anp8c=; b=SAXIZLDImo5tYLEbmcj+p/0QjXHNouOUsCSE5vovtXZIeRRkpkyjDRdhj06EUZY7s2h0UL4Q19BH7N2GKO1Xi1f3OV9jf7xS2i3RW8Wi1OgrVMiwibATG4xRTLqbYhA1/fIK4RRmGgcMmxQqTIYU1gs6u+wnncgwMvTNVOUjy8o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1617108785163492.8028551296643; Tue, 30 Mar 2021 05:53:05 -0700 (PDT) Received: from localhost ([::1]:42168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRDrj-0003wd-Ug for importer@patchew.org; Tue, 30 Mar 2021 08:53:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58368) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfe-00017h-1b for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36460) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRDfW-0003Ww-0R for qemu-devel@nongnu.org; Tue, 30 Mar 2021 08:40:33 -0400 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-488-ZHJ4dnO3OsutkSeIf8zsqw-1; Tue, 30 Mar 2021 08:40:20 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E75A18030BB; Tue, 30 Mar 2021 12:40:19 +0000 (UTC) Received: from localhost (ovpn-113-220.ams2.redhat.com [10.36.113.220]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5607A5D9CC; Tue, 30 Mar 2021 12:40:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617108025; 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=pqZQIms9YMfRAaG1TL/hv7yX/gB0kV4uhCEXI6Anp8c=; b=LBfIdpYZYBetzA7RkmZGk/WuPGK2gl7OsAhQ9RwXxrpWitADlvqYZo7ep3onX6QTURkYOy uMkqDAoJYHlDZfkSiT+eqKzK4cIPgqr/iKK9H89e7HWryWajBEHY2XzlHmd/8aUJTC4G62 ZvdG3nz658hUZDjbUU3LbSlj5RUK5mg= X-MC-Unique: ZHJ4dnO3OsutkSeIf8zsqw-1 From: Max Reitz To: qemu-block@nongnu.org Subject: [PULL 9/9] iotests/244: Test preallocation for data-file-raw Date: Tue, 30 Mar 2021 14:39:57 +0200 Message-Id: <20210330123957.826170-10-mreitz@redhat.com> In-Reply-To: <20210330123957.826170-1-mreitz@redhat.com> References: <20210330123957.826170-1-mreitz@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mreitz@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=mreitz@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, 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: Kevin Wolf , Peter Maydell , qemu-devel@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Three test cases: (1) Adding a qcow2 (metadata) file to an existing data file, see whether we can read the existing data through the qcow2 image. (2) Append data to the data file, grow the qcow2 image accordingly, see whether we can read the new data through the qcow2 image. (3) At runtime, add a backing image to a freshly created qcow2 image with an external data file (with data-file-raw). Reading data from the qcow2 image must return the same result as reading data from the data file, so everything in the backing image must be ignored. (This did not use to be the case, because without the L2 tables preallocated, all clusters would appear as unallocated, and so the qcow2 driver would fall through to the backing file.) Signed-off-by: Max Reitz Message-Id: <20210326145509.163455-3-mreitz@redhat.com> Reviewed-by: Eric Blake --- tests/qemu-iotests/244 | 104 +++++++++++++++++++++++++++++++++++++ tests/qemu-iotests/244.out | 59 +++++++++++++++++++++ 2 files changed, 163 insertions(+) diff --git a/tests/qemu-iotests/244 b/tests/qemu-iotests/244 index a46b441627..3e61fa25bb 100755 --- a/tests/qemu-iotests/244 +++ b/tests/qemu-iotests/244 @@ -38,6 +38,7 @@ trap "_cleanup; exit \$status" 0 1 2 3 15 # get standard environment, filters and checks . ./common.rc . ./common.filter +. ./common.qemu =20 _supported_fmt qcow2 _supported_proto file @@ -267,6 +268,109 @@ case $result in ;; esac =20 +echo +echo '=3D=3D=3D Preallocation with data-file-raw =3D=3D=3D' + +echo +echo '--- Using a non-zeroed data file ---' + +# Using data-file-raw must enforce at least metadata preallocation so +# that it does not matter whether one reads the raw file or the qcow2 +# file + +# Pre-create the data file, write some data. Real-world use cases for +# this are adding a qcow2 metadata file to a block device (i.e., using +# the device as the data file) or adding qcow2 features to pre-existing +# raw images (e.g. because the user now wants persistent dirty bitmaps). +truncate -s 1M "$TEST_IMG.data" +$QEMU_IO -f raw -c 'write -P 42 0 1M' "$TEST_IMG.data" | _filter_qemu_io + +# We cannot use qemu-img to create the qcow2 image, because it would +# clear the data file. Use the blockdev-create job instead, which will +# only format the qcow2 image file. +touch "$TEST_IMG" +_launch_qemu \ + -blockdev file,node-name=3Ddata,filename=3D"$TEST_IMG.data" \ + -blockdev file,node-name=3Dmeta,filename=3D"$TEST_IMG" + +_send_qemu_cmd $QEMU_HANDLE '{ "execute": "qmp_capabilities" }' 'return' + +_send_qemu_cmd $QEMU_HANDLE \ + '{ "execute": "blockdev-create", + "arguments": { + "job-id": "create", + "options": { + "driver": "qcow2", + "size": '"$((1 * 1024 * 1024))"', + "file": "meta", + "data-file": "data", + "data-file-raw": true + } } }' \ + '"status": "concluded"' + +_send_qemu_cmd $QEMU_HANDLE \ + '{ "execute": "job-dismiss", "arguments": { "id": "create" } }' \ + 'return' + +_cleanup_qemu + +echo +echo 'Comparing pattern:' + +# Reading from either the qcow2 file or the data file should return +# the same result: +$QEMU_IO -f raw -c 'read -P 42 0 1M' "$TEST_IMG.data" | _filter_qemu_io +$QEMU_IO -f $IMGFMT -c 'read -P 42 0 1M' "$TEST_IMG" | _filter_qemu_io + +# For good measure +$QEMU_IMG compare -f raw "$TEST_IMG.data" "$TEST_IMG" + +echo +echo '--- Truncation (growing) ---' + +# Append some new data to the raw file, then resize the qcow2 image +# accordingly and see whether the new data is visible. Technically +# that is not allowed, but it is reasonable behavior, so test it. +truncate -s 2M "$TEST_IMG.data" +$QEMU_IO -f raw -c 'write -P 84 1M 1M' "$TEST_IMG.data" | _filter_qemu_io + +$QEMU_IMG resize "$TEST_IMG" 2M + +echo +echo 'Comparing pattern:' + +$QEMU_IO -f raw -c 'read -P 42 0 1M' -c 'read -P 84 1M 1M' "$TEST_IMG.data= " \ + | _filter_qemu_io +$QEMU_IO -f $IMGFMT -c 'read -P 42 0 1M' -c 'read -P 84 1M 1M' "$TEST_IMG"= \ + | _filter_qemu_io + +$QEMU_IMG compare -f raw "$TEST_IMG.data" "$TEST_IMG" + +echo +echo '--- Giving a backing file at runtime ---' + +# qcow2 files with data-file-raw cannot have backing files given by +# their image header, but qemu will allow you to set a backing node at +# runtime -- it should not have any effect, though (because reading +# from the qcow2 node should return the same data as reading from the +# raw node). + +_make_test_img -o "data_file=3D$TEST_IMG.data,data_file_raw=3Don" 1M +TEST_IMG=3D"$TEST_IMG.base" _make_test_img 1M + +# Write something that is not zero into the base image +$QEMU_IO -c 'write -P 42 0 1M' "$TEST_IMG.base" | _filter_qemu_io + +echo +echo 'Comparing qcow2 image and raw data file:' + +# $TEST_IMG and $TEST_IMG.data must show the same data at all times; +# that is, the qcow2 node must not fall through to the backing image +# at any point +$QEMU_IMG compare --image-opts \ + "driver=3Draw,file.filename=3D$TEST_IMG.data" \ + "file.filename=3D$TEST_IMG,backing.file.filename=3D$TEST_IMG.base" + # success, all done echo "*** done" rm -f $seq.full diff --git a/tests/qemu-iotests/244.out b/tests/qemu-iotests/244.out index 1a3ae31dde..99f56ac18c 100644 --- a/tests/qemu-iotests/244.out +++ b/tests/qemu-iotests/244.out @@ -137,4 +137,63 @@ wrote 512/512 bytes at offset 0 512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) =20 Success: qemu-io failed, so the data file was flushed + +=3D=3D=3D Preallocation with data-file-raw =3D=3D=3D + +--- Using a non-zeroed data file --- +wrote 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +{ "execute": "qmp_capabilities" } +{"return": {}} +{ "execute": "blockdev-create", + "arguments": { + "job-id": "create", + "options": { + "driver": "IMGFMT", + "size": 1048576, + "file": "meta", + "data-file": "data", + "data-file-raw": true + } } } +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "create"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "create"}} +{"return": {}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "create"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "create"}} +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "create"}} +{ "execute": "job-dismiss", "arguments": { "id": "create" } } +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event"= : "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "create"}} +{"return": {}} + +Comparing pattern: +read 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Images are identical. + +--- Truncation (growing) --- +wrote 1048576/1048576 bytes at offset 1048576 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Image resized. + +Comparing pattern: +read 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 1048576/1048576 bytes at offset 1048576 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +read 1048576/1048576 bytes at offset 1048576 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) +Images are identical. + +--- Giving a backing file at runtime --- +Formatting 'TEST_DIR/t.IMGFMT', fmt=3DIMGFMT size=3D1048576 data_file=3DTE= ST_DIR/t.IMGFMT.data data_file_raw=3Don +Formatting 'TEST_DIR/t.IMGFMT.base', fmt=3DIMGFMT size=3D1048576 +wrote 1048576/1048576 bytes at offset 0 +1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) + +Comparing qcow2 image and raw data file: +Images are identical. *** done --=20 2.29.2