]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
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.

14 years agoImprove virSocketAddrMask[ByPrefix] API
Laine Stump [Fri, 31 Dec 2010 11:20:43 +0000 (06:20 -0500)]
Improve virSocketAddrMask[ByPrefix] API

The original version of these functions would modify the address sent
in, meaning that the caller would usually need to copy the address
first. This change makes the original a const, and puts the resulting
masked address into a new arg (which could point to the same
virSocketAddr as the original, if the caller really wants to modify
it).

This also makes the API consistent with virSocketAddrBroadcast[ByPrefix].

14 years agoSet broadcast address for IPv4 addresses on virtual network bridges
Laine Stump [Fri, 31 Dec 2010 08:57:37 +0000 (03:57 -0500)]
Set broadcast address for IPv4 addresses on virtual network bridges

Previously we used ioctl() to set the IP address and netmask of the
bridges used for virtual networks, and apparently the SIOCSIFNETMASK
ioctl implicitly set the broadcast address for the interface. The new
method of using the "ip" command requires broadcast address to be
explicitly specified though.

14 years agoUtility functions to produce an IPv4 broadcast address
Laine Stump [Fri, 31 Dec 2010 02:33:24 +0000 (21:33 -0500)]
Utility functions to produce an IPv4 broadcast address

These functions work only for IPv4, becasue IPv6 doesn't have the same
concept of "broadcast address" as IPv4. They merely OR the inverse of
the netmask with the given host address, thus turning on all the host
bits.

14 years agoesx: Fix "occurence" typo (again)
Matthias Bolte [Thu, 30 Dec 2010 11:54:20 +0000 (12:54 +0100)]
esx: Fix "occurence" typo (again)

Also include some whitespace changes. No functional change included.

14 years agovbox: Add support for VirtualBox 4.0
Matthias Bolte [Mon, 27 Dec 2010 22:35:30 +0000 (23:35 +0100)]
vbox: Add support for VirtualBox 4.0

Add vboxArrayGetWithUintArg to handle new signature variations. Also
refactor vboxArrayGet* implementation to use a common helper function.

Deal with the incompatible changes in the VirtualBox 4.0 API. This
includes major changes in virtual machine and storage medium lookup,
in RDP server property handling, in session/lock handling and other
minor areas.

VirtualBox 4.0 also dropped the old event API and replaced it with a
completely new one. This is not fixed yet and will be addressed in
another patch. Therefore, currently the domain events are supported
for VirtualBox 3.x only.

Based on initial work from Jean-Baptiste Rouault.

14 years agoFix misuse of VIR_ERR_INVALID_DOMAIN
Matthias Bolte [Thu, 23 Dec 2010 22:21:27 +0000 (23:21 +0100)]
Fix misuse of VIR_ERR_INVALID_DOMAIN

VIR_ERR_INVALID_DOMAIN is meant for invalid domain pointers.
VIR_ERR_NO_DOMAIN is meant for non-existing domains.

14 years agovbox: Handle different IID representation in Version 2.2 on Windows
Matthias Bolte [Thu, 23 Dec 2010 16:25:56 +0000 (17:25 +0100)]
vbox: Handle different IID representation in Version 2.2 on Windows

On Windows IID's are represented as GUID by value, instead of nsID
by reference on non-Windows platforms.

Patch the vbox_CAPI_v2_2.h header to deal with this difference.

Rewrite vboxIID abstraction that deals with the different IID
representations. Add support for the GUID representation. Also unify
the four context dependent free functions for vboxIIDs

  vboxIIDUnalloc, vboxIIDFree, vboxIIDUtf8Free, vboxIIDUtf16Free

into vboxIIDUnalloc that is now safe to be called (even multiple
times) on a vboxIID independent of the source and context of the
vboxIID.

The new vboxIID is designed to be used as a stack allocated variable.
It has a value member that represents the actual IID value.

14 years agoupdate docs for network disks
MORITA Kazutaka [Fri, 24 Dec 2010 11:41:47 +0000 (20:41 +0900)]
update docs for network disks

