]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
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 v0.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

15 years agoFix up "make check"
Chris Lalancette [Wed, 23 Sep 2009 07:32:10 +0000 (09:32 +0200)] 
Fix up "make check"

While running make check, I noticed that it was actually using
the virsh binary from my system, in /usr/bin/virsh, and not the
one that was just compiled.  This is actually caused by a bug
in Makefile.am, where we didn't update the PATH to include tools.

While here, I also updated all of the scripts to properly define
the srcdir, abs_top_srcdir, and abs_top_builddir environment
variables.  This is required if you want to be able to run the
tests standalone (i.e. ./test instead of from make check).  I've
tested this on both RHEL-5 and Fedora-10 machines, and make check
works on both, as does running the individual tests by hand.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoCreate /var/log/libvirt/{lxc,uml} dirs
Mark McLoughlin [Tue, 6 Oct 2009 11:33:17 +0000 (12:33 +0100)] 
Create /var/log/libvirt/{lxc,uml} dirs

Otherwise logrotate barfs:

  error: error accessing /var/log/libvirt/uml: No such file or directory
  error: libvirtd:1 glob failed for /var/log/libvirt/uml/*.log
  error: found error in /var/log/libvirt/qemu/*.log /var/log/libvirt/uml/*.log /var/log/libvirt/lxc/*.log , skipping

* qemud/Makefile.am: always create /var/log/libvirt/{lxc,uml} when
  installing the logrotate conf; not ideal, but easier than making
  the logrotate conf depend on which drivers are enabled

15 years agoFix rebuilding of devhelp files
Daniel P. Berrange [Fri, 2 Oct 2009 11:29:15 +0000 (12:29 +0100)] 
Fix rebuilding of devhelp files

The devhelp/ directory files depend on libvirt-api.xml being
uptodate, but automake always processes SUBDIRS before the
current directory. So devhelp would be built and then the
libvirt-api.xml re-build, invalidating the devhelp data again.

To fix this all the rules for devhelp are moved directly
into the docs/Makefile.am allowing make to see the global
dependancy chain and thus build things in the correct order

* docs/Makefile.am: Add rules for devhelp rebuild
* docs/devhelp/Makefile.am: Remove devhelp rebuild
* configure.in: Remove docs/devhelp/Makefile.am

15 years agoFix ordering of <exports> in API description file
Daniel P. Berrange [Fri, 2 Oct 2009 11:17:18 +0000 (12:17 +0100)] 
Fix ordering of <exports> in API description file

* docs/apibuild.py: Make uniq() function sort keys before returning
  them to ensure consitent ordering of <exports> in XML file

15 years agotest: Support loading node device info from file/XML
Cole Robinson [Fri, 2 Oct 2009 14:05:17 +0000 (10:05 -0400)] 
test: Support loading node device info from file/XML

Also add some XML examples.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agonode conf: Make parsing routines consistent with other drivers
Cole Robinson [Fri, 2 Oct 2009 14:03:55 +0000 (10:03 -0400)] 
node conf: Make parsing routines consistent with other drivers

Add virNodeDeviceParseFile, and make virNodeDeviceParseNode non-static. These
will be used by the test driver.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agotest: Implement node device driver.
Cole Robinson [Thu, 1 Oct 2009 18:54:36 +0000 (14:54 -0400)] 
test: Implement node device driver.

Add a simple 'computer' device for the default driver. Only implement
the basic calls, no creation or destroy happening.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agonodedev: Break out virNodeDeviceHasCap to node_conf
Cole Robinson [Thu, 1 Oct 2009 18:53:43 +0000 (14:53 -0400)] 
nodedev: Break out virNodeDeviceHasCap to node_conf

Will be used by test driver node device implementation.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agonodedev: Add locking in nodeNumOfDevices
Cole Robinson [Thu, 1 Oct 2009 18:51:39 +0000 (14:51 -0400)] 
nodedev: Add locking in nodeNumOfDevices

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agotest: Throw a proper error in GetBridgeName
Cole Robinson [Wed, 23 Sep 2009 15:54:48 +0000 (11:54 -0400)] 
test: Throw a proper error in GetBridgeName

Throw error in GetBridgeName if net has no bridge.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Add a newline after custom classes
Cole Robinson [Fri, 2 Oct 2009 17:05:03 +0000 (13:05 -0400)] 
python: Add a newline after custom classes

In the generated bindings, custom classes are squashed against the following
class, which hurts readability.

15 years agopython: Fix generated virInterface method names
Cole Robinson [Wed, 23 Sep 2009 16:51:55 +0000 (12:51 -0400)] 
python: Fix generated virInterface method names

A mistake in the generator was causing virInterface methods to be generated
with unpredicatable names ('ceUndefine', instead of just 'undefine'). This
fixes the method names to match existing convention.

Does anyone care if we are breaking API compat? My guess is that no one is
using the python interface bindings yet.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Use a pure python implementation of 'vir*GetConnect'
Cole Robinson [Wed, 23 Sep 2009 16:38:47 +0000 (12:38 -0400)] 
python: Use a pure python implementation of 'vir*GetConnect'

The API docs explictly warn that we shouldn't use the C vir*GetConnect calls
in bindings: doing so can close the internal connection pointer and cause
things to get screwy. Implement these calls in python.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Don't generate bindings for vir*Ref
Cole Robinson [Wed, 23 Sep 2009 16:17:03 +0000 (12:17 -0400)] 
python: Don't generate bindings for vir*Ref

They are only for use in implementing the bindings, so shouldn't be
exposed to regular API users.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Don't generate conflicting conn.createXML functions.
Cole Robinson [Wed, 23 Sep 2009 16:09:09 +0000 (12:09 -0400)] 
python: Don't generate conflicting conn.createXML functions.

A special case in the generator wasn't doing its job, and duplicate
conn.createXML functions were being generated. The bindings diff is:

@@ -1079,14 +1079,6 @@ class virConnect:
         return __tmp

     def createXML(self, xmlDesc, flags):
-        """Create a new device on the VM host machine, for example,
-           virtual HBAs created using vport_create. """
-        ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags)
-        if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self)
-        __tmp = virNodeDevice(self, _obj=ret)
-        return __tmp
-
-    def createXML(self, xmlDesc, flags):
         """Launch a new guest domain, based on an XML description
           similar to the one returned by virDomainGetXMLDesc() This
           function may requires privileged access to the hypervisor.
@@ -1327,6 +1319,14 @@ class virConnect:
         __tmp = virNetwork(self, _obj=ret)
         return __tmp

+    def nodeDeviceCreateXML(self, xmlDesc, flags):
+        """Create a new device on the VM host machine, for example,
+           virtual HBAs created using vport_create. """
+        ret = libvirtmod.virNodeDeviceCreateXML(self._o, xmlDesc, flags)
+        if ret is None:raise libvirtError('virNodeDeviceCreateXML() failed', conn=self)
+        __tmp = virNodeDevice(self, _obj=ret)
+        return __tmp
+
     def nodeDeviceLookupByName(self, name):
         """Lookup a node device by its name. """
         ret = libvirtmod.virNodeDeviceLookupByName(self._o, name)

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Remove use of xmllib in generator.py
Cole Robinson [Fri, 2 Oct 2009 15:20:47 +0000 (11:20 -0400)] 
python: Remove use of xmllib in generator.py

xmllib has been deprecated since python 2.0, and running the generator throws
a warning. Move to using xml.sax

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agopython: Remove FastParser from generator.
Cole Robinson [Fri, 2 Oct 2009 14:34:54 +0000 (10:34 -0400)] 
python: Remove FastParser from generator.

FastParser uses sgmlop, a non-standard python module meant as a replacement
for xmllib (which is deprecated since python 2.0). Fedora doesn't even carry
this module, and the generator doesn't have high performance requirements, so
just rip the code out.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years agoconfigure: Add explict --with-python option.
Cole Robinson [Fri, 2 Oct 2009 15:19:47 +0000 (11:19 -0400)] 
configure: Add explict --with-python option.

--with-python currently already works for enabling/disabling the python
bindings, but doesn't show up in the help output.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
15 years ago526769 change logrotate config default to weekly
Daniel Veillard [Mon, 5 Oct 2009 15:03:14 +0000 (17:03 +0200)] 
526769 change logrotate config default to weekly

* daemon/libvirtd.logrotate.in: change to weekly rotation of logs,
  keep a month worth of data and also extend to cover LXC and UML
  domain logs

15 years agoFix typo in Makefile.am breaking NEWS file generation
Daniel P. Berrange [Fri, 2 Oct 2009 11:01:10 +0000 (12:01 +0100)] 
Fix typo in Makefile.am breaking NEWS file generation

* docs/Makefile.am: Fix syntax error in NEWS rule, '$' should be '$$'
  to escape correctly

15 years agoFix emission of domain events messages
Daniel P. Berrange [Wed, 30 Sep 2009 13:33:05 +0000 (14:33 +0100)] 
Fix emission of domain events messages

The code which updated the message length after writing the
payload wrote the updated length word in the wrong place since
the XDR object was given a buffer pointing to the start of the
header payload, rather than message start.

* daemon/remote.c: Fix updating of event message length so that
  we actually send the payload, not just the header

15 years agounbreak `make rpcgen'
Paolo Bonzini [Thu, 1 Oct 2009 18:18:29 +0000 (20:18 +0200)] 
unbreak `make rpcgen'

Fix "make rpcgen", broken by the directory reorganization.

* src/Makefile.am (rpcgen): Fix path to rpcgen_fix.pl.

15 years agounbreak migration
Paolo Bonzini [Thu, 1 Oct 2009 18:18:28 +0000 (20:18 +0200)] 
unbreak migration

Fix migration, broken in two different ways by the QEMU monitor
abstraction.  Note that the QEMU console emits a "\r\n" as the
line-ending.

* src/qemu/qemu_monitor_text.c (qemuMonitorGetMigrationStatus):
Fix "info migrate" command and its output's parsing.

15 years agoTunnelled migration.
Chris Lalancette [Wed, 30 Sep 2009 10:51:54 +0000 (12:51 +0200)] 
Tunnelled migration.

Implementation of tunnelled migration, using a Unix Domain Socket
on the qemu backend.  Note that this requires very new versions of
qemu (0.10.7 at least) in order to get the appropriate bugfixes.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix build in separate build directory
Jiri Denemark [Thu, 1 Oct 2009 14:55:09 +0000 (16:55 +0200)] 
Fix build in separate build directory

* cfg.mk: use $(srcdir)/ prefix for Makefile.nonreentrant include
* examples/domain-events/events-c/Makefile.am tools/Makefile.am
  examples/hellolibvirt/Makefile.am: extend the include paths to
  use $(top_srcdir)/include too.

15 years agoFix documentation and comment typos
Paolo Bonzini [Thu, 1 Oct 2009 14:42:40 +0000 (16:42 +0200)] 
Fix documentation and comment typos

Fix a few mispellings :-) of "successfully" and regenerate
docs/libvirt-*.xml.
* src/libvirt.c: Fix typos.
* src/secret/secret_driver.c: Fix typos.
* docs/libvirt-api.xml: Regenerate.
* docs/libvirt-refs.xml: Regenerate.

15 years agoVarious monitor improvements for migration.
Chris Lalancette [Wed, 30 Sep 2009 12:51:32 +0000 (14:51 +0200)] 
Various monitor improvements for migration.

The upcoming tunnelled migration needs to be able to set
a migration in progress in the background, as well as
be able to cancel a migration when a problem has happened.
This patch allows for both of these to properly work.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix USB device re-labelling
Mark McLoughlin [Wed, 30 Sep 2009 17:37:03 +0000 (18:37 +0100)] 
Fix USB device re-labelling

A simple misplaced break out of a switch results in:

  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./vendor': No such file or directory
  libvir: error : Failed to open file '/sys/bus/pci/devices/0000:00:54c./device': No such file or directory
  libvir: error : this function is not supported by the hypervisor: Failed to read product/vendor ID for 0000:00:54c.

when trying to passthrough a USB host device to qemu.

* src/security_selinux.c: fix a switch/break thinko

15 years agoAvoid a libvirtd crash on broken input 523418
Daniel Veillard [Thu, 1 Oct 2009 09:54:38 +0000 (11:54 +0200)] 
Avoid a libvirtd crash on broken input 523418

* src/conf/domain_conf.c: a simple typo in an XML domain file could lead
  to a crash, because we called STRPREFIX() on the looked up value without
  checking it was non-null.

15 years agoIncorrect error message in virDomainNetDefParseXML
Florian Vichot [Wed, 30 Sep 2009 16:51:30 +0000 (18:51 +0200)] 
Incorrect error message in virDomainNetDefParseXML

* src/conf/domain_conf.c: when declaring a <interface type="bridge">
  tag, <source> needs a "bridge" attribute, but the parser complains
  about a missing "dev" attribute.

15 years agoFix a few 'make rpm' breakages
Daniel Veillard [Wed, 30 Sep 2009 12:34:15 +0000 (14:34 +0200)] 
Fix a few 'make rpm' breakages

* Makefile.am: examples/domain-events/events-python should be added
  to dist tarball
* libvirt.spec.in: there is no makefile in domain-events but in
  domain-events/events-c and python/libvirtclass.txt has vanished

15 years ago523639 Allows a <description> tag for domains
Daniel Veillard [Wed, 30 Sep 2009 14:07:24 +0000 (16:07 +0200)] 
523639 Allows a <description> tag for domains

* docs/schemas/domain.rng: allow one <description> tag in the top level
  of the <domain> to store user information as text
* src/conf/domain_conf.c src/conf/domain_conf.h: extend the structure
  to store this text, grab it at parse time and save it back when
  present after <uuid>

15 years agoAdd src/util/storage_file.c to the POTFILES.in.
Chris Lalancette [Wed, 30 Sep 2009 12:12:03 +0000 (14:12 +0200)] 
Add src/util/storage_file.c to the POTFILES.in.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoAdd a qemu feature flag for unix socket migration.
Chris Lalancette [Wed, 30 Sep 2009 10:52:34 +0000 (12:52 +0200)] 
Add a qemu feature flag for unix socket migration.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoPass remote_message_header to the dispatch functions.
Chris Lalancette [Wed, 30 Sep 2009 10:29:20 +0000 (12:29 +0200)] 
Pass remote_message_header to the dispatch functions.

This is necessary for the dispatch functions to be able to use
streams in the future.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoLet remoteClientStream only do RX if requested.
Chris Lalancette [Wed, 30 Sep 2009 10:47:43 +0000 (12:47 +0200)] 
Let remoteClientStream only do RX if requested.

Right now, the stream stuff assumes that a stream is always
going to be used for transmit.  This is not the case, and in
fact doesn't work with the tunnelled migration stuff.  Add
a flag to remoteClientStream() to allow it to do RX only.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix up a few typos in the tree.
Chris Lalancette [Tue, 22 Sep 2009 09:42:06 +0000 (11:42 +0200)] 
Fix up a few typos in the tree.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix up some warnings from stream DEBUG statements.
Chris Lalancette [Wed, 30 Sep 2009 11:05:21 +0000 (13:05 +0200)] 
Fix up some warnings from stream DEBUG statements.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
15 years agoFix apibuild.py warnings
Matthias Bolte [Wed, 30 Sep 2009 11:41:28 +0000 (13:41 +0200)] 
Fix apibuild.py warnings

Function comments for virStreamEvent{Add,Update,Remove}Callback() are
missing a trailing ':'. Therefore apibuild.py fails to parse the comment
and warns about the missing ':'.

* docs/libvirt-api.xml, docs/libvirt-refs.xml: updated by apibuild.py
* src/libvirt.c: add missing ':' in function comments

15 years agoChange signature of remoteSendStreamData() to fix compile warning
Matthias Bolte [Wed, 30 Sep 2009 10:37:10 +0000 (12:37 +0200)] 
Change signature of remoteSendStreamData() to fix compile warning

The actual type of size_t is architecture dependent. Because the len
parameter is used as unsigned int in remoteSendStreamData(), change its
type to unsigned int.

* daemon/dispatch.[ch]: change size_t to unsigned int for
  remoteSendStreamData()

15 years agoRe-label image file backing stores
Mark McLoughlin [Fri, 25 Sep 2009 13:20:13 +0000 (14:20 +0100)] 
Re-label image file backing stores

Use virStorageFileGetMetadata() to find any backing stores for images
and re-label them

Without this, qemu cannot access qcow2 backing files, see:

  https://bugzilla.redhat.com/497131

* src/security/security_selinux.c: re-label backing store files in
  SELinuxSetSecurityImageLabel()

15 years agoAdd virStorageFileGetMetadata() helper
Mark McLoughlin [Tue, 29 Sep 2009 08:41:23 +0000 (09:41 +0100)] 
Add virStorageFileGetMetadata() helper

* src/util/storage_file.c: add virStorageFileGetMetadata() so that
  the caller does not need to open the file

15 years agoMove virStorageGetMetadataFromFD() to libvirt_util
Mark McLoughlin [Tue, 29 Sep 2009 08:34:48 +0000 (09:34 +0100)] 
Move virStorageGetMetadataFromFD() to libvirt_util

Finally, we get to the point of all this.

Move virStorageGetMetadataFromFD() to virStorageFileGetMetadataFromFD()
and move to src/util/storage_file.[ch]

There's no functional changes in this patch, just code movement

* src/storage/storage_backend_fs.c: move code from here ...

* src/util/storage_file.[ch]: ... to here

* src/libvirt_private.syms: export virStorageFileGetMetadataFromFD()

15 years agoIntroduce virStorageFileMetadata structure
Mark McLoughlin [Tue, 29 Sep 2009 08:23:04 +0000 (09:23 +0100)] 
Introduce virStorageFileMetadata structure

Introduce a metadata structure and make virStorageGetMetadataFromFD()
fill it in.

* src/util/storage_file.h: add virStorageFileMetadata

* src/backend/storage_backend_fs.c: virStorageGetMetadataFromFD() now
  fills in the virStorageFileMetadata structure

15 years agoSplit virStorageGetMetadataFromFD() from virStorageBackendProbeTarget()
Mark McLoughlin [Tue, 29 Sep 2009 08:07:14 +0000 (09:07 +0100)] 
Split virStorageGetMetadataFromFD() from virStorageBackendProbeTarget()

Prepare the code probing a file's format and associated metadata for
moving into libvirt_util.

* src/storage/storage_backend_fs.c: re-factor the format and metadata
  probing code in preparation for moving it

15 years agoMove file format enum to libvirt_util
Mark McLoughlin [Fri, 25 Sep 2009 13:20:13 +0000 (14:20 +0100)] 
Move file format enum to libvirt_util

Rename virStorageVolFormatFileSystem to virStorageFileFormat and
move to src/util/storage_file.[ch]

* src/Makefile.am: add src/util/storage_file.[ch]

* src/conf/storage_conf.[ch]: move enum from here ...

* src/util/storage_file.[ch]: .. to here

* src/libvirt_private.syms: update To/FromString exports

* src/storage/storage_backend.c, src/storage/storage_backend_fs.c,
  src/vbox/vbox_tmpl.c: update for above changes