- 01 8月, 2013 4 次提交
-
-
由 Daniel P. Berrange 提交于
Make the virCgroupNewMachine method try to use systemd-machined first. If that fails, then fallback to using the traditional cgroup setup code path. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
When systemd is involved in managing processes, it may start killing off & tearing down croups associated with the process while we're still doing virCgroupKillPainfully. We must explicitly check for ENOENT and treat it as if we had finished killing processes Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Systemd uses a named cgroup mount for tracking processes. Add it as another type of controller, albeit one which we have to special case in a number of places. In particular we must never create/delete directories there, nor add tasks. Essentially the systemd mount is to be considered read-only for libvirt. With this change both the virCgroupDetectPlacement and virCgroupCopyPlacement methods must be invoked. The copy placement method will copy setup for resource controllers only. The detect placement method will probe for any named controllers, or resource controllers not already setup. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
There are some interesting escaping rules to consider when dealing with systemd slice/scope names. Thus it is helpful to have APIs for formatting names Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 31 7月, 2013 1 次提交
-
-
由 Dan Walsh 提交于
This function is needed for virt-login-shell. Also modify virGirUserDirectory to use the new function, to simplify the code. Signed-off-by: NEric Blake <eblake@redhat.com>
-
- 30 7月, 2013 1 次提交
-
-
由 Daniel P. Berrange 提交于
The way we were casting small (<32bit) integers was broken on big endian hosts, causing stack smashing. This was detected in the test suite either by test failures due to incorrect results, or by libc/gcc abort'ing with its stack canary triggered. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 29 7月, 2013 6 次提交
-
-
由 Eric Blake 提交于
Depending on the set of mingw packages installed, it is possible that other .c files hit the mingw header pollution from the virdbus.h file. In file included from ../../src/rpc/virnetserver.c:39:0: ../../src/util/virdbus.h:41:35: error: expected ';', ',' or ')' before 'struct' const char *interface, ^ * src/util/virdbus.h (virDBusCallMethod): Match .c file change. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
On platforms without decent group support, the build failed: Cannot export virGetGroupList: symbol not defined ./.libs/libvirt_security_manager.a(libvirt_security_manager_la-security_dac.o): In function `virSecurityDACPreFork': /home/eblake/libvirt-tmp/build/src/../../src/security/security_dac.c:248: undefined reference to `virGetGroupList' collect2: error: ld returned 1 exit status * src/util/virutil.c (virGetGroupList): Provide dummy implementation. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Our recent conversion to make VIR_ALLOC report oom wasn't tested on mingw: In file included from ../../src/util/virthread.c:29:0: ../../src/util/virthreadwin32.c: In function 'virCondWait': ../../src/util/virthreadwin32.c:166:81: error: 'VIR_FROM_THIS' undeclared (first use in this function) if (VIR_REALLOC_N(c->waiters, c->nwaiters + 1) < 0) { ^ * src/util/virthreadwin32.c (VIR_FROM_THIS): Define. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
Mingw headers pollute the namespace. CC libvirt_util_la-virdbus.lo ../../src/util/virdbus.c:1102:35: error: expected ';', ',' or ')' before 'struct' const char *interface, ^ * src/util/virdbus.c (virDBusCallMethod): Avoid 'interface'. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
The previous patch was incomplete. CC libvirt_util_la-vircgroup.lo ../../src/util/vircgroup.c:70:12: error: 'virCgroupPartitionEscape' declared 'static' but never defined [-Werror=unused-function] static int virCgroupPartitionEscape(char **path); ^ * src/util/vircgroup.c (virCgroupPartitionEscape): Move forward declaration inside conditional. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Daniel P. Berrange 提交于
The virCgroupValidateMachineGroup method calls some functions which are only conditionally compiled, thus it too must be made conditional. This fixes the build on non-Linux hosts. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 26 7月, 2013 5 次提交
-
-
由 Daniel P. Berrange 提交于
If the app has provided a whitelist of controllers to be used, we skip detecting its mount point. We still, however, fill in the placement info which later confuses the machine name validation code. Skip detecting placement if the controller mount point is not set Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
When detecting cgroups we must honour any controllers whitelist the driver may have. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
When a VM has an 'emulator' child cgroup present, we must strip off that suffix when detecting the cgroup for a machine Rename the virCgroupIsValidMachineGroup method to virCgroupValidateMachineGroup to make a bit clearer that this isn't simply a boolean check, it will make changes to the object. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
The virCgroupIsValidMachine does not need to be called from outside the cgroups file now, so make it static. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Instead of requiring drivers to use a combination of calls to virCgroupNewDetect and virCgroupIsValidMachine, combine the two into virCgroupNewDetectMachine Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 25 7月, 2013 2 次提交
-
-
由 Daniel P. Berrange 提交于
Add protection such that the virCgroupRemove and virCgroupKill* do not do anything to the root cgroup. Killing all PIDs in the root cgroup does not end well. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Instead of requiring one API call to create a cgroup and another to add a task to it, introduce a new API virCgroupNewMachine which does both jobs at once. This will facilitate the later code to talk to systemd to achieve this job which is also atomic. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 24 7月, 2013 10 次提交
-
-
由 Ján Tomko 提交于
As we do for other errors with an extra string.
-
由 Roman Bogorodskiy 提交于
virCgroupAvailable() implementation calls getmntent_r without checking if HAVE_GETMNTENT_R is defined, so it fails to build on platforms without getmntent_r support. Make virCgroupAvailable() just return false without HAVE_GETMNTENT_R.
-
由 Martin Kletzander 提交于
Parsing 'user:group' is useful even outside the DAC security driver, so expose the most abstract function which has no DAC security driver bits in itself.
-
由 Eric Blake 提交于
Thanks to a lack of coordination between kernel and glibc folks, it has been impossible to mix code using <linux/in.h> and <net/in.h> for some time now (see for example commit c308a9ae). On at least RHEL 6, <linux/if_bridge.h> tries to use the kernel side, and fails due to our desire to use the glibc side elsewhere: In file included from /usr/include/linux/if_bridge.h:17, from util/virnetdevbridge.c:42: /usr/include/linux/in6.h:31: error: redefinition of ‘struct in6_addr’ /usr/include/linux/in6.h:48: error: redefinition of ‘struct sockaddr_in6’ /usr/include/linux/in6.h:56: error: redefinition of ‘struct ipv6_mreq’ Thankfully, the kernel layout of these structs is ABI-compatible, they only differ in the type system presented to the C compiler. While there are other versions of kernel headers that avoid the problem, it is easier to just work around the issue than to expect all developers to upgrade to working kernel headers. * src/util/virnetdevbridge.c (includes): Coerce the kernel version of in.h to not collide with the normal version. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Eric Blake 提交于
dbus 1.2.24 (on RHEL 6) lacks DBUS_TYPE_UNIX_FD; but as we aren't trying to pass one of those anyways, we can just drop support for it in our wrapper. Solves this build error introduced in commit 834c9c94: CC libvirt_util_la-virdbus.lo util/virdbus.c:242: error: 'DBUS_TYPE_UNIX_FD' undeclared here (not in a function) * src/util/virdbus.c (virDBusBasicTypes): Drop support for unix fds. Signed-off-by: NEric Blake <eblake@redhat.com>
-
由 Daniel P. Berrange 提交于
The virCgroupNewDomainDriver and virCgroupNewDriver methods are obsolete now that we can auto-detect existing cgroup placement. Delete them to reduce code bloat. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Add virCgroupIsValidMachine API to check whether an auto detected cgroup is valid for a machine. This lets us check if a VM has just been placed into some generic shared cgroup, or worse, the root cgroup Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Add a virCgroupNewDetect API which is used to initialize a cgroup object with the placement of an arbitrary process. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
If systemd machine does not exist, return -2 instead of -1, so that applications don't need to repeat the tedious error checking code Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Current code for handling dbus errors only works for errors received from the remote application itself. We must also handle errors emitted by the bus itself, for example, when it fails to spawn the target service. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 23 7月, 2013 1 次提交
-
-
由 Roman Bogorodskiy 提交于
Commit 834c9c94 introduced virDBusMessageEncode and virDBusMessageDecode functions, however corresponding stubs were not added to !WITH_DBUS section, therefore 'make check' started to fail when compiled w/out dbus support like that: Expected symbol virDBusMessageDecode is not in ELF library
-
- 22 7月, 2013 6 次提交
-
-
由 Daniel P. Berrange 提交于
Convert the remaining methods in vircgroup.c to report errors instead of returning errno values. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Instead of returning errno values, change the virCgroupKill* APIs to fully report errors. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Instead of returning raw errno values, report full libvirt errors in virCgroupNew* functions. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Add virErrorSetErrnoFromLastError and virLastErrorIsSystemErrno to simplify code which wants to handle system errors in a more graceful fashion. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
To register virtual machines and containers with systemd-machined, and thus have cgroups auto-created, we need to talk over DBus. This is somewhat tedious code, so introduce a dedicated function to isolate the DBus call in one place. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
由 Daniel P. Berrange 提交于
Doing DBus method calls using libdbus.so is tedious in the extreme. systemd developers came up with a nice high level API for DBus method calls (sd_bus_call_method). While systemd doesn't use libdbus.so, their API design can easily be ported to libdbus.so. This patch thus introduces methods virDBusCallMethod & virDBusMessageRead, which are based on the code used for sd_bus_call_method and sd_bus_message_read. This code in systemd is under the LGPLv2+, so we're license compatible. This code is probably pretty unintelligible unless you are familiar with the DBus type system. So I added some API docs trying to explain how to use them, as well as test cases to validate that I didn't screw up the adaptation from the original systemd code. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 19 7月, 2013 1 次提交
-
-
由 Jiri Denemark 提交于
Make virStringArrayHasString return false when called on a non-existent string array.
-
- 18 7月, 2013 3 次提交
-
-
由 Michal Privoznik 提交于
-
由 Michal Privoznik 提交于
-
由 Ján Tomko 提交于
When virAsprintf was changed from a function to a macro reporting OOM error in dc6f2dad, it was documented as returning 0 on success. This is incorrect, it returns the number of bytes written as asprintf does. Some of the functions were converted to use virAsprintf's return value directly, changing the return value on success from 0 to >= 0. For most of these, this is not a problem, but the change in virPCIDriverDir breaks PCI passthrough. The return value check in virhashtest pre-dates virAsprintf OOM conversion. vmwareMakePath seems to be unused.
-