]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/log
people/liuw/libxenctrl-split/libvirt.git
14 years agodocs: document <controller> element
Eric Blake [Mon, 17 Jan 2011 21:33:00 +0000 (14:33 -0700)]
docs: document <controller> element

* docs/formatdomain.html.in: Talk about <controller> and <address>
throughout.

14 years agodocs: move the apps page to the top level as its good promo
Justin Clift [Thu, 20 Jan 2011 06:17:41 +0000 (17:17 +1100)]
docs: move the apps page to the top level as its good promo

14 years agodocs: added new entries to apps page, plus adjusted a few existing
Justin Clift [Thu, 20 Jan 2011 01:52:21 +0000 (12:52 +1100)]
docs: added new entries to apps page, plus adjusted a few existing

Added new entries for Hudson, LCFG, Tivoli Provisioning Manager,
virt-what, and Zenoss.  Adjusted the existing entries for BuildBot
and vmware2libvirt.

14 years agoqemu: Avoid sending STOPPED event twice
Jiri Denemark [Tue, 18 Jan 2011 11:07:13 +0000 (12:07 +0100)]
qemu: Avoid sending STOPPED event twice

In some circumstances, libvirtd would issue two STOPPED events after it
stopped a domain. This was because an EOF event can arrive after a qemu
process is killed but before qemuMonitorClose() is called.

qemuHandleMonitorEOF() should ignore EOF when the domain is not running.

I wasn't able to reproduce this bug directly, only after adding an
artificial sleep() into qemudShutdownVMDaemon().

14 years agoqemu: Fail if per-device boot is used but deviceboot is not supported
Jiri Denemark [Tue, 18 Jan 2011 09:04:21 +0000 (10:04 +0100)]
qemu: Fail if per-device boot is used but deviceboot is not supported

14 years agospec: Start libvirt-guests only if it's on in current runlevel
Jiri Denemark [Tue, 18 Jan 2011 08:49:10 +0000 (09:49 +0100)]
spec: Start libvirt-guests only if it's on in current runlevel

14 years agoRemove redundant brackets around return values
Daniel P. Berrange [Fri, 7 Jan 2011 17:39:43 +0000 (17:39 +0000)]
Remove redundant brackets around return values

A large number of return values used 'return (0)' instead
of simply 'return 0'. Remove all these redundant brackets
so the style is consistent throughout the file

* src/libvirt.c: Remove redundant brackets

14 years agoIncrease size of driver table to make UML work again
Daniel P. Berrange [Fri, 7 Jan 2011 17:36:33 +0000 (17:36 +0000)]
Increase size of driver table to make UML work again

The driver table only has 10 slots, but there are potentially
11 drivers that need activating. Improve the error message
when driver registration fails

* src/libvirt.c: Increase driver table size & improve errors

14 years agoTurn libvirt.c error reporting functions into macros
Daniel P. Berrange [Fri, 7 Jan 2011 17:31:36 +0000 (17:31 +0000)]
Turn libvirt.c error reporting functions into macros

The virLibConnError() function (and related ones) do not correctly
report line number info. Turn them all into macros so line numbers
are reported correctly. Drop the connection object in all of them
since it is no longer used.

Also from the virLibConnWarning() equivalents completely. Now
that the Xen driver is running 100% inside libvirtd, those
codepaths for secondary drivers cannot be reached.

* src/libvirt.c: Replace error functions with macros

14 years agodocs: document <sysinfo> and <smbios> elements
Eric Blake [Tue, 18 Jan 2011 20:41:55 +0000 (13:41 -0700)]
docs: document <sysinfo> and <smbios> elements

* docs/formatdomain.html.in: Talk about <sysinfo> throughout.

14 years agobuild: use more gnulib modules for simpler code
Eric Blake [Fri, 24 Dec 2010 02:26:15 +0000 (19:26 -0700)]
build: use more gnulib modules for simpler code

* .gnulib: Update to latest, for sigpipe and sigaction modules.
* bootstrap.conf (gnulib_modules): Add siaction, sigpipe, strerror_r.
* tools/virsh.c (vshSetupSignals) [!SIGPIPE]: Delete, now that
gnulib guarantees it.
(SA_SIGINFO): Define for mingw fallback.
* src/util/virterror.c (virStrerror): Simplify, now that gnulib
guarantees the POSIX interface.
* configure.ac (AC_CHECK_FUNCS_ONCE): Drop redundant check.
(AM_PROG_CC_STDC): Move earlier, to keep autoconf happy.

14 years agoRemove two unused PATH_MAX-sized char arrays from the stack
Matthias Bolte [Sat, 15 Jan 2011 16:38:57 +0000 (17:38 +0100)]
Remove two unused PATH_MAX-sized char arrays from the stack

14 years agoUse VIR_ERR_OPERATION_INVALID when appropriated
Matthias Bolte [Sat, 15 Jan 2011 15:57:33 +0000 (16:57 +0100)]
Use VIR_ERR_OPERATION_INVALID when appropriated

VIR_ERR_OPERATION_INVALID means that the operation is not valid
for the current state of the involved object.

14 years agoFix misuse of VIR_ERR_INVALID_* error code
Matthias Bolte [Sat, 15 Jan 2011 15:31:29 +0000 (16:31 +0100)]
Fix misuse of VIR_ERR_INVALID_* error code

VIR_ERR_INVALID_* is meant for invalid pointers only.

14 years agoSimplify "NWFilterPool" to "NWFilter"
Matthias Bolte [Sat, 15 Jan 2011 15:06:52 +0000 (16:06 +0100)]
Simplify "NWFilterPool" to "NWFilter"

The public object is called NWFilter but the corresponding private
object is called NWFilterPool. I don't see compelling reasons for this
Pool suffix. One might argue that an NWFilter is a "pool" of rules, etc.

Remove the Pool suffix from NWFilterPool. No functional change included.

14 years agodatatypes: Fix outdated function names in the documentation
Matthias Bolte [Sat, 15 Jan 2011 14:42:22 +0000 (15:42 +0100)]
datatypes: Fix outdated function names in the documentation

14 years agoAdd documentation for VIR_DOMAIN_MEMORY_PARAM_UNLIMITED
Matthias Bolte [Sat, 15 Jan 2011 14:03:08 +0000 (15:03 +0100)]
Add documentation for VIR_DOMAIN_MEMORY_PARAM_UNLIMITED

Otherwise apibuild.py complains about it.

