From nobody Wed Dec 17 08:55:56 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1744295131; cv=none; d=zohomail.com; s=zohoarc; b=ZDSwkz92gmP06CTQKJbNfBlldnEEqYUpaifvB7zXQJ2oxY/Kz7RWdRiXn/vkpYFTrHqkOY7LS9Eirgz/lslPanOa9iWRAmfUpRBScboI0hTErIlsRzE/QoC9GSG3zVAcXEWMLbM6UsdjVRm24X7TeXQXW7ocuqYOZGzHZHnW6Fo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744295131; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id:Cc; bh=bLlOYYTy+cXslr6Ng0bZ0cAsT2/1eKCokAL57CAveTc=; b=UbOt8l+OJcD0k44nEgdnhmPykf1AAmKeagtHSRa3LNiEydHV/nO3zy4ABJ5f3kbe2rNsSWzqEDmUTBO/u2aLqy22c01YVXvF+xkVBgiEUOILYYeyX9XNdpn4bBPzabLO5rrbEMy/m1Yu5EzPbdtAELaGj0LI/R980LCcaeTBZpo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 17442951311193.0634170657556297; Thu, 10 Apr 2025 07:25:31 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 8EA5817E9; Thu, 10 Apr 2025 10:25:30 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id EFA2B1806; Thu, 10 Apr 2025 10:24:38 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E3CC515FE; Thu, 10 Apr 2025 10:24:31 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 6E8ED1595 for ; Thu, 10 Apr 2025 10:24:31 -0400 (EDT) Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-138-tpwp0zvAMu2Lrd85qf7VwQ-1; Thu, 10 Apr 2025 10:24:29 -0400 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D9DCF195609E for ; Thu, 10 Apr 2025 14:24:28 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.44.22.8]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 1E708195DF86 for ; Thu, 10 Apr 2025 14:24:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1744295071; h=from:from: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; bh=nyvAqIeNWg7avLFDh27+jZa/lKDZ+C4iu7FiOgRf4h4=; b=ec2VsOJx0mfOSpRjs7WlS2nGvW7qfoyrhQl0h+UDFBeFjwDgyUSaloGOIvApbnlP/2UnNE xuSLyyPCMGqM7ijsZ6Z4LfBD++TLCRS4+1BYFWNCvBp5mQ1ne6cw8rRjGih49jjCKh1f9t nN88zyaVor4hS5rh+Vcho/FBmcfYZw4= X-MC-Unique: tpwp0zvAMu2Lrd85qf7VwQ-1 X-Mimecast-MFC-AGG-ID: tpwp0zvAMu2Lrd85qf7VwQ_1744295069 To: devel@lists.libvirt.org Subject: [PATCH 2/3] qemuDomainBlockCopyCommon: Reorder setup of 'mirror' data Date: Thu, 10 Apr 2025 16:24:23 +0200 Message-ID: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: D6x4svNpZBs-nB0rl-Tf3Xj2mdGaepIT2g_CMXrQCdw_1744295069 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: SPBWY2RXLDRJOJHXQYH5YMD2AQ6PBESD X-Message-ID-Hash: SPBWY2RXLDRJOJHXQYH5YMD2AQ6PBESD X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1744295133636019000 Content-Type: text/plain; charset="utf-8" From: Peter Krempa While exploring an idea that modified the setup of the mirror I've noticed that the code setting up the 'discard' field in the block copy job happens after setup of the stroage source, while normally e.g. in qemuDomainPrepareStorageSource() it happens before. Reorder it despite not having an effect currently. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6ce949dd07..f657751057 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14384,13 +14384,6 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, * as read-write for the duration of the copy job */ mirror->readonly =3D false; - /* we must initialize XML-provided chain prior to detecting to keep se= mantics - * with VM startup */ - for (n =3D mirror; virStorageSourceIsBacking(n); n =3D n->backingStore= ) { - if (qemuDomainPrepareStorageSourceBlockdev(disk, n, priv, cfg) < 0) - goto endjob; - } - /* 'qemuDomainPrepareStorageSourceBlockdev' calls * 'qemuDomainPrepareDiskSourceData' which propagates 'detect_zeroes' * into the topmost virStorage source of the disk chain. @@ -14401,6 +14394,13 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, mirror->detect_zeroes =3D disk->detect_zeroes; mirror->discard_no_unref =3D disk->discard_no_unref; + /* we must initialize XML-provided chain prior to detecting to keep se= mantics + * with VM startup */ + for (n =3D mirror; virStorageSourceIsBacking(n); n =3D n->backingStore= ) { + if (qemuDomainPrepareStorageSourceBlockdev(disk, n, priv, cfg) < 0) + goto endjob; + } + /* If reusing an external image that includes a backing file but the u= ser * did not enumerate the chain in the XML we need to detect the chain = */ if (mirror_reuse && --=20 2.49.0