- 03 12月, 2010 6 次提交
-
-
由 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.
-
由 Daniel P. Berrange 提交于
-
由 Daniel P. Berrange 提交于
This proof of concept shows how two existing uses of virExec and virRun can be ported to the new virCommand APIs, and how much simpler the code becomes
-
由 Daniel P. Berrange 提交于
This introduces a new set of APIs in src/util/command.h to use for invoking commands. This is intended to replace all current usage of virRun and virExec variants, with a more flexible and less error prone API. * src/util/command.c: New file. * src/util/command.h: New header. * src/Makefile.am (UTIL_SOURCES): Build it. * src/libvirt_private.syms: Export symbols internally. * tests/commandtest.c: New test. * tests/Makefile.am (check_PROGRAMS): Run it. * tests/commandhelper.c: Auxiliary program. * tests/commanddata/test2.log - test15.log: New expected outputs. * cfg.mk (useless_free_options): Add virCommandFree. (msg_gen_function): Add virCommandError. * po/POTFILES.in: New translation. * .x-sc_avoid_write: Add exemption. * tests/.gitignore: Ignore new built file.
-
由 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 12月, 2010 4 次提交
-
-
由 Daniel P. Berrange 提交于
The logging setup requires const char * strings, but the virLogSetFromEnv() strdup's the env variables, thus causing a memory leak * src/util/logging.c: Avoid strdup'ing env variables
-
由 Eric Blake 提交于
* src/qemu/qemu_driver.c (qemudShutdown): Free all strings and the ebtables structure. * src/libvirt_private.syms (ebtablesContextFree): Export missing symbol. * src/util/ebtables.c (ebtablesContextFree): Allow early exit.
-
由 Daniel P. Berrange 提交于
The arguments passed to the thread function must be allocated on the heap, rather than the stack, since it is possible for the spawning thread to continue before the new thread runs at all. In such a case, it is possible that the area of stack where the thread args were stored is overwritten. * src/util/threads-pthread.c, src/util/threads-win32.c: Allocate thread arguments on the heap
-
由 Matthias Bolte 提交于
Use macvtap specific functions depending on WITH_MACVTAP. Use #if instead of #ifdef to check for WITH_MACVTAP, because WITH_MACVTAP is always defined with value 0 or 1. Also export virVMOperationType{To|From}String unconditional, because they are used unconditional in the domain config code.
-
- 01 12月, 2010 1 次提交
-
-
由 Stefan Berger 提交于
This patch introduces the usage of the pre-associate state of the IEEE 802.1Qbg standard on incoming VM migration on the target host. It is in response to bugzilla entry 632750. https://bugzilla.redhat.com/show_bug.cgi?id=632750 For being able to differentiate the exact reason as to why a macvtap device is being created, either due to a VM creation or an incoming VM migration, I needed to pass that reason as a parameter from wherever qemudStartVMDaemon is being called in order to determine whether to send an ASSOCIATE (VM creation) or a PRE-ASSOCIATE (incoming VM migration) towards lldpad. I am also fixing a problem with the virsh domainxml-to-native call on the way. Gerhard successfully tested the patch with a recent blade network 802.1Qbg-compliant switch. The patch should not have any side-effects on the 802.1Qbh support in libvirt, but Roopa (cc'ed) may want to verify this.
-
- 30 11月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
This reverts commit Log all errors at level INFO to stop polluting syslog 04bd0360. and makes virRaiseErrorFull() log errors at debug priority when called from inside libvirtd. This stops libvirtd from polluting it's own log with client errors at error priority that'll be reported and logged on the client side anyway.
-
- 29 11月, 2010 1 次提交
-
-
由 Daniel P. Berrange 提交于
* src/util/virtaudit.c: Free audit string * src/vbox/vbox_XPCOMCGlue.c: Free library name
-
- 25 11月, 2010 1 次提交
-
-
由 Eric Blake 提交于
* cfg.mk (sc_prohibit_close): New syntax-check rule. * src/util/pci.c (pciWaitForDeviceCleanup): Fix violation. * .x-sc_prohibit_close: New exceptions. * Makefile.am (EXTRA_DIST): Distribute new file.
-
- 23 11月, 2010 11 次提交
-
-
由 Daniel P. Berrange 提交于
The stdio.h header has a function called 'remove' declared. This clashes with the 'remove' parameter in virShrinkN * src/util/memory.c: Rename 'remove' to 'toremove'
-
由 Daniel P. Berrange 提交于
* src/util/memory.c: Avoid 32-bit truncation extracting a 64bit int
-
由 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 提交于
Everytime a public API returns an error, libvirtd pollutes syslog with that error message. Reduce the error logging level to INFO so these don't appear by default. * src/util/virterror.c: Log all errors at INFO
-
由 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
-
由 Daniel P. Berrange 提交于
To allow messages from different threads to be untangled, include an integer thread identifier in log messages. * src/util/logging.c: Include thread ID * src/util/threads.h, src/util/threads.h, src/util/threads-pthread.c: Add new virThreadSelfID() function * configure.ac: Check for sys/syscall.h
-
由 Cole Robinson 提交于
If we don't escape ' or \ xend can't parse the generated sexpr. This might over apply the EscapeSexpr routine, but it shouldn't hurt.
-
由 Cole Robinson 提交于
We are about to copy this function, so clean it up before we do.
-
由 Cole Robinson 提交于
An incorrect check broke matching the closing set of quotes. Update tests to cover this case for XM config files.
-
由 Cole Robinson 提交于
-
由 Adam Litke 提交于
This patch makes two corrections to the newly-added QED support patch series: - Correct the QED header field offsets - Remove XML parsing for VIR_STORAGE_FILE_AUTO_SAFE Signed-off-by: NAdam Litke <agl@us.ibm.com>
-
- 20 11月, 2010 4 次提交
-
-
由 Adam Litke 提交于
Implement getBackingStore() for QED images. The header format is defined in the QED spec: http://wiki.qemu.org/Features/QED . Signed-off-by: NAdam Litke <agl@us.ibm.com> Cc: Stefan Hajnoczi <stefan.hajnoczi@uk.ibm.com> Cc: Anthony Liguori <aliguori@linux.vnet.ibm.com>
-
由 Adam Litke 提交于
Signed-off-by: NAdam Litke <agl@us.ibm.com>
-
由 Adam Litke 提交于
Add an entry in fileTypeInfo for QED image files. Signed-off-by: NAdam Litke <agl@us.ibm.com> Cc: Stefan Hajnoczi <stefan.hajnoczi@uk.ibm.com> Cc: Anthony Liguori <aliguori@linux.vnet.ibm.com>
-
由 Adam Litke 提交于
Disk image formats that wish to opt-out of version validation are supposed to set versionOffset to -1 in their fileTypeInfo entry. By unconditionally returning False for these formats, virStorageFileMatchesVersion() incorrectly reports a version mismatch when the test was actually skipped. The correct behavior is to return True so these formats can be successfully probed using the magic bytes alone. Signed-off-by: NAdam Litke <agl@us.ibm.com>
-
- 19 11月, 2010 3 次提交
-
-
由 Daniel P. Berrange 提交于
-
由 Eric Blake 提交于
* src/util/memory.h (VIR_RESIZE_N): New macro. * src/util/memory.c (virResizeN): New function. * src/libvirt_private.syms: Export new helper. * docs/hacking.html.in: Document it. * HACKING: Regenerate.
-
由 Eric Blake 提交于
* src/util/memory.h (VIR_REALLOC_N): Update docs. (VIR_EXPAND_N, VIR_SHRINK_N): New macros. (virAlloc, virAllocN, virReallocN, virAllocVar, virFree): Add some gcc attributes. * src/util/memory.c (virExpandN, virShrinkN): New functions. (virReallocN): Update docs. * src/libvirt_private.syms: Export new helpers. * docs/hacking.html.in: Prefer newer interfaces over VIR_REALLOC_N, since uninitialized memory can bite us. * HACKING: Regenerate.
-
- 17 11月, 2010 2 次提交
-
-
由 Eric Blake 提交于
* bootstrap.conf (gnulib_modules): Add configmake. * daemon/Makefile.am (libvirtd_CFLAGS): Drop defines provided by gnulib. * src/Makefile.am (INCLUDES): Likewise. * tests/Makefile.am (INCLUDES): Likewise. * tools/Makefile.am (virsh_CFLAGS): Likewise. * daemon/libvirtd.c (qemudInitPaths, usage, main): Update clients. * src/cpu/cpu_map.c (CPUMAPFILE): Likewise. * src/driver.c (DEFAULT_DRIVER_DIR): Likewise. * src/internal.h (_): Likewise. * src/libvirt.c (virInitialize): Likewise. * src/lxc/lxc_conf.h (LXC_CONFIG_DIR, LXC_STATE_DIR, LXC_LOG_DIR): Likewise. * src/lxc/lxc_conf.c (lxcCapsInit, lxcLoadDriverConfig): Likewise. * src/network/bridge_driver.c (NETWORK_PID_DIR) (NETWORK_STATE_DIR, DNSMASQ_STATE_DIR, networkStartup): Likewise. * src/nwfilter/nwfilter_driver.c (nwfilterDriverStartup): Likewise. * src/qemu/qemu_conf.c (qemudLoadDriverConfig): Likewise. * src/qemu/qemu_driver.c (qemudStartup): Likewise. * src/remote/remote_driver.h (LIBVIRTD_PRIV_UNIX_SOCKET) (LIBVIRTD_PRIV_UNIX_SOCKET_RO, LIBVIRTD_CONFIGURATION_FILE) (LIBVIRT_PKI_DIR): Likewise. * src/secret/secret_driver.c (secretDriverStartup): Likewise. * src/security/security_apparmor.c (VIRT_AA_HELPER): Likewise. * src/security/virt-aa-helper.c (main): Likewise. * src/storage/storage_backend_disk.c (PARTHELPER): Likewise. * src/storage/storage_driver.c (storageDriverStartup): Likewise. * src/uml/uml_driver.c (TEMPDIR, umlStartup): Likewise. * src/util/hooks.c (LIBVIRT_HOOK_DIR): Likewise. * tools/virsh.c (main): Likewise. * docs/hooks.html.in: Likewise.
-
由 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.
-
- 16 11月, 2010 1 次提交
-
-
由 Stefan Berger 提交于
In a second step I am converting the netlink send/receive functions to use libnl. I tested this with 802.1Qbg profiles and my test server and did not see a regression. Caveat: The online documentation of libnl talks about nl_socket_alloc() but the header file provides nl_handle_alloc() -- this could be a hint to a possible problem between libnl versions... http://www.infradead.org/~tgr/libnl/doc/group__socket.html versus http://libnl.sourcearchive.com/documentation/1.1/group__socket_gf903c9ea089735b1ba8e40dae801c47d.html
-
- 15 11月, 2010 1 次提交
-
-
由 Matthias Bolte 提交于
-
- 12 11月, 2010 3 次提交
-
-
由 Stefan Berger 提交于
In a first step I am converting the netlink message construction in macvtap code to use libnl. It's pretty much a 1:1 conversion except that now the message needs to be allocated and deallocated.
-
由 Daniel P. Berrange 提交于
The util/threads.c/h code already has APIs for mutexes, condition variables and thread locals. This commit adds in code for actually creating threads. * src/libvirt_private.syms: Export new symbols * src/util/threads.h: Define APIs virThreadCreate, virThreadSelf, virThreadIsSelf and virThreadJoin * src/util/threads-win32.c, src/util/threads-win32.h: Win32 impl of threads * src/util/threads-pthread.c, src/util/threads-pthread.h: POSIX impl of threads
-
由 Daniel P. Berrange 提交于
To avoid the need for duplicating implementations of virStream drivers, provide a generic implementation that can handle any FD based stream. This code is copied from the existing impl in the QEMU driver, with the locking moved into the stream impl, and addition of a read callback The FD stream code will refuse to operate on regular files or block devices, since those can't report EAGAIN properly when they would block on I/O * include/libvirt/virterror.h, include/libvirt/virterror.h: Add VIR_FROM_STREAM error domain * src/qemu/qemu_driver.c: Remove code obsoleted by the new generic streams driver. * src/fdstream.h, src/fdstream.c, src/fdstream.c, src/libvirt_private.syms: Generic reusable FD based streams
-
- 10 11月, 2010 1 次提交
-
-
由 Adam Litke 提交于
I am trying to use a qcow image with libvirt where the backing 'file' is a qemu-nbd server. Unfortunately virDomainDiskDefForeachPath() assumes that backingStore is always a real file so something like 'nbd:0:3333' is rejected because a file with that name cannot be accessed. Note that I am not worried about directly using nbd images. That would require a new disk type with XML markup, etc. I only want it to be permitted as a backingStore The following patch implements danpb's suggestion: > I think I'm inclined to push the logic for skipping NBD one stage higher. > I'd rather expect virStorageFileGetMetadata() to return all backing > stores, even if not files. The virDomainDiskDefForeachPath() method > should definitely ignore non-file backing stores though. > > So what I'm thinking is to extend the virStorageFileMetadata struct and > just add a 'bool isFile' field to it. Default this field to true, unless > you see the prefix of nbd: in which case set it to false. The > virDomainDiskDefForeachPath() method can then skip over any backing > store with isFile == false Signed-off-by: NAdam Litke <agl@us.ibm.com> Cc: Daniel P. Berrange <berrange@redhat.com>
-