14 years agodatatypes: Get virSecretFreeName in sync with the other free functions
Matthias Bolte [Sat, 15 Jan 2011 13:54:19 +0000 (14:54 +0100)]
datatypes: Get virSecretFreeName in sync with the other free functions

14 years agodocs: Move the "Network Filtering" page one level up in the hierarchy
Matthias Bolte [Sat, 15 Jan 2011 13:47:11 +0000 (14:47 +0100)]
docs: Move the "Network Filtering" page one level up in the hierarchy

"Network Filtering" is not directly related to "Networks".

Suggested by Daniel P. Berrange.

14 years agodocs: add buildbot to the apps page
Justin Clift [Tue, 18 Jan 2011 21:40:08 +0000 (08:40 +1100)]
docs: add buildbot to the apps page

14 years agoqemu: don't fail capabilities check on 0.12.x
Eric Blake [Tue, 18 Jan 2011 16:47:30 +0000 (09:47 -0700)]
qemu: don't fail capabilities check on 0.12.x

Fixes regression introduced in commit 2211518, where all qemu 0.12.x
fails to start, as does qemu 0.13.x lacking the pci-assign device.
Prior to 2211518, the code was just ignoring a non-zero exit status
from the qemu child, but the virCommand code checked this to avoid
masking any other issues, which means the real bug of provoking
non-zero exit status has been latent for a longer time.

* src/qemu/qemu_capabilities.c (qemuCapsExtractVersionInfo): Check
for -device driver,? support.
(qemuCapsExtractDeviceStr): Avoid failure if all probed devices
are unsupported.
Reported by Ken Congyang.

14 years agodocs: add new conversion heading to the apps listing
Justin Clift [Tue, 18 Jan 2011 21:21:03 +0000 (08:21 +1100)]
docs: add new conversion heading to the apps listing

14 years agodocs: updated windows page for new 0.8.7 installer
Justin Clift [Tue, 18 Jan 2011 18:00:44 +0000 (05:00 +1100)]
docs: updated windows page for new 0.8.7 installer

14 years agoqemu: use -incoming fd:n to avoid qemu holding fd indefinitely
Eric Blake [Wed, 22 Dec 2010 22:13:29 +0000 (15:13 -0700)]
qemu: use -incoming fd:n to avoid qemu holding fd indefinitely

https://bugzilla.redhat.com/show_bug.cgi?id=620363

When using -incoming stdio or -incoming exec:, qemu keeps the
stdin fd open long after the migration is complete.  Not to
mention that exec:cat is horribly inefficient, by doubling the
I/O and going through a popen interface in qemu.

The new -incoming fd: of qemu 0.12.0 closes the fd after using
it, and allows us to bypass an intermediary cat process for
less I/O.

* src/qemu/qemu_command.h (qemuBuildCommandLine): Add parameter.
* src/qemu/qemu_command.c (qemuBuildCommandLine): Support
migration via fd: when possible.  Consolidate migration handling
into one spot, now that it is more complex.
* src/qemu/qemu_driver.c (qemudStartVMDaemon): Update caller.
* tests/qemuxml2argvtest.c (mymain): Likewise.
* tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.args: New file.
* tests/qemuxml2argvdata/qemuxml2argv-restore-v2-fd.xml: Likewise.

14 years agotests: Add tests for per-device boot elements
Jiri Denemark [Thu, 13 Jan 2011 10:46:43 +0000 (11:46 +0100)]
tests: Add tests for per-device boot elements

14 years agoqemu: Support per-device boot ordering
Jiri Denemark [Wed, 12 Jan 2011 10:33:34 +0000 (11:33 +0100)]
qemu: Support per-device boot ordering

Support for this is included in qemu and seabios from upstream git.

14 years agoIntroduce per-device boot element
Jiri Denemark [Wed, 12 Jan 2011 14:19:34 +0000 (15:19 +0100)]
Introduce per-device boot element

Currently, boot order can be specified per device class but there is no
way to specify exact disk/NIC device to boot from.

