- 13 1月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Without this patch, at least tests/daemon-conf (which sticks $builddir/src in the PATH) tries to execute the directory $builddir/src/qemu rather than a real qemu binary. * src/util/util.h (virFileExists): Adjust prototype. (virFileIsExecutable): New prototype. * src/util/util.c (virFindFileInPath): Reject non-executables and directories. Avoid huge stack allocation. (virFileExists): Use lighter-weight syscall. (virFileIsExecutable): New function. * src/libvirt_private.syms (util.h): Export new function.
-
- 04 1月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Detected on cygwin: util/util.c: In function 'virSetUIDGID': util/util.c:2824: warning: format '%d' expects type 'int', but argument 7 has type 'gid_t' [-Wformat] (and three other lines) * src/util/util.c (virSetUIDGID): Cast, as is done elsewhere in this file, to avoid printf type mismatch warnings.
-
- 01 1月, 2011 1 次提交
-
-
由 Eric Blake 提交于
As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=659855#c9, commit c3568ec2 introduced a regression where we no longer close any fd's beyond FD_SETSIZE. * src/util/util.c (__virExec): Continue to close fd's beyond keepfd range. Reported by Stefan Praszalowicz.
-
- 24 12月, 2010 1 次提交
-
-
由 Laine Stump 提交于
virSetUIDGID() sets both the real and effective group and user of the process, and additionally calls initgroups() to assure that the process joins all the auxiliary groups that the given uid is a member of.
-
- 14 12月, 2010 2 次提交
-
-
由 Jiri Denemark 提交于
Remove superfluous ": %s" suffix from the error message.
-
由 Eric Blake 提交于
Allows compilation, but no creation of child processes yet. Take it one step at a time. * src/util/util.c (virExecWithHook) [WIN32]: New dummy function. * src/libvirt_private.syms: Export it.
-
- 11 12月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* src/util/util.c (__virExec): Don't use FD_ISSET on out-of-bounds fd.
-
- 03 12月, 2010 3 次提交
-
-
由 Jean-Baptiste Rouault 提交于
This patch adds a mode_t parameter to virFileWriteStr(). If mode is different from 0, virFileWriteStr() will try to create the file if it doesn't exist. * src/util/util.h (virFileWriteStr): Alter signature. * src/util/util.c (virFileWriteStr): Allow file creation. * src/network/bridge_driver.c (networkEnableIpForwarding) (networkDisableIPV6): Adjust clients. * src/node_device/node_device_driver.c (nodeDeviceVportCreateDelete): Likewise. * src/util/cgroup.c (virCgroupSetValueStr): Likewise. * src/util/pci.c (pciBindDeviceToStub, pciUnBindDeviceFromStub): Likewise.
-
由 Eric Blake 提交于
* src/util/util.h (virVasprintf): New declaration. * src/util/util.c (virVasprintf): New function. (virAsprintf): Use it. * src/util/virtaudit.c (virAuditSend): Likewise. * src/libvirt_private.syms: Export it. * cfg.mk (sc_prohibit_asprintf): Also prohibit vasprintf. * .x-sc_prohibit_asprintf: Add exemption.
-
由 Eric Blake 提交于
* src/util/util.c (saferead): Fix return type. (safewrite): Fix indentation.
-
- 23 11月, 2010 2 次提交
-
-
由 Daniel P. Berrange 提交于
The QEMU logger appends a ':' to the timestamp when it deems it neccessary, so the virTimestamp API should not duplicate this * src/util/util.c: Remove trailing ':' from timestamp
-
由 Daniel P. Berrange 提交于
The virFork call resets all logging handlers that may have been set. Re-enable them after fork in virExec, so that env variables fir LIBVIRT_LOG_OUTPUTS and LIBVIRT_LOG_FILTERS take effect until the execve() * src/util/util.c: Preserve logging in child in virExec
-
- 19 11月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 17 11月, 2010 1 次提交
-
-
由 Stefan Berger 提交于
Similarly to deprecating close(), I am now deprecating fclose() and introduce VIR_FORCE_FCLOSE() and VIR_FCLOSE(). Also, fdopen() is replaced with VIR_FDOPEN(). Most of the files are opened in read-only mode, so usage of VIR_FORCE_CLOSE() seemed appropriate. Others that are opened in write mode already had the fclose()< 0 check and I converted those to VIR_FCLOSE()< 0. I did not find occurrences of possible double-closed files on the way.
-
- 10 11月, 2010 1 次提交
-
-
由 Stefan Berger 提交于
Using automated replacement with sed and editing I have now replaced all occurrences of close() with VIR_(FORCE_)CLOSE() except for one, of course. Some replacements were straight forward, others I needed to pay attention. I hope I payed attention in all the right places... Please have a look. This should have at least solved one more double-close error.
-
- 09 11月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
Suggested by danpb, as it's not up-to-date anymore and lacks many functions that were added to libvirtd.
-
- 03 11月, 2010 1 次提交
-
-
由 Daniel Veillard 提交于
virPipeReadUntilEOF is used to read the stdout of exec'ed and this could fail to capture the full output and read only 1024 bytes. The problem is that this is based on a poll loop, and in the loop we read at most 1024 bytes per file descriptor, but we also note in the loop if poll indicates that the process won't output more than that on that fd by setting finished[i] = 1. The simplest way is that if we read a full buffer make sure finished[i] is still 0 because we will need another pass in the loop.
-
- 02 11月, 2010 1 次提交
-
-
由 Osier Yang 提交于
* src/util/util.h * src/util/util.c * src/libvirt_private.syms
-
- 28 10月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
Commit 9bd3cce0 added virFork and virDriverLoadModule to libvirt_private.syms, but virFork didn't have a body on Win32 and virDriverLoadModule was already correctly exported conditional via libvirt_driver_modules.syms.
-
- 23 9月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* .gnulib: Update to latest. * bootstrap.conf (gnulib_modules): Add new termios module. (gnulib_tool_option_extras): Make libtool usage explicit. * src/util/util.c (includes): Gnulib now guarantees termios.h. * bootstrap: Resync from gnulib.
-
- 31 8月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
virHexToBin will be used in the .vmx handling code.
-
- 13 8月, 2010 1 次提交
-
-
由 Stefan Berger 提交于
This patch fixes a couple of complaints from valgrind when tickling libvirtd with SIGHUP. The first two files contain fixes for memory leaks. The 3rd one initializes an uninitialized variable. The 4th one is another memory leak.
-
- 10 8月, 2010 1 次提交
-
-
由 Soren Hansen 提交于
virDiskNameToIndex has a list of disk name prefixes that it uses in the process of finding the disk's index. This list is missing "ubd" which is the disk prefix used for UML domains. Signed-off-by: NSoren Hansen <soren@linux2go.dk>
-
- 22 7月, 2010 2 次提交
-
-
由 Laine Stump 提交于
virDirCreate also previously returned 0 on success and errno on failure. This makes it fit the recommended convention of returning 0 on success, -errno (ie a negative number) on failure.
-
由 Laine Stump 提交于
virFileOperation previously returned 0 on success, or the value of errno on failure. Although there are other functions in libvirt that use this convention, the preferred (and more common) convention is to return 0 on success and -errno (or simply -1 in some cases) on failure. This way the check for failure is always (ret < 0). * src/util/util.c - change virFileOperation and virFileOperationNoFork to return -errno on failure. * src/storage/storage_backend.c, src/qemu/qemu_driver.c - change the hook functions passed to virFileOperation to return -errno on failure.
-
- 02 7月, 2010 1 次提交
-
-
由 Cole Robinson 提交于
Any error message raised after the process has forked needs to be followed by virDispatchError, otherwise we have no chance of ever seeing it. This was selectively done for hook functions in the past, but really applies to all post-fork errors.
-
- 29 6月, 2010 1 次提交
-
-
由 Eric Blake 提交于
https://bugzilla.redhat.com/show_bug.cgi?id=608092 * src/util/util.c (virFileResolveLink): Use canonicalize_file_name, rather than areadlink.
-
- 11 6月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
Otherwise this will segfault if PATH is not defined. Reported by Emre Erenoglu
-
- 26 5月, 2010 2 次提交
-
-
由 Chris Lalancette 提交于
We've been running into a lot of situations where virGetHostname() is returning "localhost", where a plain gethostname() would have returned the correct thing. This is because virGetHostname() is *always* trying to canonicalize the name returned from gethostname(), even when it doesn't have to. This patch changes virGetHostname so that if the value returned from gethostname() is already FQDN or localhost, it returns that string directly. If the value returned from gethostname() is a shortened hostname, then we try to canonicalize it. If that succeeds, we returned the canonicalized hostname. If that fails, and/or returns "localhost", then we just return the original string we got from gethostname() and hope for the best. Note that after this patch it is up to clients to check whether "localhost" is an allowed return value. The only place where it's currently not is in qemu migration. Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
由 Cole Robinson 提交于
Spurious / in a pool target path makes life difficult for apps using the GetVolByPath, and doing other path based comparisons with pools. This has caused a few issues for virt-manager users: https://bugzilla.redhat.com/show_bug.cgi?id=494005 https://bugzilla.redhat.com/show_bug.cgi?id=593565 Add a new util API which removes spurious /, virFileSanitizePath. Sanitize target paths when parsing pool XML, and for paths passed to GetVolByPath. v2: Leading // must be preserved, properly sanitize path=/, sanitize away /./ -> / v3: Properly handle starting ./ and ending /. v4: Drop all '.' handling, just sanitize / for now.
-
- 21 5月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
Run this: git grep -l 'VIR_ERROR\s*("'|xargs perl -pi -e \ 's/(VIR_ERROR)\s*\((".*?"),/$1(_($2),/'
-
- 18 5月, 2010 1 次提交
-
-
由 Eric Blake 提交于
virFileResolveLink was returning a positive value on error, thus confusing callers that assumed failure was < 0. The confusion is further evidenced by callers that would have ended up calling virReportSystemError with a negative value instead of a valid errno. Fixes Red Hat BZ #591363. * src/util/util.c (virFileResolveLink): Live up to documentation. * src/qemu/qemu_security_dac.c (qemuSecurityDACRestoreSecurityFileLabel): Adjust callers. * src/security/security_selinux.c (SELinuxRestoreSecurityFileLabel): Likewise. * src/storage/storage_backend_disk.c (virStorageBackendDiskDeleteVol): Likewise.
-
- 07 5月, 2010 2 次提交
-
-
由 Eric Blake 提交于
* configure.ac: Drop sys/wait.h check. * src/libvirt.c (includes): Use header unconditionally. * src/remote/remote_driver.c (includes): Likewise. * src/storage/storage_backend.c (includes): Likewise. * src/util/ebtables.c (includes): Likewise. * src/util/hooks.c (includes): Likewise. * src/util/iptables.c (includes): Likewise. * src/util/util.c (includes): Likewise.
-
由 Eric Blake 提交于
Gnulib can guarantee that pthread.h exists, but for now, it is a dummy header with no support for most pthread_* functions. Modify our use of pthread to use function checks, rather than header checks, to determine how much pthread support is present. * bootstrap.conf (gnulib_modules): Add pthread. * configure.ac: Drop all pthread.h checks. Optimize function checks. Add check for pthread functions. * src/Makefile.am (libvirt_lxc_LDADD): Ensure proper link. * src/remote/remote_driver.c (remoteIOEventLoop): Depend on pthread_sigmask, now that gnulib guarantees pthread.h. * src/util/util.c (virFork): Likewise. * src/util/threads.c (threads-pthread.c): Depend on pthread_mutexattr_init, as a witness of full pthread support. * src/util/threads.h (threads-pthread.h): Likewise.
-
- 05 5月, 2010 1 次提交
-
-
由 Eric Blake 提交于
Detected by clang. POSIX requires that the second argument to va_start be the name of the last variable; and in some implementations, passing *path instead of path would dereference bogus memory instead of pulling arguments off the stack. * src/util/util.c (virBuildPathInternal): Use correct argument to va_start.
-
- 04 5月, 2010 2 次提交
-
-
由 Matthias Bolte 提交于
Add an empty body for virCondWaitUntil and move virPipeReadUntilEOF out of the '#ifndef WIN32' block, because it compiles fine with MinGW in combination with gnulib.
-
由 Eric Blake 提交于
Necessary on cygwin, where uid_t and gid_t are 4-byte long rather than int, causing gcc -Wformat warnings. * src/util/util.c (virFileOperationNoFork, virDirCreateNoFork) (virFileOperation, virDirCreate, virGetUserEnt): Cast uid_t and gid_t before passing to printf. * .gitignore: Ignore Windows executables.
-
- 30 4月, 2010 1 次提交
-
-
由 Daniel Veillard 提交于
* src/util/util.c: as it's used for checking things like .iso suffixes
-
- 24 4月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
Cygwin has mntent.h but lacks getmntent_r. Update preprocessor checks to catch this combination.
-
- 22 4月, 2010 1 次提交
-
-
由 Jiri Denemark 提交于
-