- 09 2月, 2010 6 次提交
-
-
由 Matthias Bolte 提交于
It was used for error reporting only.
-
由 Matthias Bolte 提交于
It was used for error reporting only.
-
由 Matthias Bolte 提交于
It was used for error reporting only.
-
由 Matthias Bolte 提交于
It was used for error reporting only.
-
由 Matthias Bolte 提交于
-
由 Matthias Bolte 提交于
-
- 05 2月, 2010 5 次提交
-
-
由 Jim Meyering 提交于
When configured with --enable-gcc-warnings, it didn't even compile. * src/util/storage_file.c: Include <assert.h>. (absolutePathFromBaseFile): Assert that converting size_t to int is valid. Reverse length/string args to match "%.*s". Explicitly ignore the return value of virAsprintf.
-
由 Jim Meyering 提交于
* src/util/storage_file.c: Include "dirname.h". (absolutePathFromBaseFile): Rewrite not to leak, and to require fewer allocations. * bootstrap (modules): Add dirname-lgpl. * .gnulib: Update submodule to the latest.
-
由 Jim Meyering 提交于
* src/util/util.c (virExecWithHook): Free argv_str string before returning upon failure to allocate space for environment.
-
由 Jim Meyering 提交于
* src/util/cgroup.c (virCgroupDetectPlacement): Close the mapping FILE* also upon error.
-
由 Jim Meyering 提交于
* src/util/cgroup.c (virCgroupCpuSetInherit) [HAVE_MNTENT_H]: Don't leak CPU-set inheritance value strings.
-
- 04 2月, 2010 2 次提交
-
-
由 Laine Stump 提交于
Similar fix as previous one but for fork() usage when creating a file or directory * src/util/util.c: virLogLock() and virLogUnlock() around fork() in virFileCreate() and virDirCreateSimple()
-
由 Cole Robinson 提交于
Ad pointed out by Dan Berrange: So if some thread in libvirtd is currently executing a logging call, while another thread calls virExec(), that other thread no longer exists in the child, but its lock is never released. So when the child then does virLogReset() it deadlocks. The only way I see to address this, is for the parent process to call virLogLock(), immediately before fork(), and then virLogUnlock() afterwards in both parent & child. This will ensure that no other thread can be holding the lock across fork(). * src/util/logging.[ch] src/libvirt_private.syms: export virLogLock() and virLogUnlock() * src/util/util.c: lock just before forking and unlock just after - in both parent and child.
-
- 02 2月, 2010 2 次提交
-
-
由 Jim Meyering 提交于
* src/util/util.c (virGetUserID, virGetGroupID): In the unlikely event that sysconf(_SC_GETPW_R_SIZE_MAX) fails, don't use -1 as the size in the subsequent allocation.
-
由 Jim Meyering 提交于
* src/util/json.c (virJSONValueFree): Free the "value" pointer, too.
-
- 01 2月, 2010 2 次提交
-
-
由 Chris Lalancette 提交于
Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
由 Chris Lalancette 提交于
On RHEL-5 the qemu-kvm binary is located in /usr/libexec. To reduce confusion for people trying to run upstream libvirt on RHEL-5 machines, make the qemu driver look in /usr/libexec for the qemu-kvm binary. To make this work, I modified virFindFileInPath to handle an absolute path correctly. I also ran into an issue where NULL was sometimes being passed for the file parameter to virFindFileInPath; it didn't crash prior to this patch since it was building paths like /usr/bin/(null). This is non-standard behavior, though, so I added a NULL check at the beginning. Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
- 30 1月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
* src/util/util.c (virGetUserEnt): In the unlikely event that sysconf(_SC_GETPW_R_SIZE_MAX) fails, don't use -1 as the size in the subsequent allocation.
-
- 27 1月, 2010 2 次提交
-
-
由 Jim Meyering 提交于
* src/util/pci.c (pciDeviceDownstreamLacksACS): Fix a typo that rendered a subexpression always false.
-
由 Matthias Bolte 提交于
-
- 26 1月, 2010 4 次提交
-
-
由 Jim Meyering 提交于
* src/util/hostusb.c (usbSysReadFile): Rename labels s/error/cleanup/ (usbFindBusByVendor): Likewise. And closedir only if non-NULL.
-
由 Laine Stump 提交于
virFileMakePath is a recursive function that was creates a buffer PATH_MAX bytes long for each recursion (one recursion for each element in the path). This changes it to have no buffers on the stack, and to allocate just one buffer total, no matter how many elements are in the path. Because the modified algorithm requires a char* to be passed in rather than const char *, it is now 2 functions - a toplevel API function that remains identical in function, and a 2nd helper function called for the recursions, which 1) doesn't allocate anything, and 2) takes a char* arg, so it can modify the contents. * src/util/util.c: rewrite virFileMakePath
-
由 Daniel P. Berrange 提交于
* src/util/json.c, src/util/json.h: Declare returned strings to be const * src/qemu/qemu_monitor.c: Wire up JSON mode for qemuMonitorGetPtyPaths * src/qemu/qemu_monitor_json.c, src/qemu/qemu_monitor_json.h: Fix const correctness. Add missing error message in the function qemuMonitorJSONGetAllPCIAddresses. Add implementation of the qemuMonitorGetPtyPaths function calling 'query-chardev'.
-
由 Jim Meyering 提交于
* src/util/hostusb.c (usbGetDevice): Free "dev" when returning NULL.
-
- 25 1月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
* src/util/hostusb.c (usbFindBusByVendor): Don't leak a DIR buffer and file descriptor.
-
- 23 1月, 2010 1 次提交
-
-
由 Chris Lalancette 提交于
Certain hypervisors (like qemu/kvm) map the PCI bar(s) on the host when doing device passthrough. This can lead to a race condition where the hypervisor is still cleaning up the device while libvirt is trying to re-attach it to the host device driver. To avoid this situation, we look through /proc/iomem, and if the hypervisor is still holding onto the bar (denoted by the string in the matcher variable), then we can wait around a bit for that to clear up. v2: Thanks to review by DV, make sure we wait the full timeout per-device Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
- 22 1月, 2010 1 次提交
-
-
由 Chris Lalancette 提交于
The patches to add ACS checking to PCI device passthrough introduced a bug. With the current code, if you try to passthrough a device on the root bus (i.e. bus 0), then it denies the passthrough. This is because the code in pciDeviceIsBehindSwitchLackingACS() to check for a parent device doesn't take into account the possibility of the root bus. If we are on the root bus, it means we legitimately can't find a parent, and it also means that we don't have to worry about whether ACS is enabled. Therefore return 0 (indicating we don't lack ACS) from pciDeviceIsBehindSwitchLackingACS(). Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
- 21 1月, 2010 3 次提交
-
-
由 Dan Kenigsberg 提交于
* src/util/uuid.c: extend virUUIDParse to allow leading and trailing spaces in UUIDs
-
由 Laine Stump 提交于
These functions create a new file or directory with the given uid/gid. If the flag VIR_FILE_CREATE_AS_UID is given, they do this by forking a new process, calling setuid/setgid in the new process, and then creating the file. This is better than simply calling open then fchown, because in the latter case, a root-squashing nfs server would create the new file as user nobody, then refuse to allow fchown. If VIR_FILE_CREATE_AS_UID is not specified, the simpler tactic of creating the file/dir, then chowning is is used. This gives better results in cases where the parent directory isn't on a root-squashing NFS server, but doesn't give permission for the specified uid/gid to create files. (Note that if the fork/setuid method fails to create the file due to access privileges, the parent process will make a second attempt using this simpler method.) If the bit VIR_FILE_CREATE_ALLOW_EXIST is set in the flags, an existing file/directory will not cause an error; in this case, the function will simply set the permissions of the file/directory to those requested. If VIR_FILE_CREATE_ALLOW_EXIST is not specified, an existing file/directory is considered (and reported as) an error. Return from both of these functions is 0 on success, or the value of errno if there was a failure. * src/util/util.[ch]: add the 2 new util functions
-
由 Laine Stump 提交于
* src/util/util.[ch]: similar to virExecWithHook, but waits for child to exit. Useful for doing things like setuid after the fork but before the exec.
-
- 20 1月, 2010 3 次提交
-
-
由 Jim Meyering 提交于
* src/util/logging.c (virLogMessage): Include "ignore-value.h". Use it to ignore the return value of safewrite. Use STDERR_FILENO, rather than "2". * bootstrap (modules): Add ignore-value. * gnulib: Update to latest, for ignore-value that is now LGPLv2+.
-
由 Jiri Denemark 提交于
I noticed some debug messages are printed with an empty lines after them. This patch removes these empty lines from all invocations of the following macros: VIR_DEBUG VIR_DEBUG0 VIR_ERROR VIR_ERROR0 VIR_INFO VIR_WARN VIR_WARN0 Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
由 Jiri Denemark 提交于
New pciDeviceIsAssignable() function for checking whether a given PCI device can be assigned to a guest was added. Currently it only checks for ACS being enabled on all PCIe switches between root and the PCI device. In the future, it could be the right place to check whether a device is unbound or bound to a stub driver. Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
-
- 18 1月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
Until recently, some gnulib-generated replacement headers included *other* headers that were not strictly necessary, thus masking the need in this file for an explicit <stdlib.h>. * src/util/util.c: Include <stdlib.h> for declarations of e.g., strtol, random_r, getenv, etc.
-
- 14 1月, 2010 2 次提交
-
-
由 Cole Robinson 提交于
With the introduction virDispatchError, hook function errors are never sent through the error callback, so users will never see these messages. Fix this by calling virDispatchError after hook failure.
-
由 Cole Robinson 提交于
Based off how QEMU does it, look through /sys/bus/usb/devices/* for matching vendor:product info, and if found, use info from the surrounding files to build the device's /dev/bus/usb path. This fixes USB device assignment by vendor:product when running qemu as non-root (well, it should, but for some reason I couldn't reproduce the failure people are seeing in [1], but it appears to work properly) [1] https://bugzilla.redhat.com/show_bug.cgi?id=542450
-
- 13 1月, 2010 1 次提交
-
-
由 Cole Robinson 提交于
This allows debug statements and raised errors in hook functions to actually be logged somewhere (stderr). Users can enable debugging in the daemon and now see more info in /var/log/libvirt/...
-
- 12 1月, 2010 2 次提交
-
-
由 Cole Robinson 提交于
Can be used to re-set an old error, which may have been squashed by other functions (like cleanup routines). Will be used in subsequent patches
-
由 Daniel P. Berrange 提交于
The virRaiseErrorFull() may invoke the error handler callback functions an application has registered. This is not good because the connection object may not be available at this point, and the caller may be holding locks. This creates a problem if the error handler calls back into libvirt. The solutuon is to move invocation of the handler into the final cleanup code in the public API entry points, where it is guarenteed to have safe state. * src/libvirt.c: Invoke virDispatchError() in all error paths * src/util/virterror.c: Remove virSetConnError/virSetGlobalError, replacing with virDispatchError(). Move invocation of the error callbacks into virDispatchError() instead of the virRaiseErrorFull function which is not in a safe context
-
- 11 1月, 2010 1 次提交
-
-
由 Laine Stump 提交于
Only use pseudo-random generator for uuid if using /dev/random fails. * src/util/uuid.c: The original code. would only print the warning message if using /dev/random failed, but would still go ahead and call virUUIDGeneratePseudoRandomBytes in all cases anyway.
-