From nobody Fri May 10 16:23:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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.129.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=1645622203; cv=none; d=zohomail.com; s=zohoarc; b=RPMAQnsBB/N6o405FILle7UQ7Ew0Nqi1y64QPNJruPKPo4KH7CucoRsH6Zw28WVoF/LXo2MmzGlfM55PpC6YmQX8PrxB9q59USM//VBD3P+wHdYZYVbN3LAIC7EswFojsZPmxrCanmYziPnGsIS/rHHPvREaXuKqWHPksvWXiQ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645622203; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=VauVcSYh8YefocNCSY9mmEXWCzxwFj/Avfj/IuA9g+o=; b=JCKWMM8c4H0TWbKsb3QjgEQ0r3uHvCNRJFcYhTUsYZGwxDYdC10UuunLosEMmhtcaZEzMjpFw1SX+sASlaFMLpADr7V/MKakAFOXZeU4IlNNPVrPPMrrWNVD8JUmmb0a7g6s8d+pCBi4gAU4tXZ1s/C4BA98LBxClPc1eKDVzJU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.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.129.124]) by mx.zohomail.com with SMTPS id 1645622203491338.5574663342951; Wed, 23 Feb 2022 05:16:43 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-459-3R5QqzfONLqNZTPuK1j4Vg-1; Wed, 23 Feb 2022 08:16:40 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 414511091DA3; Wed, 23 Feb 2022 13:16:35 +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 20BA081F79; Wed, 23 Feb 2022 13:16:35 +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 E78FF58447; Wed, 23 Feb 2022 13:16:34 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 21NDDHpf027486 for ; Wed, 23 Feb 2022 08:13:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2FB1E84961; Wed, 23 Feb 2022 13:13:17 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8CE5C84967 for ; Wed, 23 Feb 2022 13:13:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645622202; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=VauVcSYh8YefocNCSY9mmEXWCzxwFj/Avfj/IuA9g+o=; b=VDn9J/1FvnG75t+kJ7UZ47j1wf6EDcQNyr2n9lc/RYo3+QomASc0FQHQ61f9+BWZ2seoA4 AIX7drQkjwrK4i/w/tH5rO4xTWecJ3KIbGPUFCq7Dl13PGIuns+dk9uBjbcBSJOrlHqdAw VdnBe5Ma7aBciHHPLftPADCz5ugIAVI= X-MC-Unique: 3R5QqzfONLqNZTPuK1j4Vg-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH] qemu: block copy: Propagate 'detect_zeroes' properly into mirror definition Date: Wed, 23 Feb 2022 14:13:00 +0100 Message-Id: <67c936c61392231ed92518a03d0aefe16b9b6076.1645621980.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.13 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: 1645622205979100001 Content-Type: text/plain; charset="utf-8" 'qemuDomainPrepareDiskSourceData' propagates 'detect_zeroes' only for the disk source image, but the mirror destination has the ambition to replace the disk source when the job is finished, so we need to propagate the 'detect_zeroes' setting also in that case. Unfortunately it would become very hairy to either set 'disk->mirror' sooner or propagate that we want this done into 'qemuDomainPrepareDiskSourceData', so the most straightforward solution is to do the propagation inside 'qemuDomainBlockCopyCommon'. Closes: https://gitlab.com/libvirt/libvirt/-/issues/277 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index e417d358cd..4fc998cde5 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14977,6 +14977,14 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, if (qemuDomainPrepareStorageSourceBlockdev(disk, n, priv, cfg)= < 0) goto endjob; } + + /* 'qemuDomainPrepareStorageSourceBlockdev' calls + * 'qemuDomainPrepareDiskSourceData' which propagates 'detect_zero= es' + * into the topmost virStorage source of the disk chain. + * Since 'mirror' has the ambition to replace it we need to propag= ate + * it into the mirror too. We do it directly as otherwise we'd need + * to modify all callers of 'qemuDomainPrepareStorageSourceBlockde= v' */ + mirror->detect_zeroes =3D disk->detect_zeroes; } /* If reusing an external image that includes a backing file but the u= ser --=20 2.35.1