]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
12 years agobuild: use strchr now that we can work around broken gcc
Eric Blake [Wed, 19 Dec 2012 19:28:48 +0000 (12:28 -0700)]
build: use strchr now that we can work around broken gcc

Revert the complex workaround of commit 39d91e9, now that we have
a nicer framework for shutting up broken gcc.

* src/util/buf.c (virBufferEscape): Simplify.

12 years agobuild: make broken -Wlogical-op test be gcc-only
Eric Blake [Wed, 19 Dec 2012 19:07:39 +0000 (12:07 -0700)]
build: make broken -Wlogical-op test be gcc-only

Commit 8b8fcdea introduced a check for broken gcc -Wlogical-op,
but did not guard the check against non-gcc compilers, which might
lead to spurious failures when another compiler encounters an
unknown pragma.  Additionally, all of our compiler warning logic
should belong in a single file, and use cache variables to allow
overriding the decision at configure time if necessary.

* configure.ac (BROKEN_GCC_WLOGICALOP): Move...
* m4/virt-compile-warnings.m4 (LIBVIRT_COMPILE_WARNINGS): ...here,
and update to modern autoconf idioms.

12 years agoutil: FreeBSD: stub out CPU affinity functions
Roman Bogorodskiy [Sun, 16 Dec 2012 14:47:56 +0000 (18:47 +0400)]
util: FreeBSD: stub out CPU affinity functions

12 years agonodeinfo: add FreeBSD support
Roman Bogorodskiy [Mon, 17 Dec 2012 18:12:44 +0000 (22:12 +0400)]
nodeinfo: add FreeBSD support

Uses sysctl(3) interface to obtain CPU and memory information on FreeBSD

12 years agoFix arch datatype in vahControl in virt-aa-helper.c
Daniel P. Berrange [Wed, 19 Dec 2012 11:45:31 +0000 (11:45 +0000)]
Fix arch datatype in vahControl in virt-aa-helper.c

When changing to virArch, the virt-aa-helper.c file was not
completely changed. The vahControl struct was left with a
char *arch field, instead of virArch arch field.

12 years agoChange string form of VIR_ARCH_ITANIUM back to ia64
Daniel P. Berrange [Wed, 19 Dec 2012 10:54:57 +0000 (10:54 +0000)]
Change string form of VIR_ARCH_ITANIUM back to ia64

Historically there was an inconsistency in handling of the
itanium arch. The xen driver & CPU model code treated it
as 'ia64' but the QEMU capabilities code used 'itanium'. On
the grounds that no one has ever seriously used  itanium
with QEMU, while RHEL shipped itanium with Xen, we should
favour 'ia64' as the canonical format

12 years agoFix parsing of arch from domain XML
Daniel P. Berrange [Wed, 19 Dec 2012 10:49:30 +0000 (10:49 +0000)]
Fix parsing of arch from domain XML

When parsing the arch from domain XML, the result was only
saved to a local variable, not the virDomainDefPtr

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoFix CPU baseline to not hardcode arch
Daniel P. Berrange [Wed, 19 Dec 2012 10:47:40 +0000 (10:47 +0000)]
Fix CPU baseline to not hardcode arch

Prior to the virArch changes, the CPU baseline method would
free the arch string in the returned CPU. Fix the regression
by setting arch to VIR_ARCH_NONE at the end

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoFix SELinux security label test
Daniel P. Berrange [Wed, 19 Dec 2012 10:05:17 +0000 (10:05 +0000)]
Fix SELinux security label test

If securityselinuxtest was run on a system with newer SELinux
policy it would fail, due to using svirt_tcg_t instead of
svirt_t. Fixing the domain type to be KVM avoids this issue.

12 years agoconf: eliminate redundant use of VIR_ALLOC
Martin Kletzander [Mon, 17 Dec 2012 15:03:15 +0000 (16:03 +0100)]
conf: eliminate redundant use of VIR_ALLOC

We can use VIR_REALLOC_N with NULL pointer, which behaves the same way
as VIR_ALLOC_N in that case, so no need for a condition that's
checking if some data are allocated already.

---

