From nobody Tue Jan 21 07:45:12 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 1736366047717921.9083328091288; Wed, 8 Jan 2025 11:54:07 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id D0E5A1500; Wed, 8 Jan 2025 14:54:06 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id DE1CD1311; Wed, 8 Jan 2025 14:44:19 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 2C83311AC; Wed, 8 Jan 2025 14:43:59 -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 0E0B81449 for ; Wed, 8 Jan 2025 14:43:31 -0500 (EST) Received: from mx-prod-mc-01.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-448-xaBz7mk8NYqZxYVXiC4UOw-1; Wed, 08 Jan 2025 14:43:29 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D59C41956060 for ; Wed, 8 Jan 2025 19:43:28 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.103]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 08314300018D; Wed, 8 Jan 2025 19:43: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.5 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=1736365410; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LCxv1P4ZnQDfTYZZZIWKAdXQ4o5+NfNyJ2ds2cvYL9Q=; b=LYzLg+OZG97Sk0Q3DOLc1rVWTfy50yw0ngF65AVO1UH4eEgru/ubKztgKPzmJ9bPmPMWDz Zi2Lh8HVSseeYH1NsXlIJKashBDF2tTLX9WNOZhehB4n3TyKJdNy0rr4Zx6dCVAkzxyBOK Abb/l+hZiVFuhm2ssewoCZx3ya7o7EQ= X-MC-Unique: xaBz7mk8NYqZxYVXiC4UOw-1 X-Mimecast-MFC-AGG-ID: xaBz7mk8NYqZxYVXiC4UOw From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: devel@lists.libvirt.org Cc: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH 22/26] rpc: don't unconditionally quit after preserving state Date: Wed, 8 Jan 2025 19:42:55 +0000 Message-ID: <20250108194259.1171990-23-berrange@redhat.com> In-Reply-To: <20250108194259.1171990-1-berrange@redhat.com> References: <20250108194259.1171990-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: QmpgMlQn3At8ClmFmdl6GntFu6i7iQmffHeY2LRRKBo_1736365409 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TRRHFSKFAZKTX47W2STJWIP7OJUZCWB6 X-Message-ID-Hash: TRRHFSKFAZKTX47W2STJWIP7OJUZCWB6 X-MailFrom: berrange@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: 1736366048224116600 Content-Type: text/plain; charset="utf-8" The call to preserve state (ie running VMs) is triggered in response to the desktop session dbus terminating (session daemon), or logind sending a "PrepareForShutdown" signal. In the case of the latter, daemons should only save their state, not actually exit yet. Other things on the system may still expect the daemon to be running at this stage. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/remote/remote_daemon.c | 4 +++- src/rpc/virnetdaemon.c | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/remote/remote_daemon.c b/src/remote/remote_daemon.c index bf91ee5772..e03ee1de5a 100644 --- a/src/remote/remote_daemon.c +++ b/src/remote/remote_daemon.c @@ -526,8 +526,10 @@ handleSessionMessageFunc(GDBusConnection *connection G= _GNUC_UNUSED, =20 if (virGDBusMessageIsSignal(message, "org.freedesktop.DBus.Local", - "Disconnected")) + "Disconnected")) { virNetDaemonPreserve(dmn); + virNetDaemonQuit(dmn); + } =20 return message; } diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index 19b19ff834..7f14c5420a 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -833,7 +833,6 @@ static void virNetDaemonPreserveWorker(void *opaque) =20 VIR_DEBUG("Completed stop dmn=3D%p", dmn); =20 - virNetDaemonQuit(dmn); virObjectUnref(dmn); } =20 --=20 2.47.1