summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* virsh: Enhance list command to ease creation of shell scriptsPeter Krempa2012-02-222-54/+156
| | | | | | | | | | | | | This patch adds new options to the "virsh list" command enabling filtering of persistent and transient domains along with the option to print only UUIDs or names of domains instead of printing the table. Option --name prints domain names (one per line) instead of the default table. Similarly --uuid prints domain's UUID. The option --table is an alias for the default behavior. Aditionally --persistent and/or --transient may be specified to filter the output of domains.
* vmware: implement domainXMLFromNativeJean-Baptiste Rouault2012-02-221-0/+31
|
* lib: Fix function documentation for virConnectListDomainsPeter Krempa2012-02-221-2/+2
| | | | Clarify the documentation of virConnectListDomains.
* esx: Correctly disable HTTP Expect header usage of libcurlMatthias Bolte2012-02-211-2/+2
| | | | | | | | Adding "Expect:" to the header list stops libcurl from sending a Expect header at all. Before, a dummy Expect header was added that might confuse HTTP proxies and result in HTTP error code 417 being reported.
* virsh: Fix docs for list commandPeter Krempa2012-02-211-1/+1
| | | | | | | Commit fad5cd210899dfde4afe36712754dc921c3f3051 introduced option to display domain's title in the list command output. There was a mistake in the virsh man page example for this command stating --note instead of --title.
* caps: Improve error if passed an unknown archCole Robinson2012-02-203-9/+41
| | | | | | | | | | | | | | Previously we would have: "os type 'hvm' & arch 'idontexist' combination is not supported" Now we get "No guest options available for arch 'idontexist'" or if options available but guest OS type not applicable: "No os type 'xen' available for arch 'x86_64'"
* spec: use ix86 macrosPeter Robinson2012-02-202-4/+5
| | | | * libvirt.spec.in: Use %{ix86} rather than open-coded list.
* Fix compilation on MacOS XLincoln Myers2012-02-202-2/+3
| | | | | | | * src/util/virfile.h: the virFileWrapperFdFlags being defined as a globa variable instead of a type ended up generating a duplicate symbol error. * AUTHORS: added Lincoln Myers
* nwfilter: improved logging during driver initializationStefan Berger2012-02-161-12/+26
| | | | | | Improve the logging during driver initialization when testing the command line tools.
* qemu: Prevent crash of libvirtd without guest agentAlex Jia2012-02-161-1/+1
| | | | | | | | | | | | | | | | | | * src/qemu/qemu_process.c (qemuFindAgentConfig): avoid crash libvirtd due to deref a NULL pointer. * How to reproduce? 1. virsh edit the following xml into guest configuration: <channel type='pty'> <target type='virtio'/> </channel> 2. virsh start <domain> or % virt-install -n foo -r 1024 --disk path=/var/lib/libvirt/images/foo.img,size=1 \ --channel pty,target_type=virtio -l <installation tree> Signed-off-by: Alex Jia <ajia@redhat.com>
* qemu: Unlock monitor when connecting to dest qemu failsJiri Denemark2012-02-161-1/+3
| | | | | | | | | When migrating a qemu domain, we enter the monitor, send some commands, try to connect to destination qemu, send other commands, end exit the monitor. However, if we couldn't connect to destination qemu we forgot to exit the monitor. Bug introduced by commit d9d518b1c8ef3b65658cc91f85ba33a63c0959a4.
* qemu: Fix segfault when host CPU is emptyJiri Denemark2012-02-161-12/+12
| | | | | | | | In case libvirtd cannot detect host CPU model (which may happen if it runs inside a virtual machine), the daemon is likely to segfault when starting a new qemu domain. It segfaults when domain XML asks for host (either model or passthrough) CPU or does not ask for any specific CPU model at all.
* storage: Allow runtime detection of scrubMichal Privoznik2012-02-163-30/+7
| | | | | | | Currently, if scrub (used for wiping algorithms) is not present at compile time, we don't support any other wiping algorithms than zeroing, even if it was installed later. Switch to runtime detection instead.
* Fix polkit0 authenticationJim Fehlig2012-02-151-11/+9
| | | | | | | | Commit 7033c5f2 introduced some bugs in polkit0 authentication. Fix libvirtd segfault in remoteDispatchAuthPolkit(). Fix polkit authentication bypass when caller UID = 0.
* Fix build with polkit0Jim Fehlig2012-02-151-1/+0
| | | | | | | | Commit 8dd623b9 introduced a build error with --enable-compile-warnings=error remote.c:2593: error: unused variable 'rv' [-Wunused-variable] Pushing under build-breaker rule.
* python: Expose virDomain{G,S}etInterfaceParameters APIs in python bindingAlex Jia2012-02-162-0/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The v4 patch corrects indentation issues. The v3 patch follows latest python binding codes and change 'size' type from int to Py_ssize_t. An simple example to show how to use it: #!/usr/bin/env python import libvirt conn = libvirt.open(None) dom = conn.lookupByName('foo') print dom.interfaceParameters('vnet0', 0) params = {'outbound.peak': 10, 'inbound.peak': 10, 'inbound.burst': 20, 'inbound.average': 20, 'outbound.average': 30, 'outbound.burst': 30} print dom.setInterfaceParameters('vnet0', params, 0) print dom.interfaceParameters('vnet0', 0) Signed-off-by: Alex Jia <ajia@redhat.com>
* snapshot: fix snapshot deletion use-after-freeEric Blake2012-02-151-2/+3
| | | | | | | | | | | | | | Bug introduced in commit 35abced. On an inactive domain, $ virsh snapshot-create-as dom snap $ virsh snapshot-create dom $ virsh snapshot-create dom $ virsh snapshot-delete --children dom snap could crash libvirtd, due to a use-after-free that results when the callback freed the current element in the iteration. * src/conf/domain_conf.c (virDomainSnapshotForEachChild) (virDomainSnapshotActOnDescendant): Allow iteration to delete current child.
* daemon: fix logic bug with virAsprintfEric Blake2012-02-151-1/+1
| | | | | | | | Regression introduced in commit 7033c5f2, due to improper conversion from snprintf to virAsprintf. * daemon/remote.c (remoteDispatchAuthList): Check return value correctly.
* daemon: plug memory leakEric Blake2012-02-151-0/+1
| | | | | | | Leak introduced in commit bb2eddc6. * daemon/remote.c (remoteDispatchAuthPolkit): Also free pkout on success.
* network: support Open vSwitchAnsis Atteka2012-02-1520-24/+359
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows libvirt to add interfaces to already existing Open vSwitch bridges. The following syntax in domain XML file can be used: <interface type='bridge'> <mac address='52:54:00:d0:3f:f2'/> <source bridge='ovsbr'/> <virtualport type='openvswitch'> <parameters interfaceid='921a80cd-e6de-5a2e-db9c-ab27f15a6e1d'/> </virtualport> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> or if libvirt should auto-generate the interfaceid use following syntax: <interface type='bridge'> <mac address='52:54:00:d0:3f:f2'/> <source bridge='ovsbr'/> <virtualport type='openvswitch'> </virtualport> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> It is also possible to pass an optional profileid. To do that use following syntax: <interface type='bridge'> <source bridge='ovsbr'/> <mac address='00:55:1a:65:a2:8d'/> <virtualport type='openvswitch'> <parameters interfaceid='921a80cd-e6de-5a2e-db9c-ab27f15a6e1d' profileid='test-profile'/> </virtualport> </interface> To create Open vSwitch bridge install Open vSwitch and run the following command: ovs-vsctl add-br ovsbr
* conf: rename virDomainNetGetActualDirectVirtPortProfileLaine Stump2012-02-158-10/+10
| | | | | | An upcoming patch will add a <virtualport> element to interfaces of type='bridge', so it makes sense to give this function a more generic name.
* qemu: increase the timeout before sending SIGKILL to qemu processLaine Stump2012-02-151-8/+10
| | | | | | | | | | | | | | | | | | | | The current default method of terminating the qemu process is to send a SIGTERM, wait for up to 1.6 seconds for it to cleanly shutdown, then send a SIGKILL and wait for up to 1.4 seconds more for the process to terminate. This is problematic because occasionally 1.6 seconds is not long enough for the qemu process to flush its disk buffers, so the guest's disk ends up in an inconsistent state. Since this only occasionally happens when the timeout prior to SIGKILL is 1.6 seconds, this patch increases that timeout to 10 seconds. At the very least, this should reduce the occurrence from "occasionally" to "extremely rarely". (Once SIGKILL is sent, it waits another 5 seconds for the process to die before returning). Note that in the cases where it takes less than this for qemu to shutdown cleanly, libvirt will *not* wait for any longer than it would without this patch - qemuProcessKill polls the process and returns as soon as it is gone.
* qemu: drop driver lock while trying to terminate qemu processLaine Stump2012-02-153-15/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is based on an earlier patch by Eric Blake which was never committed: https://www.redhat.com/archives/libvir-list/2011-November/msg00243.html Aside from rebasing, this patch only drops the driver lock once (prior to the first time the function sleeps), then leaves it dropped until it returns (Eric's patch would drop and re-acquire the lock around each call to sleep). At the time Eric sent his patch, the response (from Dan Berrange) was that, while it wasn't a good thing to be holding the driver lock while sleeping, we really need to rethink locking wrt the driver object, switching to a finer-grained approach that locks individual items within the driver object separately to allow for greater concurrency. This is a good plan, and at the time it made sense to not apply the patch because there was no known bug related to the driver lock being held in this function. However, we now know that the length of the wait in qemuProcessKill is sometimes too short to allow the qemu process to fully flush its disk cache before SIGKILL is sent, so we need to lengthen the timeout (in order to improve the situation with management applications until they can be updated to use the new VIR_DOMAIN_DESTROY_GRACEFUL flag added in commit 72f8a7f19753506ed957b78ad800c0f3892c9304). But, if we lengthen the timeout, we also lengthen the amount of time that all other threads in libvirtd are essentially blocked from doing anything (since just about everything needs to acquire the driver lock, if only for long enough to get a pointer to a domain). The solution is to modify qemuProcessKill to drop the driver lock while sleeping, as proposed in Eric's patch. Then we can increase the timeout with a clear conscience, and thus at least lower the chances that someone running with existing management software will suffer the consequence's of qemu's disk cache not being flushed. In the meantime, we still should work on Dan's proposal to make locking within the driver object more fine grained. (NB: although I couldn't find any instance where qemuProcessKill() was called with no jobs active for the domain (or some other guarantee that the current thread had at least one refcount on the domain object), this patch still follows Eric's method of temporarily adding a ref prior to unlocking the domain object, because I couldn't convince myself 100% that this was the case.)
* Fix typos in API XML file pathsDaniel P. Berrange2012-02-153-8/+8
| | | | | * libvirt.pc.in: Add missing '/api/' in path * libvirt.spec.in, mingw32-libvirt.spec.in: s/apis/api/
* qemu: Implement DomainPMSuspendForDurationMichal Privoznik2012-02-153-0/+120
| | | | | via user agent. Allow targets mem & hybrid iff system_wakeup monitor command is available.
* qemu: Set capabilities based on supported monitor commandsMichal Privoznik2012-02-157-20/+29
| | | | | | | In the future (my next patch in fact) we may want to make decisions depending on qemu having a monitor command or not. Therefore, we want to set qemuCaps flag instead of querying on the monitor each time we are about to make that decision.
* Install API XML desc to a standard locationDaniel P. Berrange2012-02-144-0/+14
| | | | | | | | | | | | | | | | | | | | | | Language bindings may well want to use the libvirt-api.xml and libvirt-qemu-api.xml files to either auto-generate themselves, or sanity check the manually written bindings for completeness. Currently these XML files are not installed as standard, merely ending up as a %doc file in the RPM. This changes them to be installed into $prefix/share/libvirt/apis/ The *-refs.xml files are not installed, since those are only useful during generation of the online API doc files. The pkg-config file is enhanced so that you can query the install location of the API files. eg # pkg-config --variable=libvirt_qemu_api libvirt /home/berrange/builder/i686-pc-mingw32/sys-root/mingw/share/libvirt/libvirt-qemu-api.xml * docs/Makefile.am: Install libvirt-api.xml & libvirt-qemu-api.xml * libvirt.pc.in: Add vars for querying API install location * libvirt.spec.in, mingw32-libvirt.spec.in: Include API XML files
* qemu: make block io tuning smarterEric Blake2012-02-132-6/+44
| | | | | | | | | | | | | When blkdeviotune was first committed in 0.9.8, we had the limitation that setting one value reset all others. But bytes and iops should be relatively independent. Furthermore, setting tuning values on a live domain followed by dumpxml did not output the new settings. * src/qemu/qemu_driver.c (qemuDiskPathToAlias): Add parameter, and update callers. (qemuDomainSetBlockIoTune): Don't lose previous unrelated settings. Make live changes reflect to dumpxml output. * tools/virsh.pod (blkdeviotune): Update documentation.
* Release of libvirt-0.9.10v0.9.10Daniel Veillard2012-02-1378-373719/+430701
| | | | | * configure.ac docs/news.html.in libvirt.spec.in: updated for the release * po/*.po*: update ja, it and uk localization, fixed the ja one
* virsh: Fix name of domain suspend commandMichal Privoznik2012-02-131-1/+1
| | | | It's dompmsuspend, not suspend-duration.
* virpidfile: Allow whitespace character at the end of pidfileMichal Privoznik2012-02-131-2/+4
| | | | | Some programs, notably dnsmasq, which are writing pidfiles on their own do append a whitespace character after pid, e.g. '\n'.
* Revert "qemu: add ibmvscsi controller model"Daniel Veillard2012-02-1310-74/+11
| | | | | | | | This reverts commit 7b345b69f28eb112238b941b743c5f6d57bd4a04. Conflicts: tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-vscsi.xml
* Revert "qemu: add virtio-scsi controller model"Daniel Veillard2012-02-1310-54/+3
| | | | | | | | This reverts commit c9abfadf3721505e8eaffbf56ef1e53202c1db3c. Conflicts: tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-virtio-scsi.xml
* python: make other APIs share common {get, set}PyVirTypedParameterGuannan Ren2012-02-102-604/+304
| | | | | | | | | | | | | | *libvirt_virDomainBlockStatsFlags *libvirt_virDomainGetSchedulerParameters *libvirt_virDomainGetSchedulerParametersFlags *libvirt_virDomainSetSchedulerParameters *libvirt_virDomainSetSchedulerParametersFlags *libvirt_virDomainSetBlkioParameters *libvirt_virDomainGetBlkioParameters *libvirt_virDomainSetMemoryParameters *libvirt_virDomainGetMemoryParameters *libvirt_virDomainSetBlockIoTune *libvirt_virDomainGetBlockIoTune
* virpidfile: replace fopen/fwrite/fscanf with more portable versionMarc-André Lureau2012-02-101-18/+25
| | | | | Replace calls to fwrite() and fscanf() with more portable-friendly version, such as snprintf() and virStrToLong().
* util: Do not use PRIx64 macroOsier Yang2012-02-101-2/+2
| | | | | It breaks the build on Mingw32, because PRIx64 is coming from the Win32 headers, but virAsprintf uses the gnulib printf.
* rpc: Plug memory leaks on doRemoteOpen() failure pathAlex Jia2012-02-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Detected by valgrind. Leaks are introduced in commit c1b2264. * src/remote/remote_driver.c (doRemoteOpen): free client program memory in failure path. * How to reproduce? % valgrind -v --leak-check=full virsh -c qemu: * Actual result ==3969== 40 bytes in 1 blocks are definitely lost in loss record 8 of 28 ==3969== at 0x4A04A28: calloc (vg_replace_malloc.c:467) ==3969== by 0x4C89C41: virAlloc (memory.c:101) ==3969== by 0x4D5A236: virNetClientProgramNew (virnetclientprogram.c:60) ==3969== by 0x4D47AB4: doRemoteOpen (remote_driver.c:658) ==3969== by 0x4D49FFF: remoteOpen (remote_driver.c:871) ==3969== by 0x4D13373: do_open (libvirt.c:1196) ==3969== by 0x4D14535: virConnectOpenAuth (libvirt.c:1422) ==3969== by 0x425627: main (virsh.c:18537) ==3969== ==3969== 40 bytes in 1 blocks are definitely lost in loss record 9 of 28 ==3969== at 0x4A04A28: calloc (vg_replace_malloc.c:467) ==3969== by 0x4C89C41: virAlloc (memory.c:101) ==3969== by 0x4D5A236: virNetClientProgramNew (virnetclientprogram.c:60) ==3969== by 0x4D47AD7: doRemoteOpen (remote_driver.c:664) ==3969== by 0x4D49FFF: remoteOpen (remote_driver.c:871) ==3969== by 0x4D13373: do_open (libvirt.c:1196) ==3969== by 0x4D14535: virConnectOpenAuth (libvirt.c:1422) ==3969== by 0x425627: main (virsh.c:18537) ==3969== ==3969== LEAK SUMMARY: ==3969== definitely lost: 80 bytes in 2 blocks Signed-off-by: Alex Jia <ajia@redhat.com>
* npiv: Auto-generate WWN if it's not specifiedOsier Yang2012-02-1011-41/+118
| | | | | | | | | | | | | | | | | The auto-generated WWN comply with the new addressing schema of WWN: <quote> the first nibble is either hex 5 or 6 followed by a 3-byte vendor identifier and 36 bits for a vendor-specified serial number. </quote> We choose hex 5 for the first nibble. And for the 3-bytes vendor ID, we uses the OUI according to underlying hypervisor type, (invoking virConnectGetType to get the virt type). e.g. If virConnectGetType returns "QEMU", we use Qumranet's OUI (00:1A:4A), if returns ESX|VMWARE, we use VMWARE's OUI (00:05:69). Currently it only supports qemu|xen|libxl|xenapi|hyperv|esx|vmware drivers. The last 36 bits are auto-generated.
* Remove single quotes from audit recordsMarcelo Cerri2012-02-101-2/+2
| | | | | | | Some audit records generated by libvirt contain fields enclosed by single quotes. Since those fields are inside the msg field, which is enclosed by single quotes, these records generated by libvirt are not correctly parsed by libauparse.
* GetCPUStats: fix overflow testLai Jiangshan2012-02-091-1/+1
| | | | | | Bug introduced in commit c6ec021b. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
* domain: add implicit USB controllerMarc-André Lureau2012-02-09162-45/+216
| | | | | | | | | Some tools, such as virt-manager, prefers having the default USB controller explicit in the XML document. This patch makes sure there is one. With this patch, it is now possible to switch from USB1 to USB2 from the release 0.9.1 of virt-manager. Fix tests to pass with this change.
* python: refactoring virTypedParameter conversion for NUMA tuning APIsGuannan Ren2012-02-092-0/+364
| | | | | | | | | *getPyVirTypedParameter *setPyVirTypedParameter *virDomainSetNumaParameters *virDomainGetNumaParameters Signed-off-by: Eric Blake <eblake@redhat.com>
* docs: fix typo in python bindingsEric Blake2012-02-091-1/+1
| | | | * docs/python.html.in: Class is virConnect, not virConn.
* conf: small changes to comments in virDomainDeviceInfoLaine Stump2012-02-091-2/+4
| | | | | romfile wasn't mentioned in the comment, and the fact that rombar is now supported for network interfaces also wasn't there.
* python: Correct arguments number for migrateSetMaxSpeedOsier Yang2012-02-091-2/+4
| | | | | | | | The API definition accepts "flags" argument, however, the implementation ignores it, though "flags" is unused currently, we should expose it instead of hard coding, the API implementation inside hypervisor driver is responsible to check if the passed "flags" is valid.
* qemu: fix persistent setting of blkiodevice weightsEric Blake2012-02-081-2/+2
| | | | | | | | | virsh blkiotune dom --device-weights /dev/sda,400 --config wasn't working correctly. * src/qemu/qemu_driver.c (qemuDomainSetBlkioParameters): Use correct definition.
* qemu: make blkiodevice weights easier to readEric Blake2012-02-081-14/+19
| | | | | | | The merge code had too many indirections to easily analyze. * src/qemu/qemu_driver.c (qemuDomainMergeDeviceWeights): Pick better variable names.
* sysinfo: simplify function signatureEric Blake2012-02-081-43/+61
| | | | | | | | | | | Now that no one is relying on the return value being a pointer to somewhere inside of the passed-in argument, we can simplify the callers to simply return success or failure. Also wrap some long lines and add some const-correctness. * src/util/sysinfo.c (virSysinfoParseBIOS, virSysinfoParseSystem) (virSysinfoParseProcessor, virSysinfoParseMemory): Change return. (virSysinfoRead): Adjust caller.
* Populate /dev/std{in,out,err} symlinks in LXC containersDaniel P. Berrange2012-02-081-0/+18
| | | | | Some applications expect /dev/std{in,out,err} to exist. Populate them during container startup as symlinks to /proc/self/fd
* Replace truncate() with ftruncate()Daniel P. Berrange2012-02-081-3/+20
| | | | | Mingw32 does not have any truncate() API defined, but it does have ftruncate(). So replace use of the former with the latter