From nobody Sun Apr 28 05:05:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1627458878; cv=none; d=zohomail.com; s=zohoarc; b=IP/2gvp6ikUokrz2lpEQD5vm50RP3DyMlahHLVO9FNdEGBU+txlNVvJ0Z82tM6Sozv64iiLsIbU4djDRWkh3vepPK5Jh+3Wuy+Np0jPWV+iIbM352Mb2RAdAzfbdQsu5Uic3xDghB1GrgrRAf3+X3Rocmi26xAjgZdRVjYYWflw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627458878; h=Content-Type:Content-Transfer-Encoding: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=6fUDY7rdAKxDV635qJ2VUxOw3gSRWS+q+5tcfAbOe58=; b=KkTot+sYds9nj35fwbl5ZoCur2R9EZQVC/TAWzm9N6eTPieleOXXXN6oHhRRXL2zfFWyEABep9Eco7gqq+DPHsuqaFca9xwJDZsl/bSuDHBeYPqiVSIIz+ievzlwjO4gUTnskKkLC7FJhEH/FFgqTxAltPyW8JdruAytaXGmT/A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 162745887799939.255494463928585; Wed, 28 Jul 2021 00:54:37 -0700 (PDT) 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-253-3e5GfkJbP6-MJdUxnmj9yQ-1; Wed, 28 Jul 2021 03:54:34 -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 F063494EE1; Wed, 28 Jul 2021 07:54:28 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6FD3519D9D; Wed, 28 Jul 2021 07:54:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 7476D180BAB1; Wed, 28 Jul 2021 07:54:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16S7pjaL010148 for ; Wed, 28 Jul 2021 03:51:45 -0400 Received: by smtp.corp.redhat.com (Postfix) id 68CA06060F; Wed, 28 Jul 2021 07:51:45 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA1DE60862 for ; Wed, 28 Jul 2021 07:51:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627458876; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=6fUDY7rdAKxDV635qJ2VUxOw3gSRWS+q+5tcfAbOe58=; b=EtQWF+zTa6ayate++/39YdxVbM7gqMWh5VvsyW9KH2mZEFkVeWpVWhf5E3jIqutBywmYud hgp3wgOBC2aQ4sAMdrJ3E9X9fG+cWt0Te1rIsZ/q+7vy+dUw97VAuIfrIYAw5BAOcyz21Z o7KunaF6QwAI90KLdW6KRn5QV7kV+KI= X-MC-Unique: 3e5GfkJbP6-MJdUxnmj9yQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] qemu: block: Pass discard requests through the copy-on-read block filter Date: Wed, 28 Jul 2021 09:51:38 +0200 Message-Id: <5ab8ff30aed84d9cb599028a606313020d7d8c61.1627458520.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1627458879208100001 Content-Type: text/plain; charset="utf-8" We need to pass the 'trim' requests through the copy-on-read filter so if a user configures a discard policy on the disk the requests get through to the appropriate format layer in the blockdev tree. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1986509 Reported-by: Richard W.M. Jones Tested-by: Richard W.M. Jones Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Michal Privoznik Reviewed-by: Richard W.M. Jones --- src/qemu/qemu_block.c | 1 + tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 1610f72d07..4691dff4f7 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2157,6 +2157,7 @@ qemuBlockStorageGetCopyOnReadProps(virDomainDiskDef *= disk) "s:driver", "copy-on-read", "s:node-name", priv->nodeCopyOnR= ead, "s:file", disk->src->nodeformat, + "s:discard", "unmap", NULL)); return ret; diff --git a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args b/= tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args index 93d3a06c88..690d4f3ea1 100644 --- a/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args +++ b/tests/qemuxml2argvdata/disk-copy_on_read.x86_64-latest.args @@ -30,7 +30,7 @@ XDG_CONFIG_HOME=3D/tmp/lib/domain--1-test/.config \ -device virtio-serial-pci,id=3Dvirtio-serial0,bus=3Dpci.0,addr=3D0x6 \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/images/f14.img","= node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}' \ -blockdev '{"node-name":"libvirt-2-format","read-only":false,"driver":"qco= w2","file":"libvirt-2-storage"}' \ --blockdev '{"driver":"copy-on-read","node-name":"libvirt-CoR-vda","file":"= libvirt-2-format"}' \ +-blockdev '{"driver":"copy-on-read","node-name":"libvirt-CoR-vda","file":"= libvirt-2-format","discard":"unmap"}' \ -device virtio-blk-pci,bus=3Dpci.0,addr=3D0x4,drive=3Dlibvirt-CoR-vda,id= =3Dvirtio-disk0,bootindex=3D2 \ -blockdev '{"driver":"file","filename":"/var/lib/libvirt/Fedora-14-x86_64-= Live-KDE.iso","node-name":"libvirt-1-storage","auto-read-only":true,"discar= d":"unmap"}' \ -blockdev '{"node-name":"libvirt-1-format","read-only":true,"driver":"raw"= ,"file":"libvirt-1-storage"}' \ --=20 2.31.1 From nobody Sun Apr 28 05:05:57 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1627458877; cv=none; d=zohomail.com; s=zohoarc; b=POLbL4Cz8cCZB/M7O56dP9Teb+OSCscL7j5iqGofvR6O1wXboMrdFrEdLiV9SRIg4nVOPGh5kZHjqD4xFkQEZke7iVPeEJQa9oNeWFg+LJyZvL9/2QgnMhPKYybFI8lRnMCZUkmzsXp8zfmzlk8I5WKzmHGg8oteE48ZzWJI1tI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627458877; h=Content-Type:Content-Transfer-Encoding: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=GtUVQME/YsbBOius88i5QnBpGVOY/Y6RKeX2OyWWJj0=; b=R+SFYi2PaqopOzmCltoOzeNNXk9TQqQEbAefiIwiBadzi6Od6fLG+vZnhad6arSLvffAMtj4jOgJl/s8xBV436lX/R1N0+FI4LN25gYFNOvSiRGF4lHf2PU7GrlQj7/zBYGZmJ3W0lcDWGTUuCiJcFs/JFGVDMmh2BQzCPFBoOA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1627458877572666.9455384136138; Wed, 28 Jul 2021 00:54:37 -0700 (PDT) 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-276-CXU-RbRIPGG_S0DoxjJbvw-1; Wed, 28 Jul 2021 03:54:34 -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 76CE5800D55; Wed, 28 Jul 2021 07:54:29 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F123F60C0F; Wed, 28 Jul 2021 07:54:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E389F4BB7C; Wed, 28 Jul 2021 07:54:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16S7pkeF010153 for ; Wed, 28 Jul 2021 03:51:46 -0400 Received: by smtp.corp.redhat.com (Postfix) id 6D7BD6060F; Wed, 28 Jul 2021 07:51:46 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id C6C8760862 for ; Wed, 28 Jul 2021 07:51:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627458876; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=GtUVQME/YsbBOius88i5QnBpGVOY/Y6RKeX2OyWWJj0=; b=eNY+fRtx11cqfgFH7aaU0gcIgbnyXc8Jjk7ig/aSBu6x3lj0PaKQ4zH5KG2NXEz4Fvsdrj gkribvp0ccWUOX1POBdOmllWUWMYHBSG9Birytk4+lEXU6zyUBtcltxG5TEm3ssEoomzL7 QKMC4yImNsO+Owb0m5E6apCl0WvQ6GI= X-MC-Unique: CXU-RbRIPGG_S0DoxjJbvw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] NEWS: Mention fix for 'copy_on_read' disks with trimming enabled Date: Wed, 28 Jul 2021 09:51:39 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1627458879209100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik Reviewed-by: Richard W.M. Jones --- NEWS.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.rst b/NEWS.rst index 618f478b81..b4adde9f82 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -46,6 +46,12 @@ v7.6.0 (unreleased) in the top layer. The intention was to emit two events only when the original registration was done without the index. + * qemu: Pass discard requests for disks with ``copy_on_read=3D'on'`` + + When a disk using the ``copy_on_read=3D'on'`` option is configured als= o with + ``discard=3D'unmap'`` the discard requests will now be passed to the + underlying image freeing up the space. + v7.5.0 (2021-07-01) =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.31.1