- 14 10月, 2019 1 次提交
-
-
由 Daniel P. Berrangé 提交于
The usleep function was missing on older mingw versions, but we can rely on it existing everywhere these days. It may only support times upto 1 second in duration though, so we'll prefer to use g_usleep instead. The commandhelper program is not changed since that can't link to glib. Fortunately it doesn't need to build on Windows platforms either. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 28 9月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
These helped with debugging https://bugzilla.redhat.com/show_bug.cgi?id=1612383Reviewed-by: NPavel Hrdina <phrdina@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 25 7月, 2019 3 次提交
-
-
由 Pavel Hrdina 提交于
When creating new group for cgroups v2 the we cannot check cgroups.controllers for that cgroup because the directory is created later. In that case we should check cgroups.subtree_control of parent group to get list of controllers enabled for child cgroups. In order to achieve that we will prefer the parent group if it exists, the current group will be used only for root group. Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Erik Skultety 提交于
Commit d5572f62 forgot to add maxthreads to the non-Linux definition of the function, thus breaking the MinGW build. Signed-off-by: NErik Skultety <eskultet@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Acked-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Jim Fehlig 提交于
Some VM configurations may result in a large number of threads created by the associated qemu process which can exceed the system default limit. The maximum number of threads allowed per process is controlled by the pids cgroup controller and is set to 16k when creating VMs with systemd's machined service. The maximum number of threads per process is recorded in the pids.max file under the machine's pids controller cgroup hierarchy, e.g. $cgrp-mnt/pids/machine.slice/machine-qemu\\x2d1\\x2dtest.scope/pids.max Maximum threads per process is controlled with the TasksMax property of the systemd scope for the machine. This patch adds an option to qemu.conf which can be used to override the maximum number of threads allowed per qemu process. If the value of option is greater than zero, it will be set in the TasksMax property of the machine's scope after creating the machine. Signed-off-by: NJim Fehlig <jfehlig@suse.com> Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 19 7月, 2019 1 次提交
-
-
由 Wang Yechao 提交于
virCgroupRemove return -1 when removing cgroup failed. But there are retry code to remove cgroup in QemuProcessStop: retry: if ((ret = qemuRemoveCgroup(vm)) < 0) { if (ret == -EBUSY && (retries++ < 5)) { usleep(200*1000); goto retry; } VIR_WARN("Failed to remove cgroup for %s", vm->def->name); } The return value of qemuRemoveCgroup will never be equal to "-EBUSY", so change the return value of virCgroupRemove if failed. Signed-off-by: NWang Yechao <wang.yechao255@zte.com.cn> Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 28 6月, 2019 2 次提交
-
-
由 Pavel Hrdina 提交于
Because of a systemd delegation policy [1] we should not write to any cgroups files owned by systemd which in case of cgroups v2 includes 'cgroups.subtree_control'. systemd will enable controllers automatically for us to have them available for VM cgroups. [1] <https://github.com/systemd/systemd/blob/master/docs/CGROUP_DELEGATION.md> Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Pavel Hrdina 提交于
This reverts commit 7bca1c9b. As it turns out it's not a good idea on systemd hosts. The root cgroup can have all controllers enabled but they don't have to be enabled for sub-cgroups. Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 26 6月, 2019 2 次提交
-
-
由 Pavel Hrdina 提交于
This affects only cgroups v2 where enabled controllers are not based on available mount points but on the list provided in cgroup.controllers file. However, moving it will fill in placement as well, so it needs to be freed together with mount point if we don't need that controller. Before this patch we were assuming that all controllers available in root cgroup where available in all other sub-cgroups which was wrong. In order to fix it we need to move the cgroup controllers detection after cgroup placement was prepared in order to build correct path for cgroup.controllers file. Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
-
由 Pavel Hrdina 提交于
In cgroups v2 we don't have to detect available controllers every single time if we are creating a new cgroup based on parent cgroup. Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 21 6月, 2019 2 次提交
-
-
由 Pavel Hrdina 提交于
If we need to get a path of specific file and we need to check its existence before we use it then we can reuse that path to get value for specific device. This way we will not build the path again in virCgroupGetValueForBlkDev. Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
由 Pavel Hrdina 提交于
If we need to get a path of specific file and we need to check its existence before we use it then we can reuse that path to get/set values instead of calling the existing get/set value functions which would be building the path again. Signed-off-by: NPavel Hrdina <phrdina@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com>
-
- 25 4月, 2019 1 次提交
-
-
由 Pavel Hrdina 提交于
virCgroup struct is always defined and the free function is not calling anything that would require OS supporting cgroups. This fixes an issue if we try to start a VM with QEMU binary that doesn't support QXL. The start operation will fail in qemuProcessStartValidateVideo() which will set correct error message, but later in one of the cleanup paths we will call qemuDomainObjPrivateDataClear() which always calls virCgroupFree() and that will fail on OS that doesn't support cgroups and it will set a new error which will be eventually reported to user. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 12 4月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
Standardize on putting the _LAST enum value on the second line of VIR_ENUM_IMPL invocations. Later patches that add string labels to VIR_ENUM_IMPL will push most of these to the second line anyways, so this saves some noise. Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 07 2月, 2019 1 次提交
-
-
由 Michal Privoznik 提交于
Prior to rewrite of cgroup code we only had one backend to try. After the rewrite the virCgroupBackendGetAll() returns both backends (for v1 and v2). However, not both have to really be present on the system which results in killRecursive callback failing which in turn might mean we won't try the other backend. At the same time, this function reports no error as it should. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 04 2月, 2019 1 次提交
-
-
由 Cole Robinson 提交于
Missing semicolon at the end of macros can confuse some analyzers (like cppcheck <filename>), and we have a mix of semicolon and non-semicolon usage through the code. Let's standardize on using a semicolon for VIR_ENUM_IMPL calls. Move the verify() statement to the end of the macro and drop the semicolon, so the compiler will require callers to add a semicolon. While we are touching these call sites, standardize on putting the closing parenth on its own line, as discussed here: https://www.redhat.com/archives/libvir-list/2019-January/msg00750.htmlReviewed-by: NJohn Ferlan <jferlan@redhat.com> Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 14 12月, 2018 3 次提交
-
-
由 Daniel P. Berrangé 提交于
Require that all headers are guarded by a symbol named LIBVIRT_$FILENAME where $FILENAME is the uppercased filename, with all characters outside a-z changed into '_'. Note we do not use a leading __ because that is technically a namespace reserved for the toolchain. Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
由 Pavel Hrdina 提交于
The rewrite to support cgroup v2 missed this function. In cgroup v2 we have different files to track tasks. We would fail to remove cgroup on non-systemd OSes if there is any extra process assigned to guest cgroup because we would not kill any process form the guest cgroup. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Daniel P. Berrangé 提交于
In many files there are header comments that contain an Author: statement, supposedly reflecting who originally wrote the code. In a large collaborative project like libvirt, any non-trivial file will have been modified by a large number of different contributors. IOW, the Author: comments are quickly out of date, omitting people who have made significant contribitions. In some places Author: lines have been added despite the person merely being responsible for creating the file by moving existing code out of another file. IOW, the Author: lines give an incorrect record of authorship. With this all in mind, the comments are useless as a means to identify who to talk to about code in a particular file. Contributors will always be better off using 'git log' and 'git blame' if they need to find the author of a particular bit of code. This commit thus deletes all Author: comments from the source and adds a rule to prevent them reappearing. The Copyright headers are similarly misleading and inaccurate, however, we cannot delete these as they have legal meaning, despite being largely inaccurate. In addition only the copyright holder is permitted to change their respective copyright statement. Reviewed-by: NErik Skultety <eskultet@redhat.com> Signed-off-by: NDaniel P. Berrangé <berrange@redhat.com>
-
- 05 12月, 2018 1 次提交
-
-
由 Yuri Chornoivan 提交于
Signed-off-by: NYuri Chornoivan <yurchor@ukr.net> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NJán Tomko <jtomko@redhat.com>
-
- 05 10月, 2018 3 次提交
-
-
由 Pavel Hrdina 提交于
This enables to use both cgroup v1 and v2 at the same time together with libvirt. It is supported by kernel and there is valid use-case, not all controllers are implemented in cgroup v2 so there might be configurations where administrator would enable these missing controllers in cgroup v1. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
When creating cgroup hierarchy we need to enable controllers in the parent cgroup in order to be usable. That means writing "+{controller}" into cgroup.subtree_control file. We can enable only controllers that are enabled for parent cgroup, that means we need to do that for the whole cgroup tree. Cgroups for threads needs to be handled differently in cgroup v2. There are two types of controllers: - domain controllers: these cannot be enabled for threads - threaded controllers: these can be enabled for threads In addition there are multiple types of cgroups: - domain: normal cgroup - domain threaded: a domain cgroup that serves as root for threaded cgroups - domain invalid: invalid cgroup, can be changed into threaded, this is the default state if you create subgroup inside domain threaded group or threaded group - threaded: threaded cgroup which can have domain threaded or threaded as parent group In order to create threaded cgroup it's sufficient to write "threaded" into cgroup.type file, it will automatically make parent cgroup "domain threaded" if it was only "domain". In case the parent cgroup is already "domain threaded" or "threaded" it will modify only the type of current cgroup. After that we can enable threaded controllers. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Place cgroup v2 backend type before cgroup v1 to make it obvious that cgroup v2 is preferred implementation. Following patches will introduce support for hybrid configuration which will allow us to use both at the same time, but we should prefer cgroup v2 regardless. Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 29 9月, 2018 1 次提交
-
-
由 Pavel Hrdina 提交于
This reverts commit 1602aa28. There is no need to call virCgroupRemove() nor virCgroupFree() if virCgroupEnableMissingControllers() fails because it will not modify 'group' at all. The cleanup of directories is done in virCgroupMakeGroup(). Reviewed-by: NJohn Ferlan <jferlan@redhat.com> Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NMarc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 27 9月, 2018 2 次提交
-
-
由 Pavel Hrdina 提交于
All the system headers are used only if we are compiling on linux and they all are present otherwise we would have seen build errors because in our tests/vircgrouptest.c we use only __linux__ to check whether to skip the cgroup tests or not. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
tests/vircgrouptest.c uses #ifdef __linux__ for a long time and no failure was reported so far so it's safe to assume that __linux__ is good enough to guard cgroup code. Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 25 9月, 2018 14 次提交
-
-
由 Pavel Hrdina 提交于
With the introduction of cgroup v2 there are new names used with cgroups based on which version is used: - legacy: cgroup v1 - unified: cgroup v2 - hybrid: cgroup v1 and cgroup v2 Let's use 'legacy' instead of 'cgroupv1' or 'controllers' in our code. Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
由 Pavel Hrdina 提交于
Reviewed-by: NFabiano Fidêncio <fidencio@redhat.com> Reviewed-by: NJán Tomko <jtomko@redhat.com> Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-