From nobody Tue Dec 16 13:50:32 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=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1738690051500423.9163578645448; Tue, 4 Feb 2025 09:27:31 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id DE9AF1D75; Tue, 4 Feb 2025 12:27:30 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 6F2581E31; Tue, 4 Feb 2025 12:25:51 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id A8F6C1D3E; Tue, 4 Feb 2025 12:25:46 -0500 (EST) 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 1C87E1D7C for ; Tue, 4 Feb 2025 12:25:35 -0500 (EST) Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-586-XiA-HzQzNICn_vVLx0NKew-1; Tue, 04 Feb 2025 12:25:33 -0500 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (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-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 683921801F1C for ; Tue, 4 Feb 2025 17:25:32 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.3]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 965F01800268 for ; Tue, 4 Feb 2025 17:25:31 +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.7 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,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=1738689934; 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=nmdWN4pfCsAM9EJC12N0ROizk7vgNY7FI/TvhQ6OA64=; b=bNyyVEn8o9yfsQrVqqELJsDQrgQShz7a7imQLd6Skt+lyCdQwtjVTwgkFGeRBtsL6hQF2Y cW/2clB2CCZrowEFzr9nDjqTjVOP+j8ToxNGkkbdbgifZuvV71P7Ubug0oRvxzoY7yVmW1 IYTAA7M9OwN/5Xv8FK3QXA63U/7G/gI= X-MC-Unique: XiA-HzQzNICn_vVLx0NKew-1 X-Mimecast-MFC-AGG-ID: XiA-HzQzNICn_vVLx0NKew From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 5/5] qemu: Attach persistent reservations manager if block-copy target requires it Date: Tue, 4 Feb 2025 18:25:23 +0100 Message-ID: <7d5c0edc31e0a217243da79351a3c788e50e943e.1738689879.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: GgWQ0BvC6wZRTzS1rdv99OvT9ysLeZqGYSgJCYscpQo_1738689932 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YHM5NSLREI7RUGRGONJ65VPY7XSSKG3O X-Message-ID-Hash: YHM5NSLREI7RUGRGONJ65VPY7XSSKG3O 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1738690053086019000 Content-Type: text/plain; charset="utf-8" Users can choose to copy a disk into a destination where they want to use persistent reservations. Start the daemon if the configuration requires it. Resolves: https://issues.redhat.com/browse/RHEL-7342 Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 1b5ac883b5..78bfaa5b3a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14389,6 +14389,9 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, goto endjob; } + if (qemuHotplugAttachManagedPR(vm, mirror, VIR_ASYNC_JOB_NONE) < 0) + goto endjob; + if (data) { qemuDomainObjEnterMonitor(vm); rc =3D qemuBlockStorageSourceChainAttach(priv->mon, data); @@ -14445,6 +14448,8 @@ qemuDomainBlockCopyCommon(virDomainObj *vm, } if (need_revoke) qemuDomainStorageSourceChainAccessRevoke(driver, vm, mirror); + + ignore_value(qemuHotplugRemoveManagedPR(vm, VIR_ASYNC_JOB_NONE)); } if (need_unlink && virStorageSourceUnlink(mirror) < 0) VIR_WARN("%s", _("unable to remove just-created copy target")); --=20 2.48.1