- 06 12月, 2016 1 次提交
-
-
由 Viktor Mihajlovski 提交于
With kernel 3.18 (since commit 3e32cb2e0a12b6915056ff04601cf1bb9b44f967) the "unlimited" value for cgroup memory limits has changed once again as its byte value is now computed from a page counter. The new "unlimited" value reported by the cgroup fs is therefore 2**51-1 pages which is (VIR_DOMAIN_MEMORY_PARAM_UNLIMITED - 3072). This results e.g. in virsh memtune displaying 9007199254740988 instead of unlimited for the limits. This patch uses the value of memory.limit_in_bytes from the cgroup memory root which is the system's "real" unlimited value for comparison. See also libvirt commit 231656bb for the history for kernel 3.12 and before. Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
-
- 25 11月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
We have couple of functions that operate over NULL terminated lits of strings. However, our naming sucks: virStringJoin virStringFreeList virStringFreeListCount virStringArrayHasString virStringGetFirstWithPrefix We can do better: virStringListJoin virStringListFree virStringListFreeCount virStringListHasString virStringListGetFirstWithPrefix Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 24 11月, 2016 1 次提交
-
-
由 Nitesh Konkar 提交于
Signed-off-by: NNitesh Konkar <nitkon12@linux.vnet.ibm.com>
-
- 13 10月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
This initially started as a fix of some debug printing in virCgroupDetect. However it turned out that other places suffer from the similar problem. While dealing with pids, esp. in cases where we cannot use pid_t for ABI stability reasons, we often chose an unsigned integer type. This makes no sense as pid_t is signed. Also, new syntax-check rule is introduced so we won't repeat this mistake. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 06 9月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
In the latest glibc, major() and minor() functions are marked as deprecated (glibc commit dbab6577): CC util/libvirt_util_la-vircgroup.lo util/vircgroup.c: In function 'virCgroupGetBlockDevString': util/vircgroup.c:768:5: error: '__major_from_sys_types' is deprecated: In the GNU C Library, `major' is defined by <sys/sysmacros.h>. For historical compatibility, it is currently defined by <sys/types.h> as well, but we plan to remove this soon. To use `major', include <sys/sysmacros.h> directly. If you did not intend to use a system-defined macro `major', you should #undef it after including <sys/types.h>. [-Werror=deprecated-declarations] if (virAsprintf(&ret, "%d:%d ", major(sb.st_rdev), minor(sb.st_rdev)) < 0) ^~ In file included from /usr/include/features.h:397:0, from /usr/include/bits/libc-header-start.h:33, from /usr/include/stdio.h:28, from ../gnulib/lib/stdio.h:43, from util/vircgroup.c:26: /usr/include/sys/sysmacros.h:87:1: note: declared here __SYSMACROS_DEFINE_MAJOR (__SYSMACROS_FST_IMPL_TEMPL) ^ Moreover, in the glibc commit, there's suggestion to keep ordering of including of header files as implemented here. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 25 8月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
-
- 26 7月, 2016 1 次提交
-
-
由 Ján Tomko 提交于
Use virAsprintf to prepend an underscore to make the code more readable.
-
- 24 6月, 2016 6 次提交
-
-
由 Ján Tomko 提交于
Remove all the remaining usage of opendir.
-
由 Ján Tomko 提交于
Use it instead of opendir everywhere we need to check for ENOENT.
-
由 Ján Tomko 提交于
Switch from opendir to virDirOpen everywhere we need to report an error.
-
由 Ján Tomko 提交于
The directories we iterate over are unlikely to contain any entries starting with a dot, other than '.' and '..' which is already skipped by virDirRead.
-
由 Ján Tomko 提交于
It skips those directory entries.
-
由 Ján Tomko 提交于
Introduce a helper that only calls closedir if DIR* is non-NULL and sets it to NULL afterwards.
-
- 10 6月, 2016 3 次提交
-
-
由 Daniel P. Berrange 提交于
Move all APIs with a virHostCPU name prefix out into new util/virhostcpu.h & util/virhostcpu.c files Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
In preparation for moving all the CPU related APIs out of the nodeinfo file, give them a virHostCPU name prefix. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Nearly all the methods in the nodeinfo file are given a 'const char *sysfs_prefix' parameter to override the default sysfs path (/sys/devices/system). Every single caller passes in NULL for this, except one use in the unit tests. Furthermore this parameter is totally Linux-specific, when the APIs are intended to be cross platform portable. This removes the sysfs_prefix parameter and instead gives a new method linuxNodeInfoSetSysFSSystemPath for use by the test suite. For two of the methods this hardcodes use of the constant SYSFS_SYSTEM_PATH, since the test suite does not need to override the path for thos methods. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 06 5月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
Fron c3bd0019 on instead of creating the following path for cgroups: /sys/fs/cgroupX/$name.libvirt-$driver we generate rather more verbose one: /sys/fs/cgroupX/$driver-$id-$name.libvirt-$driver where $name is optional and included iff contains allowed chars. See original commit for more reasoning. Now, problem with the original commit is that we are unable to start any LXC domain after it. Because when starting LXC container, the CGroup layout is created by our lxc_controller process and then detected and validated by libvirtd. The validation is done by trying to match detected layout against all the possible patterns for cgroup paths that we've ever had. And the commit in question forgot to update this part of the code. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 19 4月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
So in glibc-2.23 sys/sysmacros.h is no longer included from sys/types.h and we don't build because of the usage of major/minor/makedev macros. Autoconf already has AC_HEADER_MAJOR macro that check where exactly these functions/macros are defined, so let's use that. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 01 3月, 2016 2 次提交
-
-
由 Henning Schild 提交于
qemuProcessSetupEmulator runs at a point in time where there is only the qemu main thread. Use virCgroupAddTask to put just that one task into the emulator cgroup. That patch makes virCgroupMoveTask and virCgroupAddTaskStrController obsolete. Signed-off-by: NHenning Schild <henning.schild@siemens.com>
-
由 Henning Schild 提交于
Use virCgroupAddTaskController in virCgroupAddTask so we have one single point where we add tasks to cgroups. Signed-off-by: NHenning Schild <henning.schild@siemens.com>
-
- 17 2月, 2016 4 次提交
-
-
由 Michal Privoznik 提交于
In cf113e8d we changed the declaration of virCgroupAllowDevicePath() and virCgroupDenyDevicePath(). However, while updating the stub for non-cgroup platforms for the former we forgot to update the latter too causing a build failure. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
When adding disk images to ACL we may call those functions on NFS shares. In that case we might get an EACCES, which isn't really relevant since NFS would not hold a block device. This patch adds a flag that allows to stop reporting an error on EACCES to avoid spaming logs. Currently there's no functional change.
-
由 Peter Krempa 提交于
Since commit 47e5b5ae virCgroupAllowDevice allows to pass -1 as either the minor or major device number and it automatically uses '*' in place of that. Reuse the new approach through the code and drop the duplicated functions.
-
由 Peter Krempa 提交于
Similarly to commit 47e5b5ae virCgroupDenyDevice will handle -1 as *.
-
- 08 2月, 2016 2 次提交
-
-
由 Michal Privoznik 提交于
In the commit 7938b533 we've changed the function signature, however forgot to update stump that's used on systems without CGroups causing a build failure. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Peter Krempa 提交于
Pass a bitmap of enabled guest vCPUs to virCgroupGetPercpuStats so that non-continuous vCPU topologies can be used.
-
- 05 2月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
So, systemd-machined has this philosophy that machine names are like hostnames and hence should follow the same rules. But we always allowed international characters in domain names. Thus we need to modify the machine name we are passing to systemd. In order to change some machine names that we will be passing to systemd, we also need to call TerminateMachine at the end of a lifetime of a domain. Even for domains that were started with older libvirt. That can be achieved thanks to virSystemdGetMachineNameByPID(). And because we can change machine names, we can get rid of the inconsistent and pointless escaping of domain names when creating machine names. So this patch modifies the naming in the following way. It creates the name as <drivername>-<id>-<name> where invalid hostname characters are stripped out of the name and if the resulting name is longer, it truncates it to 64 characters. That way we can start domains we couldn't start before. Well, at least on systemd. To make it work all together, the machineName (which is needed only with systemd) is saved in domain's private data. That way the generation is moved to the driver and we don't need to pass various unnecessary arguments to cgroup functions. The only thing this complicates a bit is the scope generation when validating a cgroup where we must check both old and new naming, so a slight modification was needed there. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1282846Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 03 2月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Use 'ret' for return variable name, clarify use of 'param_idx' and avoid unnecessary 'success' label. No functional changes. Also document the function.
-
- 27 1月, 2016 2 次提交
-
-
由 Michal Privoznik 提交于
In dc576025 we renamed virCgroupIsolateMount function to virCgroupBindMount. However, we forgot about one occurrence in section of the code which provides stubs for platforms without support for CGroups like *BSD for instance. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
由 Daniel P. Berrange 提交于
On the host when we start a container, it will be placed in a cgroup path of /machine.slice/machine-lxc\x2ddemo.scope under /sys/fs/cgroup/* Inside the containers' namespace we need to setup /sys/fs/cgroup mounts, and currently will bind mount /machine.slice/machine-lxc\x2ddemo.scope on the host to appear as / in the container. While this may sound nice, it confuses applications dealing with cgroups, because /proc/$PID/cgroup now does not match the directory in /sys/fs/cgroup This particularly causes problems for systems and will make it create repeated path components in the cgroup for apps run in the container eg /machine.slice/machine-lxc\x2ddemo.scope/machine.slice/machine-lxc\x2ddemo.scope/user.slice/user-0.slice/session-61.scope This also causes any systemd service that uses sd-notify to fail to start, because when systemd receives the notification it won't be able to identify the corresponding unit it came from. In particular this break rabbitmq-server startup Future kernels will provide proper cgroup namespacing which will handle this problem, but until that time we should not try to play games with hiding parent cgroups. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 15 1月, 2016 1 次提交
-
-
由 John Ferlan 提交于
This reverts commit 71ce4759. Since commit id 'a41c00b4' has been reverted, this no longer is necessary
-
- 12 1月, 2016 1 次提交
-
-
As cgroup implementation only works on Linux, it does not make much sense to include sys/mount.h if other requirements are not met, such as HAVE_MNTENT_H and HAVE_GETMNTENT_R. Also, it fixes build on OpenBSD that requires to include sys/param.h along with sys/mount.h. Signed-off-by: NRoman Bogorodskiy <bogorodskiy@gmail.com>
-
- 25 12月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
The manpage for sysconf() suggest including unistd.h as the function is declared there. Even though we are not hitting any compile issues currently, let's include the correct header file instead of relying on some hidden include chain. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 12月, 2015 1 次提交
-
-
由 Henning Schild 提交于
virCgroupNewMachine used to add the pidleader to the newly created machine cgroup. Do not do this implicit anymore. Signed-off-by: NHenning Schild <henning.schild@siemens.com>
-
- 20 8月, 2015 1 次提交
-
-
由 Roman Bogorodskiy 提交于
Commit 89c509a0 added getters for cgroup block device I/O throttling, however stub versions of these functions have not matching function prototypes that result in compilation fail on platforms not supporting cgroup. Fix build by correcting prototypes of the stubbed functions. Pushing under build-breaker rule.
-
- 19 8月, 2015 2 次提交
-
-
由 Martin Kletzander 提交于
Since now they were not needed, but I sense they will be in a short while. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
由 Martin Kletzander 提交于
This function translates device paths to "major:minor " string, and all virCgroupSetBlkioDevice* functions are modified to use it. It's a cleanup with no functional change. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 22 7月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
The scope name, even according to our docs is "machine-$DRIVER\x2d$VMNAME.scope" virSystemdMakeScopeName would use the resource partition name instead of "machine-" if it was specified thus creating invalid scope paths. This makes libvirt drop cgroups for a VM that uses custom resource partition upon reconnecting since the detected scope name would not match the expected name generated by virSystemdMakeScopeName. The error is exposed by the following log entry: debug : virCgroupValidateMachineGroup:302 : Name 'machine-qemu\x2dtestvm.scope' for controller 'cpu' does not match 'testvm', 'testvm.libvirt-qemu' or 'machine-test-qemu\x2dtestvm.scope' for a "/machine/test" resource and "testvm" vm. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1238570
-
- 14 7月, 2015 1 次提交
-
-
由 John Ferlan 提交于
Add the sysfs_prefix argument to the call to allow for setting the path for tests to something other than SYSFS_SYSTEM_PATH.
-
- 10 4月, 2015 1 次提交
-
-
由 John Ferlan 提交于
Replace the virCgroupNew{Vcpu|Emulator|IOThread} calls with the common virCgroupNewThread API Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
-