]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
cgroup: Plumb the 'daemonDomainShutdown' parameter of 'virSystemdCreateMachine' to...
authorPeter Krempa <pkrempa@redhat.com>
Fri, 27 Jun 2025 12:47:10 +0000 (14:47 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 8 Jul 2025 12:51:44 +0000 (14:51 +0200)
Plumb the new argument across the cgroup helpers up to the domain driver
code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/ch/ch_process.c
src/hypervisor/domain_cgroup.c
src/hypervisor/domain_cgroup.h
src/lxc/lxc_cgroup.c
src/qemu/qemu_cgroup.c
src/util/vircgroup.c
src/util/vircgroup.h

index 95c808cb41c8519b76e87d606e8c71072f21541a..cc84823fdced560d6c05093eac2bec076f62a0cf 100644 (file)
@@ -973,6 +973,7 @@ virCHProcessStart(virCHDriver *driver,
                                    cfg->cgroupControllers,
                                    0, /*maxThreadsPerProc*/
                                    priv->driver->privileged,
+                                   false,
                                    priv->machineName) < 0)
         goto cleanup;
 
@@ -1147,6 +1148,7 @@ virCHProcessStartRestore(virCHDriver *driver, virDomainObj *vm, const char *from
                                    cfg->cgroupControllers,
                                    0, /*maxThreadsPerProc*/
                                    priv->driver->privileged,
+                                   false,
                                    priv->machineName) < 0)
         goto cleanup;
 
index fecc0f79662caf23f4091d9fa99a8dc6982d36e5..8787165f480b8c6acad701fae35450bb0ba58038 100644 (file)
@@ -351,6 +351,7 @@ virDomainCgroupInitCgroup(const char *prefix,
                           int cgroupControllers,
                           unsigned int maxThreadsPerProc,
                           bool privileged,
+                          bool daemonDomainShutdown,
                           char *machineName)
 {
     if (!privileged)
@@ -384,6 +385,7 @@ virDomainCgroupInitCgroup(const char *prefix,
                             vm->def->resource->partition,
                             cgroupControllers,
                             maxThreadsPerProc,
+                            daemonDomainShutdown,
                             cgroup) < 0) {
         if (virCgroupNewIgnoreError())
             return 0;
@@ -513,6 +515,7 @@ virDomainCgroupSetupCgroup(const char *prefix,
                            int cgroupControllers,
                            unsigned int maxThreadsPerProc,
                            bool privileged,
+                           bool daemonDomainShutdown,
                            char *machineName)
 {
     if (vm->pid == 0) {
@@ -529,6 +532,7 @@ virDomainCgroupSetupCgroup(const char *prefix,
                                   cgroupControllers,
                                   maxThreadsPerProc,
                                   privileged,
+                                  daemonDomainShutdown,
                                   machineName) < 0)
         return -1;
 
index 6e5c98004ebf0442de8e2a479d3de630ee72ddad..7769572a2c7bcad9a28ac6e3fb35dfa313ab1875 100644 (file)
@@ -71,6 +71,7 @@ virDomainCgroupSetupCgroup(const char *prefix,
                            int cgroupControllers,
                            unsigned int maxThreadsPerProc,
                            bool privileged,
+                           bool daemonDomainShutdown,
                            char *machineName);
 void
 virDomainCgroupEmulatorAllNodesDataFree(virCgroupEmulatorAllNodesData *data);
index 7c889667ba636290a00776f18755ed67ba92bf54..f566a5468eb098cc8b456f608e51dab039daa9e1 100644 (file)
@@ -400,6 +400,7 @@ virCgroup *virLXCCgroupCreate(virDomainDef *def,
                             def->resource->partition,
                             -1,
                             0,
+                            false,
                             &cgroup) < 0)
         return NULL;
 
index 48af467bf96712707f4ff28317912454a9c90945..04d637001188b17d0fc36b3ab9f9d824ce35613a 100644 (file)
@@ -919,6 +919,7 @@ qemuSetupCgroup(virDomainObj *vm,
                                    cfg->cgroupControllers,
                                    cfg->maxThreadsPerProc,
                                    priv->driver->privileged,
+                                   false,
                                    priv->machineName) < 0)
 
         return -1;
index fc5dca485803d039ea2d6c26b2287c3c44b562d3..532a7e56901195ed99c21f14b92b71e041773b3e 100644 (file)
@@ -1274,6 +1274,7 @@ virCgroupNewMachineSystemd(const char *name,
                            const char *partition,
                            int controllers,
                            unsigned int maxthreads,
+                           bool daemonDomainShutdown,
                            virCgroup **group)
 {
     int rv;
@@ -1294,7 +1295,7 @@ virCgroupNewMachineSystemd(const char *name,
                                       nicindexes,
                                       partition,
                                       maxthreads,
-                                      false)) < 0)
+                                      daemonDomainShutdown)) < 0)
         return rv;
 
     if (controllers != -1)
@@ -1407,6 +1408,7 @@ virCgroupNewMachine(const char *name,
                     const char *partition,
                     int controllers,
                     unsigned int maxthreads,
+                    bool daemonDomainShutdown,
                     virCgroup **group)
 {
     int rv;
@@ -1424,6 +1426,7 @@ virCgroupNewMachine(const char *name,
                                          partition,
                                          controllers,
                                          maxthreads,
+                                         daemonDomainShutdown,
                                          group)) == 0)
         return 0;
 
@@ -3144,6 +3147,7 @@ virCgroupNewMachine(const char *name G_GNUC_UNUSED,
                     const char *partition G_GNUC_UNUSED,
                     int controllers G_GNUC_UNUSED,
                     unsigned int maxthreads G_GNUC_UNUSED,
+                    bool daemonDomainShutdown G_GNUC_UNUSED,
                     virCgroup **group G_GNUC_UNUSED)
 {
     virReportSystemError(ENXIO, "%s",
index adf3850b228367d5057d3aa026ca788e853af957..2a7aa3306c8d3c90f0d3d1a75b21e3117bb37bbf 100644 (file)
@@ -101,6 +101,7 @@ int virCgroupNewMachine(const char *name,
                         const char *partition,
                         int controllers,
                         unsigned int maxthreads,
+                        bool daemonDomainShutdown,
                         virCgroup **group)
     ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2)
     ATTRIBUTE_NONNULL(3);