From nobody Wed Dec 17 07:05:59 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=1744295112; cv=none; d=zohomail.com; s=zohoarc; b=DcpLxBKg/NFWvAkOanrExdhyarjwDXMQ0EBK6pA8s0QV9kxiLqj1DXPRlkZiku4uEe4pZIw2yuCq70aMIpDeyjyZUt3hk/3ZW9/mK8MDbw7OMfM/S+LOFGsE+cKMHtWkQhxqq+aW8w2I9OfXuvBntOxsclErueKZA2LIy3LxiE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744295112; 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=IEevQ7KtR/W1GW+BpK6Hq2RaCgNQWjLgRLXVyZTA59I=; b=QgeJ1R2Tq0yhxVFn0+WoAq1cu83JeTmBbpJrRbcPYDaZ2RxkT5DDkVSmEWSS5Th20DTCJGyeikVgf3idGB8fBDd3Znng3ZS9eNXWv+FQIpfhSX3Lvdw0FKr/Wx48rE1vhOEz+K0+1fS9uoqFP9yKcSC32t9J+IVsy0RkfdplA5k= 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 1744295112459163.3617240809392; Thu, 10 Apr 2025 07:25:12 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id DFDAE182A; Thu, 10 Apr 2025 10:25:11 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 41DEB17FF; Thu, 10 Apr 2025 10:24:36 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 964C515F9; Thu, 10 Apr 2025 10:24:30 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 372981595 for ; Thu, 10 Apr 2025 10:24:30 -0400 (EDT) Received: from mx-prod-mc-04.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-651-3oD54CtDNv2O48K5H1b9pw-1; Thu, 10 Apr 2025 10:24:28 -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-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 93A871955DCC for ; Thu, 10 Apr 2025 14:24:27 +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 D9A2719560AD for ; Thu, 10 Apr 2025 14:24:26 +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_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=1744295069; 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=PNsBg6VVjWZxxK0gudi1Fu5hboNke4v+z8HiZd3tpSw=; b=JSTVJClHvkKuuo3dDAPiUvLuSVTImL38UpAE7aL0Rtegsr93+YsaBZlNDL+yptTOmgrwPX fxUpYGksGgtS6C1RnHEtcYjmUyPWWtAq+JbVxYKxbWreZIMwJhohmKnwqo6nU59UTQTl2w 4cDbwm5ltVg8vlX3aNavI6kz4PiyUrA= X-MC-Unique: 3oD54CtDNv2O48K5H1b9pw-1 X-Mimecast-MFC-AGG-ID: 3oD54CtDNv2O48K5H1b9pw_1744295067 To: devel@lists.libvirt.org Subject: [PATCH 1/3] qemu: domain: Unexport 'qemuDomainPrepareStorageSourceBlockdevNodename' Date: Thu, 10 Apr 2025 16:24:22 +0200 Message-ID: <12b49de4493bfa4b6a23660e868ef0bd5f7c526b.1744295000.git.pkrempa@redhat.com> 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: 1fCzMk5N16AQQko9dxIdomTM_bV9NA-erITZoGl8SbI_1744295067 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: Z6KCNSCFHZKIUK6IAQU5TTT7QKSVC4GA X-Message-ID-Hash: Z6KCNSCFHZKIUK6IAQU5TTT7QKSVC4GA 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: 1744295112823019000 Content-Type: text/plain; charset="utf-8" From: Peter Krempa The function is referenced only from within qemu_domain.c Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 2 +- src/qemu/qemu_domain.h | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index c3ca4b3040..63ea7db33a 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9694,7 +9694,7 @@ qemuDomainPrepareStorageSourceFDs(virStorageSource *s= rc, } -int +static int qemuDomainPrepareStorageSourceBlockdevNodename(virDomainDiskDef *disk, virStorageSource *src, const char *nodenameprefix, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 70e1fb187f..07b2151f6b 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -757,11 +757,6 @@ int qemuDomainStorageSourceAccessAllow(virQEMUDriver *= driver, bool newSource, bool chainTop); -int qemuDomainPrepareStorageSourceBlockdevNodename(virDomainDiskDef *disk, - virStorageSource *src, - const char *nodenamepre= fix, - qemuDomainObjPrivate *p= riv, - virQEMUDriverConfig *cf= g); int qemuDomainPrepareStorageSourceBlockdev(virDomainDiskDef *disk, virStorageSource *src, qemuDomainObjPrivate *priv, --=20 2.49.0 From nobody Wed Dec 17 07:05:59 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 Reviewed-by: J=C3=A1n Tomko --- 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 From nobody Wed Dec 17 07:05:59 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=1744295146; cv=none; d=zohomail.com; s=zohoarc; b=bzb5NHgXSiD9Al/Uc+2IHgk6qqp6rm+HjFtqX43v/pgUjfEhnYnPzNKlVd4YkpyhRNrlPw3fOusVKw37k62dqLedYa6f3i+GrrJ48NxOEwp7MDQ11flK4WYMETA2w764fsbVwYUogmrd3T6rqHqrlMYina+Sal3MhPdbE6fS/X8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1744295146; 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=z2+6p5pyKq4OOvF9u3vPHLCs7nan764Jn3egOuhQh7Q=; b=gZ2gjJsd3JCts3NTL2Jk8EVnH3Ll0WqgGRkORYxwIAA9LXKxQr+RvP+hT2TAwwewlca5drk394QxuhvkHBOZI2k2nsjFY9xnd0q+WJVp6x/zNpabVAHKzu2XMR8ykrX6e4RaGf3pzPrz+XT+0gn1+GXFRdDobKJ7FLollZeqXMc= 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 174429514683794.38831832494441; Thu, 10 Apr 2025 07:25:46 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 0F32416DE; Thu, 10 Apr 2025 10:25:46 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 043F017DB; Thu, 10 Apr 2025 10:24:42 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 487111595; Thu, 10 Apr 2025 10:24:33 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 C1DA91595 for ; Thu, 10 Apr 2025 10:24:32 -0400 (EDT) Received: from mx-prod-mc-03.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-169-vzErHxSvOm60HflMfPwNhA-1; Thu, 10 Apr 2025 10:24:30 -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-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 0DFD61954B38 for ; Thu, 10 Apr 2025 14:24:30 +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 4E0ED195DF86 for ; Thu, 10 Apr 2025 14:24:29 +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_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=1744295072; 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=s1vb1BSdUjHPnyNWcMnV8L6ABIiA4JoPR0MMHTZbqYY=; b=XI2IuNBcR8vtggQCCGImuLq3Ik9RQeDEkjC46x1JICSz8sgHIJNnTqzGhs3OB4CipJYG3P ve65I4soC3T+gac8xvYm6K20kro27R3Fe3XA/KC/H4lA2LbZGd0nH8y7ynkkMtZfKIlztS 35vydxGT0sAe246eu+AWH13ItQkynF4= X-MC-Unique: vzErHxSvOm60HflMfPwNhA-1 X-Mimecast-MFC-AGG-ID: vzErHxSvOm60HflMfPwNhA_1744295070 To: devel@lists.libvirt.org Subject: [PATCH 3/3] qemuDomainBlockCopyCommon: Don't revoke access to file twice on failure Date: Thu, 10 Apr 2025 16:24:24 +0200 Message-ID: <93ddb809e72641524f45eb1dc5e76cd041b085df.1744295000.git.pkrempa@redhat.com> 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: 9_NoowbR8jdMd3OMa7Yki3uDEai0AMN2CZJPELnGelk_1744295070 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 6S3435YF4TVXCLV63C6LYEHQ6YGBHY42 X-Message-ID-Hash: 6S3435YF4TVXCLV63C6LYEHQ6YGBHY42 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: 1744295149045019000 Content-Type: text/plain; charset="utf-8" From: Peter Krempa If the copy job fails to start up when calling the 'blockdev-mirror' command the code would call qemuDomainStorageSourceChainAccessRevoke() twice; once right after the monitor call and the second time in the 'endjob' section. Remove the one directly after the monitor call and let the common cleanup handle it. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index f657751057..2afe6fdc83 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14497,10 +14497,8 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, virDomainAuditDisk(vm, NULL, mirror, "mirror", ret >=3D 0); qemuDomainObjExitMonitor(vm); - if (ret < 0) { - qemuDomainStorageSourceChainAccessRevoke(driver, vm, mirror); + if (ret < 0) goto endjob; - } /* Update vm in place to match changes. */ need_unlink =3D false; --=20 2.49.0