This patch adds <boot order='N'/> element which can be used inside
<disk/> and <interface/>. This is incompatible with the older os/boot
element. Since not all hypervisors support per-device boot
specification, new deviceboot flag is included in capabilities XML for
hypervisors which understand the new boot element. Presence of the flag
allows (but doesn't require) users to use the new style boot order
specification.

14 years agoconf: Move boot parsing into a separate function
Jiri Denemark [Wed, 12 Jan 2011 07:44:54 +0000 (08:44 +0100)]
conf: Move boot parsing into a separate function

14 years agobuild: let xgettext see strings in libvirt-guests
Eric Blake [Thu, 6 Jan 2011 19:00:30 +0000 (12:00 -0700)]
build: let xgettext see strings in libvirt-guests

* tools/libvirt-guests.init.in: Rename...
* tools/libvirt-guests.init.sh: ...so that xgettext's language
detection via suffix will work.
* po/POTFILES.in: Update all references.
* tools/Makefile.am (EXTRA_DIST, libvirt-guests.init): Likewise.

14 years agolibvirt-guests: remove bashisms
Laurent Léonard [Tue, 4 Jan 2011 18:13:56 +0000 (19:13 +0100)]
libvirt-guests: remove bashisms

* tools/libvirt-guests.init.sh: Use only POSIX shell features, which
includes using gettext.sh for translation rather than $"".
* tools/Makefile.am (libvirt-guests.init): Supply a few more substitutions.
* po/POTFILES.in: Mark that libvirt-guests.init needs translation.

Signed-off-by: Eric Blake <eblake@redhat.com>
14 years agoA couple of fixes for the search PHP code
Daniel Veillard [Mon, 17 Jan 2011 08:55:41 +0000 (16:55 +0800)]
A couple of fixes for the search PHP code

14 years agotests: Remove obsolete secaatest
Matthias Bolte [Fri, 14 Jan 2011 21:37:55 +0000 (22:37 +0100)]
tests: Remove obsolete secaatest

Before the security driver was refactored in d6623003 seclabeltest and
secaatest were basically the same. seclabeltest was meant for SELinux
and secaatest for AppArmor. Both tests exited early when the specific
security driver backend wasn't enabled.

With the new security manager trying to initialize a disabled security
driver backend is an error that can't be distinguished from other errors
anymore. Therefore, the updated seclabeltest just asks for the first
available backend as this will always work even with SELinux and AppArmor
backend being disabled due to the new Nop backend.

Remove the obsolete secaatest and compile and run the seclabeltest
unconditional.

This fixes make check on systems that support AppArmor.

14 years agovirsh: Use WITH_SECDRIVER_APPARMOR to detect AppArmor support
Matthias Bolte [Fri, 14 Jan 2011 21:00:55 +0000 (22:00 +0100)]
virsh: Use WITH_SECDRIVER_APPARMOR to detect AppArmor support

There is no ENABLE_SECDRIVER_APPARMOR.

14 years agomemtune: Let virsh know the unlimited value for memory tunables
Nikunj A. Dadhania [Thu, 13 Jan 2011 09:18:11 +0000 (14:48 +0530)]
memtune: Let virsh know the unlimited value for memory tunables

Display or set unlimited values for memory parameters. Unlimited is
represented by INT64_MAX in memory cgroup.

Signed-off-by: Nikunj A. Dadhania <nikunj@linux.vnet.ibm.com>
Reported-by: Justin Clift <jclift@redhat.com>
14 years agomaint: improve sc_prohibit_strncmp syntax check
Eric Blake [Fri, 7 Jan 2011 00:17:32 +0000 (17:17 -0700)]
maint: improve sc_prohibit_strncmp syntax check

* .gnulib: Update, for sc_prohibit_strcmp fix.
* cfg.mk: Adjust copyright; the only FSF portions come from when
this file was copied from coreutils.
(sc_prohibit_strncmp): Copy bug-fixes from sc_prohibit_strcmp.
* .x-sc_prohibit_strcmp: Delete, now that rule is smarter.
* .x-sc_prohibit_strncmp: Likewise.
* Makefile.am (syntax_check_exceptions): Track deletion.

14 years agodatatypes: avoid redundant __FUNCTION__
Eric Blake [Wed, 12 May 2010 02:57:56 +0000 (20:57 -0600)]
datatypes: avoid redundant __FUNCTION__

virLibConnError already includes __FUNCTION__ in its output, so we
were redundant.  Furthermore, clang warns that __FUNCTION__ is not
a string literal (at least __FUNCTION__ will never contain %, so
it was not a security risk).

* src/datatypes.c: Replace __FUNCTION__ with a descriptive string.

14 years agoEnable tuning of qemu network tap device "sndbuf" size
Laine Stump [Wed, 12 Jan 2011 19:38:01 +0000 (14:38 -0500)]
Enable tuning of qemu network tap device "sndbuf" size

This is in response to a request in:

   https://bugzilla.redhat.com/show_bug.cgi?id=665293

In short, under heavy load, it's possible for qemu's networking to
lock up due to the tap device's default 1MB sndbuf being
inadequate. adding "sndbuf=0" to the qemu commandline -netdevice
option will alleviate this problem (sndbuf=0 actually sets it to
0xffffffff).

Because we must be able to explicitly specify "0" as a value, the
standard practice of "0 means not specified" won't work here. Instead,
virDomainNetDef also has a sndbuf_specified, which defaults to 0, but
is set to 1 if some value was given.

The sndbuf value is put inside a <tune> element of each <interface> in
the domain. The intent is that further tunable settings will also be
placed inside this element.

     <interface type='network'>
       ...
       <tune>
         <sndbuf>0</sndbuf>
       ...
       </tune>
     </interface>

14 years agoAdd XML config switch to enable/disable vhost-net support
Laine Stump [Wed, 12 Jan 2011 04:18:49 +0000 (23:18 -0500)]
Add XML config switch to enable/disable vhost-net support

This patch is in response to

  https://bugzilla.redhat.com/show_bug.cgi?id=643050

The existing libvirt support for the vhost-net backend to the virtio
network driver happens automatically - if the vhost-net device is
available, it is always enabled, otherwise the standard userland
virtio backend is used.

This patch makes it possible to force whether or not vhost-net is used
with a bit of XML. Adding a <driver> element to the interface XML, eg:

     <interface type="network">
       <model type="virtio"/>
       <driver name="vhost"/>

will force use of vhost-net (if it's not available, the domain will
fail to start). if driver name="qemu", vhost-net will not be used even
if it is available.

If there is no <driver name='xxx'/> in the config, libvirt will revert
to the pre-existing automatic behavior - use vhost-net if it's
available, and userland backend if vhost-net isn't available.

14 years agoUse the new set_password monitor command to set password.
Marc-André Lureau [Mon, 10 Jan 2011 11:12:33 +0000 (12:12 +0100)]
Use the new set_password monitor command to set password.

We try to use that command first when setting a VNC/SPICE password. If
that doesn't work we fallback to the legacy VNC only password

Allow an expiry time to be set, if that doesn't work, throw an error
if they try to use SPICE.

Change since v1:
- moved qemuInitGraphicsPasswords to qemu_hotplug, renamed
  to qemuDomainChangeGraphicsPasswords.
- updated what looks like a typo (that appears to work anyway) in
  initial patch from Daniel:
    - ret = qemuInitGraphicsPasswords(driver, vm,
    -                                 VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
    -                                 &vm->def->graphics[0]->data.vnc.auth,
    -                                 driver->vncPassword);
    + ret = qemuInitGraphicsPasswords(driver, vm,
    +                                 VIR_DOMAIN_GRAPHICS_TYPE_SPICE,
    +                                 &vm->def->graphics[0]->data.spice.auth,
    +                                 driver->spicePassword);

Based on patch by Daniel P. Berrange <berrange@redhat.com>.

14 years agoqemu: add set_password and expire_password monitor commands
Marc-André Lureau [Mon, 10 Jan 2011 11:12:32 +0000 (12:12 +0100)]
qemu: add set_password and expire_password monitor commands

14 years agoFix 'make check' after commit 04197350
Jim Fehlig [Fri, 14 Jan 2011 18:12:46 +0000 (11:12 -0700)]
Fix 'make check' after commit 04197350

I broke 'make check' with commit 04197350 by unconditionally
emitting 'hap=' in xen xm driver.  Only emit 'hap=' if
xendConfigVersion >= 3.  I've tested sending 'hap=' to a Xen 3.2
machine without support for hap setting and verified that xend
silently drops the unrecognized setting.

14 years agoqemu: move monitor device out of domain_conf common code
Eric Blake [Fri, 7 Jan 2011 23:36:25 +0000 (16:36 -0700)]
qemu: move monitor device out of domain_conf common code

* src/conf/domain_conf.h (virDomainChrDeviceType): Drop monitor.
* src/conf/domain_conf.c (virDomainChrDevice)
(virDomainChrDefParseTargetXML, virDomainChrDefFormat): Drop
monitor support.
* src/qemu/qemu_command.h (qemuBuildCommandLine): Alter signature.
* src/qemu/qemu_monitor.h (qemuMonitorOpen): Likewise.
* src/qemu/qemu_domain.h (_qemuDomainObjPrivate): Change type of
monConfig.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateFree)
(qemuDomainObjPrivateXMLFormat, qemuDomainObjPrivateXMLParse):
Adjust to type change.
* src/qemu/qemu_command.c (qemuBuildCommandLine): Likewise.
* src/qemu/qemu_driver.c (qemuPrepareMonitorChr)
(qemudStartVMDaemon, qemuDomainXMLToNative, qemuConnectMonitor)
(qemudShutdownVMDaemon): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_monitor.c (qemuMonitorOpen): Likewise.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Likewise.