I tried to find other parts of the code similar to this, so I can do a
full cleanup for the whole repository, so I used this (excuse the long
line, but that's how I was writing it):

git grep -nHC 5 -e VIR_REALLOC_N -e VIR_ALLOC_N | while read line; do if [[ "$line" == "--" ]]; then if [[ ${#tmpbuf} -gt 10 && "$REALLOC_N" == "true" && "$ALLOC_N" == "true" ]]; then echo $line; while [[ ${#tmpbuf[*]} -gt 0 ]]; do echo "${tmpbuf[0]}"; tmpbuf=( "${tmpbuf[@]:1:${#tmpbuf[*]}}" ); done; fi; unset tmpbuf REALLOC_N ALLOC_N; else if [[ "$ALLOC_N" != "true" && "${line/VIR_ALLOC_N//}" != "${line}" ]]; then ALLOC_N="true"; fi; if [[ "$REALLOC_N" != "true" && "${line/VIR_REALLOC_N//}" != "${line}" ]]; then REALLOC_N="true"; fi; tmpbuf[${#tmpbuf[*]}]="$line"; fi; done | less

And reviewed the output just to find out this was the only occurrence of
the inconsistency.

12 years agoconf: minor indentation cleanups
Martin Kletzander [Mon, 17 Dec 2012 15:02:14 +0000 (16:02 +0100)]
conf: minor indentation cleanups

On few places there are too many levels of indentation when some of
them can be fixed with negating the option they are in or omitting
useless condition altogether.

12 years agofix typo in the word affinities
Martin Kletzander [Mon, 17 Dec 2012 15:01:41 +0000 (16:01 +0100)]
fix typo in the word affinities

This patch fixes just the word Affinites to Affinities (it's really
painful to search in TAGS without being able to find the right
function).

12 years agoFix libxl driver for virArch changes
Daniel P. Berrange [Tue, 18 Dec 2012 19:50:24 +0000 (19:50 +0000)]
Fix libxl driver for virArch changes

12 years agoFix test cases for virArch changes
Daniel P. Berrange [Tue, 18 Dec 2012 19:32:23 +0000 (19:32 +0000)]
Fix test cases for virArch changes

12 years agoFix XenAPI driver for virArch changes
Daniel P. Berrange [Tue, 18 Dec 2012 19:32:15 +0000 (19:32 +0000)]
Fix XenAPI driver for virArch changes

12 years agoExport all symbols from virarch.{c,h} to drivers/tests/etc
Daniel P. Berrange [Tue, 18 Dec 2012 19:31:47 +0000 (19:31 +0000)]
Export all symbols from virarch.{c,h} to drivers/tests/etc

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoConvert QEMU capabilities code to use virArch
Daniel P. Berrange [Tue, 11 Dec 2012 13:06:45 +0000 (13:06 +0000)]
Convert QEMU capabilities code to use virArch

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agospec: Do not install *.py[co] in python examples
Jiri Denemark [Mon, 17 Dec 2012 18:27:38 +0000 (19:27 +0100)]
spec: Do not install *.py[co] in python examples

Unfortunately, rpm is stupid enough to bytycompile python scripts even
though they are located in /usr/share/doc/libvirt-python-*/examples and
it does so after %install phase is finished. Thus there's no way we
could remove those files from BUILDROOT. As a workaround, we may safely
remove the examples subdirectory completely without losing anything. The
python scripts that were installed there are also copied directly into
/usr/share/doc/libvirt-python-*/ by

    %doc python/tests/*.py

rule. And yes, the files are actually tests, not examples.

12 years agoConvert CPU APIs to use virArch
Daniel P. Berrange [Tue, 11 Dec 2012 12:58:54 +0000 (12:58 +0000)]
Convert CPU APIs to use virArch

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoConvert capabilities / domain_conf to use virArch
Daniel P. Berrange [Mon, 10 Dec 2012 22:28:09 +0000 (22:28 +0000)]
Convert capabilities / domain_conf to use virArch

Convert the host capabilities and domain config structs to
use the virArch datatype. Update the parsers and all drivers
to take account of datatype change

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoConvert QEMU command line builder to virArch APIs
Daniel P. Berrange [Mon, 10 Dec 2012 22:02:41 +0000 (22:02 +0000)]
Convert QEMU command line builder to virArch APIs

Use virArch APIs to determine host architecture when launching
QEMU.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoConvert nodeGetInfo to virArch APIs
Daniel P. Berrange [Mon, 10 Dec 2012 21:58:16 +0000 (21:58 +0000)]
Convert nodeGetInfo to virArch APIs

Replace use of uname in nodeGetInfo with virArch APIs to
provide canonicalization of host architecture name

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoIntroduce a set of APIs for managing architectures
Daniel P. Berrange [Mon, 10 Dec 2012 21:54:00 +0000 (21:54 +0000)]
Introduce a set of APIs for managing architectures

Introduce a 'virArch' enum for CPU architectures. Include
data type providing wordsize and endianness, and APIs to
query this info and convert to/from enum and string form.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agospec: Fix script warning when uninstalling libvirt-client
Cole Robinson [Mon, 17 Dec 2012 23:34:25 +0000 (18:34 -0500)]
spec: Fix script warning when uninstalling libvirt-client

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

12 years agodocs: Fix documentation for readonly element
Jiri Denemark [Tue, 18 Dec 2012 13:06:16 +0000 (14:06 +0100)]
docs: Fix documentation for readonly element

12 years agoAdded Ján Tomko to the commiters list
Daniel Veillard [Tue, 18 Dec 2012 03:08:01 +0000 (11:08 +0800)]
Added Ján Tomko to the commiters list

And Guannan Ren who was missing from the list

12 years agonetwork: don't require private addresses if dnsmasq uses SO_BINDTODEVICE
Laine Stump [Mon, 17 Dec 2012 17:49:18 +0000 (12:49 -0500)]
network: don't require private addresses if dnsmasq uses SO_BINDTODEVICE

This is yet another refinement to the fix for CVE-2012-3411:

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

It turns out that it would be very intrusive to correctly backport the
entire --bind-dynamic option to older dnsmasq versions
(e.g. dnsmasq-2.48 that is used on RHEL6.x and CentOS 6.x), but very
simple to patch those versions to just use SO_BINDTODEVICE on all
their listening sockets (SO_BINDTODEVICE also has the desired effect
of permitting only traffic that was received on the interface(s) where
dnsmasq was set to listen.)

This patch modifies the dnsmasq capabilities detection to detect the
string:

    --bind-interfaces with SO_BINDTODEVICE

in the output of "dnsmasq --version", and in that case realize that
using the old --bind-interfaces option is just as safe as
--bind-dynamic (and therefore *not* forbid creation of networks that
use public IP address ranges).

If -bind-dynamic is available, it is still preferred over
--bind-interfaces.

Note that this patch does no harm in upstream, or in any distro's
downstream if it happens to end up there, but builds for distros that
have a new enough dnsmasq to support --bind-dynamic do *NOT* need to
specifically backport this patch; it's only required for distro
releases that have dnsmasq too old to have --bind-dynamic (and those
distros will need to add the SO_BINDTODEVICE patch to dnsmasq,
*including the extra string in the --version output*, as well.

12 years agoapparmor: Fix build
Jiri Denemark [Mon, 17 Dec 2012 20:17:15 +0000 (21:17 +0100)]
apparmor: Fix build

12 years agobuild: Fix AUTHORS generation
Jiri Denemark [Fri, 14 Dec 2012 15:14:15 +0000 (16:14 +0100)]
build: Fix AUTHORS generation

Using s/#authorslist#/$$out/ makes perl eat @domain part of all email
addresses from $out since it tries to interpret them as array variables.
I'm not sure if we can escape those in s/// but I know we can use print:

    s/#authorslist#// and print '$$out'

to tell perl not to even look inside $out.

This patch also fixes gen-AUTHORS so that it works in VPATH.

12 years agonetwork: fix indentation of networkDnsmasqConfContents
Laine Stump [Thu, 13 Dec 2012 16:40:47 +0000 (11:40 -0500)]
network: fix indentation of networkDnsmasqConfContents

Somehow I managed to push the changes to this file with improper
indentation. This patch just re-indents, reformats the comment lines,
and re-groups a couple of multi-line strings so that they fit within
80 columns. The resulting binary should be identical.

12 years ago.gitignore: add tests/sysinfotest
Cole Robinson [Mon, 17 Dec 2012 19:40:48 +0000 (14:40 -0500)]
.gitignore: add tests/sysinfotest

12 years agohostusb: Move USB_DEVFS define to hostusb.h to fix the build
Cole Robinson [Mon, 17 Dec 2012 19:37:11 +0000 (14:37 -0500)]
hostusb: Move USB_DEVFS define to hostusb.h to fix the build

12 years agodaemon: Preface polkit error output with 'polkit:'
Cole Robinson [Sun, 16 Dec 2012 22:59:08 +0000 (17:59 -0500)]
daemon: Preface polkit error output with 'polkit:'

There's been a few bugs about an expected error from polkit:

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

The error is:

Authorization requires authentication but no agent is available.

The error means that polkit needs a password, but there is no polkit
agent registered in your session. Polkit agents are the bit of UI that
pop up and actually ask for your password.

Preface the error with the string 'polkit:' so folks can hopefully
make more sense of it.

12 years agoAdd support for hotplug/unplug of host misc devices in LXC
Daniel P. Berrange [Wed, 28 Nov 2012 18:31:14 +0000 (18:31 +0000)]
Add support for hotplug/unplug of host misc devices in LXC

Wire up the attach/detach device drivers in LXC to support the
hotplug/unplug of host misc devices.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for hotplug/unplug of host storage devices in LXC
Daniel P. Berrange [Wed, 28 Nov 2012 16:48:18 +0000 (16:48 +0000)]
Add support for hotplug/unplug of host storage devices in LXC

Wire up the attach/detach device drivers in LXC to support the
hotplug/unplug of host storage devices.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for hotplug/unplug of USB host devices in LXC
Daniel P. Berrange [Tue, 27 Nov 2012 16:19:43 +0000 (16:19 +0000)]
Add support for hotplug/unplug of USB host devices in LXC

Wire up the attach/detach device drivers in LXC to support the
hotplug/unplug of USB host devices.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for hotplug/unplug of NIC devices in LXC
Daniel P. Berrange [Mon, 26 Nov 2012 16:14:37 +0000 (16:14 +0000)]
Add support for hotplug/unplug of NIC devices in LXC

Wire up the attach/detach device drivers in LXC to support the
hotplug/unplug of NICs.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for hotplug/unplug of disk devices in LXC
Daniel P. Berrange [Thu, 22 Nov 2012 16:16:06 +0000 (16:16 +0000)]
Add support for hotplug/unplug of disk devices in LXC

Wire up the attach/detach device drivers in LXC to support the
hotplug/unplug of disks.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for attach/detach/update hostdev devices in config for LXC
Daniel P. Berrange [Tue, 27 Nov 2012 13:58:56 +0000 (13:58 +0000)]
Add support for attach/detach/update hostdev devices in config for LXC

Wire up the attach/detach/update device APIs to support changing
of hostdevs in the persistent config file

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for attach/detach/update disk devices in config for LXC
Daniel P. Berrange [Thu, 22 Nov 2012 15:41:41 +0000 (15:41 +0000)]
Add support for attach/detach/update disk devices in config for LXC

Wire up the attach/detach/update device APIs to support changing
of disks in the persistent config file

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for attach/detach/update net devices in config for LXC
Daniel P. Berrange [Fri, 23 Nov 2012 10:36:47 +0000 (10:36 +0000)]
Add support for attach/detach/update net devices in config for LXC

Wire up the attach/detach/update device APIs to support changing
of network interfaces in the persistent config file

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd basic driver API framework for device attach/detach support in LXC
Daniel P. Berrange [Tue, 14 Aug 2012 15:38:27 +0000 (16:38 +0100)]
Add basic driver API framework for device attach/detach support in LXC

This wires up the LXC driver to support the domain device attach/
detach/update APIs, following the same code design as used in
the QEMU driver. No actual changes are possible with this commit,
it is only providing the framework

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for misc host device passthrough with LXC
Daniel P. Berrange [Wed, 28 Nov 2012 18:07:47 +0000 (18:07 +0000)]
Add support for misc host device passthrough with LXC

This extends support for host device passthrough with LXC to
cover misc devices. In this case all we need todo is a
mknod in the container's /dev and whitelist the device in
cgroups

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for storage host device passthrough with LXC
Daniel P. Berrange [Wed, 28 Nov 2012 16:13:27 +0000 (16:13 +0000)]
Add support for storage host device passthrough with LXC

This extends support for host device passthrough with LXC to
cover storage devices. In this case all we need todo is a
mknod in the container's /dev and whitelist the device in
cgroups

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for USB host device passthrough with LXC
Daniel P. Berrange [Fri, 23 Nov 2012 14:46:18 +0000 (14:46 +0000)]
Add support for USB host device passthrough with LXC

This adds support for host device passthrough with the
LXC driver. Since there is only a single kernel image,
it doesn't make sense to pass through PCI devices, but
USB devices are fine. For the latter we merely need to
make the /dev/bus/usb/NNN/MMM character device exist
in the container's /dev

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for disks with LXC
Daniel P. Berrange [Thu, 22 Nov 2012 14:33:48 +0000 (14:33 +0000)]
Add support for disks with LXC

Currently LXC guests can be given arbitrary pre-mounted
filesystems, however, for some usecases it is more appropriate
to provide block devices which the container can mount itself.
This first impl only allows for <disk type='block'>, in other
words exposing a host disk device to a container. Since LXC
does not have device namespace virtualization, we are cheating
a little bit. If the XML specifies /dev/sdc4 to be given to
the container as /dev/sda1, when we do the mknod /dev/sda1
in the container's /dev, we actually use the major:minor
number of /dev/sdc4, not /dev/sda1.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for SELinux labelling of hostdev storage/misc devices
Daniel P. Berrange [Wed, 28 Nov 2012 16:07:27 +0000 (16:07 +0000)]
Add support for SELinux labelling of hostdev storage/misc devices

The SELinux security driver needs to learn to label storage/misc
hostdev devices for LXC

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoRefactor SELinux security driver hostdev labelling
Daniel P. Berrange [Wed, 28 Nov 2012 15:54:56 +0000 (15:54 +0000)]
Refactor SELinux security driver hostdev labelling

Prepare to support different types of hostdevs by refactoring
the current SELinux security driver code

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAllow passing a vroot into security manager hostdev labelling
Daniel P. Berrange [Tue, 27 Nov 2012 16:17:47 +0000 (16:17 +0000)]
Allow passing a vroot into security manager hostdev labelling

When LXC labels USB devices during hotplug, it is running in
host context, so it needs to pass in a vroot path to the
container root.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSkip bulk relabelling of resources in SELinux driver when used with LXC
Daniel P. Berrange [Wed, 28 Nov 2012 13:54:39 +0000 (13:54 +0000)]
Skip bulk relabelling of resources in SELinux driver when used with LXC

The virSecurityManager{Set,Restore}AllLabel methods are invoked
at domain startup/shutdown to relabel resources associated with
a domain. This works fine with QEMU, but with LXC they are in
fact both currently no-ops since LXC does not support disks,
hostdevs, or kernel/initrd files. Worse, when LXC gains support
for disks/hostdevs, they will do the wrong thing, since they
run in host context, not container context. Thus this patch
turns then into a formal no-op when used with LXC. The LXC
controller will call out to specific security manager labelling
APIs as required during startup.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoRefactor LXC NIC creation to allow reuse by hotplug code
Daniel P. Berrange [Tue, 27 Nov 2012 12:55:02 +0000 (12:55 +0000)]
Refactor LXC NIC creation to allow reuse by hotplug code

The code for creating veth/macvlan devices is part of the
LXC process startup code. Refactor this a little and export
the methods to the rest of the LXC driver. This allows them
to be reused for NIC hotplug code

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for <hostdev mode="capabilities">
Daniel P. Berrange [Fri, 23 Nov 2012 13:50:29 +0000 (13:50 +0000)]
Add support for <hostdev mode="capabilities">

The <hostdev> device type has long had a redundant "mode"
attribute, which has always been "subsys". This finally
introduces a new mode "capabilities", which will be used
by the LXC driver for device assignment. Since container
based virtualization uses a single kernel, the idea of
assigning physical PCI devices doesn't make sense. It is
still reasonable to assign USB devices, but for assigning
arbitrary nodes in /dev, the new 'capabilities' mode is
to be used.

The first capability support is 'storage', which is for
assignment of block devices. Functionally this is really
pretty similar to the <disk> support. The only difference
is the device node name is identical in both host and
container namespaces.

    <hostdev mode='capabilities' type='storage'>
      <source>
        <block>/dev/sdf1</block>
      </source>
    </hostdev>

The second capability support is 'misc', which is for
assignment of character devices. There is no existing
parallel to this. Again the device node is the same
inside & outside the container.

    <hostdev mode='capabilities' type='misc'>
      <source>
        <char>/dev/input/event3</char>
      </source>
    </hostdev>

The reason for keeping the char & storage devices
separate in the domain XML, is to mirror the split
in the node device XML. NB the node device XML does
not yet report character devices, but that's another
new patch to come

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agotests: Add tests for sysinfo
Viktor Mihajlovski [Fri, 14 Dec 2012 15:08:25 +0000 (16:08 +0100)]
tests: Add tests for sysinfo

Test cases for virSysinfoRead. Initially, there are tests for
x86 (DMI based) and s390 (/proc/... based).
In lack of PPC data, I have stubbed out the test for it, but it
can be added with a minimal effort.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
12 years agoS390: Fix virSysinfoRead memory corruption
Viktor Mihajlovski [Fri, 14 Dec 2012 15:08:24 +0000 (16:08 +0100)]
S390: Fix virSysinfoRead memory corruption

There was a double free issue caused by virSysinfoRead on s390,
as the same manufacturer string instance was assigned to more
than one processor record.
Cleaned up other potential memory issues and restructured the sysinfo
parsing code by moving repeating patterns into a helper function.

The restructuring made it necessary to conditionally disable
-Wlogical-op for some older GCC versions, using pragma GCC diagnostic.
This is a GCC specific pragma, which is acceptable, since we're
using it to work around a GCC specific bug.

Finally, added a function virSysinfoSetup to configure the sysinfo
data source files/script during run time, to facilitate writing test
programs. This function is not published in sysinfo.h and only
there for testing.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
12 years agobuild: Check for broken GCC -Wlogical-op in configure
Viktor Mihajlovski [Fri, 14 Dec 2012 15:08:23 +0000 (16:08 +0100)]
build: Check for broken GCC -Wlogical-op in configure

Some older versions of GCC report a false positive on code like
  char * haystack, needle;
  strchr(haystack, needle);

Added an extra check in configure.ac which will
  #define BROKEN_GCC_WLOGICALOP 1
in this case, allowing to special handle "offending" code.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
12 years agoconf: cpu: Break some long lines
Peter Krempa [Mon, 17 Dec 2012 11:04:14 +0000 (12:04 +0100)]
conf: cpu: Break some long lines

12 years agoconf: cpu: Refactor parsing of vendor_id and fallback attributes
Peter Krempa [Mon, 17 Dec 2012 10:49:33 +0000 (11:49 +0100)]
conf: cpu: Refactor parsing of vendor_id and fallback attributes

This patch simplifies the code that parses the fallback and vendor_id
attributes from the domain xml cpu definition.

Changes done:
- free temp variables in the cleanup section instead of local use
- remove checking for presence of the attribute to directly getting the
value (saving call to virXPathBoolean)
- replace loop used to check for ',' in the vendor_id string with strchr

12 years agoconf: cpu: Fix memory leak when specifying cpu vendor_id manually
Peter Krempa [Mon, 17 Dec 2012 10:48:37 +0000 (11:48 +0100)]
conf: cpu: Fix memory leak when specifying cpu vendor_id manually

The field was not freed from the cpu definition.

12 years agoconf: cpu: Fix parsing of vendor_id
Ken ICHIKAWA [Mon, 17 Dec 2012 08:05:59 +0000 (17:05 +0900)]
conf: cpu: Fix parsing of vendor_id

This patch fixes a problem that vendor_id attribute can not be defined
when fallback attribute is not defined.

If I define domain xml like below:
<domain>
  <cpu>
    <model vendor_id='aaaabbbbcccc'>core2duo</model>
  </cpu>
</domain>

In dumpxml, vendor_id is not reflected:
<domain>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>core2duo</model>
  </cpu>
</domain>

The expected output is:
<domain>
  <cpu mode='custom' match='exact'>
    <model fallback='allow' vendor_id='aaaabbbbcccc'>core2duo</model>
  </cpu>
</domain>

If the fallback attribute and vendor_id attribute is defined at the same
time, it's reflected as expected.

Signed-off-by: Ken ICHIKAWA <ichikawa.ken@jp.fujitsu.com>
12 years agoSupport custom 'svirt_tcg_t' context for TCG based guests
Daniel P. Berrange [Wed, 12 Dec 2012 11:47:19 +0000 (11:47 +0000)]
Support custom 'svirt_tcg_t' context for TCG based guests

The current SELinux policy only works for KVM guests, since
TCG requires the 'execmem' privilege. There is a 'virt_use_execmem'
boolean to turn this on globally, but that is unpleasant for users.
This changes libvirt to automatically use a new 'svirt_tcg_t'
context for TCG based guests. This obsoletes the previous
boolean tunable and makes things 'just work(tm)'

Since we can't assume we run with new enough policy, I also
make us log a warning message (once only) if we find the policy
lacks support. In this case we fallback to the normal label and
expect users to set the boolean tunable

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agodocs: Replace </br> with <br/> in docs/news.html.in
Peter Krempa [Mon, 17 Dec 2012 10:01:16 +0000 (11:01 +0100)]
docs: Replace </br> with <br/> in docs/news.html.in

12 years agotests: add one -device video device testcase
Guannan Ren [Fri, 14 Dec 2012 07:09:17 +0000 (15:09 +0800)]
tests: add one -device video device testcase

The testcase is for testing non-fixed PCI address for primary
video device and using video args to -deivce qemu option.

12 years agoqemu: use newer -device video device in qemu commandline
Guannan Ren [Fri, 14 Dec 2012 07:08:01 +0000 (15:08 +0800)]
qemu: use newer -device video device in qemu commandline

'-device VGA' maps to '-vga std'
'-device cirrus-vga' maps to '-vga cirrus'
'-device qxl-vga' maps to '-vga qxl'
             (there is also '-device qxl' for secondary devices)
'-device vmware-svga' maps to '-vga vmware'

For qemu(>=1.2), we can use -device to replace -vga for video
device. For the primary video device, the patch tries to use 0x2
slot for matching old qemu. If the 0x2 slot is allocated already,
the addr property could help for using any available slot.
For qemu(< 1.2), we keep using -vga for primary device.

12 years agoconf: add optional attribte primary to video <model> element
Guannan Ren [Mon, 17 Dec 2012 06:01:20 +0000 (14:01 +0800)]
conf: add optional attribte primary to video <model> element

If there are multiple video devices
primary = 'yes' marks this video device as the primary one.
The rest are secondary video devices. No more than one could be
mark as primary. If none of them has primary attribute, the first
one will be the primary by default like what it was.
The reason of this changing is that for qemu, only one primary video
device is permitted which can be of any type. For secondary video
devices, only qxl is allowd. Primary attribute removes the restriction
that the first have to be the primary one.

We always put the primary video device into the first position of
video device structure array after parsing.

12 years agoqemu: add qemu vga devices caps and one cap to mark them usable
Guannan Ren [Fri, 14 Dec 2012 07:06:31 +0000 (15:06 +0800)]
qemu: add qemu vga devices caps and one cap to mark them usable

QEMU_CAPS_DEVICE_QXL          -device qxl
QEMU_CAPS_DEVICE_VGA          -device VGA
QEMU_CAPS_DEVICE_CIRRUS_VGA   -device cirrus-vga
QEMU_CAPS_DEVICE_VMWARE_SVGA  -device vmware-svga

QEMU_CAPS_DEVICE_VIDEO_PRIMARY  /* safe to use -device XXX
                                 for primary video device */

Fix a typo in qemuCapsObjectTypes, the string 'qxl' here
should be -device qxl rather than -vga [...|qxl|..]

12 years agoRelease of libvirt-1.0.1
Daniel Veillard [Mon, 17 Dec 2012 03:36:37 +0000 (11:36 +0800)]
Release of libvirt-1.0.1

- configure.ac docs/news.html.in: update for the release
- po/*.po: updated from transifex

12 years agobuild: minor build fixes for BSD
Eric Blake [Fri, 14 Dec 2012 19:02:10 +0000 (12:02 -0700)]
build: minor build fixes for BSD

Noticed these while building on FreeBSD.

* src/qemu/qemu_monitor.c (qemuMonitorBlockInfoLookup): Rename
variable to avoid 'devname' collision.
* src/qemu/qemu_driver.c (qemuDomainInterfaceStats): Mark unused
variable.

12 years agoSocket identity support for FreeBSD.
Roman Bogorodskiy [Fri, 14 Dec 2012 18:06:33 +0000 (22:06 +0400)]
Socket identity support for FreeBSD.

This adds an implementation of virNetSocketGetUNIXIdentity()
using LOCAL_PEERCRED socket option and xucred struct, defined
in <sys/ucred.h> on systems that have it.

12 years agonetwork: fix (non)update of dnsmasq config during virDomainUpdateDeviceFlags
Laine Stump [Fri, 14 Dec 2012 17:44:03 +0000 (12:44 -0500)]
network: fix (non)update of dnsmasq config during virDomainUpdateDeviceFlags

A forgotten "!" in recently-modified code at the top of
networkRefreshDaemon() meant an improper early return, which led to 1)
dnsmasq config files not being updated from the newly modified config,
and 2) dnsmasq not being sent a SIGHUP so that it could learn about
the changes to the config.

virNetworkDefGetIpByIndex() returns NULL if there are no ip objects of
the requested type, and if there are no IP elements, then dnsmasq
shouldn't be running, so we can return early. Otherwise we should
rewrite the config files and send a SIGHUP.

12 years agoRequire SANLK_INQ_WAIT for inq_lockspace support
Guido Günther [Thu, 13 Dec 2012 16:21:54 +0000 (17:21 +0100)]
Require SANLK_INQ_WAIT for inq_lockspace support

since compilation breaks otherwise with older libsanlock.

12 years agodocs: fix some typos in examples
Eric Blake [Fri, 14 Dec 2012 15:28:57 +0000 (08:28 -0700)]
docs: fix some typos in examples

As detected in https://bugzilla.redhat.com/show_bug.cgi?id=887187

* docs/formatdomain.html.in: Fix XML typos.

12 years agosanlock: Re-add lockspace unconditionally
Michal Privoznik [Fri, 14 Dec 2012 11:17:55 +0000 (12:17 +0100)]
sanlock: Re-add lockspace unconditionally

Currently, if sanlock is already registering a lockspace other
libvirtd instances (from other hosts) obtain -EINPROGRESS. On
sufficiently new sanlock, sanlock_inq_lockspace() is called,
which suspend execution until lockspace state is changed. With
current libvirt implementation, we fail to retry adding the
lockspace again but continue in error path. Therefore we produce
meaningless error message:

virLockManagerSanlockSetupLockspace:363 : Unable to add lockspace
/var/lib/libvirt/sanlock/__LIBVIRT__DISKS__: Success
qemudLoadDriverConfig:558 : Failed to load lock manager sanlock

We should try to re-add the lockspace after its state change to
be sure it was added successfully. In fact, with sufficiently new
sanlock we can just avoid dummy usleep() which is used if there's
no inquire API.

12 years agoinstall: fix virtlockd installation
Eric Blake [Thu, 13 Dec 2012 23:28:27 +0000 (16:28 -0700)]
install: fix virtlockd installation

The virtlockd daemon scripts were lousy, when compared to their
counterparts in daemon/Makefile.am.  In particular, when init
scripts were selected, this resulted in 'make distcheck' failing
due to failure to clean up src/virtlockd.init.

* src/Makefile.am (install-systemd): Fix dependencies.  Use MKDIR_P.
(uninstall-systemd): Remove empty directory.  Use fewer processes.
(install-init, install-sysconfig): Use MKDIR_P.
(uninstall-init): Remove correct file, and also empty directory.
(uninstall-sysconfig): Remove empty directory.
(DISTCLEANFILES): Clean up trivially built sources.

12 years agodocs: Fix location of libvirt.conf and auth.conf
Michał Łomnicki [Fri, 14 Dec 2012 02:52:17 +0000 (03:52 +0100)]
docs: Fix location of libvirt.conf and auth.conf

For a unprivileged user libvirt.conf and auth.conf are looked up in
$XDG_CONFIG_HOME but the docs incorrectly state that it's $XDG_CONFIG_DIR.

12 years agoqemu: don't fail update netdev on bridge detach failure
Laine Stump [Fri, 14 Dec 2012 00:09:51 +0000 (19:09 -0500)]
qemu: don't fail update netdev on bridge detach failure

When a network device's bridge connection is changed by
virDomainUpdateDevice, libvirt first removes the netdev's tap from its
old bridge, then adds it to the new bridge. Sometimes, due to a
network being destroyed while a guest device is still attached, the
tap may already be "removed" from the old bridge (or the old bridge
may not even exist any more); the existing code was needlessly failing
the update when this happened, making it impossible to recover from
the situation without completely detaching (i.e. removing) the netdev
from the guest and re-attaching.

Instead of failing the entire operation when removal of the tap from
the old bridge fails, this patch changes qemuDomainChangeNetBridge to
just log a warning and continue, allowing a reasonable recover from
the situation.

(you'll appreciate this change if you ever accidentally destroy a
network while your guests are still using it).

12 years agospec: Include lockd files in libvirt-daemon package
Jiri Denemark [Fri, 14 Dec 2012 10:57:27 +0000 (11:57 +0100)]
spec: Include lockd files in libvirt-daemon package

12 years agobuild: Install both qemu-lockd.conf and qemu-sanlock.conf
Jiri Denemark [Fri, 14 Dec 2012 10:54:16 +0000 (11:54 +0100)]
build: Install both qemu-lockd.conf and qemu-sanlock.conf

With sanlock enabled, only one of those files was installed.

12 years agobuild: use fewer cat processes
Eric Blake [Thu, 13 Dec 2012 22:43:39 +0000 (15:43 -0700)]
build: use fewer cat processes

* src/Makefile.am (libvirt.syms): Let cat loop for us.

12 years agoselinux: fix NULL dereference in GetSecurityMountOptions
Ján Tomko [Thu, 13 Dec 2012 10:44:37 +0000 (11:44 +0100)]
selinux: fix NULL dereference in GetSecurityMountOptions

In the case of an OOM error in virDomainDefGetSecurityLabelDef, secdef
is set to NULL, then dereferenced while printing the debug message.

12 years agobuild: Distribute more files
Jiri Denemark [Thu, 13 Dec 2012 22:13:21 +0000 (23:13 +0100)]
build: Distribute more files

12 years agolocking: Fix VPATH build and distribute generated files
Jiri Denemark [Thu, 13 Dec 2012 16:00:17 +0000 (17:00 +0100)]
locking: Fix VPATH build and distribute generated files

12 years agonetwork: prevent dnsmasq from listening on localhost
Laine Stump [Thu, 13 Dec 2012 06:46:40 +0000 (01:46 -0500)]
network: prevent dnsmasq from listening on localhost

This patch resolves the problem reported in:

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

The source of the problem was the fix for CVE 2011-3411:

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

which was originally committed upstream in commit
753ff83a50263d6975f88d6605d4b5ddfcc97560. That commit improperly
removed the "--except-interface lo" from dnsmasq commandlines when
--bind-dynamic was used (based on comments in the latter bug).

It turns out that the problem reported in the CVE could be eliminated
without removing "--except-interface lo", and removing it actually
caused each instance of dnsmasq to listen on localhost on port 53,
which created a new problem:

If another instance of dnsmasq using "bind-interfaces" (instead of
"bind-dynamic") had already been started (or if another instance
started later used "bind-dynamic"), this wouldn't have any immediately
visible ill effects, but if you tried to start another dnsmasq
instance using "bind-interfaces" *after* starting any libvirt
networks, the new dnsmasq would fail to start, because there was
already another process listening on port 53.

(Subsequent to the CVE fix, another patch changed the network driver
to put dnsmasq options in a conf file rather than directly on the
dnsmasq commandline, but preserved the same options.)

This patch changes the network driver to *always* add
"except-interface=lo" to dnsmasq conf files, regardless of whether we use
bind-dynamic or bind-interfaces. This way no libvirt dnsmasq instances
are listening on localhost (and the CVE is still fixed).

The actual code change is miniscule, but must be propogated through all
of the test files as well.

12 years agobuild: Fix VPATH build
Jiri Denemark [Thu, 13 Dec 2012 15:38:48 +0000 (16:38 +0100)]
build: Fix VPATH build

$(srcdir) is already part of $$file since commit f1f9a7ac7e.

12 years agovirsh: use vshReconnect for non-default connections too
Ján Tomko [Thu, 13 Dec 2012 13:08:01 +0000 (14:08 +0100)]
virsh: use vshReconnect for non-default connections too

For non-default connections (specified by the environment variable or
the command line option) we call virConnectOpenAuth without registering
the vshCatchDisconnect callback.

This calls vshReconnect instead which takes care of it.

12 years agovirsh: don't lie about reconnection in vshReconnect
Ján Tomko [Thu, 13 Dec 2012 13:08:00 +0000 (14:08 +0100)]
virsh: don't lie about reconnection in vshReconnect

Since we (ab)use vshReconnect for the default URI connection, if it
fails it might print 'Failed to reconnect to the hypervisor' even if we
were never connected before.

This changes it to only mention reconnection on the first try after
getting disconnected.

12 years agoAdd support for locking based on SCSI volume ID
Daniel P. Berrange [Tue, 11 Dec 2012 16:39:50 +0000 (16:39 +0000)]
Add support for locking based on SCSI volume ID

12 years agoAdd support for locking based on LVM volume uuid
Daniel P. Berrange [Tue, 11 Dec 2012 16:39:50 +0000 (16:39 +0000)]
Add support for locking based on LVM volume uuid

12 years agoAdd ability to maintain disk leases indirectly
Daniel P. Berrange [Tue, 14 Aug 2012 15:46:08 +0000 (16:46 +0100)]
Add ability to maintain disk leases indirectly

The default lockd driver behavour is to acquire leases
directly on the disk files. This introduces an alternative
mode, where leases are acquire indirectly on a file that
is based on a SHA256 hash of the disk filename.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd a virtlockd client as a lock driver impl
Daniel P. Berrange [Wed, 6 Jul 2011 16:30:08 +0000 (17:30 +0100)]
Add a virtlockd client as a lock driver impl

This adds a 'lockd' lock driver which is just a client which
talks to the lockd daemon to perform all locking. This will
be the default lock driver for any hypervisor which needs one.

* src/Makefile.am: Add lockd.so plugin
* src/locking/lock_driver_lockd.c: Lockd driver impl

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd support for re-exec() of virtlockd upon SIGUSR1
Daniel P. Berrange [Tue, 7 Aug 2012 11:13:26 +0000 (12:13 +0100)]
Add support for re-exec() of virtlockd upon SIGUSR1

The virtlockd daemon maintains file locks on behalf of libvirtd
and any VMs it is running. These file locks must be held for as
long as any VM is running. If virtlockd itself ever quits, then
it is expected that a node would be fenced/rebooted. Thus to
allow for software upgrads on live systemd, virtlockd needs the
ability to re-exec() itself.

Upon receipt of SIGUSR1, virtlockd will save its current live
state out to a file /var/run/virtlockd-restart-exec.json
It then re-exec()'s itself with exactly the same argv as it
originally had, and loads the state file, reconstructing any
objects as appropriate.

The state file contains information about all locks held and
all network services and clients currently active. An example
state document is

 {
    "server": {
        "min_workers": 1,
        "max_workers": 20,
        "priority_workers": 0,
        "max_clients": 20,
        "keepaliveInterval": 4294967295,
        "keepaliveCount": 0,
        "keepaliveRequired": false,
        "services": [
            {
                "auth": 0,
                "readonly": false,
                "nrequests_client_max": 1,
                "socks": [
                    {
                        "fd": 6,
                        "errfd": -1,
                        "pid": 0,
                        "isClient": false
                    }
                ]
            }
        ],
        "clients": [
            {
                "auth": 0,
                "readonly": false,
                "nrequests_max": 1,
                "sock": {
                    "fd": 9,
                    "errfd": -1,
                    "pid": 0,
                    "isClient": true
                },
                "privateData": {
                    "restricted": true,
                    "ownerPid": 1722,
                    "ownerId": 6,
                    "ownerName": "f18x86_64",
                    "ownerUUID": "97586ba9-df27-9459-c806-f016c8bbd224"
                }
            },
            {
                "auth": 0,
                "readonly": false,
                "nrequests_max": 1,
                "sock": {
                    "fd": 10,
                    "errfd": -1,
                    "pid": 0,
                    "isClient": true
                },
                "privateData": {
                    "restricted": true,
                    "ownerPid": 1784,
                    "ownerId": 7,
                    "ownerName": "f16x86_64",
                    "ownerUUID": "7b8e5e42-b875-61e9-b981-91ad8fa46979"
                }
            }
        ]
    },
    "defaultLockspace": {
        "resources": [
            {
                "name": "/var/lib/libvirt/images/f16x86_64.raw",
                "path": "/var/lib/libvirt/images/f16x86_64.raw",
                "fd": 14,
                "lockHeld": true,
                "flags": 0,
                "owners": [
                    1784
                ]
            },
            {
                "name": "/var/lib/libvirt/images/shared.img",
                "path": "/var/lib/libvirt/images/shared.img",
                "fd": 12,
                "lockHeld": true,
                "flags": 1,
                "owners": [
                    1722,
                    1784
                ]
            },
            {
                "name": "/var/lib/libvirt/images/f18x86_64.img",
                "path": "/var/lib/libvirt/images/f18x86_64.img",
                "fd": 11,
                "lockHeld": true,
                "flags": 0,
                "owners": [
                    1722
                ]
            }
        ]
    },
    "lockspaces": [

    ],
    "magic": "30199"
 }

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoEnable systemd socket activation with virtlockd
Daniel P. Berrange [Thu, 7 Jul 2011 14:02:32 +0000 (15:02 +0100)]
Enable systemd socket activation with virtlockd

This enhancement virtlockd so that it can receive a pre-opened
UNIX domain socket from systemd at launch time, and adds the
systemd service/socket unit files

* daemon/libvirtd.service.in: Require virtlockd to be running
* libvirt.spec.in: Add virtlockd systemd files
* src/Makefile.am: Install systemd files
* src/locking/lock_daemon.c: Support socket activation
* src/locking/virtlockd.service.in, src/locking/virtlockd.socket.in:
  systemd unit files
* src/rpc/virnetserverservice.c, src/rpc/virnetserverservice.h:
  Add virNetServerServiceNewFD() method
* src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Add virNetSocketNewListenFD
  method

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoImplement dispatch functions for lock protocol in virtlockd
Daniel P. Berrange [Fri, 3 Aug 2012 09:27:07 +0000 (10:27 +0100)]
Implement dispatch functions for lock protocol in virtlockd

Introduce a lock_daemon_dispatch.c file which implements the
server side dispatcher the RPC APIs previously defined in the
lock protocol.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoDefine a wire protocol for talking to the virtlockd daemon
Daniel P. Berrange [Wed, 6 Jul 2011 16:20:04 +0000 (17:20 +0100)]
Define a wire protocol for talking to the virtlockd daemon

The virtlockd daemon will be responsible for managing locks
on virtual machines. Communication will be via the standard
RPC infrastructure. This provides the XDR protocol definition

* src/locking/lock_protocol.x: Wire protocol for virtlockd
* src/Makefile.am: Include lock_protocol.[ch] in virtlockd

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoIntroduce basic infrastructure for virtlockd daemon
Daniel P. Berrange [Thu, 2 Aug 2012 19:06:50 +0000 (20:06 +0100)]
Introduce basic infrastructure for virtlockd daemon

The virtlockd daemon will maintain locks on behalf of libvirtd.
There are two reasons for it to be separate

 - Avoid risk of other libvirtd threads accidentally
   releasing fcntl() locks by opening + closing a file
   that is locked
 - Ensure locks can be preserved across libvirtd restarts.
   virtlockd will need to be able to re-exec itself while
   maintaining locks. This is simpler to achieve if its
   sole job is maintaining locks

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoRefactor creation of lock manager plugins
Daniel P. Berrange [Tue, 11 Dec 2012 15:59:21 +0000 (15:59 +0000)]
Refactor creation of lock manager plugins

Refactor virLockManagerPluginNew() so that the caller does
not need to pass in the config file path itself - just the
config directory and driver name.

Fix QEMU to actually pass in a config file when creating the
default lock manager plugin, rather than NULL.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoFix error reporting when fetching SCSI/LVM keys
Daniel P. Berrange [Tue, 11 Dec 2012 19:10:51 +0000 (19:10 +0000)]
Fix error reporting when fetching SCSI/LVM keys

The current  virStorageFileGet{LVM,SCSI}Key methods return
the key as the return value. Unfortunately it is desirable
for "NULL" to be a valid return value, as well as an error
indicator. Thus the returned key must instead be provided
as an out-parameter.

When we invoke lvs or scsi_id to extract ID for block devices,
we don't want virCommandWait logging errors messages. Thus we
must explicitly check 'status != 0', rather than letting
virCommandWait do it.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSupport network boot for HVM guests in libxl
Jim Fehlig [Wed, 12 Dec 2012 21:28:24 +0000 (14:28 -0700)]
Support network boot for HVM guests in libxl

The libxl driver ignored boot devices in the domain config,
preventing PXE booting HVM domains.  This patch accounts for
user-specified boot devices when building the libxl domain
configuration.

12 years agoFix probing of QED file format
Daniel P. Berrange [Thu, 13 Dec 2012 14:25:10 +0000 (14:25 +0000)]
Fix probing of QED file format

The QED file format is non-versioned, so although the magic
value matched, libvirt rejected it due to lack of a version
number to compare against. We need to distinguish this case
by allowing a value of '-2' to indicate a non-versioned file
where only the magic is required to match

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd lots of debugging to storage file probing code
Daniel P. Berrange [Thu, 13 Dec 2012 14:23:50 +0000 (14:23 +0000)]
Add lots of debugging to storage file probing code

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoLog warning if storage magic matches, but version does not
Daniel P. Berrange [Thu, 13 Dec 2012 14:22:51 +0000 (14:22 +0000)]
Log warning if storage magic matches, but version does not

To help us detect when new storage file versions come into
existance log a warning if the storage file magic matches,
but the version does not

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>