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

14 years agoAdd blktap2 support to xend driver
Jim Fehlig [Tue, 24 Aug 2010 17:31:14 +0000 (11:31 -0600)]
Add blktap2 support to xend driver

Xen4.0 includes a new blktap2 implementation, which is specified
with 'tap2' prefix.  AFAICT it's configuration syntax is identical
to blktap, with exception of 'tap2' vs 'tap' prefix.  This patch
takes the simple approach of accepting and generating sexp
containing 'tap2' prefix.

14 years agoesx: Map the .vmx annotation to the domain XML description
Matthias Bolte [Fri, 27 Aug 2010 15:23:49 +0000 (17:23 +0200)]
esx: Map the .vmx annotation to the domain XML description

Take care of escaping '"' and '|' (the escape character).

Add tests for this.

14 years agoMove hextobin as virHexToBin to util.c
Matthias Bolte [Fri, 27 Aug 2010 21:13:45 +0000 (23:13 +0200)]
Move hextobin as virHexToBin to util.c

virHexToBin will be used in the .vmx handling code.

14 years agoPHYP: Bad comparison when checking for existing domain name
Eduardo Otubo [Tue, 17 Aug 2010 19:04:49 +0000 (16:04 -0300)]
PHYP: Bad comparison when checking for existing domain name

When creating a new domain from XML, the check for an existing
domain name should compare the return of the function to a valid
LPAR ID (!= -1) and not to error (== -1).

14 years agoesx: Fix esxVI_BuildSelectSet's invalid argument check
Matthias Bolte [Thu, 26 Aug 2010 22:07:23 +0000 (00:07 +0200)]
esx: Fix esxVI_BuildSelectSet's invalid argument check

The check was altered in 8c48743b9737ad4d246ab6043fd299316f9a2091
and got too strict, I've no clue how that snuck in. This check
makes every try to open a connection using the ESX driver fail
with an invalid argument error.

Revert the change to the check and add a comment to prevent future
mistakes with this check.

14 years agoesx: Add read-only storage volume access
Matthias Bolte [Sat, 7 Aug 2010 22:24:29 +0000 (00:24 +0200)]
esx: Add read-only storage volume access

This allows to list existing volumes and to retrieve information
about them.

14 years agoMove libvirt-guests init script and config to tools
Jiri Denemark [Wed, 25 Aug 2010 12:07:26 +0000 (14:07 +0200)]
Move libvirt-guests init script and config to tools

Since libvirt-guests init script and its configuration do not require
libvirtd to be running/installed, it was a bad idea to put them into
daemon directory. libvirt.spec even includes these files in
libvirt-client subpackage, which may result in build failure for
client-only builds when the whole daemon directory is just skipped.

14 years agospec: Fix undefined with_libnl
Jiri Denemark [Wed, 25 Aug 2010 10:28:02 +0000 (12:28 +0200)]
spec: Fix undefined with_libnl

When building libvirt RPM without macvtap, with_libnl would be
undefined.

14 years agoSupport virDomainAttachDevice and virDomainDetachDevice for disks in UML
Soren Hansen [Mon, 23 Aug 2010 09:31:27 +0000 (11:31 +0200)]
Support virDomainAttachDevice and virDomainDetachDevice for disks in UML

UML supports hot plugging and unplugging of various devices. This patch
exposes this functionality for disks.

Signed-off-by: Soren Hansen <soren@linux2go.dk>
14 years agoRename qemudShrinkDisks to virDomainDiskRemove and move to domain_conf.c
Soren Hansen [Mon, 23 Aug 2010 09:31:26 +0000 (11:31 +0200)]
Rename qemudShrinkDisks to virDomainDiskRemove and move to domain_conf.c

Other drivers will need this same functionality, so move it to up to
conf/domain_conf.c and give it a more general name.

Signed-off-by: Soren Hansen <soren@linux2go.dk>
14 years agodocs: fix lxc examples
Serge Hallyn [Tue, 15 Jun 2010 22:46:21 +0000 (16:46 -0600)]
docs: fix lxc examples

* docs/drvlxc.html.in: Use correct VM name, and mention that
libvirt_lxc might be in an alternate location.

14 years agoFix handling of sparse NUMA topologies
Daniel P. Berrange [Tue, 17 Aug 2010 15:09:28 +0000 (11:09 -0400)]
Fix handling of sparse NUMA topologies