14 years agodomain_conf: split source data out from ChrDef
Eric Blake [Fri, 7 Jan 2011 22:45:01 +0000 (15:45 -0700)]
domain_conf: split source data out from ChrDef

This opens up the possibility of reusing the smaller ChrSourceDef
for both qemu monitor and a passthrough smartcard device.

* src/conf/domain_conf.h (_virDomainChrDef): Factor host
details...
(_virDomainChrSourceDef): ...into new struct.
(virDomainChrSourceDefFree): New prototype.
* src/conf/domain_conf.c (virDomainChrDefFree)
(virDomainChrDefParseXML, virDomainChrDefFormat): Split...
(virDomainChrSourceDefClear, virDomainChrSourceDefFree)
(virDomainChrSourceDefParseXML, virDomainChrSourceDefFormat):
...into new functions.
(virDomainChrDefParseTargetXML): Update clients to reflect type
split.
* src/vmx/vmx.c (virVMXParseSerial, virVMXParseParallel)
(virVMXFormatSerial, virVMXFormatParallel): Likewise.
* src/xen/xen_driver.c (xenUnifiedDomainOpenConsole): Likewise.
* src/xen/xend_internal.c (xenDaemonParseSxprChar)
(xenDaemonFormatSxprChr): Likewise.
* src/vbox/vbox_tmpl.c (vboxDomainDumpXML, vboxAttachSerial)
(vboxAttachParallel): Likewise.
* src/security/security_dac.c (virSecurityDACSetChardevLabel)
(virSecurityDACSetChardevCallback)
(virSecurityDACRestoreChardevLabel)
(virSecurityDACRestoreChardevCallback): Likewise.
* src/security/security_selinux.c (SELinuxSetSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback)
(SELinuxRestoreSecurityChardevLabel)
(SELinuxSetSecurityChardevCallback): Likewise.
* src/security/virt-aa-helper.c (get_files): Likewise.
* src/lxc/lxc_driver.c (lxcVmStart, lxcDomainOpenConsole):
Likewise.
* src/uml/uml_conf.c (umlBuildCommandLineChr): Likewise.
* src/uml/uml_driver.c (umlIdentifyOneChrPTY, umlIdentifyChrPTY)
(umlDomainOpenConsole): Likewise.
* src/qemu/qemu_command.c (qemuBuildChrChardevStr)
(qemuBuildChrArgStr, qemuBuildCommandLine)
(qemuParseCommandLineChr): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLFormat)
(qemuDomainObjPrivateXMLParse): Likewise.
* src/qemu/qemu_cgroup.c (qemuSetupChardevCgroup): Likewise.
* src/qemu/qemu_hotplug.c (qemuDomainAttachNetDevice): Likewise.
* src/qemu/qemu_driver.c (qemudFindCharDevicePTYsMonitor)
(qemudFindCharDevicePTYs, qemuPrepareChardevDevice)
(qemuPrepareMonitorChr, qemudShutdownVMDaemon)
(qemuDomainOpenConsole): Likewise.
* src/qemu/qemu_command.h (qemuBuildChrChardevStr)
(qemuBuildChrArgStr): Delete, now that they are static.
* src/libvirt_private.syms (domain_conf.h): New exports.
* cfg.mk (useless_free_options): Update list.
* tests/qemuxml2argvtest.c (testCompareXMLToArgvFiles): Update
tests.

14 years agocpu: Add support for Westmere CPU model
Jiri Denemark [Fri, 14 Jan 2011 13:20:33 +0000 (14:20 +0100)]
cpu: Add support for Westmere CPU model

14 years agoqemu: improve device flag parsing
Eric Blake [Thu, 13 Jan 2011 16:09:15 +0000 (09:09 -0700)]
qemu: improve device flag parsing

* src/qemu/qemu_capabilities.h (qemuCapsParseDeviceStr): New
prototype.
* src/qemu/qemu_capabilities.c (qemuCapsParsePCIDeviceStrs)
Rename and split...
(qemuCapsExtractDeviceStr, qemuCapsParseDeviceStr): ...to make it
easier to add and test device-specific checks.
(qemuCapsExtractVersionInfo): Update caller.
* tests/qemuhelptest.c (testHelpStrParsing): Also test parsing of
device-related flags.
(mymain): Update expected flags.
* tests/qemuhelpdata/qemu-0.12.1-device: New file.
* tests/qemuhelpdata/qemu-kvm-0.12.1.2-rhel60-device: New file.
* tests/qemuhelpdata/qemu-kvm-0.12.3-device: New file.
* tests/qemuhelpdata/qemu-kvm-0.13.0-device: New file.

14 years agoutil: add missing string->integer conversion functions
Eric Blake [Thu, 13 Jan 2011 22:09:18 +0000 (15:09 -0700)]
util: add missing string->integer conversion functions

It was awkward having only int conversion in the virStrToLong family,
but only long conversion in the virXPath family.  Make both families
support both types.

* src/util/util.h (virStrToLong_l, virStrToLong_ul): New
prototypes.
* src/util/xml.h (virXPathInt, virXPathUInt): Likewise.
* src/util/util.c (virStrToLong_l, virStrToLong_ul): New
functions.
* src/util/xml.c (virXPathInt, virXPathUInt): Likewise.
* src/libvirt_private.syms (util.h, xml.h): Export them.

14 years agodocs: clarify virsh setvcpus and setmem usage with active domains
Justin Clift [Thu, 13 Jan 2011 20:45:37 +0000 (07:45 +1100)]
docs: clarify virsh setvcpus and setmem usage with active domains

Addresses BZ # 622534:

  https://bugzilla.redhat.com/show_bug.cgi?id=622534

14 years agoqemu: convert capabilities to use virCommand
Eric Blake [Wed, 12 Jan 2011 23:26:34 +0000 (16:26 -0700)]
qemu: convert capabilities to use virCommand

