]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
15 years agoFix typo in network.c function comments
Matthew Booth [Fri, 30 Oct 2009 15:39:57 +0000 (16:39 +0100)]
Fix typo in network.c function comments

* src/util/network.c: fix a few typo

15 years agoAdd symbols from new network.h module
Daniel Veillard [Fri, 30 Oct 2009 15:36:04 +0000 (16:36 +0100)]
Add symbols from new network.h module

* src/libvirt_private.syms: keep all symbols from network.h private

15 years agoSet of new network related utilities
Daniel Veillard [Thu, 22 Oct 2009 14:34:43 +0000 (16:34 +0200)]
Set of new network related utilities

* src/util/network.h src/util/network.c: utilities to parse network
  addresses, check netmask and compute ranges

15 years agoFix configure detection of device mapper
Pritesh Kothari [Fri, 30 Oct 2009 13:44:50 +0000 (14:44 +0100)]
Fix configure detection of device mapper

* configure.in: the PKG_CHECK_MODULES() for it would not work on
  Ubuntu and SuSE, so add a direct check fallback

15 years agoRemote code caught EINTR making it ininterruptable
Daniel Veillard [Fri, 30 Oct 2009 11:08:26 +0000 (12:08 +0100)]
Remote code caught EINTR making it ininterruptable

John Levon raised the issue that remoteIOEventLoop() poll call was
reissued after EINTR was caught making it uninterruptible.
* src/remote/remote_driver.c: catch EAGAIN instead as suggested by
  Richard Jones

15 years agoConvert virDomainObjListPtr to use a hash of domain objects
Daniel P. Berrange [Fri, 9 Oct 2009 11:33:51 +0000 (12:33 +0100)]
Convert virDomainObjListPtr to use a hash of domain objects

The current virDomainObjListPtr object stores domain objects in
an array. This means that to find a particular objects requires
O(n) time, and more critically acquiring O(n) mutex locks.

The new impl replaces the array with a virHashTable, keyed off
UUID. Finding a object based on UUID is now O(1) time, and only
requires a single mutex lock. Finding by name/id is unchanged
in complexity.

In changing this, all code which iterates over the array had
to be updated to use a hash table iterator function callback.
Several of the functions which were identically duplicating
across all drivers were pulled into domain_conf.c

* src/conf/domain_conf.h, src/conf/domain_conf.c: Change
  virDomainObjListPtr to use virHashTable. Add a initializer
  method virDomainObjListInit, and rename virDomainObjListFree
  to virDomainObjListDeinit, since its not actually freeing
  the container, only its contents. Also add some convenient
  methods virDomainObjListGetInactiveNames,
  virDomainObjListGetActiveIDs and virDomainObjListNumOfDomains
  which can be used to implement the correspondingly named
  public API entry points in drivers
* src/libvirt_private.syms: Export new methods from domain_conf.h
* src/lxc/lxc_driver.c, src/opennebula/one_driver.c,
  src/openvz/openvz_conf.c, src/openvz/openvz_driver.c,
  src/qemu/qemu_driver.c, src/test/test_driver.c,
  src/uml/uml_driver.c, src/vbox/vbox_tmpl.c: Update all code
  to deal with hash tables instead of arrays for domains

15 years agolibvirt-devel should only require libvirt-client
Mark McLoughlin [Wed, 28 Oct 2009 17:23:34 +0000 (17:23 +0000)]
libvirt-devel should only require libvirt-client

There's a long known issue where if you install libvirt in a guest,
the default virtual network will conflict with the default virtual
network in the host.

That's one of the reasons we have the libvirt-client RPM - it allows
you to install the client library without having the host side
installed.

Rich Jones points out that if you install libvirt-devel in a guest,
then you get libvirtd installed and the network conflict:

  https://bugzilla.redhat.com/531200

libvirt-devel should only require libvirt-client - e.g. nothing in
the devel package pertains to anything in the libvirt RPM. The Fedora
packaging guidelines say:

  https://fedoraproject.org/wiki/Packaging/Guidelines#Devel_Packages

  Devel packages must require the base package using a fully versioned
  dependency ...

But for all intents and purposes, libvirt-client is our base RPM.

* libvirt.spec.in: make libvirt-devel require libvirt-client

15 years agovirterror: Add a missing 'break' for VIR_ERR_INVALID_SECRET
Cole Robinson [Tue, 27 Oct 2009 14:01:06 +0000 (10:01 -0400)]
virterror: Add a missing 'break' for VIR_ERR_INVALID_SECRET

15 years agoqemu: migrate: Don't require manual URI to specify a port
Cole Robinson [Mon, 26 Oct 2009 20:08:23 +0000 (16:08 -0400)]
qemu: migrate: Don't require manual URI to specify a port

The xen driver will generate a migration port if only a hostname is passed
in the optional migrate URI, so let's do the same in qemu.

15 years agoFix p2p migration without a passed uri.
Cole Robinson [Thu, 22 Oct 2009 18:51:30 +0000 (14:51 -0400)]
Fix p2p migration without a passed uri.

15 years agoqemu: Fix an error message in GetVcpus
Cole Robinson [Wed, 21 Oct 2009 19:03:58 +0000 (15:03 -0400)]
qemu: Fix an error message in GetVcpus

15 years agotest: Support virStorageFindPoolSources
Cole Robinson [Fri, 16 Oct 2009 08:35:05 +0000 (04:35 -0400)]
test: Support virStorageFindPoolSources

