From nobody Mon Dec 15 09:42: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=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 1741800570560365.4282364380456; Wed, 12 Mar 2025 10:29:30 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id EC34518B9; Wed, 12 Mar 2025 13:29:29 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 1B1BB1D6D; Wed, 12 Mar 2025 13:26:42 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 189561B55; Wed, 12 Mar 2025 13:26:36 -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 C7FAB1EB8 for ; Wed, 12 Mar 2025 13:26:01 -0400 (EDT) Received: from mx-prod-mc-06.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-88-FaivO4IdOoSlkpXCN9voEw-1; Wed, 12 Mar 2025 13:25:59 -0400 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (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-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E3C6A190E8F3 for ; Wed, 12 Mar 2025 17:18:33 +0000 (UTC) Received: from toolbx.redhat.com (unknown [10.42.28.57]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id F22C718001D4; Wed, 12 Mar 2025 17:18:32 +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, 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=1741800361; 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=JANkFDo6iN7opUWSu78NFZXu/kVxxQhsD0ohnHFlAdo=; b=Dk8udMw+qrRiSo0hYwxotqQ5kGin7MuW6WYhtEHaLKLxCBxxsRclhM2VnRYgYNRZNbCpUM qdE3BDC/LCDwhpBSJMG1bh5IvrPff45zda+qwlyynW7LmFvdu8T6sc/mM03S7fyXKVOa7J HQjP/8D4hLrl5d6rTQIJA/HnAiCeaUk= X-MC-Unique: FaivO4IdOoSlkpXCN9voEw-1 X-Mimecast-MFC-AGG-ID: FaivO4IdOoSlkpXCN9voEw_1741800359 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 v2 18/22] rpc: don't unconditionally quit after preserving state Date: Wed, 12 Mar 2025 17:17:58 +0000 Message-ID: <20250312171802.1854985-19-berrange@redhat.com> In-Reply-To: <20250312171802.1854985-1-berrange@redhat.com> References: <20250312171802.1854985-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Xq76fmfug0h-7-gg7rF4WsorMpt3uYIXvrunjnPx7ao_1741800359 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: HXPCPLSFFXB7DGTQPHQO7MNBZW3PDKQR X-Message-ID-Hash: HXPCPLSFFXB7DGTQPHQO7MNBZW3PDKQR 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: 1741800572607019000 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. Reviewed-by: Peter Krempa 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 16dc1d86f7..1424d4cf5e 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")) { virNetDaemonStop(dmn); + virNetDaemonQuit(dmn); + } =20 return message; } diff --git a/src/rpc/virnetdaemon.c b/src/rpc/virnetdaemon.c index 43a75b330f..469a1d3ae2 100644 --- a/src/rpc/virnetdaemon.c +++ b/src/rpc/virnetdaemon.c @@ -840,7 +840,6 @@ virNetDaemonStopWorker(void *opaque) =20 VIR_DEBUG("Completed stop dmn=3D%p", dmn); =20 - virNetDaemonQuit(dmn); virObjectUnref(dmn); } =20 --=20 2.48.1