]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu_extdevice: Add a comment into qemuExtDevicesSetupCgroup()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 15 Feb 2023 14:52:21 +0000 (15:52 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 16 Feb 2023 09:50:39 +0000 (10:50 +0100)
The way setting up CGroups for external helpers work, is:
qemuExtDevicesHasDevice() is called first to determine whether
there is a helper process running, the CGroup controller is
created and then qemuExtDevicesSetupCgroup() is called to place
helpers into the CGroup. But when one reads just
qemuExtDevicesSetupCgroup() it's easy to miss this hidden logic.
Therefore, add a warning at the beginning of the function.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/qemu/qemu_extdevice.c

index 47e97f35655240fa4b8a9e4115a2fe26d1418071..1c397972e48e37357b3be07bf072f1e7dee353bc 100644 (file)
@@ -331,6 +331,9 @@ qemuExtDevicesSetupCgroup(virQEMUDriver *driver,
     virDomainDef *def = vm->def;
     size_t i;
 
+    /* Don't forget to adjust qemuExtDevicesHasDevice() accordingly.
+     * Otherwise, this function might not be called at all. */
+
     if (qemuDBusSetupCgroup(driver, vm, cgroup) < 0)
         return -1;