The results are hardcoded into the test driver, no option to read from a
testfile is implemented at this time.

15 years agostorage: Add ParseSourceString function for use with FindPoolSources.
Cole Robinson [Thu, 15 Oct 2009 15:58:35 +0000 (11:58 -0400)]
storage: Add ParseSourceString function for use with FindPoolSources.

This will simplify adding FindPoolSources support to more pool backends in
the future (as well as the test driver).

15 years agostorage: Break out function to add pool source to a SourceList.
Cole Robinson [Thu, 15 Oct 2009 15:41:53 +0000 (11:41 -0400)]
storage: Break out function to add pool source to a SourceList.

Similar in theory to *AssignDef type functions, this duplicate functionality
will be used by an future FindPoolSources implementations.

15 years agostorage: Break out pool source parsing to a separate function.
Cole Robinson [Thu, 15 Oct 2009 14:55:19 +0000 (10:55 -0400)]
storage: Break out pool source parsing to a separate function.

We need to parse a source XML block for FindPoolSources, so this is a step
in sharing the parsing. The new storage pool XML 2 XML tests cover this area
pretty well to ensure we aren't causing regressions.

15 years agoUpdate the documentation for virDomainMigrateToURI
Chris Lalancette [Fri, 23 Oct 2009 07:38:32 +0000 (09:38 +0200)]
Update the documentation for virDomainMigrateToURI

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoAdd support for an external TFTP boot server
Paolo Bonzini [Wed, 28 Oct 2009 14:57:49 +0000 (15:57 +0100)]
Add support for an external TFTP boot server

This patch adds an optional attribute to the <bootp> tag, that
allows to specify a TFTP server address other than the address of
the DHCP server itself.

This can be used to forward the BOOTP settings of the host down to the
guest.  This is something that configurations such as Xen's default
network achieve naturally, but must be done manually for NAT.

* docs/formatnetwork.html.in: Document new attribute.
* docs/schemas/network.rng: Add it to schema.
* src/conf/network_conf.h: Add it to struct.
* src/conf/network_conf.c: Add it to parser and pretty printer.
* src/network/bridge_driver.c: Put it in the dnsmasq command line.
* tests/networkxml2xmlin/netboot-proxy-network.xml
  tests/networkxml2xmlout/netboot-proxy-network.xml
  tests/networkxml2xmltest.c: add new tests

15 years agotest: Support virNodeDeviceCreate and virNodeDeviceDestroy
Cole Robinson [Wed, 14 Oct 2009 20:16:10 +0000 (16:16 -0400)]
test: Support virNodeDeviceCreate and virNodeDeviceDestroy

15 years agoFix some typos in comments
Dan Kenigsberg [Mon, 26 Oct 2009 23:02:46 +0000 (00:02 +0100)]
Fix some typos in comments

15 years agoFix problems in the Xen inotify driver.
Matthias Bolte [Sat, 24 Oct 2009 17:20:33 +0000 (19:20 +0200)]
Fix problems in the Xen inotify driver.

In xenInotifyXendDomainsDirLookup() the wrong UUID variable is used
to search in the config info list.

In xenInotifyEvent() the event is dispatched if it's NULL.

Both were introduced in bc898df2c74fe3c8efedfbbd430737bac950e65e.

15 years agoFix error message in qemudLoadDriverConfig()
Matthias Bolte [Thu, 22 Oct 2009 15:41:57 +0000 (17:41 +0200)]
Fix error message in qemudLoadDriverConfig()

* src/qemu/qemu_conf.c: change the error message to refer to
  'cgroup_controllers' instead of 'cgroup_device_acl'

15 years agoAdd a new syntax-check rule for gethostname.
Chris Lalancette [Fri, 23 Oct 2009 10:13:20 +0000 (12:13 +0200)]
Add a new syntax-check rule for gethostname.

We should always be using virGetHostname in place of
gethostname; thus add in a new syntax-check rule to make
sure no new uses creep in.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoVarious syntax-check fixes.
Chris Lalancette [Fri, 23 Oct 2009 10:10:38 +0000 (12:10 +0200)]
Various syntax-check fixes.

Make a pass over the syntax-check files, tightening up regex's,
un-ignoring certain files, and cleaning things up.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoTighten up nonreentrant syntax-check.
Chris Lalancette [Fri, 23 Oct 2009 10:07:17 +0000 (12:07 +0200)]
Tighten up nonreentrant syntax-check.

We can slightly tighten up the regex's used to detect the use of
nonreentrant functions.  We can also check src/util/virterror.c
by modifying a comment; I think it's worth it to get the additional
coverage.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoReplace a gethostname by virGetHostname in libvirtd.c
Chris Lalancette [Fri, 23 Oct 2009 10:05:01 +0000 (12:05 +0200)]
Replace a gethostname by virGetHostname in libvirtd.c

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoReplace two strcmp() by STREQ() in qemu_driver.c
Chris Lalancette [Fri, 23 Oct 2009 10:04:10 +0000 (12:04 +0200)]
Replace two strcmp() by STREQ() in qemu_driver.c

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoReplace gethostname by virGetHostname in xend_internal.c
Chris Lalancette [Fri, 23 Oct 2009 10:02:46 +0000 (12:02 +0200)]
Replace gethostname by virGetHostname in xend_internal.c