When finding a sparse NUMA topology, libnuma will return ENOENT
the first time it is invoked. On subsequent invocations it
will return success, but with an all-1's CPU mask. Check for
this, to avoid polluting the capabilities XML with 4096 bogus
CPUs

* src/nodeinfo.c: Check for all-1s CPU mask

14 years agoLog return value for virConnectGetCapabilities
Daniel P. Berrange [Tue, 17 Aug 2010 15:08:19 +0000 (11:08 -0400)]
Log return value for virConnectGetCapabilities

Enabling debug doesn't show the capabilities XML for a connection.
Add an extra debug statement for the return value

* src/libvirt.c: Enable debug logging of capabilities XML

14 years agoTry harder to send RPC error message back to client
Daniel P. Berrange [Tue, 17 Aug 2010 14:31:51 +0000 (10:31 -0400)]
Try harder to send RPC error message back to client

When failing to serialize the normal RPC reply, try harder to
send a error message back to the client, instead of immediately
closing the connection.

* daemon/dispatch.c: Improve error messages when RPC reply
  can not be sent

14 years agoAdd explicit warning messages when failing to serialize to XDR
Daniel P. Berrange [Tue, 17 Aug 2010 14:23:27 +0000 (10:23 -0400)]
Add explicit warning messages when failing to serialize to XDR

When libvirtd fails to serialize a message to XDR the client
connection is terminated immediately. To enable this to be
diagnosed, log the message which caused the problem on the
server

* daemon/dispatch.c: Log XDR serialization failures

14 years agoAllow chardev of type 'file' for UML domains.
Soren Hansen [Mon, 23 Aug 2010 11:25:50 +0000 (13:25 +0200)]
Allow chardev of type 'file' for UML domains.

Like the comment suggested, we just open the file and pass the file
descriptor to uml. The input "stream" is set to "null", since I couldn't
find any useful way to actually use a file for input for a chardev and
this also mimics what e.g. QEmu does internally.

Signed-off-by: Soren Hansen <soren@linux2go.dk>
14 years agoesx: Improve object-by-type lookup performance
Matthias Bolte [Sat, 21 Aug 2010 16:49:18 +0000 (18:49 +0200)]
esx: Improve object-by-type lookup performance

Instead of using one big traversal spec for lookup use a set of
more fine grained traversal specs that are selected based on the
actual needs of the lookup.

This gives up to 20% speedup for certain operations like domain
listing due to less HTTP(S) traffic.

14 years agoxen tests: Fix PV-VFB tests with RHEL-5 API
Jiri Denemark [Mon, 23 Aug 2010 13:43:51 +0000 (15:43 +0200)]
xen tests: Fix PV-VFB tests with RHEL-5 API

RHEL-5 Xen doesn't support the old style vnc configuration. In sexpr, we
can't really check it with rhel5-api turned on. However, for XM
configuration files it's sufficient to use cfg version 1 instead of 2.

14 years agoxml2sexprtest: Remove graphics from unrelated tests
Jiri Denemark [Mon, 23 Aug 2010 13:42:12 +0000 (15:42 +0200)]
xml2sexprtest: Remove graphics from unrelated tests

This caused unnecessary make check failures when libvirt is configured
--with-rhel5-api

14 years agoxen tests: Fix missing "type ioemu" with rhel5-api
Jiri Denemark [Mon, 23 Aug 2010 12:58:08 +0000 (14:58 +0200)]
xen tests: Fix missing "type ioemu" with rhel5-api

The most common cause of errors with rhel5-api turn on was missing
"(type ioemu)" in sexpr or its equivalent in XM configuration file. This
happens because the presence of that part in sexpr (or cfg) depends on
xen version the host is running. Let's avoid it by explicitly specifying
interface model which ensures "type ioemu" will always be emitted.

This patch adds

    <model type='e1000'/>

withing the interface element in all affected xml files. And

    (model 'e1000')

to all corresponding sexpr files with similar fix to cfg files. Such
configuration works regardless on Xen version.

14 years agonodeinfotest: Print libvirt error on failure
Jiri Denemark [Mon, 23 Aug 2010 14:48:33 +0000 (16:48 +0200)]
nodeinfotest: Print libvirt error on failure

If linuxNodeInfoCPUPopulate() fails, the test would just print "FAILED"
which is not very informative. It's better to print the real error.

14 years agoxenapi: support xenapi 5.6.0 headers
Eric Blake [Fri, 20 Aug 2010 23:35:54 +0000 (17:35 -0600)]
xenapi: support xenapi 5.6.0 headers

