- 21 8月, 2018 1 次提交
-
-
由 Christian Ehrhardt 提交于
It was found that in cases with host devices virProcessKillPainfully might be able to send signal zero to the target PID for quite a while with the process already being gone from /proc/<PID>. That is due to cleanup and reset of devices which might include a secondary bus reset that on top of the actions taken has a 1s delay to let the bus settle. Due to that guests with plenty of Host devices could easily exceed the default timeouts. To solve that, this adds an extra delay of 2s per hostdev that is associated to a VM. Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com> Signed-off-by: NChristian Ehrhardt <christian.ehrhardt@canonical.com>
-
- 07 8月, 2018 2 次提交
-
-
由 Sukrit Bhatnagar 提交于
By making use of GNU C's cleanup attribute handled by the VIR_AUTOPTR macro for declaring aggregate pointer variables, majority of the calls to *Free functions can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
由 Sukrit Bhatnagar 提交于
By making use of GNU C's cleanup attribute handled by the VIR_AUTOFREE macro for declaring scalar variables, majority of the VIR_FREE calls can be dropped, which in turn leads to getting rid of most of our cleanup sections. Signed-off-by: NSukrit Bhatnagar <skrtbhtngr@gmail.com> Reviewed-by: NErik Skultety <eskultet@redhat.com>
-
- 26 6月, 2018 1 次提交
-
-
由 Julio Faracco 提交于
After running libvirt daemon with valgrind tools, some errors are appearing when you try to start a domain. One example: ==18012== Syscall param mount(type) points to unaddressable byte(s) ==18012== at 0x6FEE3CA: mount (syscall-template.S:78) ==18012== by 0x531344D: virFileMoveMount (virfile.c:3828) ==18012== by 0x27FE7675: qemuDomainBuildNamespace (qemu_domain.c:11501) ==18012== by 0x2800C44E: qemuProcessHook (qemu_process.c:2870) ==18012== by 0x52F7E1D: virExec (vircommand.c:726) ==18012== by 0x52F7E1D: virCommandRunAsync (vircommand.c:2477) ==18012== by 0x52F4EDD: virCommandRun (vircommand.c:2309) ==18012== by 0x2800A731: qemuProcessLaunch (qemu_process.c:6235) ==18012== by 0x2800D6B4: qemuProcessStart (qemu_process.c:6569) ==18012== by 0x28074876: qemuDomainObjStart (qemu_driver.c:7314) ==18012== by 0x280522EB: qemuDomainCreateWithFlags (qemu_driver.c:7367) ==18012== by 0x55484BF: virDomainCreate (libvirt-domain.c:6531) ==18012== by 0x12CDBD: remoteDispatchDomainCreate (remote_daemon_dispatch_stubs.h:4350) ==18012== by 0x12CDBD: remoteDispatchDomainCreateHelper (remote_daemon_dispatch_stubs.h:4326) ==18012== Address 0x0 is not stack'd, malloc'd or (recently) free'd Some documentation recommends to use "none" when you don't have a filesystem type to use. Specially, for bind and move actions. Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
-
- 28 3月, 2017 1 次提交
-
-
由 Andrea Bolognani 提交于
The value we use internally to represent the lack of a memory locking limit, VIR_DOMAIN_MEMORY_PARAM_UNLIMITED, doesn't match the value setrlimit() and prlimit() use for the same purpose, RLIM_INFINITY, so we have to handle the translation ourselves. Partially-resolves: https://bugzilla.redhat.com/1431793
-
- 07 2月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
The comment to the function states that the errors from the child process are reported. Well, the error buffer is filled with possible error messages. But then it is thrown away. Among with important error message from the child process. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 12 1月, 2017 1 次提交
-
-
由 Michal Privoznik 提交于
Other drivers (like qemu) would like to know if the namespaces are available therefore it makes sense to move this function to a shared module. At the same time, this function had some default namespaces that are checked with every call. It is not necessary - let callers pass just those namespaces they are interested in. With the move the function is renamed to virProcessNamespaceAvailable. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 15 12月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
This part of code that LXC currently uses will be reused so move to a generic function. Signed-off-by: NMichal Privoznik <mprivozn@redhat.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>
-
- 21 11月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
After commit f2bf5fbb, MinGW strikes again. Simply print pid as any other place after commit b7d2d4af. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 18 11月, 2016 1 次提交
-
-
由 Martin Kletzander 提交于
Commit 94cc5778 tried fixing build on systems that did not have SCHED_BATCH or SCHED_IDLE defined. But instead of changing it to conditional support, it rather completely disabled the support for setting any scheduler. Since then, such old systems are not supported, but rather than reverting that commit, let's change that to the conditional support. That way any addition to the list of schedulers can follow the same style so that we're consistent in the future. Signed-off-by: NMartin Kletzander <mkletzan@redhat.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 次提交
-
-
由 Daniel P. Berrange 提交于
Currently the QEMU processes inherit their core dump rlimit from libvirtd, which is really suboptimal. This change allows their limit to be directly controlled from qemu.conf instead.
-
- 24 6月, 2016 3 次提交
-
-
由 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 提交于
Introduce a helper that only calls closedir if DIR* is non-NULL and sets it to NULL afterwards.
-
- 19 2月, 2016 1 次提交
-
-
由 Peter Krempa 提交于
Use the helper that does not return errors to fix spuriously looking dead return of -1.
-
- 10 2月, 2016 1 次提交
-
-
由 Michal Privoznik 提交于
The virStringListLength function does not ever modify the passed string list. It merely counts the items in it. Make sure that we reflect this bit in the function header. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com> (crobinso: fix up spacing and squash in sheepdog bit suggested by Andrea)
-
- 17 12月, 2015 2 次提交
-
-
由 Andrea Bolognani 提交于
This function can be used to retrieve the current locked memory limit for a process, so that the setting can be later restored. Add a configure check for getrlimit(), which we now use.
-
由 Andrea Bolognani 提交于
The prlimit() function allows both getting and setting limits for a process; expose the same functionality in our wrapper. Add the const modifier for new_limit, in accordance with the prototype for prlimit().
-
- 20 11月, 2015 1 次提交
-
-
由 Andrea Bolognani 提交于
This can be useful for debugging.
-
- 04 11月, 2015 1 次提交
-
-
由 Jiri Denemark 提交于
VIR_DEBUG and VIR_WARN will automatically add a new line to the message, having "\n" at the end or at the beginning of the message results in empty lines. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 28 10月, 2015 1 次提交
-
-
由 Pino Toscano 提交于
Use the virProcessGetStartTime implementation also when only the kernel is FreeBSD, such as on GNU/kFreeBSD.
-
- 27 8月, 2015 1 次提交
-
-
由 Michal Privoznik 提交于
So far, the virProcessSetNamespaces() takes an array of FDs that it tries to set namespace on. However, in the very next commit this array may be sparse, having some -1's in it. Teach the function to cope with that. Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
-
- 18 8月, 2015 1 次提交
-
-
由 Eric Blake 提交于
Ever since commit e44b0269, 64-bit mingw compilation fails with: ../../src/util/virprocess.c: In function 'virProcessGetPids': ../../src/util/virprocess.c:628:50: error: passing argument 4 of 'virStrToLong_i' from incompatible pointer type [-Werror=incompatible-pointer-types] if (virStrToLong_i(ent->d_name, NULL, 10, &tmp_pid) < 0) ^ In file included from ../../src/util/virprocess.c:59:0: ../../src/util/virstring.h:53:5: note: expected 'int *' but argument is of type 'pid_t * {aka long long int *}' int virStrToLong_i(char const *s, ^ cc1: all warnings being treated as errors Although mingw won't be using this function, it does compile the file, and the fix is relatively simple. * src/util/virprocess.c (virProcessGetPids): Don't assume pid_t fits in int. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 16 6月, 2015 2 次提交
-
-
由 John Ferlan 提交于
Commit id 'e44b0269' in advertently checked !dir before calling closedir
-
由 Cédric Bosdonnat 提交于
This function gets all the PIDs listed in /proc/PID/task. This will be needed at least to move all qmeu-nbd tasks to the container cgroup.
-
- 11 6月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
Store the cpu count in an intermediate variable and reuse it rather than caluclating the index. Additionally add a coverity silencing comment.
-
- 08 6月, 2015 1 次提交
-
-
由 Roman Bogorodskiy 提交于
Commit 825df8c3 refactored virProcess{Set,Get}Affinity routines, however broke BSD implementation because of the incorrect variable name. Fix build by using a proper variable name. Pushing as trivial and build break fix.
-
- 03 6月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
Refactor the function to return the bitmap instead of an integer and the inner workings so that they make more sense. This patch also fixes possible segfault on old systems that was introduced by commit: commit f1a43a8e Author: Hu Tao <hutao@cn.fujitsu.com> Date: Fri Sep 14 15:46:59 2012 +0800 use virBitmap to store cpu affinity info
-
- 02 6月, 2015 1 次提交
-
-
由 Peter Krempa 提交于
-
- 09 4月, 2015 1 次提交
-
-
由 Cédric Bosdonnat 提交于
lxc-enter-namespace stopped working on recent kernels (at least 3.19+) due to /proc/PID/ns/* file descriptors being opened RW. From outside the namespace these can only be opened RO.
-
- 23 3月, 2015 1 次提交
-
-
由 Martin Kletzander 提交于
Wikipedia's list of common misspellings [1] has a machine-readable version. This patch fixes those misspellings mentioned in the list which don't have multiple right variants (as e.g. "accension", which can be both "accession" and "ascension"), such misspellings are left untouched. The list of changes was manually re-checked for false positives. [1] https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machinesSigned-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 13 3月, 2015 1 次提交
-
-
由 Ján Tomko 提交于
A helper that never returns an error and treats bits out of bitmap range as false. Use it everywhere we use ignore_value on virBitmapGetBit, or loop over the bitmap size.
-
- 13 2月, 2015 1 次提交
-
-
由 Pavel Hrdina 提交于
Commit b6a2828e introduced new functions to set process scheduler. There is a small typo in ELSE path for systems where scheduler is not available. Also some of the definitions were introduced later in kernel. For example RHEL-5 is running on kernel 2.6.18, but SCHED_IDLE was introduces in 2.6.23 [1] and SCHED_BATCH in 2.6.16 [1]. We should not count only on existence of function sched_setscheduler(), we must also check for existence of used macros as they might not be defined. [1] see 'man 7 sched' Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
-
- 12 2月, 2015 1 次提交
-
-
由 Martin Kletzander 提交于
This function uses sched_setscheduler() function so it works with processes and threads as well (even threads not created by us, which is what we'll need in the future). Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 19 12月, 2014 1 次提交
-
-
由 Daniel P. Berrange 提交于
The code assumes that def->vcpus == nvcpupids, so when we setup fake CPU pids for old QEMU with nvcpupids == 1, we cause the later code to read off the end of the array. This has fun results like sche_setaffinity(0, ...) which changes libvirtd's own CPU affinity, or even better sched_setaffinity($RANDOM, ...) which changes the affinity of a random OS process.
-
- 29 10月, 2014 1 次提交
-
-
由 Eric Blake 提交于
C guarantees that static variables are zero-initialized. Some older compilers (and also gcc -fno-zero-initialized-in-bss) create larger binaries if you explicitly zero-initialize a static variable. * src/libvirt.c: Fix initialization. * src/util/viralloc.c: Likewise. * src/util/virdbus.c: Likewise. * src/util/virevent.c: Likewise. * src/util/virfile.c (safezero): Likewise. * src/util/virlog.c: Likewise. * src/util/virnetlink.c: Likewise. * src/util/virthread.h (VIR_ONCE_GLOBAL_INIT): Likewise. * src/util/virprocess.c (virProcessGetStartTime): Likewise. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 12 10月, 2014 1 次提交
-
-
由 Martin Kletzander 提交于
The actual origin of this so called typo are two commits. The first one was commit 72f8a7f1 that came up with the following condition: if ((i == 8) & (flags & VIR_QEMU_PROCESS_KILL_FORCE)) Fortunately this succeeded thanks to bool being (int)1 and VIR_QEMU_PROCESS_KILL_FORCE having the value of 1 << 0. The check was then moved and altered in 8fd38231 to current state: if ((i == 50) & force) that will work again (both sides of '&' being booleans), but since this was missed so many times, it may pose a problem in the future in case it gets copy-pasted again. Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
-
- 02 10月, 2014 1 次提交
-
-
由 Eric Blake 提交于
A cygwin build of 1.2.9 fails with: util/virprocess.c:87:27: fatal error: sys/syscall.h: No such file or directory # include <sys/syscall.h> But in reality, the ONLY user of setns() is lxc, which is Linux-only. It's easiest to just limit the setns workarounds to Linux. * src/util/virprocess.c (setns): Limit definition to Linux. Signed-off-by: NEric Blake <eblake@redhat.com>
-