From nobody Tue Jan 21 07:31:48 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 1736365617657169.4684091437225; Wed, 8 Jan 2025 11:46:57 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id BABC413AD; Wed, 8 Jan 2025 14:46:56 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id E3BA31447; Wed, 8 Jan 2025 14:43:32 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 551DA140A; Wed, 8 Jan 2025 14:43:28 -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 64A4B143B for ; Wed, 8 Jan 2025 14:43:11 -0500 (EST) Received: from mx-prod-mc-02.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-32-0RIlWKUkMYqhx6cUQEPKmA-1; Wed, 08 Jan 2025 14:43:09 -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-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id E7DF11956087 for ; Wed, 8 Jan 2025 19:43:08 +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 22311300018D; Wed, 8 Jan 2025 19:43:07 +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=1736365391; 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=B+tGe6pP2n+Zuz+1yqtYesLCJEHh7cBeZAsaYH+0goM=; b=Nx7WFqb8xA2Pb8c347a3RmFD6bI1dkg/qht1BqU6OqH5NAcHLKn7BtjhQqQ2wzbskRi6XF exSoMmzXsU4AexlRJ8fNcXhFtFJHtRbmCYsRYiOuPrK/AOTPRviiJOjvCQuHj22dd4XVvS x8cNsp8wxBS76/Sj23KlwJC6hv82eUY= X-MC-Unique: 0RIlWKUkMYqhx6cUQEPKmA-1 X-Mimecast-MFC-AGG-ID: 0RIlWKUkMYqhx6cUQEPKmA 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 06/26] qemu: add 'auto_start_delay' configuration parameter Date: Wed, 8 Jan 2025 19:42:39 +0000 Message-ID: <20250108194259.1171990-7-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: f8zEKH1_mqZ7ysadLqgewdD6NIqgifUtkIbRgtsTAIw_1736365389 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 733XAS6OHIQI6VZ347CKN5U4LZKWTHP7 X-Message-ID-Hash: 733XAS6OHIQI6VZ347CKN5U4LZKWTHP7 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: 1736365712906116600 Content-Type: text/plain; charset="utf-8" This allows a user specified delay between autostart of each VM, giving parity with the equivalent feature of libvirt-guests. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/qemu/libvirtd_qemu.aug | 1 + src/qemu/qemu.conf.in | 4 ++++ src/qemu/qemu_conf.c | 2 ++ src/qemu/qemu_conf.h | 1 + src/qemu/qemu_driver.c | 1 + src/qemu/test_libvirtd_qemu.aug.in | 1 + 6 files changed, 10 insertions(+) diff --git a/src/qemu/libvirtd_qemu.aug b/src/qemu/libvirtd_qemu.aug index 1377fd89cc..642093c40b 100644 --- a/src/qemu/libvirtd_qemu.aug +++ b/src/qemu/libvirtd_qemu.aug @@ -97,6 +97,7 @@ module Libvirtd_qemu =3D | str_entry "auto_dump_path" | bool_entry "auto_dump_bypass_cache" | bool_entry "auto_start_bypass_cache" + | int_entry "auto_start_delay" =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 d853136f10..a3e9bbfcf3 100644 --- a/src/qemu/qemu.conf.in +++ b/src/qemu/qemu.conf.in @@ -634,6 +634,10 @@ # #auto_start_bypass_cache =3D 0 =20 +# Delay in milliseconds between starting each VM, during autostart +# +#auto_start_delay =3D 0 + # If provided by the host and a hugetlbfs mount point is configured, # a guest may request huge page backing. When this mount point is # unspecified here, determination of a host mount point in /proc/mounts diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c index 8b9fe4e381..0b6b923bcb 100644 --- a/src/qemu/qemu_conf.c +++ b/src/qemu/qemu_conf.c @@ -638,6 +638,8 @@ virQEMUDriverConfigLoadSaveEntry(virQEMUDriverConfig *c= fg, return -1; if (virConfGetValueBool(conf, "auto_start_bypass_cache", &cfg->autoSta= rtBypassCache) < 0) return -1; + if (virConfGetValueInt(conf, "auto_start_delay", &cfg->autoStartDelayM= S) < 0) + return -1; =20 return 0; } diff --git a/src/qemu/qemu_conf.h b/src/qemu/qemu_conf.h index 42cdb6f883..61a2bdce51 100644 --- a/src/qemu/qemu_conf.h +++ b/src/qemu/qemu_conf.h @@ -200,6 +200,7 @@ struct _virQEMUDriverConfig { char *autoDumpPath; bool autoDumpBypassCache; bool autoStartBypassCache; + int autoStartDelayMS; =20 char *lockManagerName; =20 diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 45bfbd3727..f689dadc0a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -887,6 +887,7 @@ qemuStateInitialize(bool privileged, .stateDir =3D cfg->stateDir, .callback =3D qemuAutostartDomain, .opaque =3D qemu_driver, + .delayMS =3D cfg->autoStartDelayMS, }; virDomainDriverAutoStart(qemu_driver->domains, &autostartCfg); =20 diff --git a/src/qemu/test_libvirtd_qemu.aug.in b/src/qemu/test_libvirtd_qe= mu.aug.in index 69fdae215a..c2a1d7d829 100644 --- a/src/qemu/test_libvirtd_qemu.aug.in +++ b/src/qemu/test_libvirtd_qemu.aug.in @@ -75,6 +75,7 @@ module Test_libvirtd_qemu =3D { "auto_dump_path" =3D "/var/lib/libvirt/qemu/dump" } { "auto_dump_bypass_cache" =3D "0" } { "auto_start_bypass_cache" =3D "0" } +{ "auto_start_delay" =3D "0" } { "hugetlbfs_mount" =3D "/dev/hugepages" } { "bridge_helper" =3D "qemu-bridge-helper" } { "set_process_name" =3D "1" } --=20 2.47.1