* src/xenapi/xenapi_driver.c (xenapiDomainGetInfo): Avoid using
XEN_VM_POWER_STATE_UNKNOWN, which disappeared in newer xenapi.
* src/xenapi/xenapi_utils.c (mapPowerState): Likewise.

14 years agoAdd support for -enable-kqemu flag
Daniel P. Berrange [Fri, 23 Jul 2010 11:05:32 +0000 (12:05 +0100)]
Add support for -enable-kqemu flag

Previously QEMU enabled KQEMU by default and had -no-kqemu.
0.11.x switched to requiring -enable-kqemu. 0.12.x dropped
kqemu entirely. This patch adds support for -enable-kqemu
so 0.11.x works. It replaces a huge set of if() with a
switch() to make the code a bit more readable.

* src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Support
  -enable-kqemu

14 years agoesx: Use MD5 sum of mount path as storage pool UUID
Matthias Bolte [Sun, 8 Aug 2010 18:45:12 +0000 (20:45 +0200)]
esx: Use MD5 sum of mount path as storage pool UUID

With the previous storage pool UUID source not all storage pools
had a proper UUID, especially GSX storage pools. The mount path
is unique per host and cannot change during the lifetime of the
datastore. Therefore, it's MD5 sum can be used as UUID.

Use gnulib's crypto/md5 module to generate the MD5 sum.

14 years agoesx: Make sure dumpxml outputs proper ID for active domains
Matthias Bolte [Fri, 20 Aug 2010 18:42:45 +0000 (20:42 +0200)]
esx: Make sure dumpxml outputs proper ID for active domains

14 years agoxenapi: Fix compile error in previous commit
Matthias Bolte [Fri, 20 Aug 2010 21:28:28 +0000 (23:28 +0200)]
xenapi: Fix compile error in previous commit

14 years agoAdd actions to virDomainLifecycle enum
Jim Fehlig [Thu, 12 Aug 2010 17:15:44 +0000 (11:15 -0600)]
Add actions to virDomainLifecycle enum

Xen supports on_crash actions coredump-{destroy,restart}.  libvirt
cannot parse config returned by xend that contains either of these
actions

xen52 # xm li -l test | grep on_crash
    (on_crash coredump-restart)
xen52 # virsh dumpxml test
error: internal error unknown lifecycle type coredump-restart

This patch adds a new virDomainLifecycleCrash enum and appends
the new options to existing destroy, restart, preserve, and
rename-restart options.

14 years agoqemu: Remove code duplication
Jiri Denemark [Fri, 20 Aug 2010 11:57:35 +0000 (13:57 +0200)]
qemu: Remove code duplication

We already filled the PCI address structure when we checked whether it's
free or not, so let's just use the structure here instead of filling it
again.

14 years agoqemu: Check for errors when converting PCI address to string
Jiri Denemark [Fri, 20 Aug 2010 11:53:54 +0000 (13:53 +0200)]
qemu: Check for errors when converting PCI address to string

14 years agoqemu: Fix JSON migrate_set_downtime command
Jiri Denemark [Thu, 19 Aug 2010 13:59:25 +0000 (15:59 +0200)]
qemu: Fix JSON migrate_set_downtime command

14 years agovbox: factor a large function
Eric Blake [Wed, 18 Aug 2010 23:20:07 +0000 (17:20 -0600)]
vbox: factor a large function

* src/vbox/vbox_tmpl.c (vboxDomainCreateWithFlags): Split...
(vboxStartMachine): ...into new helper.

14 years agovbox: add location used in rpmfusion release
Eric Blake [Wed, 18 Aug 2010 22:59:20 +0000 (16:59 -0600)]
vbox: add location used in rpmfusion release

* configure.ac (vbox_xpcomc_dir): Add another potential dir.

14 years agoxenapi: avoid sprintf
Eric Blake [Wed, 18 Aug 2010 22:57:00 +0000 (16:57 -0600)]
xenapi: avoid sprintf

* src/xenapi/xenapi_utils.h (createVifNetwork): Delete prototype.
* src/xenapi/xenapi_utils.c (createVifNetwork): Change signature,
and use virAsprintf.  Detect allocation failure.
(createVMRecordFromXml): Adjust caller.

14 years agostorage: avoid s[n]printf
Eric Blake [Wed, 18 Aug 2010 21:54:11 +0000 (15:54 -0600)]
storage: avoid s[n]printf

