- 23 6月, 2011 2 次提交
-
-
由 Stefan Berger 提交于
In a first cleanup step, make nlComm from macvtap.c commonly available for other code to use. Since nlComm uses Linux-specific structures as parameters it's prototype is only visible on Linux.
-
由 Daniel P. Berrange 提交于
Files under src/util must not depend on src/conf Solve the macvtap problem by moving the definition of macvtap modes from domain_conf.h into macvtap.h * src/util/macvtap.c, src/util/macvtap.h: Add enum for macvtap modes * src/conf/domain_conf.c, src/conf/domain_conf.h: Remove enum for macvtap modes
-
- 22 6月, 2011 1 次提交
-
-
由 Osier Yang 提交于
virCommandProcessIO: It's reading from stdout or stderr of child, but not writing.
-
- 21 6月, 2011 3 次提交
-
-
由 Dirk Herrendoerfer 提交于
The following patch addresses the problem that when a PASSTHROUGH mode DIRECT NIC connection is made the MAC address of the NIC is not automatically set and reset to the configured VM MAC and back again. The attached patch fixes this problem by setting and resetting the MAC while remembering the previous setting while the VM is running. This also works if libvirtd is restarted while the VM is running. the patch passes make syntax-check
-
由 Cole Robinson 提交于
-
由 Cole Robinson 提交于
Since we virEventRegisterDefaultImpl is now a public API, callers need a way to invoke the default registered Handle and Timeout functions. We already have general functions for these internally, so promote them to the public API. v2: Actually add APIs to libvirt.h
-
- 17 6月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
Most of the safezero() implementations return -1 on error, setting errno. The safezero() impl using posix_fallocate() though returned a positive errno value on error (due to the unusual API contract of posix_fallocate() compared to most syscall APIs). * src/util/util.c: Ensure safezero() returns -1 and sets errno on error. * src/storage/storage_backend.c: Change safezero != 0 to < 0 for detecting errors
-
- 14 6月, 2011 4 次提交
-
-
由 Eric Blake 提交于
Previously, the parent process opened 'null' to /dev/null, then the child process closes 'null' as well as 'childout'. But if childout was set to be null, then this is a double close. At least the double close was confined to the child process after a fork, and therefore there is no risk of another thread opening an fd of the same value to be bitten by the double close, but it is always better to avoid double-close to begin with. Additionally, if all three fds were specified, then opening 'null' was wasted. This patch fixes things to lazily open null on the first use, then guarantees it gets closed exactly once. * src/util/command.c (getDevNull): New helper function. (virExecWithHook): Use it to avoid spurious opens and double close.
-
由 Eric Blake 提交于
This also reduces malloc pressure for invoking a child when VIR_DEBUG is enabled. * src/util/command.c (virExecWithHook): Drop debug, since the only caller (virCommandRunAsync) also prints debug info.
-
由 Osier Yang 提交于
Push under trivial rule.
-
由 Stefan Berger 提交于
The below patch decreases the response time of libvirt to errors reported by Qemu upon startup by checking whether the qemu process is still alive while polling for the local socket to show up. This patch also introduces a special handling of signal for the Win32 part of virKillProcess.
-
- 13 6月, 2011 2 次提交
-
-
由 Jiri Denemark 提交于
-
由 Jiri Denemark 提交于
-
- 08 6月, 2011 4 次提交
-
-
由 Eric Blake 提交于
Coverity already saw through a NULL dereference without these annotations, and gcc is still too puny to do good NULL analysis. But clang still benefits (and is easier to run than coverity), not to mention that adding this bit of documentation to the code may help future developers remember the constraints. * src/util/uuid.h (virGetHostUUID, virUUIDFormat): Document restrictions, for improved static analysis.
-
由 Eric Blake 提交于
Similar in nature to commit fd21ecfd, which shut up valgrind. sigaction is apparently a nasty interface for analyzer tools, at least for how many false positives it generates. * src/util/command.c (virExecWithHook): Initialize entire var, since coverity gripes about the (unused and non-standard) sa_restorer.
-
由 Eric Blake 提交于
Detected by Coverity. The code was doing math on shifted unsigned char (which promotes to int), then promoting that to unsigned long during assignment to size. On 64-bit platforms, this risks sign extending values of size > 2GiB. Bug present since commit 489fd3 (v0.6.0). I'm not sure if a specially-crafted bogus qcow2 image could exploit this, although it's probably not possible, since we were already checking for the computed results being within range of our fixed-size buffer. * src/util/storage_file.c (qcowXGetBackingStore): Avoid sign extension.
-
由 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 2 次提交
-
-
由 Cole Robinson 提交于
v2: Simplify command building Handle command building failure v3: Remove unneeded NULL check Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
由 Cole Robinson 提交于
v3: Remove obsolete comment Signed-off-by: NCole Robinson <crobinso@redhat.com>
-
- 03 6月, 2011 3 次提交
-
-
由 Eric Blake 提交于
Coverity complained that infd could be -1 at the point where it is passed to write, when in reality, this code can only be reached if infd is non-negative. * src/util/command.c (virCommandProcessIO): Help out coverity.
-
由 Eric Blake 提交于
Spotted by coverity. Triggers on failed stat, although I'm not sure how easy that condition is, so I'm not sure if this is a runtime memory hog. Regression introduced in commit 8077d64f (unreleased). * src/util/storage_file.c (virStorageFileGetMetadataFromFD): Reduce need for malloc, avoiding a leak.
-
由 Eric Blake 提交于
Detected by Coverity. While it is possible on OOM condition, as well as with bad code that passes binary == NULL, it is unlikely to be encountered in the wild. * src/util/command.c (virCommandNewArgList): Don't leak memory.
-
- 02 6月, 2011 2 次提交
-
-
由 Daniel P. Berrange 提交于
Define the basic framework lock manager plugins. The basic plugin API for 3rd parties to implemented is defined in src/locking/lock_driver.h This allows dlopen()able modules for alternative locking schemes, however, we do not install the header. This requires lock plugins to be in-tree allowing changing of the lock manager plugin API in future. The libvirt code for loading & calling into plugins is in src/locking/lock_manager.{c,h} * include/libvirt/virterror.h, src/util/virterror.c: Add VIR_FROM_LOCKING * src/locking/lock_driver.h: API for lock driver plugins to implement * src/locking/lock_manager.c, src/locking/lock_manager.h: Internal API for managing locking * src/Makefile.am: Add locking code
-
由 Daniel P. Berrange 提交于
Allow the parent process to perform a bi-directional handshake with the child process during fork/exec. The child process will fork and do its initial setup. Immediately prior to the exec(), it will stop & wait for a handshake from the parent process. The parent process will spawn the child and wait until the child reaches the handshake point. It will do whatever extra setup work is required, before signalling the child to continue. The implementation of this is done using two pairs of blocking pipes. The first pair is used to block the parent, until the child writes a single byte. Then the second pair pair is used to block the child, until the parent confirms with another single byte. * src/util/command.c, src/util/command.h, src/libvirt_private.syms: Add APIs to perform a handshake
-
- 01 6月, 2011 2 次提交
-
-
由 Osier Yang 提交于
Substitute VIR_ERR_NO_SUPPORT with VIR_ERR_INTERNAL_ERROR. Error like following is not what user want to see. error : pciDeviceIsAssignable:1487 : this function is not supported by the connection driver: Device 0000:07:10.0 is behind a switch lacking ACS and cannot be assigned
-
由 Cole Robinson 提交于
Since directories can be used for <filesystem> passthrough, they are basically storage volumes. v2: Skip ., .., lost+found dirs v3: Use gnulib last_component v4: Use gnulib "dirname.h", not system <dirname.h> Don't skip lost+found
-
- 31 5月, 2011 2 次提交
-
-
由 Daniel P. Berrange 提交于
The virSysinfoIsEqual method was mistakenly inside a #ifndef WIN32 conditional. The existing virSysinfoFormat is also stubbed out on Win32, even though the code works without any trouble. This breaks XML output on Win32, so the stub is removed. virsh migrate mistakenly had some variables inside the conditional * src/util/sysinfo.c: Build virSysinfoIsEqual on Win32 and remove Win32 stub for virSysinfoFormat * tools/virsh.c: Fix variable declaration on Win32
-
由 Daniel P. Berrange 提交于
To allow a client app to pass in custom XML during migration of a guest it is neccessary to ensure the guest ABI remains unchanged. The virDomainDefCheckABIStablity method accepts two virDomainDefPtr structs and compares everything in them that could impact the guest machine ABI * src/conf/domain_conf.c, src/conf/domain_conf.h, src/libvirt_private.syms: Add virDomainDefCheckABIStablity * src/conf/cpu_conf.c, src/conf/cpu_conf.h: Add virCPUDefIsEqual * src/util/sysinfo.c, src/util/sysinfo.h: Add virSysinfoIsEqual
-
- 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):
-
- 27 5月, 2011 2 次提交
-
-
由 Matthias Bolte 提交于
-
由 Eric Blake 提交于
Coverity spotted this off-by-one. Thankfully, no one in libvirt was ever calling virAuditSend with an argument of 3. * src/util/virtaudit.c (virAuditSend): Use correct comparison.
-
- 25 5月, 2011 1 次提交
-
-
由 Eric Blake 提交于
We don't use the gnulib vsnprintf replacement, which means that on mingw, vsnprintf doesn't support %zn or %lln. And as it turns out, VIR_GET_VAR_STR was a rather inefficient reimplementation of virVasprintf logic. * src/util/logging.c (VIR_GET_VAR_STR): Drop. (virLogMessage): Inline a simpler version here. * src/util/virterror.c (VIR_GET_VAR_STR, virRaiseErrorFull): Likewise. Reported by Matthias Bolte.
-
- 24 5月, 2011 2 次提交
-
-
由 Jiri Denemark 提交于
Two additional places need initgroups call to properly work in an environment where the UID is allowed to open/create stuff through its supplementary groups.
-
由 Jiri Denemark 提交于
-
- 18 5月, 2011 2 次提交
-
-
由 Cole Robinson 提交于
This error code has existed since the dawn of time, yet the messages it generates are almost universally busted. Here's a small sampling: src/conf/domain_conf.c:4889 : XML description for missing root element is not well formed or invalid src/conf/domain_conf.c:4951 : XML description for unknown device type is not well formed or invalid src/conf/domain_conf.c:5460 : XML description for maximum vcpus must be an integer is not well formed or invalid src/conf/domain_conf.c:5468 : XML description for invalid maxvcpus %(count)lu is not well formed or invalid Fix up the error code to instead be XML error: <msg> Adjust the few locations that were using the original correctly (or shouldn't have been using the error code at all). v2: Fix wording of error code without a passed argument
-
由 Dirk Herrendorefer 提交于
starting with kernel 2.6.38 macvtap supports a 'passthru' mode for attaching virtual functions of a SRIOV capable network card directly to a VM. This patch adds the capability to configure such a device. Signed-off-by: NDirk Herrendoerfer <d.herrendoerfer@herrendoerfer.name>
-
- 17 5月, 2011 3 次提交
-
-
由 Daniel P. Berrange 提交于
* src/util/util.c: Fix virRun prototype
-
由 Eric Blake 提交于
POSIX allows sysconf(_SC_GETPW_R_SIZE_MAX) to return -1 if there is no fixed limit, and requires ERANGE errors to track real size. Model our behavior after the example in POSIX itself: http://pubs.opengroup.org/onlinepubs/9699919799/functions/getpwuid_r.html Also, on error for get*_r functions, errno is undefined, and the real error was the return value. * src/util/util.c (virGetUserEnt, virGetUserID, virGetGroupID) (virSetUIDGID): Cope with sysconf failure or too small buffer. Reported by Matthias Bolte.
-
由 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
-
- 16 5月, 2011 1 次提交
-
-
由 Daniel P. Berrange 提交于
Mingw execve() has a broken signature. Disable this function until gnulib fixes the signature, since we don't really need this on Win32 anyway. * src/util/command.c: Disable virCommandExec on Win32
-