* src/qemu/qemu_capabilities.c (qemuCapsProbeMachineTypes)
(qemuCapsProbeCPUModels, qemuCapsParsePCIDeviceStrs)
(qemuCapsExtractVersionInfo): Use virCommand rather than virExec.

14 years agovirsh: ensure --maximum flag used only with --config for setvcpus
Justin Clift [Thu, 13 Jan 2011 17:42:03 +0000 (04:42 +1100)]
virsh: ensure --maximum flag used only with --config for setvcpus

14 years agoDocument HAP domain feature
Jim Fehlig [Wed, 5 Jan 2011 23:07:54 +0000 (16:07 -0700)]
Document HAP domain feature

Add HAP feature to schema and documentation.

14 years agoAdd HAP to xen hypervisor capabilities
Jim Fehlig [Wed, 5 Jan 2011 22:20:01 +0000 (15:20 -0700)]
Add HAP to xen hypervisor capabilities

xen-unstable c/s 16931 introduced a per-domain setting for hvm
guests to enable/disable hardware assisted paging.  If disabled,
software techniques such as shadow page tables are used.  If enabled,
and the feature exists in underlying hardware, hardware support for
paging is used.

Xen does not provide a mechanism to discover the HAP capability, so
we advertise its availability for hvm guests on Xen >= 3.3.

14 years agoAdd support for HAP feature to xen drivers
Jim Fehlig [Wed, 5 Jan 2011 22:16:57 +0000 (15:16 -0700)]
Add support for HAP feature to xen drivers

xen-unstable c/s 16931 introduced a per-domain setting for hvm
guests to enable/disable hardware assisted paging.  If disabled,
software techniques such as shadow page tables are used.  If enabled,
and the feature exists in underlying hardware, hardware support for
paging is used.

This provides implementation for mapping HAP setting to/from
domxml/native formats in xen drivers.

14 years agoAdd HAP to virDomainFeature enum
Jim Fehlig [Wed, 5 Jan 2011 21:56:48 +0000 (14:56 -0700)]
Add HAP to virDomainFeature enum

Extend the virDomainFeature enumeration to include HAP (hardware
assisted paging) feature.

Hardware features such as Extended Page Table and Nested Page
Table augment hypervisor software techniques such as shadow
page table.  Adding HAP to the virDomainFeature enumeration
allows users to select between hardware and software memory
management mechanisms for their guests.

14 years agotests: virsh is no longer in builddir/src
Eric Blake [Wed, 12 Jan 2011 20:13:22 +0000 (13:13 -0700)]
tests: virsh is no longer in builddir/src

Commit 870dba0 (Mar 2008) added builddir/src to PATH to pick
up virsh.  Later, virsh was moved to tools; commit db68d6b
(Oct 2009) noticed this, but only added the new location rather
than deleting the old location.

* tests/Makefile.am (path_add): Drop now-useless directory.
Suggested by Daniel P. Berrange.

14 years agovirFindFileInPath: only find executable non-directory
Eric Blake [Wed, 12 Jan 2011 16:12:24 +0000 (09:12 -0700)]
virFindFileInPath: only find executable non-directory

Without this patch, at least tests/daemon-conf (which sticks
$builddir/src in the PATH) tries to execute the directory
$builddir/src/qemu rather than a real qemu binary.

* src/util/util.h (virFileExists): Adjust prototype.
(virFileIsExecutable): New prototype.
* src/util/util.c (virFindFileInPath): Reject non-executables and
directories.  Avoid huge stack allocation.
(virFileExists): Use lighter-weight syscall.
(virFileIsExecutable): New function.
* src/libvirt_private.syms (util.h): Export new function.

14 years agoFix old PHP syntax in the search online form
Daniel Veillard [Thu, 13 Jan 2011 06:09:13 +0000 (14:09 +0800)]
Fix old PHP syntax in the search online form

14 years agobuild: restore mingw build
Eric Blake [Wed, 12 Jan 2011 20:18:37 +0000 (13:18 -0700)]
build: restore mingw build

* bootstrap.conf (gnulib_modules): Add chown.

14 years agoesx: Fix memory leak in HostSystem managed object free function
Matthias Bolte [Sat, 8 Jan 2011 13:59:01 +0000 (14:59 +0100)]
esx: Fix memory leak in HostSystem managed object free function

14 years agodocs: fix trivial typos in currentMemory description
Justin Clift [Wed, 12 Jan 2011 21:33:09 +0000 (08:33 +1100)]
docs: fix trivial typos in currentMemory description

14 years agodoc: improve the documentation of desturi
Wen Congyang [Wed, 12 Jan 2011 06:12:39 +0000 (14:12 +0800)]
doc: improve the documentation of desturi

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
14 years agoreport error when specifying wrong desturi
Wen Congyang [Wed, 12 Jan 2011 06:12:29 +0000 (14:12 +0800)]
report error when specifying wrong desturi

When we do peer2peer migration, the dest uri is an address of the
target host as seen from the source machine. So we must specify
the ip or hostname of target host in dest uri. If we do not specify
it, report an error to the user.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
14 years agoqemu: Reject SDL graphic if it's not supported by qemu
Osier Yang [Wed, 12 Jan 2011 14:44:00 +0000 (22:44 +0800)]
qemu: Reject SDL graphic if it's not supported by qemu

If the emulator doesn't support SDL graphic, we should reject
the use of SDL graphic xml with error messages, but not ignore
it silently, and pretend things are fine.

"-sdl" flag was exposed explicitly by qemu since 0.10.0, more detail:
http://www.redhat.com/archives/libvir-list/2011-January/msg00442.html

And we already have capability flag "QEMUD_CMD_FLAG_0_10", which
could be used to prevent the patch affecting the older versions
of QEMU.

* src/qemu/qemu_command.c

14 years agodocs: reorder apps page alphabetically, plus add libguestfs entries
Justin Clift [Wed, 12 Jan 2011 14:18:50 +0000 (01:18 +1100)]
docs: reorder apps page alphabetically, plus add libguestfs entries

14 years agodocs: add entry for archipel to the apps page
Justin Clift [Tue, 11 Jan 2011 20:28:53 +0000 (07:28 +1100)]
docs: add entry for archipel to the apps page

14 years agodocs: use xml entity encoding for extended character last name
Justin Clift [Tue, 11 Jan 2011 20:58:23 +0000 (07:58 +1100)]
docs: use xml entity encoding for extended character last name

