]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: add 'auto_start_delay' configuration parameter
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 16 Dec 2024 19:49:33 +0000 (19:49 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Wed, 12 Feb 2025 18:06:02 +0000 (18:06 +0000)
This allows a user specified delay between autostart of each VM, giving
parity with the equivalent feature of libvirt-guests.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/libvirtd_qemu.aug
src/qemu/qemu.conf.in
src/qemu/qemu_conf.c
src/qemu/qemu_conf.h
src/qemu/qemu_driver.c
src/qemu/test_libvirtd_qemu.aug.in

index 1377fd89ccc6bd0afb85cb10d7c5cf769d2f01fe..642093c40bde46f0d770c410f16ed385b5327d7a 100644 (file)
@@ -97,6 +97,7 @@ module Libvirtd_qemu =
                  | str_entry "auto_dump_path"
                  | bool_entry "auto_dump_bypass_cache"
                  | bool_entry "auto_start_bypass_cache"
+                 | int_entry "auto_start_delay"
 
    let process_entry = str_entry "hugetlbfs_mount"
                  | str_entry "bridge_helper"
index d853136f102c116f6e4c449b99202eb4bb0f98f2..31172303dc47f6061be01f88b814ce8a525ddebb 100644 (file)
 #
 #auto_start_bypass_cache = 0
 
+# Delay in milliseconds between initiating the startup for
+# each VM, during autostart
+#
+#auto_start_delay = 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
index 8b9fe4e381103a3829b66e2f936da4708570140a..b73dda7e109c7f0d1d1a2165658d018a01f76160 100644 (file)
@@ -638,6 +638,8 @@ virQEMUDriverConfigLoadSaveEntry(virQEMUDriverConfig *cfg,
         return -1;
     if (virConfGetValueBool(conf, "auto_start_bypass_cache", &cfg->autoStartBypassCache) < 0)
         return -1;
+    if (virConfGetValueUInt(conf, "auto_start_delay", &cfg->autoStartDelayMS) < 0)
+        return -1;
 
     return 0;
 }
index 42cdb6f8831908c1c6b44f55353a91d00649ebe3..97214f72d0a47a2079e0afa296b525c840cc4726 100644 (file)
@@ -200,6 +200,7 @@ struct _virQEMUDriverConfig {
     char *autoDumpPath;
     bool autoDumpBypassCache;
     bool autoStartBypassCache;
+    unsigned int autoStartDelayMS;
 
     char *lockManagerName;
 
index 3c2b6d988d10e295116cd8b1643c8afd80f16d1f..772cb405d69010b11b123568929407d99562aca1 100644 (file)
@@ -887,6 +887,7 @@ qemuStateInitialize(bool privileged,
         .stateDir = cfg->stateDir,
         .callback = qemuAutostartDomain,
         .opaque = qemu_driver,
+        .delayMS = cfg->autoStartDelayMS,
     };
     virDomainDriverAutoStart(qemu_driver->domains, &autostartCfg);
 
index 69fdae215a492dfd2de67e1b5511f1cde52710e4..c2a1d7d829f8c49548525bdeda159459e2ca7227 100644 (file)
@@ -75,6 +75,7 @@ module Test_libvirtd_qemu =
 { "auto_dump_path" = "/var/lib/libvirt/qemu/dump" }
 { "auto_dump_bypass_cache" = "0" }
 { "auto_start_bypass_cache" = "0" }
+{ "auto_start_delay" = "0" }
 { "hugetlbfs_mount" = "/dev/hugepages" }
 { "bridge_helper" = "qemu-bridge-helper" }
 { "set_process_name" = "1" }