From nobody Tue Jan 21 07:44:25 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 1736365795578593.2947637746812; Wed, 8 Jan 2025 11:49:55 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 92B2E13B3; Wed, 8 Jan 2025 14:49:54 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 800AE1399; Wed, 8 Jan 2025 14:43:55 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id EEB5814B3; Wed, 8 Jan 2025 14:43:49 -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 01E2513C9 for ; Wed, 8 Jan 2025 14:43:18 -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-594-LPQB37c_MvKdwd8uQZK0GA-1; Wed, 08 Jan 2025 14:43:17 -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-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 71DA119540EB for ; Wed, 8 Jan 2025 19:43:16 +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 978ED300019E; Wed, 8 Jan 2025 19:43:15 +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=1736365398; 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=/dvf/JkyhTC2xr3NBh70YnW4/yiVHXz0lDReNQP9t3c=; b=L7ZFK1aJZUnU7+CB8OeCv3e1kVTRkaxHhY3zQTZl4xiSGWBuS0achlpZT6CSs0tQfkpF9y v+q1zTVb1Q9nTnbCDbURDCz4nQLD0JJx9uw1+80JzBcOAHFjbRyejxqk2C/dc2+GvRkSDs T1SCaAeYePu2XgtN635wOIelU9emkGI= X-MC-Unique: LPQB37c_MvKdwd8uQZK0GA-1 X-Mimecast-MFC-AGG-ID: LPQB37c_MvKdwd8uQZK0GA 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 12/26] qemu: improve shutdown defaults for session daemon Date: Wed, 8 Jan 2025 19:42:45 +0000 Message-ID: <20250108194259.1171990-13-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: 2DA8pf0z0nab5mjSZgTkgn6opsAXFiRiBT2JjnhjD2w_1736365396 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NGXXRLAMZOWTIMQ22U6S2AQGGKSCUDDV X-Message-ID-Hash: NGXXRLAMZOWTIMQ22U6S2AQGGKSCUDDV 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: 1736365796781116600 Content-Type: text/plain; charset="utf-8" Currently the session daemon will try a managed save on all VMs, leaving them running if that fails. This limits the managed save just to persistent VMs, as there will usually not be any way to restore transient VMs later. It also enables graceful shutdown and then forced poweroff, should save fail for some reason. These new defaults can be overridden in the config file if needed. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/qemu/libvirtd_qemu.aug | 2 +- src/qemu/qemu.conf.in | 14 ++++++++------ src/qemu/qemu_conf.c | 6 +++--- src/qemu/test_libvirtd_qemu.aug.in | 6 +++--- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index e465a231fc..605604a01a 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -100,7 +100,7 @@ module Libvirtd_qemu =3D | int_entry "auto_start_delay" | str_entry "auto_shutdown_try_save" | str_entry "auto_shutdown_try_shutdown" - | str_entry "auto_shutdown_powerdown" + | str_entry "auto_shutdown_poweroff" =20 let process_entry =3D str_entry "hugetlbfs_mount" | str_entry "bridge_helper" diff --git a/src/qemu/qemu.conf.in b/src/qemu/qemu.conf.in index d8890c4c32..82eae2eecd 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -647,33 +647,35 @@ # * "transient" - only try to save transient running VMs # * "all" - try to save all running VMs # -# Defaults to "all" for session daemons and "none" +# Defaults to "persistent" for session daemons and "none" # for system daemons # # If 'libvirt-guests.service' is enabled, then this must be # set to 'none' for system daemons to avoid dueling actions -#auto_shutdown_try_save =3D "all" +#auto_shutdown_try_save =3D "persistent" =20 # As above, but with a graceful shutdown action instead of # managed save. If managed save is enabled, shutdown will # be tried only on failure to perform managed save. # -# Defaults to "none" +# Defaults to "all" for session daemons and "none" for +# system daemons # # If 'libvirt-guests.service' is enabled, then this must be # set to 'none' for system daemons to avoid dueling actions -#auto_shutdown_try_shutdown =3D "none" +#auto_shutdown_try_shutdown =3D "all" =20 # As above, but with a forced poweroff instead of managed # save. If managed save or graceful shutdown are enabled, # forced poweroff will be tried only on failure of the # other options. # -# Defaults to "none" +# Defaults to "all" for session daemons and "none" for +# system daemons. # # If 'libvirt-guests.service' is enabled, then this must be # set to 'none' for system daemons to avoid dueling actions -#auto_shutdown_powerdown =3D "none" +#auto_shutdown_poweroff =3D "all" =20 # If provided by the host and a hugetlbfs mount point is configured, # a guest may request huge page backing. When this mount point is diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index a57eccf569..76bb3bd888 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -313,9 +313,9 @@ virQEMUDriverConfig *virQEMUDriverConfigNew(bool privil= eged, cfg->autoShutdownTryShutdown =3D VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_S= COPE_NONE; cfg->autoShutdownPoweroff =3D VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_SCOP= E_NONE; } else { - cfg->autoShutdownTrySave =3D VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_SCOPE= _ALL; - cfg->autoShutdownTryShutdown =3D VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_S= COPE_NONE; - cfg->autoShutdownPoweroff =3D VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_SCOP= E_NONE; + cfg->autoShutdownTrySave =3D VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_SCOPE= _PERSISTENT; + cfg->autoShutdownTryShutdown =3D VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_S= COPE_ALL; + cfg->autoShutdownPoweroff =3D VIR_DOMAIN_DRIVER_AUTO_SHUTDOWN_SCOP= E_ALL; } =20 return g_steal_pointer(&cfg); diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qe= mu.aug.in index e7137f686f..3bc8104d7a 100644 --- a/src/qemu/test_libvirtd_qemu.aug.in +++ b/src/qemu/test_libvirtd_qemu.aug.in @@ -76,9 +76,9 @@ module Test_libvirtd_qemu =3D { "auto_dump_bypass_cache" =3D "0" } { "auto_start_bypass_cache" =3D "0" } { "auto_start_delay" =3D "0" } -{ "auto_shutdown_try_save" =3D "all" } -{ "auto_shutdown_try_shutdown" =3D "none" } -{ "auto_shutdown_poweroff" =3D "none" } +{ "auto_shutdown_try_save" =3D "persistent" } +{ "auto_shutdown_try_shutdown" =3D "all" } +{ "auto_shutdown_poweroff" =3D "all" } { "hugetlbfs_mount" =3D "/dev/hugepages" } { "bridge_helper" =3D "qemu-bridge-helper" } { "set_process_name" =3D "1" } --=20 2.47.1