15 years agoRemove a completely bogus reference increment in the Xen driver.
Chris Lalancette [Fri, 23 Oct 2009 06:57:03 +0000 (08:57 +0200)]
Remove a completely bogus reference increment in the Xen driver.

xenUnifiedDomainEventRegister() calls out to
virDomainEventCallbackListAdd(), which increments the reference
count on the connection.  That is fine, but then
xenUnifiedDomainEventRegister() increments the usage count again,
leading to a usage count leak.  Remove the increment in the xen
register, and the UnrefConnect in the xen unregister.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoAdd a default log_level to qemudSetLogging to remove a build warning.
Chris Lalancette [Fri, 23 Oct 2009 06:56:21 +0000 (08:56 +0200)]
Add a default log_level to qemudSetLogging to remove a build warning.

(original patch from Charles Duffy)

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoBetter error message when libvirtd fails to start.
Chris Lalancette [Wed, 23 Sep 2009 10:38:21 +0000 (12:38 +0200)]
Better error message when libvirtd fails to start.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix potential false-positive OOM error reporting.
Matthias Bolte [Wed, 21 Oct 2009 20:27:09 +0000 (22:27 +0200)]
Fix potential false-positive OOM error reporting.

If no matching device was found (cap == NULL) then no strdup() call
was made and *wwnn and *wwpn are untouched. Checking them for NULL
in this situation may result in reporting an false-positive OOM error
because *wwnn and *wwpn may be initialized to NULL by the caller.

Only check *wwnn and *wwpn for NULL if a matching device was found
(cap != NULL) and thus strdup() was called.

* src/conf/node_device_conf.c: only report an OOM error if there
  really is one

15 years agoConsolidate virXPathNodeSet()
Daniel Veillard [Thu, 22 Oct 2009 08:32:15 +0000 (10:32 +0200)]
Consolidate virXPathNodeSet()

virXPathNodeSet() could return -1 when doing an evaluation failure
due to xmlXPathEval() from libxml2 behaviour.
* src/util/xml.c: make sure we always return 0 unless the returned
  XPath type is of the wrong type (meaning the query passed didn't
  evaluate to a node set and code must be fixed)

15 years agoSupport QEMU watchdog device.
Richard Jones [Wed, 21 Oct 2009 12:26:38 +0000 (13:26 +0100)]
Support QEMU watchdog device.

This adds simple support for configuring a guest with a QEMU/KVM
virtual hardware watchdog device.

15 years agoDo not log rotate very small logs
Dan Kenigsberg [Wed, 21 Oct 2009 11:56:04 +0000 (13:56 +0200)]
Do not log rotate very small logs

Without this, after few weeks without use, each defined domain grows a
tail of empty gzipped logs, instead of keeping just the last log of
interest.

* daemon/libvirtd.logrotate.in: only rotate when the log is over 100 KBytes

15 years ago528575 avoid libvirtd crash on LCX domain autostart
Daniel Veillard [Wed, 21 Oct 2009 11:32:20 +0000 (13:32 +0200)]
528575 avoid libvirtd crash on LCX domain autostart

https://bugzilla.redhat.com/show_bug.cgi?id=528575
virsh -c lxc:/// autostart vm1
was crashing the daemon

* src/lxc/lxc_conf.h src/lxc/lxc_conf.c: initialize the driver
  autostartDir to avoid a NULL reference and implement autostart for LXC

15 years agoFix virsh.c compilation warning
Jim Fehlig [Wed, 21 Oct 2009 10:59:43 +0000 (12:59 +0200)]
Fix virsh.c compilation warning

* tools/virsh.c: call to vshError() containing 'doexit' parameter
  sneaked in after said parameter was removed

15 years agoFix SELinux linking issues
Jim Fehlig [Wed, 21 Oct 2009 10:11:13 +0000 (12:11 +0200)]
Fix SELinux linking issues

* src/Makefile.am: add selinux CFLAGS and linker flags to security driver

15 years agoLXC implement missing macaddr assignment feature
Ryota Ozaki [Wed, 21 Oct 2009 10:04:02 +0000 (12:04 +0200)]
LXC implement missing macaddr assignment feature

Currently MAC address configuration of container veth is just ignored.
This patch implements the missing feature.

* src/lxc/veth.c, src/lxc/veth.h: add setMacAddr
* src/lxc/lxc_driver.c: set macaddr of container veth if specified

15 years agoFix a make dist error due to wrong EXTRA_DIST paths
Daniel Veillard [Wed, 21 Oct 2009 09:16:21 +0000 (11:16 +0200)]
Fix a make dist error due to wrong EXTRA_DIST paths

* tests/Makefile.am: networkpoolxml2xmlout and networkpoolxml2xmlin are
  really networkxml2xmlout and networkxml2xmlin

15 years agonode device: Break out get_wwns and get_parent_node helpers
Cole Robinson [Wed, 14 Oct 2009 19:47:10 +0000 (15:47 -0400)]
node device: Break out get_wwns and get_parent_node helpers

These will be used by the test driver, so move them to a shareable space.

15 years agonode device: Fix locking issue in virNodeDeviceDestroy
Cole Robinson [Wed, 14 Oct 2009 20:15:13 +0000 (16:15 -0400)]
node device: Fix locking issue in virNodeDeviceDestroy

Certain error paths won't unlock the node device object.

