- 19 2月, 2010 2 次提交
-
-
由 Chris Lalancette 提交于
If the hostname as returned by "gethostname" resolves to "localhost" (as it does with the broken Fedora-12 installer), then live migration will fail because the source will try to migrate to itself. Detect this situation up-front and abort the live migration before we do any real work. * src/util/util.h src/util/util.c: add a new virGetHostnameLocalhost with an optional localhost check, and rewire virGetHostname() to use it * src/libvirt_private.syms: expose the new function * src/qemu/qemu_driver.c: use it in qemudDomainMigratePrepare2()
-
由 Laine Stump 提交于
virFork() contains bookkeeping that must be done any time a process forks. Currently this includes: 1) Call virLogLock() prior to fork() and virLogUnlock() just after, to avoid a deadlock if some other thread happens to hold that lock during the fork. 2) Reset the logging hooks and send all child process log messages to stderr. 3) Block all signals prior to fork(), then either a) reset the signal mask for the parent process, or b) clear the signal mask for the child process. Note that the signal mask handling in __virExec erroneously fails to restore the signal mask when fork() fails. virFork() fixes this problem. Other than this, it attempts to behave as closely to fork() as possible (including preserving errno for the caller), with a couple exceptions: 1) The return value is 0 (success) or -1 (failure), while the pid is returned via the pid_t* argument. Like fork(), if pid < 0 there is no child process, otherwise both the child and the parent will return to the caller, and both should look at the return value, which will indicate if some of the extra processing outlined above encountered an error. 2) If virFork() returns with pid < 0 or with a return value < 0 indicating an error condition, the error has already been reported. You can log an additional message if you like, but it isn't necessary, and may be awkwardly extraneous. Note that virFork()'s child process will *never* call _exit() - if a child process is created, it will return to the caller. * util.c util.h: add virFork() function, based on what is currently done in __virExec().
-
- 10 2月, 2010 1 次提交
-
-
由 Jim Meyering 提交于
* src/util/util.h (virAsprintf): Remove ATTRIBUTE_RETURN_CHECK, since it is perfectly fine to ignore the return value, now that the pointer is guaranteed to be set to NULL upon failure. * src/util/storage_file.c (absolutePathFromBaseFile): Remove now- unnecessary use of ignore_value.
-
- 09 2月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
It was used for error reporting only.
-
- 21 1月, 2010 2 次提交
-
-
由 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.
-
- 22 12月, 2009 1 次提交
-
-
由 Matthias Bolte 提交于
Found while trying to cross-compile libvirt on Fedora 12 for Windows. gnulib redefines 'close' to 'close_used_without_including_unistd_h' in sys/socket.h if winsock2.h is present and unistd.h has not been included before sys/socket.h. Reorder some includes to fix this.
-
- 04 12月, 2009 1 次提交
-
-
由 Matthias Bolte 提交于
esxVMX_IndexToDiskName handles indices up to 701. This limit comes from a mapping gap in virDiskNameToIndex: sdzy -> 700 sdzz -> 701 sdaaa -> 728 sdaab -> 729 This line in virDiskNameToIndex causes this gap: idx = (idx + i) * 26; Fixing it by altering this line to: idx = (idx + (i < 1 ? 0 : 1)) * 26; Also add a new version of virIndexToDiskName that handles the inverse mapping for arbitrary indices. * src/esx/esx_vmx.[ch]: remove esxVMX_IndexToDiskName * src/util/util.[ch]: add virIndexToDiskName and fix mapping gap * tests/esxutilstest.c: update test to verify that the gap is fixed
-
- 13 11月, 2009 1 次提交
-
-
由 David Allan 提交于
* configure.in: add new --with-udev, disabled by default, and requiring libudev > 145 * src/node_device/node_device_udev.c src/node_device/node_device_udev.h: the new node device backend * src/node_device/node_device_linux_sysfs.c: moved node_device_hal_linux.c to a better file name * src/conf/node_device_conf.c src/conf/node_device_conf.h: add a couple of fields in node device definitions, and an API to look them up, remove a couple of unused fields from previous patch. * src/node_device/node_device_driver.c src/node_device/node_device_driver.h: plug the new driver * po/POTFILES.in src/Makefile.am src/libvirt_private.syms: add the new files and symbols * src/util/util.h src/util/util.c: add a new convenience macro virBuildPath and virBuildPathInternal() function
-
- 04 11月, 2009 1 次提交
-
-
由 Cole Robinson 提交于
All drivers have copy + pasted inadequate error reporting which wraps util.c:virGetHostname. Move all error reporting to this function, and improve what we report. Changes from v1: Drop the driver wrappers around virGetHostname. This means we still need to keep the new conn argument to virGetHostname, but I think it's worth it.
-
- 03 11月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
Nearly all of the methods in src/util/util.h have error codes that must be checked by the caller to correct detect & report failure. Add ATTRIBUTE_RETURN_CHECK to ensure compile time validation of this * daemon/libvirtd.c: Add explicit check on return value of virAsprintf * src/conf/domain_conf.c: Add missing check on virParseMacAddr return value status & report error * src/network/bridge_driver.c: Add missing OOM check on virAsprintf and report error * src/qemu/qemu_conf.c: Add missing check on virParseMacAddr return value status & report error * src/security/security_selinux.c: Remove call to virRandomInitialize that's done in libvirt.c already * src/storage/storage_backend_logical.c: Add check & log on virRun return status * src/util/util.c: Add missing checks on virAsprintf/Run status * src/util/util.h: Annotate all methods with ATTRIBUTE_RETURN_CHECK if they return an error status code * src/vbox/vbox_tmpl.c: Add missing check on virParseMacAddr * src/xen/xm_internal.c: Add missing checks on virAsprintf * tests/qemuargv2xmltest.c: Remove bogus call to virRandomInitialize()
-
- 08 10月, 2009 1 次提交
-
-
由 Amy Griffis 提交于
* src/util/util.[ch]: Add virFileAbsPath() function to ensure an absolute path for a potentially realtive path. * src/libvirt_private.syms: add it in libvirt private symbols
-
- 29 9月, 2009 1 次提交
-
-
由 Mark McLoughlin 提交于
Seems standard to include internal.h in order to pull in libvirt.h * src/util/util.h: include internal.h
-
- 23 9月, 2009 1 次提交
-
-
由 Chris Lalancette 提交于
Add the virStrncpy function, which takes a dst string, source string, the number of bytes to copy and the number of bytes available in the dest string. If the source string is too large to fit into the destination string, including the \0 byte, then no data is copied and the function returns NULL. Otherwise, this function copies n bytes from source into dst, including the \0, and returns a pointer to the dst string. This function is intended to replace all unsafe uses of strncpy in the code base, since strncpy does *not* guarantee that the buffer terminates with a \0. Signed-off-by: NChris Lalancette <clalance@redhat.com>
-
- 21 9月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
* src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c, src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h, src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h, src/iptables.c, src/iptables.h, src/logging.c, src/logging.h, src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c, src/qparams.h, src/stats_linux.c, src/stats_linux.h, src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c, src/threads-win32.h, src/threads.c, src/threads.h, src/util.c, src/util.h, src/uuid.c, src/uuid.h, src/virterror.c, src/virterror_internal.h, src/xml.c, src/xml.h: Move all files into src/util/ * daemon/Makefile.am: Add -Isrc/util/ to build flags * src/Makefile.am: Add -Isrc/util/ to build flags and update for moved files * src/libvirt_private.syms: Export cgroup APIs since they're now in util rather than linking directly to drivers * src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call when built under PROXY * proxy/Makefile.am: Update for changed file locations. Remove bogus build of event.c * tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags
-
- 10 9月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
Remove the bogus dependancy between node_device.c & storage_backend.c by moving the virWaitForDevices into util.h where it can be shared safely * src/storage_backend_disk.c, src/storage_backend_logical.c, src/storage_backend_mpath.c, src/storage_backend_scsi.c: Replace virStorageBackendWaitForDevices with virFileWaitForDevices * src/storage_backend.c, src/storage_backend.h: Remove virStorageBackendWaitForDevices, virWaitForDevices * src/util.h, src/util.c: Add virFileWaitForDevices * configure.in: Move xmlrpc check further down after pkgconfig is detected * src/Makefile.am: Add missing XMLRPC_CFLAGS/LIBS to opennebula * src/libvirt_private.syms: Add many missing exports
-
- 03 9月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
Add option to domain XML for <memoryBacking> <hugepages/> </memoryBacking> * configure.in: Add check for mntent.h * qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug, src/qemu.conf Add 'hugetlbfs_mount' config parameter * src/qemu_conf.c, src/qemu_conf.h: Check for -mem-path flag in QEMU, and pass it when hugepages are requested. Load hugetlbfs_mount config parameter, search for mount if not given. * src/qemu_driver.c: Free hugetlbfs_mount/path parameter in driver shutdown. Create directory for QEMU hugepage usage, chowning if required. * docs/formatdomain.html.in: Document memoryBacking/hugepages elements * docs/schemas/domain.rng: Add memoryBacking/hugepages elements to schema * src/util.c, src/util.h, src/libvirt_private.syms: Add virFileFindMountPoint helper API * tests/qemuhelptest.c: Add -mem-path constants * tests/qemuxml2argvtest.c, tests/qemuxml2xmltest.c: Add tests for hugepage handling * tests/qemuxml2argvdata/qemuxml2argv-hugepages.xml, tests/qemuxml2argvdata/qemuxml2argv-hugepages.args: Data files for hugepage tests
-
- 24 7月, 2009 2 次提交
-
-
由 Daniel P. Berrange 提交于
* src/qemu_driver.c: Add driver methods qemuGetSchedulerType, qemuGetSchedulerParameters, qemuSetSchedulerParameters * src/lxc_driver.c: Fix to use unsigned long long consistently for schedular parameters * src/cgroup.h, src/cgroup.c: Fix cpu_shares to take unsigned long long * src/util.c, src/util.h, src/libvirt_private.syms: Add a virStrToDouble helper * src/virsh.c: Fix handling of --set arg to schedinfo command to honour the designated data type of each schedular tunable as declared by the driver
-
由 Daniel P. Berrange 提交于
Allow the driver level cgroup to be managed explicitly by the hypervisor drivers, in order to detect whether to enable or disable cgroup support for domains. Provides better error reporting of failures. Also allow for creation of cgroups for unprivileged drivers if controller is accessible by the user. * src/cgroup.c, src/cgroup.h: Add an API to obtain a driver cgroup * src/lxc_conf.h, src/lxc_controller.c, src/lxc_driver.c: Obtain a driver cgroup at startup and use that instead of re-creating everytime. * src/util.c, src/util.h, src/libvirt_private.syms: Add a virGetUserName() helper
-
- 23 7月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
GCC >= 4.4 assumes the 'printf' attribute refers to the native runtime libraries format specifiers. Thanks to gnulib, libvirt has GNU format specifiers everywhere. This means we need to use 'gnu_printf' with GCC >= 4.4 to get correct compiler checking of printf format specifiers. * HACKING: Document new rules for ATTRIBUTE_FMT_PRINTF * autobuild.sh, mingw32-libvirt.spec.in: Disable OpenNebula driver on mingw32 builds * qemud/dispatch.h, qemud/qemu.h, src/buf.h src/internal.h, src/logging.h, src/security.h, src/sexpr.h, src/util.h, src/virterror_internal.h, src/xend_internal.c: Change over to ATTRIBUTE_FMT_PRINTF. * src/virsh.c: Disable 'cd' and 'pwd' commands on Win32 since they don't compile * src/threads-win32.c: Add missing return value check
-
- 17 7月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
* configure.in: Add --with-qemu-user and --with-qemu-group args * libvirt.spec.in: use 'qemu' for user/group for Fedora >= 12 * qemud/libvirtd_qemu.arg, qemud/test_libvirtd_qemu.aug, src/qemu.conf: Add 'user' and 'group' args for configuration * src/Makefile.am: Create %localstatedir/cache/libvirt/qemu * src/qemu_conf.c, src/qemu_conf.h: Load user/group from config * src/qemu_driver.c: Change user ID/group ID when launching QEMU guests. Change user/group ownership on disks/usb/pci devs. Put memory dumps in %localstatedir/cache/libvirt/qemu * src/util.c, src/util.h: Add convenient APIs for converting username/groupname to user ID / group ID
-
- 30 6月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 11 6月, 2009 1 次提交
-
-
由 Daniel Veillard 提交于
* configure.in src/libvirt_private.syms src/storage_backend_fs.c src/util.c src/util.h: find and use kvm-img, qemu-img or qcow-create dynamically at runtime, patch by Doug Goldstein * AUTHORS: add Doug Goldstein Daniel
-
- 11 5月, 2009 2 次提交
-
-
由 Cole Robinson 提交于
virExec will write out the pid of the daemonized process only. Use this in the QEMU driver, rather than QEMU's pidfile, so we can catch errors we might miss if the emulator bails early.
-
由 Cole Robinson 提交于
Wraps __virExec with the VIR_EXEC_DAEMON flag. Waits on the intermediate process to ensure we don't end up with any zombies, and differentiates between original process errors and intermediate process errors.
-
- 22 4月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 01 4月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 20 3月, 2009 1 次提交
-
-
由 Daniel Veillard 提交于
* src/libvirt_private.syms src/storage_backend_fs.c src/util.c src/util.h: use posix_fallocate() on supported systems to allocate diskspace faster, patches by Amit Shah Daniel
-
- 27 2月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 14 2月, 2009 1 次提交
-
-
由 Mark McLoughlin 提交于
Re-factor the code from networkEnableIpForwarding() into a utility function in preparation for code which writes to sysfs files.
-
- 06 2月, 2009 1 次提交
-
-
由 Jim Meyering 提交于
* src/qemu_driver.c: Use virSetCloseExec and virSetNonBlock, rather than qemuSet* functions. Suggested by Daniel P. Berrange. * src/util.c (virSetCloseExec): Publicize. * src/util.h (virSetCloseExec): Declare * src/libvirt_private.syms: Add virSetCloseExec.
-
- 03 2月, 2009 1 次提交
-
-
由 Jim Meyering 提交于
* Makefile.cfg (local-checks-to-skip): Remove sc_redundant_const. * src/lxc_controller.c: Remove redundant "const"(s). * src/storage_backend_fs.c: Likewise. * src/util.h: Likewise. * src/xen_internal.c: Likewise. * tests/qparamtest.c: Likewise.
-
- 23 1月, 2009 2 次提交
-
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
-
- 21 1月, 2009 1 次提交
-
-
由 Daniel P. Berrange 提交于
-
- 07 1月, 2009 2 次提交
-
-
由 Daniel Veillard 提交于
src/uml_driver.c src/util.c src/util.h src/xen_unified.c: unify hostname lookup using virGetHostname convenience function, patch by David Lutterkort daniel
-
由 Guido Günther 提交于
-
- 18 12月, 2008 3 次提交
-
-
由 Guido Günther 提交于
-
由 Daniel P. Berrange 提交于
-
由 Jim Meyering 提交于
* src/util.c (virAsprintf): Remove trailing space. * src/util.h (virAsprintf): Use ATTRIBUTE_FORMAT. * HACKING (Printf-style functions): New section.
-