From nobody Tue Dec 16 03:19:52 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 1738689980965444.12202345118806; Tue, 4 Feb 2025 09:26:20 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 019B01E19; Tue, 4 Feb 2025 12:26:19 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 7A1BA1DA2; Tue, 4 Feb 2025 12:25:32 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id EF16B1CF6; Tue, 4 Feb 2025 12:25:29 -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 71B55147D for ; Tue, 4 Feb 2025 12:25:29 -0500 (EST) Received: from mx-prod-mc-05.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-204-94pe89uDPziihcpIoqYZwA-1; Tue, 04 Feb 2025 12:25:27 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2277D1956080 for ; Tue, 4 Feb 2025 17:25:27 +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 594C01800268 for ; Tue, 4 Feb 2025 17:25: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.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=1738689929; 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=baLQHk6IhBCj5Xqa3migpvCwoAHAh4fVhCWHnUWFKdw=; b=GXKZIsEdBIwqBUMlr/IvkUYvZep2XUfRYtoHhaP19b4Q6vV/7y1E5bDs7srcSVIq2rXoHv EoQGfN2o8PqX64HsO5ZXWa0XQV7V78GUSbC1b00ZFlh5gwnJNG45IJiCwWqf3jNPjLVNSQ Uh8PtRB96BsY5A5q9WJYSvqlx+aMufM= X-MC-Unique: 94pe89uDPziihcpIoqYZwA-1 X-Mimecast-MFC-AGG-ID: 94pe89uDPziihcpIoqYZwA From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 1/5] qemu_hotplug.h: Reformat according to new coding style Date: Tue, 4 Feb 2025 18:25:19 +0100 Message-ID: <8f73d676efabddc3733f02cf669e64e0c435a88d.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: uRXpM0RIR8nPp-ax4A1G8bRUO-UusIPNxssXwLh3_HE_1738689927 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: K3KUOG4MM3ODLZTOIDKJLIP2WGY7LNIR X-Message-ID-Hash: K3KUOG4MM3ODLZTOIDKJLIP2WGY7LNIR 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: 1738689983139019100 Content-Type: text/plain; charset="utf-8" Fix the mixed style by unifying the formatting. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_hotplug.h | 167 ++++++++++++++++++++++------------------ 1 file changed, 92 insertions(+), 75 deletions(-) diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index 4fe7f4923e..c6cea0fe69 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -24,52 +24,62 @@ #include "qemu_conf.h" #include "qemu_domain.h" -void qemuDomainDelTLSObjects(virDomainObj *vm, - virDomainAsyncJob asyncJob, - const char *secAlias, - const char *tlsAlias); - -int qemuDomainAddTLSObjects(virDomainObj *vm, - virDomainAsyncJob asyncJob, - virJSONValue **secProps, - virJSONValue **tlsProps); - -int qemuDomainGetTLSObjects(qemuDomainSecretInfo *secinfo, - const char *tlsCertdir, - bool tlsListen, - bool tlsVerify, - const char *alias, - virJSONValue **tlsProps, - virJSONValue **secProps); - -int qemuDomainAttachDiskGeneric(virDomainObj *vm, - virDomainDiskDef *disk, - virDomainAsyncJob asyncJob); - -int qemuDomainFindGraphicsIndex(virDomainDef *def, - virDomainGraphicsDef *dev); -int qemuDomainChangeGraphicsPasswords(virDomainObj *vm, - int type, - virDomainGraphicsAuthDef *auth, - const char *defaultPasswd, - int asyncJob); - -int qemuDomainAttachDeviceLive(virDomainObj *vm, - virDomainDeviceDef *dev, - virQEMUDriver *driver); - -int qemuDomainDetachDeviceLive(virDomainObj *vm, - virDomainDeviceDef *match, - virQEMUDriver *driver, - bool async); - -int qemuDomainUpdateDeviceLive(virDomainObj *vm, - virDomainDeviceDef *dev, - virQEMUDriver *driver, - bool force); - -void qemuDomainRemoveVcpuAlias(virDomainObj *vm, - const char *alias); +void +qemuDomainDelTLSObjects(virDomainObj *vm, + virDomainAsyncJob asyncJob, + const char *secAlias, + const char *tlsAlias); + +int +qemuDomainAddTLSObjects(virDomainObj *vm, + virDomainAsyncJob asyncJob, + virJSONValue **secProps, + virJSONValue **tlsProps); + +int +qemuDomainGetTLSObjects(qemuDomainSecretInfo *secinfo, + const char *tlsCertdir, + bool tlsListen, + bool tlsVerify, + const char *alias, + virJSONValue **tlsProps, + virJSONValue **secProps); + +int +qemuDomainAttachDiskGeneric(virDomainObj *vm, + virDomainDiskDef *disk, + virDomainAsyncJob asyncJob); + +int +qemuDomainFindGraphicsIndex(virDomainDef *def, + virDomainGraphicsDef *dev); +int +qemuDomainChangeGraphicsPasswords(virDomainObj *vm, + int type, + virDomainGraphicsAuthDef *auth, + const char *defaultPasswd, + int asyncJob); + +int +qemuDomainAttachDeviceLive(virDomainObj *vm, + virDomainDeviceDef *dev, + virQEMUDriver *driver); + +int +qemuDomainDetachDeviceLive(virDomainObj *vm, + virDomainDeviceDef *match, + virQEMUDriver *driver, + bool async); + +int +qemuDomainUpdateDeviceLive(virDomainObj *vm, + virDomainDeviceDef *dev, + virQEMUDriver *driver, + bool force); + +void +qemuDomainRemoveVcpuAlias(virDomainObj *vm, + const char *alias); int qemuDomainChrInsert(virDomainDef *vmdef, @@ -78,33 +88,40 @@ virDomainChrDef * qemuDomainChrRemove(virDomainDef *vmdef, virDomainChrDef *chr); -int qemuDomainRemoveDevice(virQEMUDriver *driver, +int +qemuDomainRemoveDevice(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDeviceDef *dev); + +bool +qemuDomainSignalDeviceRemoval(virDomainObj *vm, + const char *devAlias, + qemuDomainUnpluggingDeviceStatus status); + +int +qemuDomainSetVcpusInternal(virQEMUDriver *driver, virDomainObj *vm, - virDomainDeviceDef *dev); - -bool qemuDomainSignalDeviceRemoval(virDomainObj *vm, - const char *devAlias, - qemuDomainUnpluggingDeviceStatus status= ); - -int qemuDomainSetVcpusInternal(virQEMUDriver *driver, - virDomainObj *vm, - virDomainDef *def, - virDomainDef *persistentDef, - unsigned int nvcpus, - bool hotpluggable); - -int qemuDomainSetVcpuInternal(virQEMUDriver *driver, - virDomainObj *vm, - virDomainDef *def, - virDomainDef *persistentDef, - virBitmap *vcpus, - bool state); - -unsigned long long qemuDomainGetUnplugTimeout(virDomainObj *vm) G_NO_INLIN= E; - -int qemuHotplugAttachDBusVMState(virQEMUDriver *driver, - virDomainObj *vm, - virDomainAsyncJob asyncJob); - -int qemuHotplugRemoveDBusVMState(virDomainObj *vm, - virDomainAsyncJob asyncJob); + virDomainDef *def, + virDomainDef *persistentDef, + unsigned int nvcpus, + bool hotpluggable); + +int +qemuDomainSetVcpuInternal(virQEMUDriver *driver, + virDomainObj *vm, + virDomainDef *def, + virDomainDef *persistentDef, + virBitmap *vcpus, + bool state); + +unsigned long long +qemuDomainGetUnplugTimeout(virDomainObj *vm) G_NO_INLINE; + +int +qemuHotplugAttachDBusVMState(virQEMUDriver *driver, + virDomainObj *vm, + virDomainAsyncJob asyncJob); + +int +qemuHotplugRemoveDBusVMState(virDomainObj *vm, + virDomainAsyncJob asyncJob); --=20 2.48.1 From nobody Tue Dec 16 03:19:52 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 1738689998061571.4649999354549; Tue, 4 Feb 2025 09:26:38 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 71C941E1E; Tue, 4 Feb 2025 12:26:37 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 656DB1E4D; Tue, 4 Feb 2025 12:25:35 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 5C4751440; Tue, 4 Feb 2025 12:25:31 -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 DC489147D for ; Tue, 4 Feb 2025 12:25:30 -0500 (EST) Received: from mx-prod-mc-05.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-220-v7FSTBZgPeuAhgkq-p_xAw-1; Tue, 04 Feb 2025 12:25:29 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 696B71956083 for ; Tue, 4 Feb 2025 17:25:28 +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 962C118008C0 for ; Tue, 4 Feb 2025 17:25: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.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=1738689930; 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=He4Hz/KXvXWyu8KPb/uv3OdcFFY6/GJwcLiIx9KKTXE=; b=GX30NfX68HWSrA8316QPiSzbTbAwT8Hz7jv7zFrTjK66h4gtPqj4zMo82fuRH0U9VxXbtp 81GwpN3fd3dZW9Gy3wT1FC/QyIJyXkfmw+aqiVtZDGiaaYPiVcFzumQvLlAV8foSp7fvwJ 2o6pa+Uo8c+H//8puWMzoR6DdvHhQJw= X-MC-Unique: v7FSTBZgPeuAhgkq-p_xAw-1 X-Mimecast-MFC-AGG-ID: v7FSTBZgPeuAhgkq-p_xAw From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 2/5] virDomainDefHasManagedPR: Consider also disk's 'mirror' chain Date: Tue, 4 Feb 2025 18:25:20 +0100 Message-ID: <2caa3055abb7f12f9997e661752ec1f18944be4c.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: 2Syww6_keI0KeXZW1Zp7g6Th9DPbTCZpnOA1VHbybkI_1738689928 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: WUIX3YJTUYT5JMZIOHRFPUWFMDVKI3T7 X-Message-ID-Hash: WUIX3YJTUYT5JMZIOHRFPUWFMDVKI3T7 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: 1738690000922019000 Content-Type: text/plain; charset="utf-8" Consider also the destination of a block-copy job. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/conf/domain_conf.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 2ef18b77fc..87f87bbe56 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -31372,6 +31372,9 @@ virDomainDefHasManagedPR(const virDomainDef *def) for (i =3D 0; i < def->ndisks; i++) { if (virStorageSourceChainHasManagedPR(def->disks[i]->src)) return true; + + if (virStorageSourceChainHasManagedPR(def->disks[i]->mirror)) + return true; } return false; --=20 2.48.1 From nobody Tue Dec 16 03:19:52 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 1738690014853921.5310532878493; Tue, 4 Feb 2025 09:26:54 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id C524E1D69; Tue, 4 Feb 2025 12:26:53 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1D65D1E1B; Tue, 4 Feb 2025 12:25:41 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 2C38A1DC0; Tue, 4 Feb 2025 12:25:37 -0500 (EST) 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 157121D3E for ; Tue, 4 Feb 2025 12:25:32 -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-671-UVe44d-uMa-X5C0OC3pMYw-1; Tue, 04 Feb 2025 12:25:30 -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 BB9671801F1C for ; Tue, 4 Feb 2025 17:25:29 +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 EDF131800268 for ; Tue, 4 Feb 2025 17:25:28 +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_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=1738689931; 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=FYb9sElxcjqL77ovQDVRIrLY0Xuzt7mDuc7hjE37bQU=; b=ExhF+nMyjCW9wnmnmVztQ/WGG1sZcQAsMt5G15KLMFGw/Yua9fkPwCl0m5QzfolAtbOHY2 2ymTV3KT1p6kyiPH5rlb+af4STVIRuCKtSSeleuoi5GGUnXmMR2kNPuWhx4Vcg/NWeifEO vEGBM0CovdA+F8+lN7W47vsgDuK7ZUY= X-MC-Unique: UVe44d-uMa-X5C0OC3pMYw-1 X-Mimecast-MFC-AGG-ID: UVe44d-uMa-X5C0OC3pMYw From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 3/5] qemu: hotplug: Export persistent reservations manager helper functions Date: Tue, 4 Feb 2025 18:25:21 +0100 Message-ID: <3e7fe4a8db0b3dbba854e33ec2cb8170382ccfb6.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: rNuw9ft9wWHo6ywskQQTTF31CKPSXToPZkm-0_pnTFo_1738689929 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: DL4HZGKN6NCO2THXOCKJ4AGXLEJHQG7D X-Message-ID-Hash: DL4HZGKN6NCO2THXOCKJ4AGXLEJHQG7D 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: 1738690017248019100 Content-Type: text/plain; charset="utf-8" Export qemuHotplugAttachManagedPR/qemuHotplugRemoveManagedPR for reuse in blockjob code. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_hotplug.c | 4 ++-- src/qemu/qemu_hotplug.h | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 5a7e6c3b12..6c224c9793 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -419,7 +419,7 @@ qemuHotplugRemoveDBusVMState(virDomainObj *vm, * * Returns: 0 on success, -1 on error. */ -static int +int qemuHotplugAttachManagedPR(virDomainObj *vm, virStorageSource *src, virDomainAsyncJob asyncJob) @@ -469,7 +469,7 @@ qemuHotplugAttachManagedPR(virDomainObj *vm, * Removes the managed PR object from @vm if the configuration does not re= quire * it any more. */ -static int +int qemuHotplugRemoveManagedPR(virDomainObj *vm, virDomainAsyncJob asyncJob) { diff --git a/src/qemu/qemu_hotplug.h b/src/qemu/qemu_hotplug.h index c6cea0fe69..d51f649bac 100644 --- a/src/qemu/qemu_hotplug.h +++ b/src/qemu/qemu_hotplug.h @@ -125,3 +125,11 @@ qemuHotplugAttachDBusVMState(virQEMUDriver *driver, int qemuHotplugRemoveDBusVMState(virDomainObj *vm, virDomainAsyncJob asyncJob); + +int +qemuHotplugAttachManagedPR(virDomainObj *vm, + virStorageSource *src, + virDomainAsyncJob asyncJob); +int +qemuHotplugRemoveManagedPR(virDomainObj *vm, + virDomainAsyncJob asyncJob); --=20 2.48.1 From nobody Tue Dec 16 03:19:52 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 1738690028835169.83956964106937; Tue, 4 Feb 2025 09:27:08 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 007D31E82; Tue, 4 Feb 2025 12:27:08 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id DAED41DCB; Tue, 4 Feb 2025 12:25:45 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 463751E0B; Tue, 4 Feb 2025 12:25:41 -0500 (EST) 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 9999D1E0E for ; Tue, 4 Feb 2025 12:25:33 -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-159-q1wrqjm1MIKndh1KdpFVZw-1; Tue, 04 Feb 2025 12:25:32 -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 0F4DF1801F16 for ; Tue, 4 Feb 2025 17:25:31 +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 3E93C18008C0 for ; Tue, 4 Feb 2025 17:25:30 +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_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=1738689933; 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=sGrPSRSsCfErcGXKSoXVSq47bZkt5pgPwaazU8Ho4vA=; b=MznYcdDImp/qkP9gCwtrU+xE1n+R7DZbBgZlf5T5jxHuvM/ThZLyHg8WZfYZctXHOtke2C xan4gX1Cai/JPgsoE23rDcEXTPe8KR9q+oOuie2Nm9eBq15E5hH/Vl6QCCQFGJpSmpUw4V Pj5YWfwGccMrS55rSrXEnP7rEjpm974= X-MC-Unique: q1wrqjm1MIKndh1KdpFVZw-1 X-Mimecast-MFC-AGG-ID: q1wrqjm1MIKndh1KdpFVZw From: Peter Krempa To: devel@lists.libvirt.org Subject: [PATCH 4/5] qemu: blockjob: Remove persistent reservations manager when dropping disk images Date: Tue, 4 Feb 2025 18:25:22 +0100 Message-ID: <690b547a0c88d6dd307ad86cb56e869f44e8b50c.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: XFmqRmQiDJ12nx1crwbZ_MwOjTuhqjRDYpmcNO5NtfU_1738689931 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7G3TLI4JIZ5N22JQGEB2MFM77JAQGPDU X-Message-ID-Hash: 7G3TLI4JIZ5N22JQGEB2MFM77JAQGPDU 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: 1738690031087019000 Content-Type: text/plain; charset="utf-8" Check if the persistent reservations manager daemon is still needed after a disk (sub)-chain was dropped after a blockjob. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- src/qemu/qemu_blockjob.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 4e77543fa8..3aef1ec285 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -28,6 +28,7 @@ #include "qemu_domain.h" #include "qemu_alias.h" #include "qemu_backup.h" +#include "qemu_hotplug.h" #include "conf/domain_conf.h" #include "conf/domain_event.h" @@ -707,6 +708,8 @@ qemuBlockJobEventProcessConcludedRemoveChain(virQEMUDri= ver *driver, qemuDomainObjExitMonitor(vm); qemuDomainStorageSourceChainAccessRevoke(driver, vm, chain); + + ignore_value(qemuHotplugRemoveManagedPR(vm, asyncJob)); } --=20 2.48.1 From nobody Tue Dec 16 03:19:52 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 Reviewed-by: Michal Privoznik --- 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