15 years agotests: Centralize VIR_TEST_DEBUG lookup, and document it
Cole Robinson [Fri, 16 Oct 2009 15:37:36 +0000 (11:37 -0400)]
tests: Centralize VIR_TEST_DEBUG lookup, and document it

Provide a simple interface for other tests to lookup the testDebug variable.
Also remove a redundant error message in interface tests.

If anyone feels inclined to change this env variable to match the existing
LIBVIRT_* format, it should now be easier to do so.

15 years agotests: Initialize virRandom in for test suite.
Cole Robinson [Thu, 8 Oct 2009 22:03:55 +0000 (18:03 -0400)]
tests: Initialize virRandom in for test suite.

Otherwise any virRandom calls will result in a segfault.

15 years agoRemove bogus const annotations to hash iterator
Daniel P. Berrange [Wed, 14 Oct 2009 10:17:24 +0000 (11:17 +0100)]
Remove bogus const annotations to hash iterator

Most of the hash iterators need to modify either payload of
data args. The const annotation prevents this.

* src/util/hash.h, src/util/hash.c: Remove const-ness from
  virHashForEach/Iterator
* src/xen/xm_internal.c: Remove bogus casts

15 years agofix virDomainMigrateToURI doc
Dan Kenigsberg [Mon, 19 Oct 2009 12:53:29 +0000 (14:53 +0200)]
fix virDomainMigrateToURI doc

* src/libvirt.c: remove reverences to non existent dconn parameter
  when using that entry point.

15 years agoLXC fix virCgroupGetValueStr problem with \n
Ryota Ozaki [Mon, 19 Oct 2009 12:29:42 +0000 (14:29 +0200)]
LXC fix virCgroupGetValueStr problem with \n

A cgroup file returns integer value terminated with '\n' and remaining
it has sometimes harmful effects, for example it leads virStrToLong_ull
to fail.
* src/util/cgroup.c: strip out terminating \n when reading a value

15 years agoRemove bashisms from schema tests.
Matthias Bolte [Fri, 16 Oct 2009 23:16:25 +0000 (01:16 +0200)]
Remove bashisms from schema tests.

Introduced in commit 39a7be470cc5477a96a4d53194291bf4c7b07185.