14 years agovbox: Silently ignore missing registry key on Windows
Matthias Bolte [Mon, 10 Jan 2011 14:05:45 +0000 (15:05 +0100)]
vbox: Silently ignore missing registry key on Windows

Don't report an error when the VirtualBox registry key is missing,
as this just indicates that VirtualBox is not installed in general.

This matches the behavior of the XPCOM glue that silently ignores
a missing VBoxXPCOMC.so.

14 years agoqemu: Watchdog IB700 is not a PCI device (RHBZ#667091).
Richard W.M. Jones [Tue, 11 Jan 2011 13:37:52 +0000 (13:37 +0000)]
qemu: Watchdog IB700 is not a PCI device (RHBZ#667091).

Skip IB700 when assigning PCI slots.

Note: the I6300ESB watchdog _is_ a PCI device.

To test this: I applied this patch to libvirt-0.8.3-2.fc14 (rebasing
it slightly: qemu_command.c didn't exist in that version) and
installed this on my machine, then tested that I could successfully
add an ib700 watchdog device to a guest, start the guest, and the
ib700 was available to the guest.  I also added an i6300esb (PCI)
watchdog to another guest, and verified that libvirt assigned a PCI
device to it, that the guest could be started, and that i6300esb was
present in the guest.

Note that if you previously had a domain with a ib700 watchdog, it
would have had an <address type='pci' .../> clause added to it in the
libvirt configuration.  This patch does not attempt to remove this.
You cannot start such a domain -- qemu gives an error if you try.
With this patch you are able to remove the bogus address element
without libvirt adding it back.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
14 years agocpu: plug memory leak
Eric Blake [Mon, 10 Jan 2011 23:56:36 +0000 (16:56 -0700)]
cpu: plug memory leak

* src/cpu/cpu_x86.c (x86ModelLoad): Free data before overwriting.

14 years agonetwork: plug memory leak
Eric Blake [Mon, 10 Jan 2011 22:35:37 +0000 (15:35 -0700)]
network: plug memory leak

* src/conf/network_conf.c (virNetworkDefParseXML): Release ipNodes.

14 years agonetwork: plug unininitialized read found by valgrind
Eric Blake [Mon, 10 Jan 2011 22:08:56 +0000 (15:08 -0700)]
network: plug unininitialized read found by valgrind

* src/util/network.c (virSocketAddrMask): Zero out port, so that
iptables can initialize just the netmask then call
virSocketFormatAddr without an uninitialized read in getnameinfo.

14 years agodocs: updated memtune info again in virsh command reference
Justin Clift [Mon, 10 Jan 2011 20:33:15 +0000 (07:33 +1100)]
docs: updated memtune info again in virsh command reference

14 years agopython: Use PyCapsule API if available
Cole Robinson [Thu, 2 Dec 2010 17:15:10 +0000 (12:15 -0500)]
python: Use PyCapsule API if available

On Fedore 14, virt-manager spews a bunch of warnings to the console:

/usr/lib64/python2.7/site-packages/libvirt.py:1781: PendingDeprecationWarning: The CObject type is marked Pending Deprecation in Python 2.7.  Please use capsule objects instead.

Have libvirt use the capsule API if available. I've verified this compiles
fine on older python (2.6 in RHEL6 which doesn't have capsules), and
virt-manager seems to function fine.

14 years agoevent-test: Simplify debug on/off
Cole Robinson [Wed, 5 Jan 2011 21:47:22 +0000 (16:47 -0500)]
event-test: Simplify debug on/off

Make it easy to change debugging if being used by a client program.

14 years agoremote: Don't lose track of events when callbacks are slow
Cole Robinson [Wed, 5 Jan 2011 21:35:07 +0000 (16:35 -0500)]
remote: Don't lose track of events when callbacks are slow

After the remote driver runs an event callback, it unconditionally disables the
loop timer, thinking it just flushed every queued event. This doesn't work
correctly though if an event is queued while a callback is running.

The events actually aren't being lost, it's just that the event loop didn't
think there was anything that needed to be dispatched. So all those 'lost
events' should actually get re-triggered if you manually kick the loop by
generating a new event (like creating a new guest).

The solution is to disable the dispatch timer _before_ we invoke any event
callbacks. Events queued while a callback is running will properly reenable the
timer.

More info at https://bugzilla.redhat.com/show_bug.cgi?id=624252

14 years agoRefactor the security drivers to simplify usage
Daniel P. Berrange [Wed, 17 Nov 2010 20:26:30 +0000 (20:26 +0000)]
Refactor the security drivers to simplify usage

The current security driver usage requires horrible code like

    if (driver->securityDriver &&
        driver->securityDriver->domainSetSecurityHostdevLabel &&
        driver->securityDriver->domainSetSecurityHostdevLabel(driver->securityDriver,
                                                              vm, hostdev) < 0)

This pair of checks for NULL clutters up the code, making the driver
calls 2 lines longer than they really need to be. The goal of the
patchset is to change the calling convention to simply

  if (virSecurityManagerSetHostdevLabel(driver->securityDriver,
                                        vm, hostdev) < 0)

The first check for 'driver->securityDriver' being NULL is removed
by introducing a 'no op' security driver that will always be present
if no real driver is enabled. This guarentees driver->securityDriver
!= NULL.

The second check for 'driver->securityDriver->domainSetSecurityHostdevLabel'
being non-NULL is hidden in a new abstraction called virSecurityManager.
This separates the driver callbacks, from main internal API. The addition
of a virSecurityManager object, that is separate from the virSecurityDriver
struct also allows for security drivers to carry state / configuration
information directly. Thus the DAC/Stack drivers from src/qemu which
used to pull config from 'struct qemud_driver' can now be moved into
the 'src/security' directory and store their config directly.

* src/qemu/qemu_conf.h, src/qemu/qemu_driver.c: Update to
  use new virSecurityManager APIs
* src/qemu/qemu_security_dac.c,  src/qemu/qemu_security_dac.h
  src/qemu/qemu_security_stacked.c, src/qemu/qemu_security_stacked.h:
  Move into src/security directory
* src/security/security_stack.c, src/security/security_stack.h,
  src/security/security_dac.c, src/security/security_dac.h: Generic
  versions of previous QEMU specific drivers
* src/security/security_apparmor.c, src/security/security_apparmor.h,
  src/security/security_driver.c, src/security/security_driver.h,
  src/security/security_selinux.c, src/security/security_selinux.h:
  Update to take virSecurityManagerPtr object as the first param
  in all callbacks
* src/security/security_nop.c, src/security/security_nop.h: Stub
  implementation of all security driver APIs.
* src/security/security_manager.h, src/security/security_manager.c:
  New internal API for invoking security drivers
* src/libvirt.c: Add missing debug for security APIs

14 years agoconf: Report error if invalid type specified for character device
Osier Yang [Sun, 9 Jan 2011 11:18:52 +0000 (19:18 +0800)]
conf: Report error if invalid type specified for character device

If invalid type is specified, e.g.
<serial type='foo'>
    <target port='0'/>
</serial>

We replace 'foo' with "null" type implicitly, without reporting an
error message to tell the user, and "start" or "edit" the domain
will be success.

It's not good to guess what the user wants, This patch is to fix
the problem.

* src/conf/domain_conf.c

14 years agodaemon: Fix core dumps if unix_sock_group is set
Jiri Denemark [Fri, 7 Jan 2011 11:34:12 +0000 (12:34 +0100)]
daemon: Fix core dumps if unix_sock_group is set

Setting unix_sock_group to something else than default "root" in
/etc/libvirt/libvirtd.conf prevents system libvirtd from dumping core on
crash. This is because we used setgid(unix_sock_group) before binding to
/var/run/libvirt/libvirt-sock* and setgid() back to original group.
However, if a process changes its effective or filesystem group ID, it
will be forbidden from leaving core dumps unless fs.suid_dumpable sysctl
is set to something else then 0 (and it is 0 by default).

Changing socket's group ownership after bind works better. And we can do
so without introducing a race condition since we loosen access rights by
changing the group from root to something else.

14 years agoAdd AM_MAINTAINER_MODE
Guido Günther [Fri, 7 Jan 2011 10:11:23 +0000 (11:11 +0100)]
Add AM_MAINTAINER_MODE

and keep it enabled by default. This allows downstreams to turn it off
via:

./configure --disable-maintainer-mode

as discussed in

https://www.redhat.com/archives/virt-tools-list/2010-October/msg00049.html

14 years agoesx: Move occurrence check into esxVI_LookupObjectContentByType
Matthias Bolte [Thu, 30 Dec 2010 12:30:44 +0000 (13:30 +0100)]
esx: Move occurrence check into esxVI_LookupObjectContentByType

This simplifies the callers of esxVI_LookupObjectContentByType.

14 years agoesx: Add domain autostart support
Matthias Bolte [Thu, 30 Dec 2010 00:36:31 +0000 (01:36 +0100)]
esx: Add domain autostart support

14 years agocommandtest: avoid printing loader-control variables from commandhelper
Diego Elio Pettenò [Thu, 6 Jan 2011 20:23:36 +0000 (21:23 +0100)]
commandtest: avoid printing loader-control variables from commandhelper

This avoids throwing the tests off if LD_LIBRARY_PATH or LD_PRELOAD or
other variables are set.

Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com>
14 years agodocs: updated release of virsh cmd reference, with memtune info
Justin Clift [Thu, 6 Jan 2011 18:37:23 +0000 (05:37 +1100)]
docs: updated release of virsh cmd reference, with memtune info

14 years agovmx: Add support for video device VRAM size
Matthias Bolte [Thu, 30 Dec 2010 17:08:54 +0000 (18:08 +0100)]
vmx: Add support for video device VRAM size

Update test suite accordingly.

14 years agovbox: Use correct VRAM size unit
Matthias Bolte [Thu, 30 Dec 2010 14:18:27 +0000 (15:18 +0100)]
vbox: Use correct VRAM size unit

VirtualBox uses megabyte, libvirt uses kilobyte.

14 years agoAPI: Improve log for domain related APIs
Osier Yang [Thu, 6 Jan 2011 15:43:36 +0000 (23:43 +0800)]
API: Improve log for domain related APIs

Add VM name/UUID in log for domain related APIs.
Format: "dom=%p, (VM: name=%s, uuid=%s), param0=%s, param1=%s

*src/libvirt.c (introduce two macros: VIR_DOMAIN_DEBUG, and
VIR_DOMAIN_DEBUG0)

14 years agoschema: tighten <serial><protocol type=...> relaxNG
Eric Blake [Thu, 6 Jan 2011 00:13:16 +0000 (17:13 -0700)]
schema: tighten <serial><protocol type=...> relaxNG

* docs/schemas/domain.rng (qemucdevSrcDef): Restrict list of
supported <protocol type=> values.

14 years agobridge: Fix generation of dnsmasq's --dhcp-hostsfile option
Kay Schubert [Thu, 6 Jan 2011 08:14:58 +0000 (09:14 +0100)]
bridge: Fix generation of dnsmasq's --dhcp-hostsfile option

I added a host definition to a network definition:

<network>
  <name>Lokal</name>
  <uuid>2074f379-b82c-423f-9ada-305d8088daaa</uuid>
  <bridge name='virbr1' stp='on' delay='0' />
  <ip address='192.168.180.1' netmask='255.255.255.0'>
    <dhcp>
      <range start='192.168.180.128' end='192.168.180.254' />
      <host mac='23:74:00:03:42:02' name='somevm' ip='192.168.180.10' />
    </dhcp>
  </ip>
</network>

But due to the wrong if-statement the argument --dhcp-hostsfile doesn't get
added to the dnsmasq command. The patch below fixes it for me.

14 years agoqemu: Fix bogus warning about uninitialized saveptr
Jiri Denemark [Wed, 5 Jan 2011 15:04:58 +0000 (16:04 +0100)]
qemu: Fix bogus warning about uninitialized saveptr

The warning is bogus since strtok_r doesn't use the value when it's
first called and initializes it for the following calls.

14 years agoDon't chown qemu saved image back to root after save if dynamic_ownership=0
Laine Stump [Wed, 5 Jan 2011 21:53:03 +0000 (16:53 -0500)]
Don't chown qemu saved image back to root after save if dynamic_ownership=0

When dynamic_ownership=0, saved images must be owned by the same uid
as is used to run the qemu process, otherwise restore won't work. To
accomplish this, qemuSecurityDACRestoreSavedStateLabel() needs to
simply return when it's called.

This fix is in response to:

  https://bugzilla.redhat.com/show_bug.cgi?id=661720

14 years agomaint: document dislike of mismatched if/else bracing
Eric Blake [Wed, 5 Jan 2011 17:58:35 +0000 (10:58 -0700)]
maint: document dislike of mismatched if/else bracing

* docs/hacking.html.in (Curly braces): Tighten recommendations to
disallow if (cond) one-line; else { block; }.
* HACKING: Regenerate.
Suggested by Daniel P. Berrange.

14 years agoLog an error on attempts to add a NAT rule for non-IPv4 addresses
Laine Stump [Tue, 4 Jan 2011 17:31:40 +0000 (12:31 -0500)]
Log an error on attempts to add a NAT rule for non-IPv4 addresses

Although the upper-layer code protected against it, it was possible to
call iptablesForwardMasquerade() with an IPv6 address and have it
attempt to add a rule to the MASQUERADE chain of ip6tables (which
doesn't exist).

This patch changes that function to check the protocol of the given
address, generate an error log if it's not IPv4 (AF_INET), and finally
hardcodes all the family parameters sent down to lower-level functions.

14 years agoImprove error reporting when parsing dhcp info for virtual networks
Laine Stump [Mon, 3 Jan 2011 21:47:17 +0000 (16:47 -0500)]
Improve error reporting when parsing dhcp info for virtual networks

This is partially in response to

  https://bugzilla.redhat.com/show_bug.cgi?id=653300

The crash in that report was coincidentally fixed when we switched
from using inet_pton() to using virSocketParseAddr(), but the absence
of an ip address in a dhcp static host definition was still silently
ignored (and that entry discarded from the saved XML). This patch
turns that into a logged failure; likewise if the entry has neither a
mac address nor a name attribute (the entry is useless without at
least one of those, plus an ip address).

Since the network name is now pulled into this function in order for
those error logs to be more informative, the other error messages in
the function have also been changed to take advantage.

14 years agodocs: added libvirt-announce to contact page
Justin Clift [Tue, 4 Jan 2011 19:10:32 +0000 (06:10 +1100)]
docs: added libvirt-announce to contact page

Also added explicit links to the subscription and
archive pages for the user and developer mailing
lists.

14 years agoqemu driver: fix positioning to end of log file
Stefan Berger [Tue, 4 Jan 2011 17:46:10 +0000 (12:46 -0500)]
qemu driver: fix positioning to end of log file

While doing some testing with Qemu and creating huge logfiles I encountered the case where the VM could not start anymore due to the lseek() to the end of the Qemu VM's log file failing. The patch below fixes the problem by replacing the previously used 'int' with 'off_t'.

To reproduce this error, you could do the following:

dd if=/dev/zero of=/var/log/libvirt/qemu/<name of VM>.log bs=1024 count=$((1024*2048))

and you should get an error like this:

error: Failed to start domain <name of VM>
error: Unable to seek to -2147482651 in /var/log/libvirt/qemu/<name of VM>.log: Success

14 years agobuild: satisfy 'make syntax-check' regarding year change
Eric Blake [Mon, 3 Jan 2011 15:52:44 +0000 (08:52 -0700)]
build: satisfy 'make syntax-check' regarding year change

* .gnulib: Update to latest, to pick up 2011 copyrights.

14 years agoRelease of libvirt-0.8.7
Daniel Veillard [Tue, 4 Jan 2011 02:37:17 +0000 (03:37 +0100)]
Release of libvirt-0.8.7

* configure.ac libvirt.spec.in docs/news.html.in: bump version and add
  documentation
* po/*po*: regenerate po and pot files

14 years agobuild: avoid compilation warnings
Eric Blake [Mon, 3 Jan 2011 22:26:33 +0000 (15:26 -0700)]
build: avoid compilation warnings

Detected on cygwin:
util/util.c: In function 'virSetUIDGID':
util/util.c:2824: warning: format '%d' expects type 'int', but argument 7 has type 'gid_t' [-Wformat]
(and three other lines)

* src/util/util.c (virSetUIDGID): Cast, as is done elsewhere in
this file, to avoid printf type mismatch warnings.

14 years agothreadpool: allow NULL jobdata
Hu Tao [Mon, 27 Dec 2010 06:29:34 +0000 (14:29 +0800)]
threadpool: allow NULL jobdata

Don't require non-null jobdata to virThreadPoolSendJob().

14 years agonode_device: udev driver does not handle SR-IOV devices
Chris Wright [Fri, 24 Dec 2010 18:41:52 +0000 (10:41 -0800)]
node_device: udev driver does not handle SR-IOV devices

The udev driver does not update a PCI device with its SR-IOV capabilities,
when applicable, the way the hal driver does.  As a result, dumping the
device's XML will not include the relevant physical or virtual function
information.

With this patch, the XML is correct:

# virsh nodedev-dumpxml pci_0000_09_00_0
<device>
  <name>pci_0000_09_00_0</name>
  <parent>pci_0000_00_1c_0</parent>
  <driver>
    <name>vxge</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>9</bus>
    <slot>0</slot>
    <function>0</function>
    <product id='0x5833'>X3100 Series 10 Gigabit Ethernet PCIe</product>
    <vendor id='0x17d5'>Neterion Inc.</vendor>
    <capability type='virt_functions'>
      <address domain='0x0000' bus='0x0a' slot='0x00' function='0x1'/>
      <address domain='0x0000' bus='0x0a' slot='0x00' function='0x2'/>
      <address domain='0x0000' bus='0x0a' slot='0x00' function='0x3'/>
    </capability>
  </capability>
</device>

# virsh nodedev-dumpxml pci_0000_0a_00_1
<device>
  <name>pci_0000_0a_00_1</name>
  <parent>pci_0000_00_1c_0</parent>
  <driver>
    <name>vxge</name>
  </driver>
  <capability type='pci'>
    <domain>0</domain>
    <bus>10</bus>
    <slot>0</slot>
    <function>1</function>
    <product id='0x5833'>X3100 Series 10 Gigabit Ethernet PCIe</product>
    <vendor id='0x17d5'>Neterion Inc.</vendor>
    <capability type='phys_function'>
      <address domain='0x0000' bus='0x09' slot='0x00' function='0x0'/>
    </capability>
  </capability>
</device>

Cc: Dave Allan <dallan@redhat.com>
Signed-off-by: Chris Wright <chrisw@redhat.com>
14 years agovirExec: fix logic bug
Eric Blake [Fri, 24 Dec 2010 15:40:42 +0000 (08:40 -0700)]
virExec: fix logic bug

As pointed out in https://bugzilla.redhat.com/show_bug.cgi?id=659855#c9,
commit c3568ec2 introduced a regression where we no longer close any
fd's beyond FD_SETSIZE.

* src/util/util.c (__virExec): Continue to close fd's beyond
keepfd range.
Reported by Stefan Praszalowicz.