- 16 9月, 2011 1 次提交
-
-
由 Peter Krempa 提交于
/usr/lib/stdlib.h in Mac OS X and probably also in BSD's exports this symbol :(
-
- 30 8月, 2011 1 次提交
-
-
由 Eric Blake 提交于
Back in 2008 when this line of util.h was written, gnulib's verify module didn't allow the use of multiple verify() in one file in combination with our choice of gcc -W options. But that has since been fixed in gnulib, and newer gnulib even maps verify() to the C1x feature of _Static_assert, which gives even nicer diagnostics with a new enough compiler, so we might as well go with the simpler verify(). * src/util/util.h (VIR_ENUM_IMPL): Use simpler verify, now that gnulib module is smarter.
-
- 17 8月, 2011 1 次提交
-
-
由 Stefan Berger 提交于
Get rid of the #if __linux__ check in virPidFileReadPathIfAlive that was preventing a check of a symbolic link in /proc/<pid>/exe on non-linux platforms against an expected executable. Replace this with a run-time check testing whether the /proc/<pid>/exe is a symbolic link and if so call the function doing the comparison against the expected file the link is supposed to point to.
-
- 13 8月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
The functions for manipulating pidfiles are in util/util.{c,h}. We will shortly be adding some further pidfile related functions. To avoid further growing util.c, this moves the pidfile related functions into a dedicated virpidfile.{c,h}. The functions are also all renamed to have 'virPidFile' as their name prefix * util/util.h, util/util.c: Remove all pidfile code * util/virpidfile.c, util/virpidfile.h: Add new APIs for pidfile handling. * lxc/lxc_controller.c, lxc/lxc_driver.c, network/bridge_driver.c, qemu/qemu_process.c: Add virpidfile.h include and adapt for API renames
-
- 22 7月, 2011 1 次提交
-
-
由 Laine Stump 提交于
If util.h is going to have a MIN, it may as well also have MAX.
-
- 12 7月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
Avoid re-formatting the pidfile path everytime we need it. Create it once when starting the guest, and preserve it until the guest is shutdown. * src/libvirt_private.syms, src/util/util.c, src/util/util.h: Add virFileReadPidPath * src/qemu/qemu_domain.h: Add pidfile field * src/qemu/qemu_process.c: Store pidfile path in qemuDomainObjPrivate
-
- 08 7月, 2011 1 次提交
-
-
由 Eric Blake 提交于
No caller was using the flags argument, and this function is internal only, so we might as well skip it. * src/util/util.h (safezero): Update signature. * src/util/util.c (safezero): Update function. * src/locking/lock_driver_sanlock.c (virLockManagerSanlockSetupLockspace) (virLockManagerSanlockCreateLease): Update all callers. * src/storage/storage_backend.c (createRawFile): Likewise.
-
- 07 7月, 2011 2 次提交
-
-
由 Eric Blake 提交于
The next patch wants to adjust an end pointer to trim trailing spaces but without modifying the underlying string, but a more generally useful ability to trim trailing spaces in place is also worth providing. * src/util/util.h (virTrimSpaces, virSkipSpacesBackwards): New prototypes. * src/util/util.c (virTrimSpaces, virSkipSpacesBackwards): New functions. * src/libvirt_private.syms (util.h): Export new functions. Inspired by a patch by Minoru Usui.
-
由 Eric Blake 提交于
Most clients of virSkipSpaces don't want to omit backslashes. Also, open-coding the list of spaces is not as nice as using c_isspace. * src/util/util.c (virSkipSpaces): Use c_isspace. (virSkipSpacesAndBackslash): New function. * src/util/util.h (virSkipSpacesAndBackslash): New prototype. * src/xen/xend_internal.c (sexpr_to_xend_topology): Update caller. * src/libvirt_private.syms (util.h): Export new function.
-
- 02 7月, 2011 1 次提交
-
-
由 Eric Blake 提交于
To avoid regressions, we let callers specify whether to require a minor and micro version. Callers that were parsing uname() output benefit from defaulting to 0, whereas callers that were parsing version strings from other sources should not change in behavior. * src/util/util.c (virParseVersionString): Allow caller to choose whether to fail if minor or micro is missing. * src/util/util.h (virParseVersionString): Update signature. * src/esx/esx_driver.c (esxGetVersion): Update callers. * src/lxc/lxc_driver.c (lxcVersion): Likewise. * src/openvz/openvz_conf.c (openvzExtractVersionInfo): Likewise. * src/uml/uml_driver.c (umlGetVersion): Likewise. * src/vbox/vbox_MSCOMGlue.c (vboxLookupVersionInRegistry): Likewise. * src/vbox/vbox_tmpl.c (vboxExtractVersion): Likewise. * src/vmware/vmware_conf.c (vmwareExtractVersion): Likewise. * src/xenapi/xenapi_driver.c (xenapiGetVersion): Likewise. Reported by Matthias Bolte.
-
- 13 6月, 2011 1 次提交
-
-
由 Jiri Denemark 提交于
-
- 08 6月, 2011 1 次提交
-
-
由 Cole Robinson 提交于
Seems reasonable to have all command wrappers in the same place v2: Dont move SetInherit v3: Comment spelling fix Adjust WARN0 comment Remove spurious #include movement Don't include sys/types.h Combine virExec enums Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 07 6月, 2011 1 次提交
-
-
由 Cole Robinson 提交于
v3: Remove obsolete comment Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 29 5月, 2011 1 次提交
-
-
由 Richard Laager 提交于
This was necessary to get libvirt to build on Solaris 11 Express and seems correct (as it makes this match the definition in util.c):
-
- 17 5月, 2011 1 次提交
-
-
由 Cole Robinson 提交于
virRunWithHook is now unused, so we can drop it. Tested w/ raw + qcow2 volume creation and copying. v2: Use opaque data to skip hook second time around Simply command building v3: Drop explicit FindFileInPath
-
- 14 5月, 2011 1 次提交
-
-
由 Cole Robinson 提交于
And drop the now unused virExecDaemonize
-
- 06 5月, 2011 1 次提交
-
-
由 Michal Privoznik 提交于
Users often edit XML file stored in configuration directory thinking of modifying a domain/network/pool/etc. Thus it is wise to let them know they are using the wrong way and give them hint.
-
- 05 4月, 2011 1 次提交
-
-
由 Matthias Bolte 提交于
Make virFileBuildPath operate on the heap instead of the stack. It allocates a buffer instead of expecting a preexisting buffer.
-
- 29 3月, 2011 3 次提交
-
-
由 Eric Blake 提交于
This patch intentionally doesn't change indentation, in order to make it easier to review the real changes. * src/util/util.h (VIR_FILE_OP_RETURN_FD, virFileOperationHook): Delete. (virFileOperation): Rename... (virFileOpenAs): ...and reduce parameters. * src/util/util.c (virFileOperationNoFork, virFileOperation): Rename and simplify. * src/qemu/qemu_driver.c (qemudDomainSaveFlag): Adjust caller. * src/storage/storage_backend.c (virStorageBackendCreateRaw): Likewise. * src/libvirt_private.syms: Reflect rename.
-
由 Eric Blake 提交于
Currently, the hook function in virFileOperation is extremely limited: it must be async-signal-safe, and cannot modify any memory in the parent process. It is much handier to return a valid fd and operate on it in the parent than to deal with hook restrictions. * src/util/util.h (VIR_FILE_OP_RETURN_FD): New flag. * src/util/util.c (virFileOperationNoFork, virFileOperation): Honor new flag.
-
由 Eric Blake 提交于
* src/util/util.h (virSetInherit): New prototype. * src/util/util.c (virSetCloseExec): Move guts... (virSetInherit): ...to new function, and allow clearing. * src/libvirt_private.syms (util.h): Export it.
-
- 15 3月, 2011 2 次提交
-
-
由 Daniel P. Berrange 提交于
* configure.ac: Check for geteuid() * src/util/util.h: Compat for geteuid()
-
由 Daniel P. Berrange 提交于
The virSetNonBlock() API only allows enabling non-blocking operations. It doesn't allow turning blocking back on. Add a new API to allow arbitrary toggling. * src/libvirt_private.syms, src/util/util.h src/util/util.c: Add virSetBlocking
-
- 24 2月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
Remove the <stdbool.h> header from all source files / headers and just put it into internal.h * src/internal.h: Add <stdbool.h>
-
- 17 2月, 2011 1 次提交
-
-
由 Osier Yang 提交于
The name convention of device mapper disk is different, and 'parted' can't be used to delete a device mapper disk partition. e.g. Name Path ----------------------------------------- 3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1 Error: Expecting a partition number. This patch introduces 'dmsetup' to fix it. Changes: - New function "virIsDevMapperDevice" in "src/utils/utils.c" - remove "is_dm_device" in "src/storage/parthelper.c", use "virIsDevMapperDevice" instead. - Requires "device-mapper" for 'with-storage-disk" in "libvirt.spec.in" - Check "dmsetup" in 'configure.ac' for "with-storage-disk" - Changes on "src/Makefile.am" to link against libdevmapper - New entry for "virIsDevMapperDevice" in "src/libvirt_private.syms" Changes from v1 to v3: - s/virIsDeviceMapperDevice/virIsDevMapperDevice/g - replace "virRun" with "virCommand" - sort the list of util functions in "libvirt_private.syms" - ATTRIBUTE_NONNULL(1) for virIsDevMapperDevice declaration. e.g. Name Path ----------------------------------------- 3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1 Vol /dev/mapper/3600a0b80005ad1d7000093604cae912fp1 deleted Name Path -----------------------------------------
-
- 14 1月, 2011 1 次提交
-
-
由 Eric Blake 提交于
It was awkward having only int conversion in the virStrToLong family, but only long conversion in the virXPath family. Make both families support both types. * src/util/util.h (virStrToLong_l, virStrToLong_ul): New prototypes. * src/util/xml.h (virXPathInt, virXPathUInt): Likewise. * src/util/util.c (virStrToLong_l, virStrToLong_ul): New functions. * src/util/xml.c (virXPathInt, virXPathUInt): Likewise. * src/libvirt_private.syms (util.h, xml.h): Export them.
-
- 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.
-
- 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.
-
- 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.
-
- 02 11月, 2010 1 次提交
-
-
由 Osier Yang 提交于
* src/util/util.h * src/util/util.c * src/libvirt_private.syms
-
- 31 8月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
virHexToBin will be used in the .vmx handling code.
-
- 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.
-
- 22 4月, 2010 1 次提交
-
-
由 Jiri Denemark 提交于
-
- 16 4月, 2010 1 次提交
-
-
由 Eric Blake 提交于
Based on a warning from coverity. The safe* functions guarantee complete transactions on success, but don't guarantee freedom from failure. * src/util/util.h (saferead, safewrite, safezero): Add ATTRIBUTE_RETURN_CHECK. * src/remote/remote_driver.c (remoteIO, remoteIOEventLoop): Ignore some failures. (remoteIOReadBuffer): Adjust error messages on read failure. * daemon/event.c (virEventHandleWakeup): Ignore read failure.
-
- 01 4月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
virParseVersionString uses virStrToLong_ui instead of sscanf. This also fixes a bug in the UML driver, that always returned 0 as version number. Introduce STRSKIP to check if a string has a certain prefix and to skip this prefix.
-
- 30 3月, 2010 1 次提交
-
-
由 Daniel Veillard 提交于
used to read the data from virExec stdout/err file descriptors * src/util/util.c src/util/util.h: not static anymore and export it * src/libvirt_private.syms: allow access internally
-
- 23 3月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
Add dummy bodies for HAVE_GETPWUID_R and HAVE_MNTENT_H dependent functions for MinGW builds.
-