From nobody Fri Nov 21 10:12:05 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=1763545344; cv=none; d=zohomail.com; s=zohoarc; b=NbhIcoFXPUN0bvywCWNuOjexUGZZcFr8E1NJ5D1TPbTyrsWmM/HwPGIrjamGB3asI+LzYh464ds5/PfsShsZ+xecABSn58yGoj69CFqnhw8XICCcYVQ1jAt9FR1rDcNDmgsGH+wZ/+qxbrLJWBeVVxJSKIY5xrUgn76e3ocDTwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763545344; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner: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=0d1Kb701Z5NFWQsuBAKXI2rMwKMfLXo8EJ6CfuV261Q=; b=YPkG8ShV/ol2HM1+R+z2DZ5Fvry4YsXH4s6ygk1Su6mcBZxhXu6j5B1/lXv9ucUNvWLMlsBpnSdY0w+rrWB30SYy1T7Rq7w2L1jQzK7+IcyZqoaSgatdJ4bl3UHGj835pehWoaq8yQt0vh4RMzvTUbUkvbmOs0P2LTkFk5IYOTw= 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 1763545344000872.3411038151477; Wed, 19 Nov 2025 01:42:24 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 5090743FFE; Wed, 19 Nov 2025 04:42:23 -0500 (EST) Received: from [172.19.199.50] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id 814D844128; Wed, 19 Nov 2025 04:38:26 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 4432443EBA; Wed, 19 Nov 2025 04:38:01 -0500 (EST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (3072 bits) server-digest SHA256) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 7666F43EBD for ; Wed, 19 Nov 2025 04:38:00 -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-654-xmZrp-FxNPK_K9wplAgp6Q-1; Wed, 19 Nov 2025 04:37:58 -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 CECC419560B2 for ; Wed, 19 Nov 2025 09:37:57 +0000 (UTC) Received: from speedmetal.openshiftapps.com (unknown [10.45.242.12]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 11816180049F for ; Wed, 19 Nov 2025 09:37:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1763545080; 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=0d1Kb701Z5NFWQsuBAKXI2rMwKMfLXo8EJ6CfuV261Q=; b=avzgkmcLWX+tXnYkPFjazxmAZed6bn4OmQ5Q/O1lBgA/zAQqVBZMyftWt3gsp0yrM07yAz nmGuiO/LtIwUwQw4WXWSHvT2qpWlSPOtHp+I8HzJJeNcDdYW405gRZ0Ug4VSGazjJ7Vgzb +t2cReRsnT3LGINdWZGV2vhmbMWRmeY= X-MC-Unique: xmZrp-FxNPK_K9wplAgp6Q-1 X-Mimecast-MFC-AGG-ID: xmZrp-FxNPK_K9wplAgp6Q_1763545077 To: devel@lists.libvirt.org Subject: [PATCH 3/8] qemu: backup: Don't attempt to stop the NBD server twice Date: Wed, 19 Nov 2025 10:37:46 +0100 Message-ID: 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: CWkiuLeTn_cX3YPR7_hEY3wMD4GTv_QkCs_9u57l170_1763545077 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 4MH7JN5MCZLDID5YRXH2UPIOCJR4IZ35 X-Message-ID-Hash: 4MH7JN5MCZLDID5YRXH2UPIOCJR4IZ35 X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: 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: 1763545347317153000 Content-Type: text/plain; charset="utf-8" From: Peter Krempa When notifying the backup code about termination of the block job which is part of a backup operation the code attempts to terminate the NBD server. This is done for every blockjob so could cause us to attempt to terminate the NBD server multiple times which doesn't cause problems but generates spurious errors. Add a flag that the NBD server was stopped and do it just once. Don't bother storing the flag in the status XML as it's just for the shutdown phase. Signed-off-by: Peter Krempa --- src/conf/backup_conf.h | 4 ++++ src/qemu/qemu_backup.c | 19 +++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/conf/backup_conf.h b/src/conf/backup_conf.h index 9c3532a546..f90a4dcaee 100644 --- a/src/conf/backup_conf.h +++ b/src/conf/backup_conf.h @@ -99,6 +99,10 @@ struct _virDomainBackupDef { char *errmsg; /* error message of failed sub-blockjob */ unsigned int apiFlags; /* original flags used when starting the job */ + + bool nbdStopped; /* The NBD server for a pull-mode backup was stopped.= This + flag is deliberately not stored in the status XML = as + it's related only to termination of the backup. */ }; typedef enum { diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 3b4fe54854..9832c186a8 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -1006,14 +1006,17 @@ qemuBackupNotifyBlockjobEnd(virDomainObj *vm, return; if (backup->type =3D=3D VIR_DOMAIN_BACKUP_TYPE_PULL) { - if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) - return; - ignore_value(qemuMonitorNBDServerStop(priv->mon)); - if (backup->tlsAlias) - ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsAlias,= false)); - if (backup->tlsSecretAlias) - ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsSecret= Alias, false)); - qemuDomainObjExitMonitor(vm); + if (!backup->nbdStopped) { + if (qemuDomainObjEnterMonitorAsync(vm, asyncJob) < 0) + return; + ignore_value(qemuMonitorNBDServerStop(priv->mon)); + if (backup->tlsAlias) + ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsAl= ias, false)); + if (backup->tlsSecretAlias) + ignore_value(qemuMonitorDelObject(priv->mon, backup->tlsSe= cretAlias, false)); + qemuDomainObjExitMonitor(vm); + backup->nbdStopped =3D true; + } /* update the final statistics with the current job's data */ backup->pull_tmp_used +=3D cur; --=20 2.51.1