Signed-off-by: MORITA Kazutaka <morita.kazutaka@lab.ntt.co.jp>
14 years agobuild: fix building error when building without libvirtd
Wen Congyang [Fri, 24 Dec 2010 06:21:48 +0000 (14:21 +0800)]
build: fix building error when building without libvirtd

When I build libvirt without libvirtd, I receive some errors:
cp: cannot stat `/home/wency/rpmbuild/BUILDROOT/libvirt-0.8.6-1.el6.x86_64/etc/libvirt/qemu/networks/default.xml': No such file or directory

My build step:
# ./autogen.sh --without-libvirtd
# make dist
# rpmbuild --nodeps --define "_sourcedir `pwd`" --define "_without_libvirtd 1" -ba libvirt.spec

The reason is we disable network when we do not build libvirt daemon in configure.ac.
After fixing this bug, I build libvirt without libvirtd, I receive other errors:
RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/share/doc/libvirt-0.8.6/html/32favicon.png
   /usr/share/doc/libvirt-0.8.6/html/api.html
..

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
14 years agoqemu: add -incoming fd:n capability checking
Eric Blake [Wed, 22 Dec 2010 22:13:06 +0000 (15:13 -0700)]
qemu: add -incoming fd:n capability checking

* src/qemu/qemu_capabilities.h (QEMUD_CMD_FLAG_MIGRATE_QEMU_FD):
New enum value.
* src/qemu/qemu_capabilities.c (qemuCapsComputeCmdFlags): Populate
flags according to qemu version.
* tests/qemuhelptest.c (mymain): Adjust test.

14 years agospec: Enable ESX driver on RHEL
Jiri Denemark [Thu, 23 Dec 2010 08:48:14 +0000 (09:48 +0100)]
spec: Enable ESX driver on RHEL

14 years agospec: Automatically turn on cgconfig service
Daniel P. Berrange [Thu, 23 Dec 2010 08:44:19 +0000 (09:44 +0100)]
spec: Automatically turn on cgconfig service

A number of the libvirt APIs require the use of cgroups. This is not
enabled by default on a RHEL6 install. After discussion with cgroups
team, it was decided that upon installation of the libvirt RPM, we
should automatically turn on the cgroups service. This will activate a
default configuration that turns on all cgroups controllers libvirt
requires for full operation.

14 years agobridge: Fix uninitialized variable
Jiri Denemark [Thu, 23 Dec 2010 22:03:56 +0000 (23:03 +0100)]
bridge: Fix uninitialized variable

14 years agoReplace setuid/setgid/initgroups with virSetUIDGID()
Laine Stump [Tue, 21 Dec 2010 20:34:41 +0000 (15:34 -0500)]
Replace setuid/setgid/initgroups with virSetUIDGID()

This patch fixes https://bugzilla.redhat.com/show_bug.cgi?id=664406

If qemu is run as a different uid, it has been unable to access mode
0660 files that are owned by a different user, but with a group that
the qemu is a member of (aside from the one group listed in the passwd
file), because initgroups() is not being called prior to the
exec. initgroups will change the group membership of the process (and
its children) to match the new uid.

To make this happen, the setregid()/setreuid() code in
qemuSecurityDACSetProcessLabel has been replaced with a call to
virSetUIDGID(), which does both of those, plus calls initgroups.

Similar, but not identical, code in qemudOpenAsUID() has been replaced
with virSetUIDGID(). This not only consolidates the functionality to a
single location, but also potentially fixes some as-yet unreported
bugs.

14 years agonew virSetUIDGID() utility function
Laine Stump [Thu, 23 Dec 2010 06:44:02 +0000 (01:44 -0500)]
new virSetUIDGID() utility function

virSetUIDGID() sets both the real and effective group and user of the
process, and additionally calls initgroups() to assure that the
process joins all the auxiliary groups that the given uid is a member
of.

14 years agoPreserve errno across calls to error reporting functions & VIR_FREE
Laine Stump [Thu, 23 Dec 2010 18:23:42 +0000 (13:23 -0500)]
Preserve errno across calls to error reporting functions & VIR_FREE

There are cases when we want log an error message, and possibly free
some memory as part of the cleanup, while still preserving errno for a
caller, but the functions that log errors, and virFree (VIR_FREE) make
system calls that will clear errno. This patch preserves errno during
those most basic functions (corresponding to virReportSystemError(),
virReportOOMError(), networkReportError(), etc, as well as
virStrError()). It does *not preserve errno across calls to higher
level items such as virDispatchError(), as it's assumed the caller is
all finished with any need for errno by the time it dispatches the
error.

14 years agoRun radvd for virtual networks with IPv6 addresses
Laine Stump [Mon, 20 Dec 2010 06:14:11 +0000 (01:14 -0500)]
Run radvd for virtual networks with IPv6 addresses

Running an instance of the router advertisement daemon (radvd) allows
guests using the virtual network to automatically acquire an IPv6
address and default route. Note that acquiring an address only works
for networks with a prefix length of exactly 64 - radvd is still run
in other circumstances, and still advertises routes, but autoconf will
not work because it requires exactly 64 bits of address info from the
network prefix.

This patch avoids a race condition with the pidfile by manually
daemonizing radvd rather than allowing it to daemonize itself, then
creating our own pidfile (in addition to radvd's own file, which is
unnecessary, but there is no way to tell radvd to not create it). This
is accomplished by exec'ing it with "--debug 1" in the commandline,
and using virCommand's features to fork, create a pidfile, and detach
from the newly forked process.

14 years agoTurn on IPv6 support in the bridge_driver.c virtual network driver
Laine Stump [Thu, 16 Dec 2010 20:50:01 +0000 (15:50 -0500)]
Turn on IPv6 support in the bridge_driver.c virtual network driver

At this point everything is already in place to make IPv6 happen, we just
need to add a few rules, remove some checks for IPv4-only, and document
the changes to the XML on the website.

14 years agoUpdate iptables.c to also support ip6tables.
Laine Stump [Wed, 8 Dec 2010 19:09:25 +0000 (14:09 -0500)]
Update iptables.c to also support ip6tables.

All of the iptables functions eventually call down to a single
bottom-level function, and fortunately, ip6tables syntax (for all the
args that we use) is identical to iptables format (except the
addresses), so all we need to do is:

1) Get an address family down to the lowest level function in each
   case, either implied through an address, or explicitly when no
   address is in the parameter list, and

2) At the lowest level, just decide whether to call "iptables" or
   "ip6tables" based on the family.

The location of the ip6tables binary is determined at build time by
autoconf. If a particular target system happens to not have ip6tables
installed, any attempts to run it will generate an error, but that
won't happen unless someone tries to define an IPv6 address for a
network. This is identical behavior to IPv4 addresses and iptables.

14 years agoSupport multiple IP addresses on one network in bridge_driver.c
Laine Stump [Fri, 10 Dec 2010 21:04:37 +0000 (16:04 -0500)]
Support multiple IP addresses on one network in bridge_driver.c

This patch reorganizes the code in bridge_driver.c to account for the
concept of a single network with multiple IP addresses, without adding
in the extra variable of IPv6. A small bit of code has been
temporarily added that checks all given addresses to verify they are
IPv4 - this will be removed when full IPv6 support is turned on.

14 years agoChange virtual network XML parsing/formatting to support IPv6
Laine Stump [Wed, 17 Nov 2010 18:36:19 +0000 (13:36 -0500)]
Change virtual network XML parsing/formatting to support IPv6

This commit adds support for IPv6 parsing and formatting to the
virtual network XML parser, including moving around data definitions
to allow for multiple <ip> elements on a single network, but only
changes the consumers of this API to accommodate for the changes in
API/structure, not to add any actual IPv6 functionality. That will
come in a later patch - this patch attempts to maintain the same final
functionality in both drivers that use the network XML parser - vbox
and "bridge" (the Linux bridge-based driver used by the qemu
hypervisor driver).

* src/libvirt_private.syms: Add new private API functions.
* src/conf/network_conf.[ch]: Change C data structure and
  parsing/formatting.
* src/network/bridge_driver.c: Update to use new parser/formatter.
* src/vbox/vbox_tmpl.c: update to use new parser/formatter
* docs/schemas/network.rng: changes to the schema -
  * there can now be more than one <ip> element.
  * ip address is now an ip-addr (ipv4 or ipv6) rather than ipv4-addr
  * new optional "prefix" attribute that can be used in place of "netmask"
  * new optional "family" attribute - "ipv4" or "ipv6"
    (will default to ipv4)
  * define data types for the above
* tests/networkxml2xml(in|out)/nat-network.xml: add multiple <ip> elements
  (including IPv6) to a single network definition to verify they are being
  correctly parsed and formatted.

14 years agomake the <dhcp> element optional in network.rng
Laine Stump [Thu, 16 Dec 2010 17:36:19 +0000 (12:36 -0500)]
make the <dhcp> element optional in network.rng

In practice this has always been optional, but the RNG has shown it as
mandatory, and since all the examples for make check had it, it was
never noticed. One of the existing test cases has been changed to
check for this.

I also noticed that the dhcp/host/ip was still defined as <text/>,
but should really be <ref name='ipv4-addr'/>

14 years agoReplace brSetInetAddress/brSetInetNetmask with brAddInetAddress
Laine Stump [Tue, 14 Dec 2010 17:14:39 +0000 (12:14 -0500)]
Replace brSetInetAddress/brSetInetNetmask with brAddInetAddress

brSetInetAddress can only set a single IP address on the bridge, and
uses a method (ioctl(SIOCSETIFADDR)) that only works for IPv4. Replace
it and brSetInetNetmask with a single function that uses the external
"ip addr add" command to add an address/prefix to the interface - this
supports IPv6, and allows adding multiple addresses to the interface.

Although it isn't currently used in the code, we also add a
brDelInetAddress for completeness' sake.

Also, while we're modifying bridge.c, we change brSetForwardDelay and
brSetEnableSTP to use the new virCommand API rather than the
deprecated virRun, and also log an error message in bridge_driver.c if
either of those fail (previously the failure would be completely
silent).

14 years agoMake virtual network netmasks optional
Laine Stump [Tue, 30 Nov 2010 20:53:17 +0000 (15:53 -0500)]
Make virtual network netmasks optional

When a netmask isn't specified for an IPv4 address, one can be implied
based on what network class range the address is in. The
virNetworkDefPrefix function does this for us, so netmask isn't
required.

14 years agoPass prefix rather than netmask into iptables functions
Laine Stump [Tue, 30 Nov 2010 19:35:58 +0000 (14:35 -0500)]
Pass prefix rather than netmask into iptables functions

IPv6 will use prefix exclusively, and IPv4 will also optionally be
able to use it, and the iptables functions really need a prefix
anyway, so use the new virNetworkDefPrefix() function to send prefixes
into iptables functions instead of netmasks.

Also, in a couple places where a netmask is actually needed, use the
new private API function for it rather than getting it directly. This
will allow for cases where no netmask or prefix is specified (it
returns the default for the current class of network.)

14 years agoConsistently return 0 on success, -1 on failure in bridge_driver.c
Laine Stump [Wed, 15 Dec 2010 06:49:29 +0000 (01:49 -0500)]
Consistently return 0 on success, -1 on failure in bridge_driver.c

Some functions in this file were returning 1 on success and 0 on
failure, and others were returning 0 on success and -1 on
failure. Switch them all to return the libvirt-preferred 0/-1.

14 years agoFix logging of failed iptables commands
Laine Stump [Tue, 14 Dec 2010 20:01:10 +0000 (15:01 -0500)]
Fix logging of failed iptables commands

The functions in iptables.c all return -1 on failure, but all their
callers (which all happen to be in bridge_driver.c) assume that they
are returning an errno, and the logging is done accordingly. This
patch fixes all the error checking and logging to assume < 0 is an
error, and nothing else.

14 years agoNew virNetworkDef utility functions
Laine Stump [Fri, 26 Nov 2010 22:20:37 +0000 (17:20 -0500)]
New virNetworkDef utility functions

Later patches will add the possibility to define a network's netmask
as a prefix (0-32, or 0-128 in the case of IPv6). To make it easier to
deal with definition of both kinds (prefix or netmask), add two new
functions:

virNetworkDefNetmask: return a copy of the netmask into a
virSocketAddr. If no netmask was specified in the XML, create a
default netmask based on the network class of the virNetworkDef's IP
address.

virNetworkDefPrefix: return the netmask as numeric prefix (or the
default prefix for the network class of the virNetworkDef's IP
address, if no netmask was specified in the XML)

14 years agoNew virSocketAddr utility functions
Laine Stump [Fri, 26 Nov 2010 18:51:44 +0000 (13:51 -0500)]
New virSocketAddr utility functions

virSocketPrefixToNetmask: Given a 'prefix', which is the number of 1
bits in a netmask, fill in a virSocketAddr object with a netmask as an
IP address (IPv6 or IPv4).

virSocketAddrMask: Mask off the host bits in one virSocketAddr
according to the netmask in another virSocketAddr.

virSocketAddrMaskByPrefix, Mask off the host bits in a virSocketAddr
according to a prefix (number of 1 bits in netmask).

VIR_SOCKET_FAMILY: return the family of a virSocketAddr

14 years agofix syntax error in configure.ac
Wen Congyang [Thu, 23 Dec 2010 09:32:33 +0000 (17:32 +0800)]
fix syntax error in configure.ac

When I run configure, I receive some syntax error.

.....
checking where to find <rpc/rpc.h>... none
checking for library containing dlopen... -ldl
/configure: line 52500: test: =: unary operator expected
/configure: line 52766: test: =: unary operator expected
checking linux/kvm.h usability... yes
checking linux/kvm.h presence... yes
.....

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
14 years agodocs: Make VMware Workstation / Player page appear in the menu
Matthias Bolte [Thu, 23 Dec 2010 15:56:11 +0000 (16:56 +0100)]
docs: Make VMware Workstation / Player page appear in the menu

By adding it to sitemap.html.in. Also <ul> can't be nested in <p>.

14 years agoqemu: Reparent children when deleting a snapshot
Matthias Bolte [Wed, 22 Dec 2010 20:44:42 +0000 (21:44 +0100)]
qemu: Reparent children when deleting a snapshot

Shorten qemuDomainSnapshotWriteSnapshotMetadata function name
and make it take a snapshot pointer instead of dealing with
the current snapshot. Update other functions accordingly.

Add a qemuDomainSnapshotReparentChildren hash iterator to
reparent the children of a snapshot that is being deleted. Use
qemuDomainSnapshotWriteMetadata to write updated metadata
to disk.

This fixes a problem where outdated parent information breaks
the snapshot tree and hinders the deletion of child snapshots.

Reported by Philipp Hahn.

14 years agoAdd info about VMware driver to the libvirt website
Jean-Baptiste Rouault [Thu, 23 Dec 2010 08:35:51 +0000 (09:35 +0100)]
Add info about VMware driver to the libvirt website

14 years agovirsh: Add --force option to update-device
Jiri Denemark [Wed, 22 Dec 2010 16:01:53 +0000 (17:01 +0100)]
virsh: Add --force option to update-device

14 years agoSet bitmap size when allocating a bitmap
Jim Fehlig [Wed, 22 Dec 2010 18:15:32 +0000 (11:15 -0700)]
Set bitmap size when allocating a bitmap

I began noticing a race when reserving VNC ports as described here

https://www.redhat.com/archives/libvir-list/2010-November/msg00379.html

Turns out that we were not initializing the size field of bitmap
struct when allocating the bitmap.  This subsequently caused
virBitmapSetBit() to fail since bitmap->size is 0, hence we never
actually reserved the port.

14 years agoesx: Add support for storage volume wiping
Matthias Bolte [Wed, 22 Dec 2010 16:24:45 +0000 (17:24 +0100)]
esx: Add support for storage volume wiping

14 years agoesx: Add support for storage volume deletion
Matthias Bolte [Wed, 22 Dec 2010 15:45:50 +0000 (16:45 +0100)]
esx: Add support for storage volume deletion

14 years agoqemu: Return SPICE ports on domain shutdown
Jiri Denemark [Wed, 22 Dec 2010 13:33:49 +0000 (14:33 +0100)]
qemu: Return SPICE ports on domain shutdown

Commit ed0d9f6c0cdd56f38ce31b8d9b5293162addaa23 added support for
automatic port allocation for SPICE but forgot to mark such ports as
unused when they are not used anymore.

14 years agovirterror: avoid API breakage with vmware
Eric Blake [Tue, 21 Dec 2010 22:06:27 +0000 (15:06 -0700)]
virterror: avoid API breakage with vmware

Fix glitch in commit cddd2a06 (thankfully post-0.8.6, so no
released version has the glitch).

Document and try to workaround glitch in commit 46e9b0f (in 0.8.0),
which invalidated 6 virErrorNumber values dating as far back as 0.7.1.

My audit did not find any other glitches until pre-0.1.0 days.  I'm
not sure how to add a syntax-check off the top of my head, but
hopefully the explicit numbering will make people think twice about
renumbering in the future.

* include/libvirt/virterror.h (virErrorDomain): Avoid inserting
new values in the middle, and add explicit numbering to help avoid
this in the future.
(virErrorNumber): Add explicit numbering, and document the snafu.
* src/remote/remote_driver.c (remoteIO): Compensate for the snafu.

14 years agoFix memory leak in virsh
Hu Tao [Wed, 22 Dec 2010 07:12:34 +0000 (15:12 +0800)]
Fix memory leak in virsh

14 years agodocs: fixed typo, added table of contents
Justin Clift [Wed, 22 Dec 2010 12:48:25 +0000 (23:48 +1100)]
docs: fixed typo, added table of contents

14 years agoDistribute libvirt_vmx.syms
Matthias Bolte [Tue, 21 Dec 2010 23:48:11 +0000 (00:48 +0100)]
Distribute libvirt_vmx.syms

This fixes the build from a tarball and makes autobuild.sh
work again.

This should actually have been part of this earlier commit:

  esx: Move VMX handling code out of the driver directory
  42b2f35d36a9e33f03e973130267c19cff910f2e

Reported by Eric Blake.

14 years agovmware: Fix undefine symbol with loadable drivers enabled
Matthias Bolte [Tue, 21 Dec 2010 21:47:35 +0000 (22:47 +0100)]
vmware: Fix undefine symbol with loadable drivers enabled

All other drivers are explicitly linked to gnulib. The VMware
driver lacked this, resulting in mdir_name being an undefine
symbol.

Explicitly link the VMware driver to gnulib to fix this.

14 years agoesx: Move VMX handling code out of the driver directory
Matthias Bolte [Tue, 21 Dec 2010 21:39:55 +0000 (22:39 +0100)]
esx: Move VMX handling code out of the driver directory

Now the VMware driver doesn't depend on the ESX driver anymore.

Add a WITH_VMX option that depends on WITH_ESX and WITH_VMWARE.
Also add a libvirt_vmx.syms file.

Move some escaping functions from esx_util.c to vmx.c.

Adapt the test suite, ESX and VMware driver to the new code layout.

14 years agoesx: Fix cluster resource lookup when connecting to a vCenter
Matthias Bolte [Mon, 20 Dec 2010 18:16:05 +0000 (19:16 +0100)]
esx: Fix cluster resource lookup when connecting to a vCenter

Connecting to a ESX(i) server that is part of a cluster failed
when the connection also involved a vCenter.

Accept ClusterComputeResource type in addition to ComputeResource
type in the object lookup function.

Reported by Guillaume Le Louët.

14 years agomaint: avoid space-tab
Eric Blake [Tue, 21 Dec 2010 15:58:03 +0000 (08:58 -0700)]
maint: avoid space-tab

* daemon/Makefile.am: Avoid spurious space before tabs.
* src/Makefile.am: Likewise.
* examples/dominfo/Makefile.am: Likewise.
* examples/domsuspend/Makefile.am: Likewise.
* tools/Makefile.am: Likewise.
* src/datatypes.h (VIR_CONNECT_MAGIC): Likewise.
* src/internal.h (TODO): Likewise.
* src/qemu/qemu_monitor.h (QEMU_MONITOR_MIGRATE): Likewise.
* src/xen/xen_hypervisor.c (XEN_V2_OP_GETAVAILHEAP): Likewise.
* src/xen/xs_internal.h: Likewise.

14 years agocommand: avoid hanging on daemon processes
Eric Blake [Tue, 21 Dec 2010 18:49:49 +0000 (11:49 -0700)]
command: avoid hanging on daemon processes

* src/util/command.c (virCommandRun): Don't capture output on
daemons.
* tests/commandtest.c (test18): Expose the bug.
Reported by Laine Stump.

14 years agobuild: skip vmware driver when building for RHEL
Eric Blake [Tue, 21 Dec 2010 17:13:50 +0000 (10:13 -0700)]
build: skip vmware driver when building for RHEL

* libvirt.spec.in: Provide vmware conditionals.

14 years agostorage: Ignore dangling symbolic link for filesystem pool
Osier Yang [Tue, 21 Dec 2010 06:45:24 +0000 (14:45 +0800)]
storage: Ignore dangling symbolic link for filesystem pool

If there is a dangling symbolic link in filesystem pool, the pool
will fail to start or refresh, this patch is to fix it by ignoring
it with a warning log.

14 years agoSkip file-based security checks for network disks
Josh Durgin [Tue, 21 Dec 2010 02:30:58 +0000 (18:30 -0800)]
Skip file-based security checks for network disks

Network disks are accessed by qemu directly, and have no
associated file on the host, so checking for file ownership etc.
is unnecessary.

Signed-off-by: Josh Durgin <joshd@hq.newdream.net>
14 years agodocs: added compiling page and significantly expanded windows page
Justin Clift [Tue, 21 Dec 2010 09:38:37 +0000 (20:38 +1100)]
docs: added compiling page and significantly expanded windows page

Also added an additional menu placement for the windows page, in
order to attract further potential testers.

14 years agobuild: make building on cygwin easier
Eric Blake [Wed, 8 Dec 2010 03:35:08 +0000 (20:35 -0700)]
build: make building on cygwin easier

* configure.ac (dlopen): Cygwin dlopen is in libc; avoid spurious
failure.
(XDR_CFLAGS): Define when needed.
* src/Makefile.am (libvirt_driver_remote_la_CFLAGS): Use it.

14 years agoqemu: use virAsprintf instead of PATH_MAX
Eric Blake [Wed, 8 Dec 2010 18:36:08 +0000 (11:36 -0700)]
qemu: use virAsprintf instead of PATH_MAX

* src/qemu/qemu_driver.c (qemudLogFD, qemudLogReadFD)
(qemudStartup, qemudGetProcessInfo): Use heap instead of stack.

14 years agotests: avoid spurious failure of nodeinfotest
Eric Blake [Wed, 15 Dec 2010 20:49:00 +0000 (13:49 -0700)]
tests: avoid spurious failure of nodeinfotest

When running 'make check' under a multi-cpu Dom0 xen machine,
nodeinfotest had a spurious failure it was reading from
/sys/devices/system/cpu, but xen has no notion of topology.  The test
was intended to be isolated from reading any real system files; the
regression was introduced in Mar 2010 with commit aa2f6f96dd.

Fix things by allowing an early exit for the testsuite.

* src/nodeinfo.c (linuxNodeInfoCPUPopulate): Add parameter.
(nodeGetInfo): Adjust caller.
* tests/nodeinfotest.c (linuxTestCompareFiles): Likewise.