- 20 2月, 2010 1 次提交
-
-
由 Laine Stump 提交于
It turns out it is also useful to be able to perform other operations on a file created while running as a different uid (eg, write things to that file), and possibly to do this to a file that already exists. This patch adds an optional hook function to the renamed (for more accuracy of purpose) virFileOperation; the hook will be called after the file has been opened (possibly created) and gid/mode checked/set, before closing it. As with the other operations on the file, if the VIR_FILE_OP_AS_UID flag is set, this hook function will be called in the context of a child process forked from the process that called virFileOperation. The implication here is that, while all data in memory is available to this hook function, any modification to that data will not be seen by the caller - the only indication in memory of what happened in the hook will be the return value (which the hook should set to 0 on success, or one of the standard errno values on failure). Another piece of making the function more flexible was to add an "openflags" argument. This arg should contain exactly the flags to be passed to open(2), eg O_RDWR | O_EXCL, etc. In the process of adding the hook to virFileOperation, I also realized that the bits to fix up file owner/group/mode settings after creation were being done in the parent process, which could fail, so I moved them to the child process where they should be. * src/util/util.[ch]: rename and rework virFileCreate-->virFileOperation, and redo flags in virDirCreate * storage/storage_backend.c, storage/storage_backend_fs.c: update the calls to virFileOperation/virDirCreate to reflect changes in the API, but don't yet take advantage of the hook.
-
- 19 2月, 2010 16 次提交
-
-
由 Dustin Xiong 提交于
ACPI feature bit dropped: I asked internally if the -no-acpi option had any meaning for IA64, and was told 'probably not'.
-
由 Cole Robinson 提交于
-
由 Yuji NISHIDA 提交于
Fix multiple veth problem. NETIF setting was overwritten after first CT because any CT could not be found by name. * src/openvz/openvz_conf.c src/openvz/openvz_conf.h: add the openvzGetVEID lookup function * src/openvz/openvz_driver.c: use it in openvzDomainSetNetwork()
-
由 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()
-
由 Chris Lalancette 提交于
* src/conf/domain_conf.c: make function static * src/conf/domain_conf.h: remove it from header
-
由 Chris Lalancette 提交于
* src/util/pci.c: update 2 message on pciRead errors
-
由 Stefan Berger 提交于
This patch adds the mac_filter support to the macvtap device.
-
由 Jim Meyering 提交于
* tools/virsh.c (cmdCPUBaseline): Add an explicit "return" statement after the "no_memory:" label.
-
由 Jim Meyering 提交于
* src/util/buf.c (virBufferStrcat): Do not skip va_end due to an early return.
-
由 Jim Meyering 提交于
* src/util/qparams.c (new_qparam_set, append_qparams): Do not skip va_end due to an early return.
-
由 Jim Meyering 提交于
* src/xen/xend_internal.c (xenDaemonDomainSetAutostart): Rewrite to avoid dereferencing the result of sexpr_lookup. While in this particular case, it was guaranteed never to be NULL, due to the preceding "if sexpr_node(...)" guard, it's cleaner to skip the sexpr_node call altogether, and also saves a lookup.
-
由 Stefan Berger 提交于
This patch sets or unsets the IFF_VNET_HDR flag depending on what device is used in the VM. The manipulation of the flag is done in the open function and is only fatal if the IFF_VNET_HDR flag could not be cleared although it has to be (or if an ioctl generally fails). In that case the macvtap tap is closed again and the macvtap interface torn. * src/qemu/qemu_conf.c src/qemu/qemu_conf.h: pass qemuCmdFlags to qemudPhysIfaceConnect() * src/util/macvtap.c src/util/macvtap.h: add vnet_hdr boolean to openMacvtapTap(), and private function configMacvtapTap() * src/qemu/qemu_driver.c: add extra qemuCmdFlags when calling qemudPhysIfaceConnect()
-
由 Laine Stump 提交于
For __virExec() this is a semantic NOP except for when fork() fails. __virExec() would previously forget to restore the signal mask in this case; virFork() corrects this behavior. virFileCreate() and virDirCreate() gain the code to reset the logging and properly deal with the signal handling race condition. This also removes a log message that had a typo ("cannot fork o create file '%s'") - this error is now logged in a more generic manner in virFork() (more generic, but really just as informative, since the fact that it's forking to create a file is immaterial to the fact that it simply can't fork) * src/util/util.c: use the generic virFork() in the 3 functions
-
由 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().
-
由 Matthew Booth 提交于
Support virtio-serial controller and virtio channel in QEMU backend. Will output the following for virtio-serial controller: -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x4,max_ports=16,vectors=4 and the following for a virtio channel: -chardev pty,id=channel0 \ -device virtserialport,bus=virtio-serial0.0,chardev=channel0,name=org.linux-kvm.port.0 * src/qemu/qemu_conf.c: Add argument output for virtio * tests/qemuxml2argvtest.c tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.args: Add test for QEMU command line generation
-
由 Matthew Booth 提交于
Add support for virtio-serial by defining a new 'virtio' channel target type and a virtio-serial controller. Allows the following to be specified in a domain: <controller type='virtio-serial' index='0' ports='16' vectors='4'/> <channel type='pty'> <target type='virtio' name='org.linux-kvm.port.0'/> <address type='virtio-serial' controller='0' bus='0'/> </channel> * docs/schemas/domain.rng: Add virtio-serial controller and virtio channel type. * src/conf/domain_conf.[ch]: Domain parsing/serialization for virtio-serial controller and virtio channel. * tests/qemuxml2xmltest.c tests/qemuxml2argvdata/qemuxml2argv-channel-virtio.xml: add domain xml parsing test * src/libvirt_private.syms src/qemu/qemu_conf.c: virDomainDefAddDiskControllers() renamed to virDomainDefAddImplicitControllers()
-
- 18 2月, 2010 12 次提交
-
-
由 Matthew Booth 提交于
Remove virDomainDevicePCIAddressEqual and virDomainDeviceDriveAddressEqual, which are defined but not used anywhere. * src/conf/domain_conf.[ch] src/libvirt_private.syms: Remove virDomainDevicePCIAddressEqual and virDomainDeviceDriveAddressEqual.
-
由 Matthew Booth 提交于
* src/qemu/qemu_driver.c: qemudStartVMDaemon() fix typo in comment
-
由 Jim Meyering 提交于
* src/node_device/node_device_linux_sysfs.c(get_virtual_functions_linux): Return "ret", rather than always returning 0.
-
由 Cole Robinson 提交于
Currently we just error with ex. 'virbr0: No such device'. Since we are using public API calls here, we need to ensure that any raised error is properly saved and restored, since API entry points always reset messages.
-
由 Cole Robinson 提交于
We were accessing the wrong private data structure, which would cause a segfault.
-
由 Cole Robinson 提交于
virGetLastError returns NULL if no error has been set, not on allocation error like virSetError assumed. Use virLastErrorObject instead. This fixes virSetError when no error is currently stored.
-
由 Cole Robinson 提交于
The commands updated are SetMem, SetMaxMem, SetVcpus, and PinVcpu.
-
由 Stefan Berger 提交于
Rework and simplification of teardown of the macvtap device. Basically all devices with the same MAC address and link device are kept alive and not attempted to be torn down. If a macvtap device linked to a physical interface with a certain MAC address 'M' is to be created it will automatically fail if the interface is 'up'ed and another macvtap with the same properties (MAC addr 'M', link dev) happens to be 'up'. This will prevent the VM from starting or the device from being attached to a running VM. Stale interfaces are assumed to be there for some reason and not stem from libvirt. In the VM shutdown path, it's assuming that an interface name is always available so that if the device type is DIRECT it can be torn down using its name. * src/util/macvtap.h src/libvirt_macvtap.syms: change of deleting routine * src/util/macvtap.c: cleanups and change of deleting routine * src/qemu/qemu_driver.c: change cleanup on shutdown * src/qemu/qemu_conf.c: don't delete Macvtap in qemudPhysIfaceConnect()
-
由 Matthew Booth 提交于
* src/schemas/domain.rng: Replace tabs with 8 spaces
-
由 Daniel P. Berrange 提交于
The QEMU JSON monitor changed balloon commands to return/accept bytes instead of kilobytes. Update libvirt to cope with this * src/qemu/qemu_monitor_json.c: Expect/use bytes for ballooning
-
由 Jim Meyering 提交于
* src/openvz/openvz_conf.c (openvzLoadDomains): Diagnose failure of virUUIDFormat.
-
由 Cole Robinson 提交于
The recent commit to implement a python version of this function didn't drop an explicit 'ignore' check in the generator, so this never ended up in the bindings.
-
- 17 2月, 2010 11 次提交
-
-
由 Eric Blake 提交于
Silence a libtoolize warning. * configure.ac (AC_CONFIG_MACRO_DIR): Add.
-
由 Jiri Denemark 提交于
* tools/virsh.c: add a command to compute a CPU baseline based on multiple CPU definitions in an XML chunk * tools/virsh.pod: add it to the man page
-
由 Jim Meyering 提交于
There is no real leak here, but Coverity-Prevent thinks there is. It does not see that while there are four ways to return from vshCommandGetToken with VSH_TK_END, none of them results in allocation of a result. * tools/virsh.c (vshCommandParse): Add a (currently) useless VIR_FREE, to ensure that we never leak when vshCommandGetToken returns VSH_TK_END.
-
由 Jim Meyering 提交于
* src/qemu/qemu_monitor_text.c (qemuMonitorTextAddUSBDisk): Free command output buffer.
-
由 Jim Meyering 提交于
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Handle malloc failure.
-
由 Jim Meyering 提交于
* src/qemu/qemu_driver.c (qemuInitPasswords): Free pass-phrase buffer.
-
由 Jim Meyering 提交于
* src/qemu/qemu_monitor_text.c (qemuMonitorTextAddDevice): Free the device name buffer.
-
由 Jim Meyering 提交于
* python/libvirt-override.c (libvirt_virConnectBaselineCPU): Don't leak the xmlcpus buffer upon encountering a non-string list element.
-
由 Jim Meyering 提交于
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML): Free vboxCallback buffer upon OOM.
-
由 Jim Meyering 提交于
* src/conf/node_device_conf.c (virNodeDevCapScsiHostParseXML): Free the "nodes" buffer allocated by virXPathNodeSet.
-
由 Jim Meyering 提交于
* src/uml/uml_driver.c (umlMonitorCommand): This function would sometimes return -1, yet fail to free the "reply" it had allocated. Hence, no caller would know to free the corresponding argument. When returning -1, be sure to free all allocated resources.
-