]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
14 years agoxen: Fix virDomain{At,De}tachDevice
Jiri Denemark [Fri, 1 Oct 2010 14:45:55 +0000 (16:45 +0200)]
xen: Fix virDomain{At,De}tachDevice

According to API documentation virDomain{At,De}tachDevice calls are
supposed to only work on active guests for device hotplug. For anything
beyond that, their *Flags variants have to be used.

Despite the variant which was acked on libvirt mailing list
(https://www.redhat.com/archives/libvir-list/2010-January/msg00385.html)
commit ed9c14a7ef86d7a45a6d57cbfee5410fca428633 (by Jim Fehlig)
introduced automagic behavior of these API calls for xen driver. Since
January, these calls always change persistent configuration of a guest
and if the guest is currently active, they also hot(un)plug the device.

That change didn't follow API documentation and also broke device
hot(un)plug for older xend implementations which do not support changing
persistent configuration of a guest and hot(un)plugging in one step.

This patch should not break anything for active guests. On the other
hand, changing inactive guests is not supported any more.

14 years agoxen: xenXMDomain*DeviceFlags should obey all flags
Jiri Denemark [Fri, 1 Oct 2010 14:37:53 +0000 (16:37 +0200)]
xen: xenXMDomain*DeviceFlags should obey all flags

xenXMDomain*DeviceFlags() silently ignores requests to modify live
configuration of an active guest while still touching its persistent
configuration.

14 years agoxen: Fix logic bug in xenDaemon*DeviceFlags
Jiri Denemark [Fri, 1 Oct 2010 14:31:04 +0000 (16:31 +0200)]
xen: Fix logic bug in xenDaemon*DeviceFlags

14 years agoxen: Make xenDaemon*DeviceFlags errors less confusing
Jiri Denemark [Fri, 1 Oct 2010 14:22:29 +0000 (16:22 +0200)]
xen: Make xenDaemon*DeviceFlags errors less confusing

When a user calls to virDomain{Attach,Detach,Update}DeviceFlags() with
flags == VIR_DOMAIN_DEVICE_MODIFY_LIVE on an inactive guest running on
an old Xen hypervisor (such as RHEL-5) xend_internal driver reports:

    Xend version does not support modifying persistent config

which is pretty confusing since no-one requested to modify persistent
config.

14 years agoReturn a suitable error message if we can't find a matching emulator
Guido Günther [Fri, 8 Oct 2010 12:16:46 +0000 (14:16 +0200)]
Return a suitable error message if we can't find a matching emulator

14 years agoPass -n to ip(6)tables
Guido Günther [Fri, 8 Oct 2010 14:35:03 +0000 (16:35 +0200)]
Pass -n to ip(6)tables

to avoid long timeouts waiting for DNS servers

14 years agonwfilter: Add 2nd example to the html docs
Stefan Berger [Thu, 7 Oct 2010 10:50:26 +0000 (06:50 -0400)]
nwfilter: Add 2nd example to the html docs

This patch adds another example to the nwfilter html page and provides 2 solutions for how to write a filter meeting the given requirements using newly added features.

14 years agonwfilter: Extend docs with info about the state attribute
Stefan Berger [Thu, 7 Oct 2010 10:45:46 +0000 (06:45 -0400)]
nwfilter: Extend docs with info about the state attribute

I am adding a row with information about the newly supported state
attribute to each of the tables describing supported attributes of protocols.

14 years agonwfilter: Extend schema to accept state attribute
Stefan Berger [Thu, 7 Oct 2010 10:44:41 +0000 (06:44 -0400)]
nwfilter: Extend schema to accept state attribute

Extend the nwfilter.rng schema to accept state attribute.

14 years agonwfilter: Add test case for testing the state attribute
Stefan Berger [Thu, 7 Oct 2010 10:43:35 +0000 (06:43 -0400)]
nwfilter: Add test case for testing the state attribute

This patch adds a test case for testing the XML parser's and instantiator's
support of the state attribute. The other test case tests existing
capabilities. Both test cases will be used in TCK again.

14 years agonwfilter: Instantiate state match in ip(6)tables rules
Stefan Berger [Thu, 7 Oct 2010 10:41:37 +0000 (06:41 -0400)]
nwfilter: Instantiate state match in ip(6)tables rules

In this patch I am extending the rule instantiator to create the state
match according to the state attribute in the XML. Only one iptables
rule in the incoming or outgoing direction will be created for a rule
in direction 'in' or 'out' respectively. A rule in direction 'inout' does
get iptables rules in both directions.

14 years agonwfilter: Extend XML parser and gen. to support state attr.
Stefan Berger [Thu, 7 Oct 2010 10:37:31 +0000 (06:37 -0400)]
nwfilter: Extend XML parser and gen. to support state attr.

The patch below extends the XML parser and generator so that every l3 protocol
now can have a state attribute.

14 years agobuild: require pkg-config for bootstrap
Eric Blake [Tue, 5 Oct 2010 15:10:31 +0000 (09:10 -0600)]
build: require pkg-config for bootstrap

* .gnulib: Update to latest, for bootstrap fixes.
* bootstrap: Synchronize with upstream.
* bootstrap.conf: Add pkg-config pre-requisite.
* autogen.sh: Tweak wording message.
Reported by Justin Clift, and with feedback from Bruno Haible.

14 years agoxen: Fix bogus error when attaching a device
Jiri Denemark [Tue, 5 Oct 2010 11:39:37 +0000 (13:39 +0200)]
xen: Fix bogus error when attaching a device

The xm internal xen driver only supports disk and network devices to be
added to a guest. On an attempt to attach any other device the xm driver
used VIR_ERR_XML_ERROR which resulted in a completely bogus error
message:

error: Failed to attach device from pci.xml
error: XML description for unknown device is not well formed or invalid

14 years agoconfigure: disable network and storage-fs drivers on mac os x
Justin Clift [Tue, 5 Oct 2010 01:31:05 +0000 (12:31 +1100)]
configure: disable network and storage-fs drivers on mac os x

Disabling these two drivers on MacOS X, where they are known to
not work, allows libvirt (including the daemon) to compile without
any further changes.

14 years agonwfilter: fix memory leaks
Stefan Berger [Mon, 4 Oct 2010 10:34:05 +0000 (06:34 -0400)]
nwfilter: fix memory leaks

Fixing memory leak shown by valgrind and freeing buffer in two more places.

14 years agoesx: Add support for virtual serial device network backing
Matthias Bolte [Wed, 29 Sep 2010 21:04:19 +0000 (23:04 +0200)]
esx: Add support for virtual serial device network backing

Since version 4.1 ESX(i) can expose virtual serial devices over TCP.

Add support in the VMX handling code for this, add test cases to cover
it and add links to some documentation.

ESX supports two additional protocols: TELNETS and TLS. Add them to
the list of serial-over-TCP protocols.

14 years agovcpu: improve cpuset attribute
Eric Blake [Mon, 27 Sep 2010 23:29:13 +0000 (17:29 -0600)]
vcpu: improve cpuset attribute

The <vcpu cpuset=...> attribute has been available since commit
e193b5dd, but without documentation or RNG validation.

* docs/schemas/domain.rng (vcpu): Further validate cpuset.
* docs/formatdomain.html.in: Document it.
* src/conf/domain_conf.c: Fix typos.

14 years agophyp: Verify that domain XML contains at least one disk element
Matthias Bolte [Thu, 30 Sep 2010 19:13:29 +0000 (21:13 +0200)]
phyp: Verify that domain XML contains at least one disk element

phypBuildLpar expects that at least one disk element is provided.

14 years agovirt-aa-helper-test cleanups
Jamie Strandboge [Thu, 30 Sep 2010 21:01:36 +0000 (15:01 -0600)]
virt-aa-helper-test cleanups

Don't cat | sed, just sed.  Suggested by Eric Blake.

14 years agoimplement usb and pci hot attach in AppArmor driver
Jamie Strandboge [Thu, 30 Sep 2010 20:54:56 +0000 (14:54 -0600)]
implement usb and pci hot attach in AppArmor driver

Description: Implement AppArmorSetSecurityHostdevLabel() and
AppArmorRestoreSecurityHostdevLabel() for hostdev and pcidev attach.

virt-aa-helper also has to be adjusted because *FileIterate() is used for pci
and usb devices and the corresponding XML for hot attached hostdev and pcidev
is not in the XML passed to virt-aa-helper. The new '-F filename' option is
added to append a rule to the profile as opposed to the existing '-f
filename', which rewrites the libvirt-<uuid>.files file anew. This new '-F'
option will append a rule to an existing libvirt-<uuid>.files if it exists,
otherwise it acts the same as '-f'.

load_profile() and reload_profile() have been adjusted to add an 'append'
argument, which when true will use '-F' instead of '-f' when executing
virt-aa-helper.

All existing calls to load_profile() and reload_profile() have been adjusted
to use the old behavior (ie append==false) except AppArmorSetSavedStateLabel()
where it made sense to use the new behavior.

This patch also adds tests for '-F'.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/640993

14 years agonwfilter: Add a test case for testing the comment attribute
Stefan Berger [Thu, 30 Sep 2010 20:09:04 +0000 (16:09 -0400)]
nwfilter: Add a test case for testing the comment attribute

This patch adds a test case for testing the XML parser's and instantiator's
support of the comment attribute.

14 years agonwfilter: Extend docs with information about comment attr.
Stefan Berger [Thu, 30 Sep 2010 20:01:51 +0000 (16:01 -0400)]
nwfilter: Extend docs with information about comment attr.

I am adding a row with information about the newly supported comment
attribute to each of the tables describing supported attributes of protocols.

14 years agonwfilter: Extend nwfilter schema to accept comment attrib.
Stefan Berger [Thu, 30 Sep 2010 20:00:11 +0000 (16:00 -0400)]
nwfilter: Extend nwfilter schema to accept comment attrib.

Extend the nwfilter.rng schema to accept comment attributes for all protocol
types.

14 years agonwfilter: Instantiate comments in ip(6)tables rules
Stefan Berger [Thu, 30 Sep 2010 19:56:09 +0000 (15:56 -0400)]
nwfilter: Instantiate comments in ip(6)tables rules

In this patch I am extending the rule instantiator to create the comment
node where supported, which is the case for iptables and ip6tables.

Since commands are written in the format

cmd='iptables ...-m comment --comment \"\" '

certain characters ('`) in the comment need to be escaped to
prevent comments from becoming commands themselves or cause other
forms of (bash) substitutions. I have tested this with various input and in
my tests the input made it straight into the comment. A test case for TCK
will be provided separately that tests this.

14 years agonwfilter: Extend XML parser and generator w/ comment attribute
Stefan Berger [Thu, 30 Sep 2010 19:46:10 +0000 (15:46 -0400)]
nwfilter: Extend XML parser and generator w/ comment attribute

The patch below extends the XML parser and generator so that every protocol
now can have a comment node. Comments are limited to 256 characters.

14 years agobuild: fix example build on MacOS X
Eric Blake [Tue, 28 Sep 2010 16:37:50 +0000 (10:37 -0600)]
build: fix example build on MacOS X

Partial reversion of commit 76d87a59, now that bootstrap is smarter.

* .gnulib: Update to latest, for poll and bootstrap fixes.
* bootstrap: Resync from gnulib.
* autogen.sh: Drop redundant tool checks; bootstrap does them
better, by honoring environment variables.
* examples/domain-events/events-c/Makefile.am (INCLUDES)
(event_test_LDADD): Use gnulib library during build.
* bootstrap.conf (gnulib_tool_option_extras): Revert --libtool
addition, now that updated bootstrap does it for us.
Reported by Justin Clift.

14 years agophyp: Checking for NULL values when building new guest
Eduardo Otubo [Wed, 29 Sep 2010 14:52:15 +0000 (16:52 +0200)]
phyp: Checking for NULL values when building new guest

When creating a new gust, the function phypBuildLpar() was not
checking for NULL values

src/phyp/phyp_driver.c: check the definition arguments to avoid a segmentation
  fault in phypBuildLpar()

14 years agoconfigure: tweak logic flow of virtport check
Justin Clift [Wed, 29 Sep 2010 14:14:07 +0000 (00:14 +1000)]
configure: tweak logic flow of virtport check

This fixes a small logic bug, where passing --without-macvtap
on the configure line, or otherwise indicating a lack of
support for macvtap, causes configure to bail.

14 years agompath: disable devmapper-multipath checking on non-linux
Justin Clift [Wed, 29 Sep 2010 12:34:36 +0000 (22:34 +1000)]
mpath: disable devmapper-multipath checking on non-linux

The configure script was breaking on MacOS X unless passed:

  --without-storage-mpath

This patch leverages Stefan Bergers earlier work for nwfilter,
so non-linux systems don't even attempt to build multipath.

14 years agoRework configure logic for virtualport support
Stefan Berger [Wed, 29 Sep 2010 11:56:26 +0000 (07:56 -0400)]
Rework configure logic for virtualport support

In this patch I am reworking the logic around detecting virtual port support and requiring the libnl dependency.

- It requires --with-macvtap and displays an error in case of --without-macvtap --with-virtualport.
- It tests for availability of certain data in include files and displays an error in case the include file is not at the correct level and --with-virtualport was chosen
- displays 'checking' messages for macvtap and virtualport support and results
- libnl support is required when macvtap is found or requested; if libnl is not there, please supply without-macvtap

14 years agomac os x: use awk selected by build system rather than first in path
Justin Clift [Tue, 28 Sep 2010 13:28:23 +0000 (23:28 +1000)]
mac os x: use awk selected by build system rather than first in path

Prior to this patch, the ChangeLog generation was hard coded to use
"awk", when it should have been using the AWK variable set by our
build system.

This breaks compilation on a newly installed OS X system, where the
default path has the Mac (non GNU) awk in the default search PATH
before any installed GNU awk (gawk).

14 years agonwfilter: remove recently added workaround define for macos x
Justin Clift [Tue, 28 Sep 2010 00:52:21 +0000 (10:52 +1000)]
nwfilter: remove recently added workaround define for macos x

This reverses commit 04c3704, which added a define to nwfilter to
allow libvirtd compilation on Mac OS X.  Stefan Bergers commit, 2e7294d,
is the proper solution, removing the requirement for nwfilter on non-Linux.

14 years agovirtualbox: fix a typo in the expected location on mac os x
Justin Clift [Tue, 28 Sep 2010 01:16:04 +0000 (11:16 +1000)]
virtualbox: fix a typo in the expected location on mac os x

Mac OS X provides an "/Applications" folder, not an "/Application" folder,
so installed VirtualBox wasn't being detected by default.

This 1 character patch fixes this.

14 years agopython: drop unnecessary conn assignment
Dan Kenigsberg [Mon, 27 Sep 2010 08:58:28 +0000 (10:58 +0200)]
python: drop unnecessary conn assignment

Since 554d82a200289938d5639a782a9f12e3e2e968f0, conn is unused. Let's
drop it - but keep the signature of the constructor for backward
compatibility.

14 years agonwfilter: Don't compile nwfilter driver on other systems than Linux
Stefan Berger [Mon, 27 Sep 2010 19:44:27 +0000 (15:44 -0400)]
nwfilter: Don't compile nwfilter driver on other systems than Linux

Don't compile the nwfilter driver (instantiating the rules) on other systems than Linux.

14 years agonwfilter: add a missing define, so libvirtd builds on macos x
Justin Clift [Mon, 27 Sep 2010 15:18:57 +0000 (01:18 +1000)]
nwfilter: add a missing define, so libvirtd builds on macos x

The nwfilter code uses ETH_ALEN, which isn't defined on MacOS X.
This is a simple workaround, to add it when missing.

14 years agonwfilter: report if ip(6)tables rules would not be active
Stefan Berger [Fri, 24 Sep 2010 16:06:17 +0000 (12:06 -0400)]
nwfilter: report if ip(6)tables rules would not be active

The patch below reports a warning in the log if the generated ip(6)tables rules would not be effective due to the proc filesystem entries

    /proc/sys/net/bridge/bridge-nf-call-iptables
    /proc/sys/net/bridge/bridge-nf-call-ip6tables

containing a '0'. The warning tells the user what to do. I am rate-limiting the warning message to appear only every 10 seconds.

14 years agoapp-armor: add 'rw' for appropriate devices
Jamie Strandboge [Thu, 23 Sep 2010 17:22:44 +0000 (11:22 -0600)]
app-armor: add 'rw' for appropriate devices

Description: Check for VIR_DOMAIN_CHR_TYPE in serial ports and add 'rw' for
defined serial ports, parallel ports and channels

Bug-Ubuntu: LP: #578527, LP: #609055

14 years agoadd extra tests to virt-aa-helper-test for new '-p' option
Jamie Strandboge [Thu, 23 Sep 2010 17:16:24 +0000 (11:16 -0600)]
add extra tests to virt-aa-helper-test for new '-p' option

14 years agodocs: grammar cleanups on logging examples
Eric Blake [Wed, 22 Sep 2010 21:34:17 +0000 (15:34 -0600)]
docs: grammar cleanups on logging examples

* docs/logging.html.in: Fix spelling and grammar.

14 years agoFix spelling of Xen in comments
Philipp Hahn [Thu, 23 Sep 2010 15:22:03 +0000 (17:22 +0200)]
Fix spelling of Xen in comments

14 years agomaint: update to latest gnulib
Eric Blake [Wed, 22 Sep 2010 18:08:58 +0000 (12:08 -0600)]
maint: update to latest gnulib

* .gnulib: Update to latest.
* bootstrap.conf (gnulib_modules): Add new termios module.
(gnulib_tool_option_extras): Make libtool usage explicit.
* src/util/util.c (includes): Gnulib now guarantees termios.h.
* bootstrap: Resync from gnulib.

14 years agoesx: Allow '-' in VMX entry names
Matthias Bolte [Wed, 22 Sep 2010 20:41:38 +0000 (22:41 +0200)]
esx: Allow '-' in VMX entry names

Add a test for this.

Reported by Frank Dirks.

14 years agopciFindStubDriver should return NULL on error
Chris Wright [Wed, 22 Sep 2010 22:54:23 +0000 (15:54 -0700)]
pciFindStubDriver should return NULL on error

pciFindStubDriver currently returns 0 in one of the error cases.
While it's correct...NULL is more readable.

Signed-off-by: Chris Wright <chrisw@redhat.com>
14 years agolibvirt-guests: start late and stop early
Jiri Denemark [Wed, 22 Sep 2010 13:46:04 +0000 (15:46 +0200)]
libvirt-guests: start late and stop early

libvirt-guests init script should be started as late as possible during
host startup and stopped as early as possible during host shutdown to
make sure required services are already/still up and running at the time
libvirt-guests runs.

14 years agoMake SASL work over UNIX domain sockets
Daniel P. Berrange [Tue, 14 Sep 2010 18:17:25 +0000 (19:17 +0100)]
Make SASL work over UNIX domain sockets

The addrToString methods were not coping with UNIX domain sockets
which have no normal host+port address. Hardcode special handling
for these so that SASL routines can work over UNIX sockets. Also
fix up SSF logic in remote client so that it presumes that a UNIX
socket is secure

* daemon/remote.c: Fix addrToString for UNIX sockets.
* src/remote/remote_driver.c: Fix addrToString for UNIX sockets
  and fix SSF logic to work for TLS + UNIX sockets in the same
  manner

14 years agoRefactor some daemon code to facilitate introduction of static probes
Daniel P. Berrange [Tue, 14 Sep 2010 16:50:25 +0000 (17:50 +0100)]
Refactor some daemon code to facilitate introduction of static probes

Refactor some daemon code to facilitate the introductioin of static
probes, sanitizing function exit paths in many places

* daemon/libvirtd.c: Pass the dname string into remoteCheckDN
  to let caller deal with failure paths. Add separate exit paths
  to remoteCheckCertificate for auth failure vs denial. Merge
  all exit paths in qemudDispatchServer to one cleanup block
* daemon/remote.c: Add separate exit paths to SASL & PolicyKit
  functions for auth failure vs denial

14 years agonodeinfo: work when hot-plugging is disabled
Eric Blake [Tue, 21 Sep 2010 17:43:06 +0000 (11:43 -0600)]
nodeinfo: work when hot-plugging is disabled

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

* src/nodeinfo.c (cpu_online): Allow missing directory for all
CPUs, not just cpu0.

Signed-off-by: Eric Blake <eblake@redhat.com>
14 years agoThis patch fixes a bug appearing on big endian machines where the returned XML is...
Stefan Berger [Wed, 22 Sep 2010 10:24:19 +0000 (06:24 -0400)]
This patch fixes a bug appearing on big endian machines where the returned XML is not the one that is expected (see test/nwfilterxml2xmltest). The problem is due to for example the casting of pointers to unsigned integers to void * and then back to 16 bit integers.

14 years agotests: silence qemuargv2xmltest noise
Eric Blake [Fri, 10 Sep 2010 16:25:49 +0000 (10:25 -0600)]
tests: silence qemuargv2xmltest noise

Before this patch, the testsuite was noisy:

TEST: qemuargv2xmltest
      ........................................ 40
      ................20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument '-unknown', adding to the qemu namespace
20:41:28.046: warning : qemuParseCommandLine:6565 : unknown QEMU argument 'parameter', adding to the qemu namespace
.                        57  OK
PASS: qemuargv2xmltest

It's not a real failure (which is why the test was completing
successfully), so much as an intentional warning to the user that use
of the qemu namespace has the potential for undefined effects that
leaked through the default logging behavior.  After this patch series,
all tests can access any logged data, and this particular test can
explicitly check for the presence or absence of the warning, such that
the test output becomes:

TEST: qemuargv2xmltest
      ........................................ 40
      .................                        57  OK
PASS: qemuargv2xmltest

* tests/testutils.h (virtTestLogContentAndReset): New prototype.
* tests/testutils.c (struct virtTestLogData): New struct.
(virtTestLogOutput, virtTestLogClose, virtTestLogContentAndReset):
New functions.
(virtTestMain): Always capture log data emitted during tests.
* tests/qemuargv2xmltest.c (testCompareXMLToArgvHelper, mymain):
Use flag to mark which tests expect noisy stderr.
(testCompareXMLToArgvFiles): Add parameter to test whether stderr
was appropriately silent.

14 years agotests: clean up qemuargv2xmltest
Eric Blake [Fri, 10 Sep 2010 02:32:50 +0000 (20:32 -0600)]
tests: clean up qemuargv2xmltest

Since commit 107a7bd06bc, the extraFlags argument was unused.

* tests/qemuargv2xmltest.c (DO_TEST): Drop extraFlags argument.
Adjust all callers.

14 years agodocs: reworked the policykit patch submitted by Patrick Dignan
Justin Clift [Thu, 16 Sep 2010 12:14:18 +0000 (22:14 +1000)]
docs: reworked the policykit patch submitted by Patrick Dignan

Tweaked the PolicyKit documentation improvement patch submitted
by Patrick Dignan.

Additionally, removed the reference to PolicyKit.conf, which is
no longer used by PolicyKit, plus added a link to the expanded
PolicyKit example page on the wiki.

14 years agodocs: fix the xml validity errors regarding name and id
Justin Clift [Thu, 16 Sep 2010 10:07:19 +0000 (20:07 +1000)]
docs: fix the xml validity errors regarding name and id

Got sick of seeing the "validity error : ID Objects already defined"
errors, which this patch addresses.

14 years agobuild: avoid non-portable IPv6 struct member, for MacOS X
Eric Blake [Wed, 15 Sep 2010 20:50:51 +0000 (14:50 -0600)]
build: avoid non-portable IPv6 struct member, for MacOS X

* src/util/network.c (getIPv6Addr): Manually join s6_addr bytes,
instead of assuming s6_addr16 shorts.
Reported by Justin Clifton; solution suggested by Bruno Haible.

14 years agovirsh: change wexitstatus order to allow compilation on mac osx
Justin Clift [Wed, 15 Sep 2010 15:08:14 +0000 (01:08 +1000)]
virsh: change wexitstatus order to allow compilation on mac osx

This is the simple fix Daniel Veillard suggested last year:

  http://www.redhat.com/archives/libvir-list/2009-May/msg00459.html

14 years agolibvirtd: improve the error message displayed on tls client auth failure
Justin Clift [Wed, 15 Sep 2010 15:39:08 +0000 (01:39 +1000)]
libvirtd: improve the error message displayed on tls client auth failure

This address BZ # 556599:

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

14 years agomaint: silence warning from libtool
Eric Blake [Fri, 10 Sep 2010 02:10:33 +0000 (20:10 -0600)]
maint: silence warning from libtool

I got tired of seeing this.

config.status: executing libtool commands
/bin/rm: cannot remove `libtoolT': No such file or directory
config.status: executing po-directories commands

While I was at it, there were a couple other unused variables.

* configure.ac (RM, MV, TAR): Drop; nothing in libvirt directly uses
this, and assigning RM interferes with libtool.

14 years agoRebuild network filter for UML guests on updates
Soren Hansen [Tue, 14 Sep 2010 08:07:43 +0000 (10:07 +0200)]
Rebuild network filter for UML guests on updates

When nwfilter support was added to UML, I didn't realise the UML driver
needed instrumentation to make updating nwfilters on the fly work. This
patch adds this bit of glue.

Signed-off-by: Soren Hansen <soren@linux2go.dk>
14 years agovirsh: Use virBuffer for generating XML
Jiri Denemark [Fri, 10 Sep 2010 11:38:40 +0000 (13:38 +0200)]
virsh: Use virBuffer for generating XML

cmdAttachInterface and cmdAttachDisk still used vshRealloc and sprintf
for generating XML, which is hardly maintainable. Let's get rid of this
old code.

14 years agobuild: use portable sed expressions
Eric Blake [Fri, 10 Sep 2010 16:38:17 +0000 (10:38 -0600)]
build: use portable sed expressions

* src/Makefile.am (libvirt.def, libvirt_qemu.def): '\}' and '\t'
are not required by POSIX.  Use '}' and literal tab instead.
(install-data-local): Avoid sed -i.
* tests/read-bufsiz: Likewise.
Reported by Mitchell Hashimoto.

14 years agodocs: improve wording for the dev guide
Justin Clift [Mon, 13 Sep 2010 07:28:49 +0000 (17:28 +1000)]
docs: improve wording for the dev guide

Wording tweak suggested by David Jorm, author of the libvirt App Dev Guide.

14 years agotests: Fix preprocessor indentation
Jiri Denemark [Mon, 13 Sep 2010 11:33:31 +0000 (13:33 +0200)]
tests: Fix preprocessor indentation

14 years agodocs: add the app dev guide
Justin Clift [Fri, 10 Sep 2010 09:26:05 +0000 (19:26 +1000)]
docs: add the app dev guide

Added a workable initial page for the libvirt Application
Development Guide, giving the online viewable options +
the available download ones (pdf, epub, srpm).

Added a link to the PDF to the main Downloads page, plus
neatened the html tags throughout the page as they
were a bit of a mess.

Added --enable-compile-warnings=error to the autogen line,
as suggested by Eric Blake.

14 years agoLibvirt release 0.8.4
Daniel Veillard [Fri, 10 Sep 2010 15:19:28 +0000 (17:19 +0200)]
Libvirt release 0.8.4

update news, spec and french localizaton

14 years agobuf: Fix possible infinite loop in EscapeString, VSnprintf
Cole Robinson [Wed, 1 Sep 2010 17:51:35 +0000 (13:51 -0400)]
buf: Fix possible infinite loop in EscapeString, VSnprintf

The current code will go into an infinite loop if the printf generated
string is >= 1000, AND exactly 1 character smaller than the amount of free
space in the buffer. When this happens, we are dropped into the loop body,
but nothing will actually change, because count == (buf->size - buf->use - 1),
and virBufferGrow returns unchanged if count < (buf->size - buf->use)

Fix this by removing the '- 1' bit from 'size'. The *nprintf functions handle
the NULL byte for us anyways, so we shouldn't need to manually accommodate
for it.

Here's a bug where we are actually hitting this issue:
https://bugzilla.redhat.com/show_bug.cgi?id=602772

v2: Eric's improvements: while -> if (), remove extra va_list variable,
    make sure we report buffer error if snprintf fails

v3: Add tests/virbuftest which reproduces the infinite loop before this
    patch, works correctly after

14 years agoFix block statistics with newer versions of Xen
Guido Günther [Fri, 10 Sep 2010 13:57:35 +0000 (15:57 +0200)]
Fix block statistics with newer versions of Xen

Apparently the xen block device statistics moved from
"/sys/devices/xen-backend/vbd-%d-%d/statistics/%s"
to
"/sys/bus/xen-backend/devices/vbd-%d-%d/statistics/%s"

* src/xen/block_stats.c: try the extra path in case of failure to
  find the statistics in /sys

14 years agovirsh: Option for overriding disk type in attach-disk
Jiri Denemark [Fri, 10 Sep 2010 11:37:55 +0000 (13:37 +0200)]
virsh: Option for overriding disk type in attach-disk

Unless --driver tap|file option was given to attach-disk, virsh would
generate <disk type='block'> XML which might be fine for Xen but not for
other hypervisors. This patch introduces a new option --sourcetype which
can be used to explicitly set the type of disk source. The option
accepts either "file" or "block" types.

14 years agoFix dependancies for remote generated files
Daniel P. Berrange [Thu, 19 Aug 2010 13:33:39 +0000 (14:33 +0100)]
Fix dependancies for remote generated files

Very occasionally during a parallel make, dispatch.c would
be compiled before the generated remote headers had been
fully written. This would cause it to compile an empty
union, and result in really wierd runtime bugs that are
near impossible to diagnose.

* daemon/Makefile.am: Fix remote build deps

14 years agoEnsure remote daemon unions are always non-zero length
Daniel P. Berrange [Thu, 19 Aug 2010 13:32:10 +0000 (14:32 +0100)]
Ensure remote daemon unions are always non-zero length

If the remote daemon args/ret unions ever become zero length
(due to a build / Makefile bug) then bad stuff happens at
runtime. Add a compile time assertion to check for this kind
of problem

* daemon/remote.h: Ensure non-zero length unions

14 years agoFix off-by-1 in QEMU boot arg array handling
Daniel P. Berrange [Tue, 24 Aug 2010 11:00:41 +0000 (12:00 +0100)]
Fix off-by-1 in QEMU boot arg array handling

A QEMU guest can have upto VIR_DOMAIN_BOOT_LAST boot entries
defined. When building the QEMU arg, each entry takes a
single byte. This means the array must be declared to be
VIR_DOMAIN_BOOT_LAST+1 bytes in length to allow for the
trailing null

* src/qemu/qemu_conf.c: Fix off-by-1 boot arg array size

14 years agobridge: Fix static-only DHCP configuration
Jiri Denemark [Thu, 9 Sep 2010 14:00:08 +0000 (16:00 +0200)]
bridge: Fix static-only DHCP configuration

For static-only DHCP, i.e. with no <range> but at least one <host>
element within <dhcp> element, we have to add "--dhcp-range IP,static"
option to dnsmasq to actually enable the service. Without this option,
dnsmasq will not respond to DHCP requests.

14 years agoqemu: qemuMonitorJSONEjectMedia(): Fix arguments' type
Luiz Capitulino [Thu, 9 Sep 2010 21:05:04 +0000 (18:05 -0300)]
qemu: qemuMonitorJSONEjectMedia(): Fix arguments' type

QMP in QEMU 0.13 has been fixed to enforce type correctness,
this means that boolean types must be true or false, not
integers.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoqemu: qemuMonitorJSONMigrate(): Fix arguments' type
Luiz Capitulino [Thu, 9 Sep 2010 21:05:03 +0000 (18:05 -0300)]
qemu: qemuMonitorJSONMigrate(): Fix arguments' type

QMP in QEMU 0.13 has been fixed to enforce type correctness,
this means that boolean types must be true or false, not
integers.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
14 years agoAdd nwfilter support to UML driver
Soren Hansen [Tue, 7 Sep 2010 08:19:56 +0000 (10:19 +0200)]
Add nwfilter support to UML driver

Extend user-mode-linux driver to support nwfilter.

Signed-off-by: Soren Hansen <soren@linux2go.dk>
14 years agotest: Don't overwrite storage volume target path and key
Matthias Bolte [Wed, 8 Sep 2010 19:46:15 +0000 (21:46 +0200)]
test: Don't overwrite storage volume target path and key

Only generate target path and key when they are not defined
in the XML config.

14 years agoRemove hack to get static binaries in DV environment
Daniel Veillard [Thu, 9 Sep 2010 15:06:00 +0000 (17:06 +0200)]
Remove hack to get static binaries in DV environment

14 years agoMoved my name up to the primary list, as I have commit rights now.
Justin Clift [Wed, 8 Sep 2010 14:13:19 +0000 (00:13 +1000)]
Moved my name up to the primary list, as I have commit rights now.

As recommended by Eric. :)

14 years agoesx: Use SessionIsActive when available
Matthias Bolte [Sun, 5 Sep 2010 14:53:10 +0000 (16:53 +0200)]
esx: Use SessionIsActive when available

Before this commit SessionIsActive was not used because ESX(i)
doesn't implement it. vCenter supports SessionIsActive, so use
it here, but keep the fall back mechanism for ESX(i) and GSX.

14 years agoesx: Fall back to path as key when QueryVirtualDiskUuid isn't available
Matthias Bolte [Fri, 3 Sep 2010 23:30:04 +0000 (01:30 +0200)]
esx: Fall back to path as key when QueryVirtualDiskUuid isn't available

QueryVirtualDiskUuid is only available on an ESX(i) server. vCenter
returns an NotImplemented fault and a GSX server is missing the
VirtualDiskManager completely. Therefore only use QueryVirtualDiskUuid
with an ESX(i) server and fall back to path as storage volume key for
vCenter and GSX server.

14 years agomingw: match recent changes in spec file
Eric Blake [Fri, 3 Sep 2010 19:48:25 +0000 (13:48 -0600)]
mingw: match recent changes in spec file

* libvirt.spec.in (%file): List new installed files.
* configure.ac (with_init_script): Assume default of none when
cross-compiling.

14 years agobuild: Fix permissions of sysconfig files
Jiri Denemark [Thu, 2 Sep 2010 14:53:38 +0000 (16:53 +0200)]
build: Fix permissions of sysconfig files

14 years agoUpdate of localization files
Daniel Veillard [Sat, 4 Sep 2010 17:24:07 +0000 (19:24 +0200)]
Update of localization files

- Updated dutch, spanish and russian, regenerated the po/pot files

14 years agoesx: Use the VirtualDisk UUID as storage volume key
Matthias Bolte [Sun, 29 Aug 2010 17:33:49 +0000 (19:33 +0200)]
esx: Use the VirtualDisk UUID as storage volume key

VirtualDisks are .vmdk file based. Other files in a datastore
like .iso or .flp files don't have a UUID attached, fall back
to the path as key for them.

14 years agoesx: Add .vmdk storage volume creation
Matthias Bolte [Sat, 28 Aug 2010 19:49:07 +0000 (21:49 +0200)]
esx: Add .vmdk storage volume creation

14 years agoOpenVZ: add ethernet interface type support
Jean-Baptiste Rouault [Wed, 18 Aug 2010 15:05:02 +0000 (17:05 +0200)]
OpenVZ: add ethernet interface type support

This patch adds support for ethernet interface type to OpenVZ domains
as stated in this previous message: http://www.redhat.com/archives/libvir-
list/2010-July/msg00658.html

14 years agobuild: avoid uninitialized variable warning
Eric Blake [Fri, 3 Sep 2010 15:39:23 +0000 (09:39 -0600)]
build: avoid uninitialized variable warning

* src/vbox/vbox_tmpl.c (vboxAttachDrives): Capture return value.

14 years agoesx: Rework datastore path parsing and handling
Matthias Bolte [Wed, 25 Aug 2010 09:44:57 +0000 (11:44 +0200)]
esx: Rework datastore path parsing and handling

Instead of splitting the path part of a datastore path into
directory and file name, keep this in one piece. An example:

  "[datastore] directory/file"

was split into this before:

  datastoreName = "datastore"
  directoryName = "directory"
  fileName = "file"

Now it's split into this:

  datastoreName = "datastore"
  directoryName = "directory"
  directoryAndFileName = "directory/file"

This simplifies code using esxUtil_ParseDatastorePath, because
directoryAndFileName is used more often than fileName. Also the
old approach expected the datastore path to reference an actual
file, but this isn't always correct, especially when listing
volumes. In that case esxUtil_ParseDatastorePath is used to parse
a path that references a directory. This fails for a vpx://
connection because the vCenter returns directory paths with a
trailing '/'. The new approach is robust against this and the
actual decision if the datastore path should reference a file or
a directory is up to the caller of esxUtil_ParseDatastorePath.

Update the tests accordingly.

14 years agovbox: factor a large function
Eric Blake [Tue, 31 Aug 2010 18:01:45 +0000 (12:01 -0600)]
vbox: factor a large function

* src/vbox/vbox_tmpl.c (vboxDomainDefineXML): Split...
(vboxSetBootDeviceOrder, vboxAttachDrives, vboxAttachSound)
(vboxAttachNetwork, vboxAttachSerial, vboxAttachParallel)
(vboxAttachVideo, vboxAttachDisplay, vboxAttachUSB): ...into new
helper functions.

14 years agolxc: avoid large stacks with veth creation
Eric Blake [Tue, 31 Aug 2010 22:04:46 +0000 (16:04 -0600)]
lxc: avoid large stacks with veth creation

* src/lxc/veth.h (vethCreate): Change prototype.
* src/lxc/veth.c (vethCreate): Always malloc veth2, and allocate
veth1 if needed.
(getFreeVethName): Adjust signature, and use virAsprintf.
* src/lxc/lxc_driver.c (lxcSetupInterfaces): Adjust caller.

14 years agoesx: Fix generator for string return values
Matthias Bolte [Sun, 29 Aug 2010 17:17:10 +0000 (19:17 +0200)]
esx: Fix generator for string return values

Distinguish between strings as parameters (const char *)
and strings as return values (char **).

14 years agoopenvz: use virAsprintf to avoid large stacks
Eric Blake [Tue, 31 Aug 2010 22:56:22 +0000 (16:56 -0600)]
openvz: use virAsprintf to avoid large stacks

* src/openvz/openvz_conf.c (openvzLocateConfFile): Alter
signature.
(openvzGetVPSUUID, openvzSetDefinedUUID)
(openvzWriteVPSConfigParam, openvzReadVPSConfigParam)
(openvzCopyDefaultConfig): Adjust callers.

14 years agoopenvz: formatting cleanups
Eric Blake [Tue, 31 Aug 2010 22:43:18 +0000 (16:43 -0600)]
openvz: formatting cleanups

* src/openvz/openvz_conf.c: Whitespace fixes.
* src/openvz/openvz_driver.c: Likewise.

14 years agonetwork: use virAsprintf when appropriate
Eric Blake [Tue, 31 Aug 2010 20:25:49 +0000 (14:25 -0600)]
network: use virAsprintf when appropriate

* src/conf/network_conf.c (virNetworkAllocateBridge): Avoid
limited buffer from snprintf.

14 years agobuild: add some modules
Eric Blake [Tue, 31 Aug 2010 22:27:24 +0000 (16:27 -0600)]
build: add some modules

snprintf is currently implicitly picked up by getaddrinfo, but we
might as well make it explicit so that mingw doesn't break if
getaddrinfo changes to drop the dependency.

func doesn't matter for gcc compilation, but may help other compilers
cope with our use of __func__.

* bootstrap.conf (gnulib_modules): Add snprintf and func.

14 years agovirsh: remove driver check from attach-disk command
Ryan Harper [Tue, 24 Aug 2010 16:09:00 +0000 (11:09 -0500)]
virsh: remove driver check from attach-disk command

Virsh shouldn't check for driver support but rather let the backend handled this.
After removing the check, I can successfully attach file-based images to a qemu
VM with attach-disk.

% virsh attach-disk vm2 /images/test02.img vdc --driver qemu --type disk --subdriver raw
Disk attached successfully

This command generates the following XML:

<disk type='block' device='disk'>
      <driver name='qemu' type='raw'/>
      <source dev='/images/test02.img'/>
      <target dev='vdc' bus='virtio'/>
      <alias name='virtio-disk2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
</disk>

Signed-off-by: Ryan Harper <ryanh@us.ibm.com>
14 years agoUse global directory as UML's monitorDir for privileged connections
Soren Hansen [Tue, 31 Aug 2010 11:44:16 +0000 (13:44 +0200)]
Use global directory as UML's monitorDir for privileged connections

For privileged UML connections (uml:///system), we shouldn't use root's
home dir, but rather somewhere in /var/run/libvirt/uml-guest.

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

Signed-off-by: Soren Hansen <soren@linux2go.dk>
14 years agoExplicitly pass uml_dir argument to user-mode-linux
Soren Hansen [Wed, 25 Aug 2010 09:03:42 +0000 (11:03 +0200)]
Explicitly pass uml_dir argument to user-mode-linux

uml_dir overrides user-mode-linux's default of ~/.uml. This is needed
for a couple of different reasons:

libvirt expects this to default to virGetUserDirectory(geteuid()) +
'/.uml'. However, user-mode-linux actually uses the HOME environment
variable to determine where to look for the uml sockets, but if running
libvirtd under sudo (which I routinely do during development), $HOME is
pointing at my user's homedir, while my euid is 0, so libvirt looks in
/root.

Also (and this was my actual motivation for this patch), if HOME isn't
set at all, user-mode-linux utterly fails. Looking at the code, it seems
it's meant to emit a warning, but alas, it doesn't for some reason.
If running libvirtd from upstart, HOME is not set, so any system using
upstart will need this change.

Signed-off-by: Soren Hansen <soren@linux2go.dk>
14 years agomaint: track moved file
Eric Blake [Tue, 31 Aug 2010 16:00:31 +0000 (10:00 -0600)]
maint: track moved file

* daemon/.gitignore: Move libvirt-guests.init...
* tools/.gitignore: ...to its new location.

14 years agoAdd tests for Xen's blktap2 implementation
Jim Fehlig [Tue, 24 Aug 2010 21:49:00 +0000 (15:49 -0600)]
Add tests for Xen's blktap2 implementation

xml2sexpr and sexpr2xml tests for blktap2