* tests/*schematest: replace 'source' with '.'
* tests/schematestutils.sh: remove 'function' keyword and add '()'

15 years agotests: Add storage volume XML 2 XML tests.
Cole Robinson [Fri, 9 Oct 2009 18:17:21 +0000 (14:17 -0400)]
tests: Add storage volume XML 2 XML tests.

15 years agotests: Add network XML to XML tests.
Cole Robinson [Fri, 9 Oct 2009 12:47:43 +0000 (08:47 -0400)]
tests: Add network XML to XML tests.

15 years agoschema: Update network schema.
Cole Robinson [Fri, 9 Oct 2009 12:48:22 +0000 (08:48 -0400)]
schema: Update network schema.

Make things a bit more readable, and properly handle forward mode 'route'.

15 years agotests: Add XML 2 XML tests for storage pools.
Cole Robinson [Thu, 8 Oct 2009 21:26:30 +0000 (17:26 -0400)]
tests: Add XML 2 XML tests for storage pools.

Move existing schema data to an input directory. Add extra files for more
thorough XML testing.

15 years agotests: Break out duplicate schema verification functionality.
Cole Robinson [Thu, 8 Oct 2009 22:06:59 +0000 (18:06 -0400)]
tests: Break out duplicate schema verification functionality.

All schema tests have identical functionality, so avoid the duplication.

15 years agotests: Fix text output for interface XML 2 XML
Cole Robinson [Thu, 8 Oct 2009 21:23:54 +0000 (17:23 -0400)]
tests: Fix text output for interface XML 2 XML

15 years agoDon't copy old machines from a domain which has none
Mark McLoughlin [Thu, 15 Oct 2009 11:09:17 +0000 (12:09 +0100)]
Don't copy old machines from a domain which has none

If the the qemu and kvm binaries are the same, we don't include machine
types in the kvm domain info.

However, the code which refreshes the machine types info from the
previous capabilities structure first looks at the kvm domain's info,
finds it matches and then copies the empty machine types list over
for the top-level qemu domain.

That doesn't make sense, we shouldn't copy an empty machin types list.

* src/qemu/qemu_conf.c: qemudGetOldMachinesFromInfo(): don't copy an
  empty machine types list.

15 years agoAvoid crash in virBufferEscapeString
Laine Stump [Thu, 15 Oct 2009 12:19:11 +0000 (14:19 +0200)]
Avoid crash in virBufferEscapeString

* src/util/buf.c: if virBufferEscapeString was called on a buffer that
  had 0 bytes of space, a size of -1 will be passed to snprintf, resulting
  in a segmentation fault, this preallocate some space.

15 years agoAdd ocfs2 to list of fs pool types
Jim Fehlig [Wed, 14 Oct 2009 15:03:22 +0000 (17:03 +0200)]
Add ocfs2 to list of fs pool types

* src/conf/storage_conf.c src/conf/storage_conf.h: extend the enums
  and values
* docs/schemas/storagepool.rng: add to the list of storage pool type
  formats

15 years agoLXC complement PATH environment variable
Ryota Ozaki [Wed, 14 Oct 2009 14:54:29 +0000 (16:54 +0200)]
LXC complement PATH environment variable

* src/lxc/lxc_driver.c: without PATH, the controller will definitely
  fail to call ip command

15 years agoFiner grained migration control
Chris Lalancette [Fri, 31 Jul 2009 10:10:22 +0000 (12:10 +0200)]
Finer grained migration control

Normally, when you migrate a domain from host A to host B,
the domain on host A remains defined but shutoff and the domain
on host B remains running but is a "transient".  Add a new
flag to virDomainMigrate() to allow the original domain to be
undefined on source host A, and a new flag to virDomainMigrate() to
allow the new domain to be persisted on the destination host B.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoRelease of 0.7.2
Daniel Veillard [Wed, 14 Oct 2009 09:16:13 +0000 (11:16 +0200)]
Release of 0.7.2

15 years agoFixing ca.po
Daniel Veillard [Wed, 14 Oct 2009 08:32:53 +0000 (10:32 +0200)]
Fixing ca.po

15 years agoUpdated and regenerated localizations
Daniel Veillard [Wed, 14 Oct 2009 08:30:25 +0000 (10:30 +0200)]
Updated and regenerated localizations

* de.po ja.po it.po hi.po gu.po or.po mr.po ml.po kn.po ru.po pl.po
  pa.po te.po ta.po: many updates

15 years agonetwork: Fix printing XML 'delay' attribute
Cole Robinson [Tue, 13 Oct 2009 15:31:27 +0000 (11:31 -0400)]
network: Fix printing XML 'delay' attribute

When specifying bridge delay via network XML define, we were looking for
the 'delay' attribute, but would dump the value as 'forwardDelay'. Have
the output match the expected input (and schema).

15 years agoFix virFileReadLimFD/virFileReadAll to handle EINTR
Daniel P. Berrange [Mon, 12 Oct 2009 19:32:33 +0000 (20:32 +0100)]
Fix virFileReadLimFD/virFileReadAll to handle EINTR

The fread_file_lim() function uses fread() but never handles
EINTR results, causing unexpected failures when reading QEMU
help arg info. It was unneccessarily using FILE * instead
of plain UNIX file handles, which prevented use of saferead()

* src/util/util.c: Switch fread_file_lim over to use saferead
  instead of fread, remove FILE * use, and rename

15 years agostorage: Fix generating iscsi 'auth' xml
Cole Robinson [Thu, 8 Oct 2009 22:05:36 +0000 (18:05 -0400)]
storage: Fix generating iscsi 'auth' xml

We were missing a closing tag, so the XML wasn't proper.

15 years agoschema: Update storage pool schema.
Cole Robinson [Thu, 8 Oct 2009 22:06:10 +0000 (18:06 -0400)]
schema: Update storage pool schema.

- mpath pools weren't listed
- scsi pools were missing an adapter section
- iscsi pools were missing an auth section
- Logical pools do not require a source name to be specified

15 years agoremote: Don't print a warning every time a remote call fails
Cole Robinson [Thu, 8 Oct 2009 14:58:29 +0000 (10:58 -0400)]
remote: Don't print a warning every time a remote call fails

$ sudo virsh pool-start idontexist
10:58:18.716: warning : processCallDispatchReply:7612 : Method call error
error: failed to get pool 'idontexist'
error: Storage pool not found: no pool with matching name 'idontexist'

That warning doesn't server much purpose being printed via a virsh call. So
remove the message.

15 years agostorage: Report errors in FindPoolSources
Cole Robinson [Thu, 8 Oct 2009 14:24:37 +0000 (10:24 -0400)]
storage: Report errors in FindPoolSources

15 years agotest: Activate interfaces specified through driver config file.
Cole Robinson [Wed, 7 Oct 2009 14:44:05 +0000 (10:44 -0400)]
test: Activate interfaces specified through driver config file.

This matches the behavior of domains, storage, etc. Also, fix up some
whitespace issues in the area.

15 years agoFix QEMU restore from file in raw format
Daniel P. Berrange [Mon, 12 Oct 2009 19:03:50 +0000 (20:03 +0100)]
Fix QEMU restore from file in raw format

The logic for running the decompression programs was broken in
commit f238709304f9f6c57204cdd943e542cbae38fa5f, so that for
non-raw formats the decompression program was never run, and
for raw formats, it tried to exec an argv[] with initial NULL
in the program name.

* src/qemu/qemu_driver.c: Fix logic in runing decompression program

15 years agoLXC fix return code handling in lxcVmStart
Ryota Ozaki [Tue, 13 Oct 2009 14:36:59 +0000 (16:36 +0200)]
LXC fix return code handling in lxcVmStart

In lxcVmStart we first should not reuse rc for another purpose
than the return value.

* src/lxc/lxc_driver.c: don't reuse rc for local procedure calls

15 years agoAdd a target for libvirt.devhelp
Daniel Veillard [Tue, 13 Oct 2009 14:19:57 +0000 (16:19 +0200)]
Add a target for libvirt.devhelp

* docs/Makefile.am: the lack of a target for devhelp/libvirt.devhelp
  broke 'make dist'

15 years agoFix a missing % on endif in spec file
Daniel Veillard [Tue, 13 Oct 2009 14:18:45 +0000 (16:18 +0200)]
Fix a missing % on endif in spec file

* libvirt.spec.in: missing % broke 'make rpm'

15 years agoTake domain type into account when looking up default machine
Mark McLoughlin [Mon, 12 Oct 2009 09:52:13 +0000 (10:52 +0100)]
Take domain type into account when looking up default machine

If one has e.g.

  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
      <wordsize>64</wordsize>
      <emulator>/usr/bin/qemu-system-x86_64</emulator>
      <machine>pc-0.11</machine>
      <machine canonical='pc-0.11'>pc</machine>
      <machine>pc-0.10</machine>
      <machine>isapc</machine>
      <domain type='qemu'>
      </domain>
      <domain type='kvm'>
        <emulator>/usr/bin/kvm</emulator>
        <machine>pc</machine>
        <machine>isapc</machine>
      </domain>
    </arch>
  </guest>

and start a guest with:

  <domain type='kvm'>
    ...
    <os>
      <type arch='x86_64'>hvm</type>
      ...
    </os>
  </domain>

then the default machine type should be 'pc' and not 'pc-0.11'

Issue was reported by Anton Protopopov.

* src/capabilities.[ch]: pass the domain type to
  virCapabilitiesDefaultGuestArch() and use it to look up the default
  machine type from a specific guest domain if needed.

* src/conf/domain_conf.c, src/xen/xm_internal.c: update

* tests/qemuxml2argvdata/qemuxml2argv-machine-aliases2.xml: update
  the domain type to 'kvm' and remove the machine type to check
  that the default gets looked up correctly

15 years agoFix schema to allow missing machine type
Mark McLoughlin [Mon, 12 Oct 2009 09:47:01 +0000 (10:47 +0100)]
Fix schema to allow missing machine type

The domain/os/type element may have an arch specified without having
a machine variant specified. In fact, this is what python-virtinst
does when defining a guest.

* docs/schemas/domain.rng: allow missing machine type

15 years agoRewrite example domain events programm for python
Daniel P. Berrange [Fri, 9 Oct 2009 12:05:10 +0000 (13:05 +0100)]
Rewrite example domain events programm for python

The existing python demo for domain events does not fully
implement the event loop contract. This makes the code useless
for real world applications. This change re-writes the demo so
that it has a full event loop implementation which is suitable
for application usage & better demonstrates integration

* examples/domain-events/events-python/event-test.py: Rewrite
  to include a real world usable event loop implementation

15 years agoRemove some auto-generated files
Daniel P. Berrange [Wed, 7 Oct 2009 10:15:45 +0000 (11:15 +0100)]
Remove some auto-generated files

Removes some auto-generated files still under version control.
It also moves the rule for generating NEWS into the Makefile.am
that's in the same directory as the output file to avoid confusion

* docs/libvirt-api.xml, docs/libvirt-refs.xml, NEWS: Remove
  auto-generated files from source control
* Makefile.am: Add rule for generating NEWS file
* docs/Makefile.am: Remove rule for generating NEWS file

15 years agoSupport a new peer-to-peer migration mode & public API
Daniel P. Berrange [Thu, 17 Sep 2009 17:10:04 +0000 (18:10 +0100)]
Support a new peer-to-peer migration mode & public API

Introduces several new public API options for migration

 - VIR_MIGRATE_PEER2PEER: With this flag the client only
   invokes the virDomainMigratePerform method, expecting
   the source host driver to do whatever is required to
   complete the entire migration process.
 - VIR_MIGRATE_TUNNELLED: With this flag the actual data
   for migration will be tunnelled over the libvirtd RPC
   channel. This requires that VIR_MIGRATE_PEER2PEER is
   also set.
 - virDomainMigrateToURI: This is variant of the existing
   virDomainMigrate method which does not require any
   virConnectPtr for the destination host. Given suitable
   driver support, this allows for all the same modes as
   virDomainMigrate()

The URI for VIR_MIGRATE_PEER2PEER must be a valid libvirt
URI. For non-p2p migration a hypervisor specific migration
URI is used.

virDomainMigrateToURI without a PEER2PEER flag is only
support for Xen currently, and it involves XenD talking
directly to XenD, no libvirtd involved at all.

* include/libvirt/libvirt.h.in: Add VIR_MIGRATE_PEER2PEER
  flag for migration
* src/libvirt_internal.h: Add feature flags for peer to
  peer migration (VIR_FEATURE_MIGRATE_P2P) and direct
  migration (VIR_MIGRATE_PEER2PEER mode)
* src/libvirt.c: Implement support for VIR_MIGRATE_PEER2PEER
  and virDomainMigrateToURI APIs.
* src/xen/xen_driver.c: Advertise support for DIRECT migration
* src/xen/xend_internal.c: Add TODO item for p2p migration
* src/libvirt_public.syms: Export virDomainMigrateToURI
  method
* src/qemu/qemu_driver.c: Add support for PEER2PEER and
  migration, and adapt TUNNELLED migration.
* tools/virsh.c: Add --p2p and --direct args and use the
  new virDomainMigrateToURI method where possible.

15 years agoRe-arrange doTunnelMigrate to simplify cleanup code
Daniel P. Berrange [Fri, 2 Oct 2009 15:14:27 +0000 (16:14 +0100)]
Re-arrange doTunnelMigrate to simplify cleanup code

Re-arrange the doTunnelMigrate method putting all non-QEMU local
state setup steps first. This maximises chances of success before
then starting destination QEMU for receiving incoming migration.
Altogether this can reduce the number of goto cleanup labels to
something more managable.

* qemu/qemu_driver.c: Re-order steps in doTunnelMigrate

15 years agoSeparate out code for sending tunnelled data
Daniel P. Berrange [Fri, 2 Oct 2009 15:02:25 +0000 (16:02 +0100)]
Separate out code for sending tunnelled data

Simplify the doTunnelMigrate code by pulling out the code for
sending all tunnelled data into separate helper

* qemu/qemu_driver.c: introduce doTunnelSendAll() method

15 years agoPull connection handling code out of doTunnelMigrate
Daniel P. Berrange [Fri, 2 Oct 2009 14:56:36 +0000 (15:56 +0100)]
Pull connection handling code out of doTunnelMigrate

Simplify the doTunnelMigrate() method by pulling out the code
which opens/closes the virConnectPtr  object into a parent
method

* qemu/qemu_driver.c: Add doPeer2PeerMigrate which then calls
  doTunnelMigrate with dconn & dom_xml

15 years agoFix stream abort upon I/O failure during migration
Daniel P. Berrange [Fri, 2 Oct 2009 14:49:50 +0000 (15:49 +0100)]
Fix stream abort upon I/O failure during migration

virStreamAbort is needed when the caller wishes to terminate
the stream early, not when virStreamSend fails.

* qemu/qemu_driver.c: Fix calling of virStreamAbort during
  tunnelled migration

15 years agoRefactor native QEMU migration code
Daniel P. Berrange [Fri, 2 Oct 2009 14:31:06 +0000 (15:31 +0100)]
Refactor native QEMU migration code

The code for tunnelled migration was added in a dedicated method,
but the native migration code is still inline in the top level
qemudDomainMigratePerform() API. Move the native code out into
a dedicated method too to make things more maintainable.

* src/qemu/qemu_driver.c: Pull code for performing a native
  QEMU migration out into separate method

15 years agoDon't force dconn to be NULL in virDomainMigrate
Daniel P. Berrange [Fri, 2 Oct 2009 14:20:23 +0000 (15:20 +0100)]
Don't force dconn to be NULL in virDomainMigrate

The code for tunnelled migration wierdly required the app to pass
a  NULL 'dconn' parameter, only to have to use virConnectOpen
itself shortly thereafter to get a 'dconn' object. Remove this
bogus check & require the app to always pas 'dconn' as before

* src/libvirt.c: Require 'dconn' for virDomainMigrate calls again
  and remove call to virConnectOpen

15 years agoRemove unneccessary uri_in parameter from virMigratePrepareTunnel
Daniel P. Berrange [Fri, 2 Oct 2009 14:05:11 +0000 (15:05 +0100)]
Remove unneccessary uri_in parameter from virMigratePrepareTunnel

Since virMigratePrepareTunnel() is used for migration over the
native libvirt connection, there is never any need to pass the
target URI to this method.

* daemon/remote.c, src/driver.h, src/libvirt.c, src/libvirt_internal.h,
  src/qemu/qemu_driver.c, src/remote/remote_driver.c,
  src/remote/remote_protocol.c, src/remote/remote_protocol.h,
  src/remote/remote_protocol.x: Remove 'uri_in' parameter from
  virMigratePrepareTunnel() method

15 years agoMove the VIR_DRV_FEATURE* constants
Daniel P. Berrange [Fri, 2 Oct 2009 13:43:22 +0000 (14:43 +0100)]
Move the VIR_DRV_FEATURE* constants

Move the VIR_DRV_FEATURE* constants into libvirt_internal.h
since these flags are indicating whether  APIs in the
libvirt_internal.h file are supported by a driver

* src/driver.h: Remove VIR_DRV_FEATURE* constants
* src/libvirt_internal.h: Add VIR_DRV_FEATURE* constants, using
  an enum instead of #define
* src/internal.h: pull in libvirt_internal.h

15 years agoFix configure.ac message vertical alignment
Daniel P. Berrange [Fri, 9 Oct 2009 09:42:09 +0000 (10:42 +0100)]
Fix configure.ac message vertical alignment

* configure.in: Align messages in configuration summary

15 years agoLXC add augeas support for config file
Amy Griffis [Thu, 8 Oct 2009 16:06:40 +0000 (18:06 +0200)]
LXC add augeas support for config file

* src/lxc/libvirtd_lxc.aug src/lxc/test_libvirtd_lxc.aug: augeas schemas
  for lxc.conf
* src/Makefile.am libvirt.spec.in: glue the new augeas files in

15 years agoLXC add driver config file lxc.conf
Amy Griffis [Thu, 8 Oct 2009 15:40:14 +0000 (17:40 +0200)]
LXC add driver config file lxc.conf

* src/lxc/lxc.conf: new configuration file, there is currently one
  tunable "log_with_libvirtd" that controls whether an lxc controller will
  log only to the container log file, or whether it will honor libvirtd's
  log output configuration. This provides a way to have libvirtd and its
  children log to a single file.  The default is to log to the container
  log file.
* src/Makefile.am libvirt.spec.in: add the new file
* src/lxc/lxc_conf.[ch] src/lxc/lxc_driver.c: read the new log value
  from the configuration file and pass the log informations when
  starting up a container.

15 years agoLXC do not truncate container log files on restart
Amy Griffis [Thu, 8 Oct 2009 15:37:09 +0000 (17:37 +0200)]
LXC do not truncate container log files on restart

* src/lxc/lxc_driver.c: use O_APPEND instead of O_TRUNC when opening
  the log file on lxcVmStart()

15 years agoLXC initialize logging configuration
Amy Griffis [Thu, 8 Oct 2009 15:16:08 +0000 (17:16 +0200)]
LXC initialize logging configuration

* src/lxc/lxc_driver.c src/lxc/lxc_controller.c: before launching the
  lxc controller, have the lxc driver query the log settings and setup
  envp[]. This provides the advantage of honoring the actual log
  configuration instead of only what had been set in the environment.
  The lxc controller now simply has to call virLogSetFromEnv().

15 years agoAdd debug for envp[] in virExecWithHook()
Amy Griffis [Thu, 8 Oct 2009 15:11:03 +0000 (17:11 +0200)]
Add debug for envp[] in virExecWithHook()

* src/util/util.c: output some debug if caller of virExecWithHook have
  set envp[]

15 years agoAdd accessors for logging filters and outputs
Amy Griffis [Thu, 8 Oct 2009 15:05:01 +0000 (17:05 +0200)]
Add accessors for logging filters and outputs

When configuring logging settings, keep more information about the
output destination. Add accessors to retrieve the filter and output
settings in the original string form; this to be used to set up
environment for a child process that also logs.

* src/util/logging.[ch]: add virLogGetFilters and virLogGetOutputs
  accessors and modify the internals (including virLogDefineOutput())
  to save the data needed for the accessors

15 years agoAdd virFileAbsPath() utility
Amy Griffis [Thu, 8 Oct 2009 14:55:58 +0000 (16:55 +0200)]
Add virFileAbsPath() utility

* src/util/util.[ch]: Add virFileAbsPath() function to ensure an
  absolute path for a potentially realtive path.
* src/libvirt_private.syms: add it in libvirt private symbols

15 years agoDocumentation and examples for SVirt Apparmor driver
Jamie Strandboge [Thu, 8 Oct 2009 14:42:05 +0000 (16:42 +0200)]
Documentation and examples for SVirt Apparmor driver

* docs/drvqemu.html.in: include documentation for AppArmor sVirt
  confinement
* examples/apparmor/TEMPLATE examples/apparmor/libvirt-qemu
  examples/apparmor/usr.lib.libvirt.virt-aa-helper
  examples/apparmor/usr.sbin.libvirtd: example templates and
  configuration files for SVirt Apparmor when using KVM/QEmu

15 years agosVirt AppArmor security driver
Jamie Strandboge [Thu, 8 Oct 2009 14:34:22 +0000 (16:34 +0200)]
sVirt AppArmor security driver

* configure.in: look for AppArmor and devel
* src/security/security_apparmor.[ch] src/security/security_driver.c
  src/Makefile.am: add and plug the new driver
* src/security/virt-aa-helper.c: new binary which is used exclusively by
  the AppArmor security driver to manipulate AppArmor.
* po/POTFILES.in: registers the new files
* tests/Makefile.am tests/secaatest.c tests/virt-aa-helper-test:
  tests for virt-aa-helper and the security driver, secaatest.c is
  identical to seclabeltest.c except it initializes the 'apparmor'
  driver instead of 'selinux'

15 years agocgroup: Fix -Werror breakage
Cole Robinson [Thu, 8 Oct 2009 14:26:42 +0000 (10:26 -0400)]
cgroup: Fix -Werror breakage

15 years agoMisc win32 build fixes
Daniel P. Berrange [Wed, 7 Oct 2009 10:18:31 +0000 (11:18 +0100)]
Misc win32 build fixes

* daemon/Makefile.am: Fix missing sasl rule
* src/datatypes.c: Add unistd.h to avoid gnulib bug
* src/util/cgroup.c: Disable mntent if not available

15 years agoFix handling return value of qemuMonitorSetBalloon
Ryota Ozaki [Wed, 7 Oct 2009 13:33:36 +0000 (15:33 +0200)]
Fix handling return value of qemuMonitorSetBalloon

* src/qemu/qemu_driver.c: The positive return value of
  qemuMonitorSetBalloon should be handled as a success

15 years agoLXC implement memory control APIs
Ryota Ozaki [Wed, 7 Oct 2009 13:26:23 +0000 (15:26 +0200)]
LXC implement memory control APIs

The patch implements the missing memory control APIs for lxc, i.e.,
domainGetMaxMemory, domainSetMaxMemory, domainSetMemory, and improves
domainGetInfo to return proper amount of used memory via cgroup.

* src/libvirt_private.syms: Export virCgroupGetMemoryUsage
  and add missing virCgroupSetMemory
* src/lxc/lxc_driver.c: Implement missing memory functions
* src/util/cgroup.c, src/util/cgroup.h: Add the function
  to get used memory

15 years agoAdd a domain argument to SVirt *RestoreImageLabel
Jamie Strandboge [Wed, 7 Oct 2009 10:36:35 +0000 (12:36 +0200)]
Add a domain argument to SVirt *RestoreImageLabel

When James Morris originally submitted his sVirt patches (as seen in
libvirt 0.6.1), he did not require on disk labelling for
virSecurityDomainRestoreImageLabel. A later commit[2] changed this
behavior to assume on disk labelling, which halts implementations for
path-based MAC systems such as AppArmor and TOMOYO where
vm->def->seclabel is required to obtain the label.

* src/security/security_driver.h src/qemu/qemu_driver.c
  src/security/security_selinux.c: adds the 'virDomainObjPtr vm'
  argument back to *RestoreImageLabel