* src/storage/storage_backend.c (virStorageBackendCreateQemuImg)
(virStorageBackendCreateQcowCreate): Use virAsprintf instead.
* src/storage/storage_backend_disk.c
(virStorageBackendDiskCreateVol, virStorageBackendDiskPartFormat):
Likewise.

14 years agomaint: whitespace cleanups
Eric Blake [Wed, 18 Aug 2010 20:54:48 +0000 (14:54 -0600)]
maint: whitespace cleanups

* src/storage/storage_backend_disk.c
(virStorageBackendDiskPartFormat): Fix spacing.

14 years agobuild: delete dead comments
Eric Blake [Wed, 18 Aug 2010 19:54:11 +0000 (13:54 -0600)]
build: delete dead comments

* src/qemu/qemu_driver.c (qemudGetProcessInfo): Clean up.
* src/uml/uml_driver.c (umlGetProcessInfo): Likewise.
* src/xen/sexpr.c (_string2sexpr): Likewise.

14 years agostorage: add support for Vendor and Model in XML
Patrick Dignan [Tue, 17 Aug 2010 17:44:27 +0000 (12:44 -0500)]
storage: add support for Vendor and Model in XML

I wrote a patch to add support for listing the Vendor and Model of a
storage pool in the storage pool XML.  This would allow vendor
extensions of specific devices.  The patch includes a test for the new
attributes as well.

Patrick Dignan

14 years agouml: fix logic bug in checking reply length
Eric Blake [Mon, 16 Aug 2010 21:21:38 +0000 (15:21 -0600)]
uml: fix logic bug in checking reply length

* src/uml/uml_driver.c (umlMonitorCommand): Validate that enough
bytes were read to dereference both res.length, and that many
bytes from res.data.
Reported by Soren Hansen.

14 years agonwfilter: use consistent OOM reporting
Eric Blake [Wed, 18 Aug 2010 18:10:08 +0000 (12:10 -0600)]
nwfilter: use consistent OOM reporting

* src/nwfilter/nwfilter_driver.c (nwfilterLog): Delete.
(nwfilterDriverStartup): Use virReportOOMError instead.

14 years agobuild: fix compiler warning
Eric Blake [Wed, 18 Aug 2010 19:43:26 +0000 (13:43 -0600)]
build: fix compiler warning

node_device/node_device_driver.c: In function 'nodeDeviceVportCreateDelete':
node_device/node_device_driver.c:423: error: implicit declaration of function 'stat' [-Wimplicit-function-declaration]

* src/node_device/node_device_driver.c (includes): Add <sys/stat.h>.

14 years agoxen: Fix scheduler setting problems
Daniel Veillard [Tue, 17 Aug 2010 16:30:17 +0000 (18:30 +0200)]
xen: Fix scheduler setting problems

Doing `virsh schedinfo rhel5u3 --cap 65535' the hypervisor does the
call, but does not change the value nor raise an error. Best is just to
consider it's not in the allowed values. The problem is that the error
won't be output since the xend driver will then be called and raise an
error

    error: this function is not supported by the hypervisor: unsupported
    in xendConfigVersion < 4

which will override the useful information from
xenUnifiedDomainSetSchedulerParameters(). So best is to also invert the
order in which the xen sub-drivers are called.

* src/xen/xen_hypervisor.c: mark 65535 cap value as out of bound
* src/xen/xen_hypervisor.c: reverse the order of the calls to the xen
  sub drivers to get the error message if needed

14 years agonodedev: Free the right pointers when getting WWNs fails
Jiri Denemark [Tue, 17 Aug 2010 15:49:12 +0000 (17:49 +0200)]
nodedev: Free the right pointers when getting WWNs fails

14 years agonodedev: Fix sysfs paths for vport operations
Dave Allan [Tue, 17 Aug 2010 15:21:16 +0000 (17:21 +0200)]
nodedev: Fix sysfs paths for vport operations

Some kernels, such as the one used in RHEL-5, have vport_create and
vport_delete operation files in /sys/class/scsi_host/hostN directory
instead of /sys/class/fc_host/hostN. Let's check both paths for
compatibility reasons.

This also removes unnecessary '/' characters from sysfs paths containing
LINUX_SYSFS_FC_HOST_PREFIX.

14 years agoxen: Fix device count on detach
Daniel Berrange [Tue, 17 Aug 2010 14:14:28 +0000 (16:14 +0200)]
xen: Fix device count on detach