]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/log
people/liuw/libxenctrl-split/libvirt.git
11 years agoconf: Fix virNetworkAssignDef's comment.
lawrancejing [Tue, 24 Sep 2013 02:05:37 +0000 (10:05 +0800)]
conf: Fix virNetworkAssignDef's comment.

11 years agoAdd test case for virNetServerClient object identity code
Daniel P. Berrange [Mon, 23 Sep 2013 11:39:19 +0000 (12:39 +0100)]
Add test case for virNetServerClient object identity code

Start a test case for the virNetServerClient object, which
initially checks the creation of a virIdentityPtr object.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdd a virNetSocketNewConnectSockFD method
Daniel P. Berrange [Mon, 23 Sep 2013 10:58:26 +0000 (11:58 +0100)]
Add a virNetSocketNewConnectSockFD method

To allow creation of a virNetSocketPtr instance from a pre-opened
socketpair FD, add a virNetSocketNewConnectSockFD method.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agopython: add bindings for virConnectGetCPUModelNames
Giuseppe Scrivano [Mon, 23 Sep 2013 09:46:04 +0000 (11:46 +0200)]
python: add bindings for virConnectGetCPUModelNames

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agovirsh: add function to get the CPU models for an arch
Giuseppe Scrivano [Mon, 23 Sep 2013 09:46:03 +0000 (11:46 +0200)]
virsh: add function to get the CPU models for an arch

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agovirConnectGetCPUModelNames: add the support for the test protocol
Giuseppe Scrivano [Mon, 23 Sep 2013 09:46:02 +0000 (11:46 +0200)]
virConnectGetCPUModelNames: add the support for the test protocol

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agovirConnectGetCPUModelNames: add the support for qemu
Giuseppe Scrivano [Mon, 23 Sep 2013 09:46:01 +0000 (11:46 +0200)]
virConnectGetCPUModelNames: add the support for qemu

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agovirConnectGetCPUModelNames: implement the remote protocol
Giuseppe Scrivano [Mon, 23 Sep 2013 09:46:00 +0000 (11:46 +0200)]
virConnectGetCPUModelNames: implement the remote protocol

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agocpu: add function to get the models for an arch
Giuseppe Scrivano [Mon, 23 Sep 2013 09:45:59 +0000 (11:45 +0200)]
cpu: add function to get the models for an arch

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agolibvirt: add new public API virConnectGetCPUModelNames
Giuseppe Scrivano [Mon, 23 Sep 2013 09:45:58 +0000 (11:45 +0200)]
libvirt: add new public API virConnectGetCPUModelNames

The new function virConnectGetCPUModelNames allows to retrieve the list
of CPU models known by the hypervisor for a specific architecture.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agobuild: ensure 'make check' sees up-to-date config.h
Eric Blake [Wed, 18 Sep 2013 22:11:25 +0000 (16:11 -0600)]
build: ensure 'make check' sees up-to-date config.h

Nehal J. Wani reported on IRC a rather interesting build failure:

In file included from util/virnetdevbridge.c:53:0:
/usr/include/linux/in6.h:30:8: error: redefinition of 'struct in6_addr'
 struct in6_addr {
        ^

I traced it to the fact that he ran 'git pull; make check' across
commit e62e0094.  What happened is that the configure changes
result in a new variable that was set to be defined on his system,
but config.h was not regenerated to contain the value of that
variable.  Running 'make' instead of 'make check' cleaned up the
problem.  A bit more investigation, and I see that in Makefile.am,
automake sticks rules that rebuild config.h as part of 'make all',
and that we also had a dependency 'check-local: all'; BUT the
rule for check-local is run only at the point when the top-level
directory is visited.  Automake documents that SUBDIRS should
contain an explicit '.' at the point the top-level should be
visited (defaulting to last, if it doesn't appear).  Sure enough,
with this patch, 'make check' now does the top-level 'all' rules,
which regenerates 'config.h' BEFORE compiling any code that might
depend on changed content of that file.

* Makefile.am (SUBDIRS): Put '.' first, not last.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoFix typo in identity code which is pre-requisite for CVE-2013-4311
Daniel P. Berrange [Mon, 23 Sep 2013 11:46:25 +0000 (12:46 +0100)]
Fix typo in identity code which is pre-requisite for CVE-2013-4311

The fix for CVE-2013-4311 had a pre-requisite enhancement
to the identity code

  commit db7a5688c05f3fd60d9d2b74c72427eb9ee9c176
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Thu Aug 22 16:00:01 2013 +0100

    Also store user & group ID values in virIdentity

This had a typo which caused the group ID to overwrite the
user ID string. This meant any checks using this would have
the wrong ID value. This only affected the ACL code, not the
initial polkit auth. It also leaked memory.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agodocs: Load libvirt_access*.xml from build dir
Jiri Denemark [Fri, 20 Sep 2013 09:47:39 +0000 (11:47 +0200)]
docs: Load libvirt_access*.xml from build dir

The xml files are generated in build directory and thus docs/newapi.xsl
was not able to find them in a VPATH build.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
11 years agoLXC: Check the existence of dir before resolving symlinks
Chen Hanxiao [Mon, 23 Sep 2013 10:22:17 +0000 (11:22 +0100)]
LXC: Check the existence of dir before resolving symlinks

If a dir does not exist, raise an immediate error in logs
rather than letting virFileResolveAllLinks fail, since this
gives better error reporting to the user.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
11 years agoLXC: follow the unit style of /proc/meminfo
Chen Hanxiao [Mon, 23 Sep 2013 10:01:07 +0000 (11:01 +0100)]
LXC: follow the unit style of /proc/meminfo

When FUSE is enabled, the LXC container is setup with
a custom /proc/meminfo file. This file uses "KB" as a
suffix, rather than "kB" which is the kernel's style.
Fix this inconsistency to avoid confusing apps.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
11 years agoconf: Do better job when comparing features ABI compatibility
Peter Krempa [Fri, 20 Sep 2013 13:03:43 +0000 (15:03 +0200)]
conf: Do better job when comparing features ABI compatibility

The ABI compatibility check for domain features didn't check the
expanded HyperV and APIC EOI values, thus possibly allowing change in
guest ABI.

Add the check and use typecasted switch statement to warn developers
when adding a new HyperV feature.

11 years agoFix potential use of uninitialized value in virDomainGetVcpuPinInfo
Daniel P. Berrange [Fri, 20 Sep 2013 12:54:13 +0000 (13:54 +0100)]
Fix potential use of uninitialized value in virDomainGetVcpuPinInfo

The virDomainGetVcpuPinInfo python wrapper had a potential use of
uninitialized values

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoqemu: Fix seamless SPICE migration
Martin Kletzander [Fri, 20 Sep 2013 14:40:20 +0000 (16:40 +0200)]
qemu: Fix seamless SPICE migration

Since the wait is done during migration (still inside
QEMU_ASYNC_JOB_MIGRATION_OUT), the code should enter the monitor as such
in order to prohibit all other jobs from interfering in the meantime.
This patch fixes bug #1009886 in which qemuDomainGetBlockInfo was
waiting on the monitor condition and after GetSpiceMigrationStatus
mangled its internal data, the daemon crashed.

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

11 years agoVMware: Make version parsing testable and add tests
Doug Goldstein [Wed, 18 Sep 2013 14:30:35 +0000 (09:30 -0500)]
VMware: Make version parsing testable and add tests

This splits up the version parsing code into a callable API like QEMU
help/version string parsing so that we can test it as we need to add
additional patterns for newer versions/products.

11 years agoVMware: Store vmrun binary's path in the driver
Doug Goldstein [Sun, 15 Sep 2013 04:28:20 +0000 (23:28 -0500)]
VMware: Store vmrun binary's path in the driver

Rather than looking up the path to vmrun each time we call it, look it
up once and save it. This sets up the ability for us to detect where the
path is on Mac OS X and not have to look it up each time we execute it.

11 years agoVMware: Convert driver type defines to enum
Doug Goldstein [Sat, 14 Sep 2013 04:28:30 +0000 (23:28 -0500)]
VMware: Convert driver type defines to enum

The VMware driver supports multiple backends for the VMware Player and
VMware Workstation, convert this logic into enum and use VIR_ENUM_IMPL()
to provide conversions to and from strings.

11 years agoDon't dereference NULL in qemumonitorjsontest
Ján Tomko [Fri, 20 Sep 2013 11:02:43 +0000 (13:02 +0200)]
Don't dereference NULL in qemumonitorjsontest

In case of an error, qemuMonitorTestNewSimple returns NULL.
Error out instead of dereferencing it.

Found by Coverity, reported by John Ferlan.

11 years agoAdd checking of dbus_message_iter_append_basic return value
Daniel P. Berrange [Fri, 20 Sep 2013 10:47:33 +0000 (11:47 +0100)]
Add checking of dbus_message_iter_append_basic return value

Coverity complains that the test suite did not check the
return value of dbus_message_iter_append_basic() as we did
in most other places.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoqemu: use "ide" as device name for implicit SATA controller on Q35
Laine Stump [Fri, 20 Sep 2013 10:00:48 +0000 (06:00 -0400)]
qemu: use "ide" as device name for implicit SATA controller on Q35

This resolves https://bugzilla.redhat.com/show_bug.cgi?id=1008903

The Q35 machinetype has an implicit SATA controller at 00:1F.2 which
isn't given the "expected" id of ahci0 by qemu when it's created. The
original suggested solution to this problem was to not specify any
controller for the disks that use the default controller and just
specify "unit=n" instead; qemu should then use the first IDE or SATA
controller for the disk.

Unfortunately, this "solution" is ignorant of the fact that in the
case of SATA disks, the "unit" attribute in the disk XML is actually
*not* being used for the unit, but is instead used to specify the
"bus" number; each SATA controller has 6 buses, and each bus only
allows a single unit. This makes it nonsensical to specify unit='n'
where n is anything other than 0. It also means that the only way to
connect more than a single device to the implicit SATA controller is
to explicitly give the bus names, which happen to be "ide.$n", where
$n can be replaced by the disk's "unit" number.

11 years agodaemon: Avoid dead code in polkit auth
Jiri Denemark [Thu, 19 Sep 2013 12:55:38 +0000 (14:55 +0200)]
daemon: Avoid dead code in polkit auth

11 years agovirsh: add missing "async" option in opts_block_commit
Simone Gotti [Thu, 19 Sep 2013 13:08:29 +0000 (15:08 +0200)]
virsh: add missing "async" option in opts_block_commit

After commit 8aecd351266a66efa59b7f7be77bf66693d99ce0 it'll detect
that a required option is not defined and it will assert and exit with:

virsh.c:1364: vshCommandOpt: Assertion `valid->name' failed.

Problem has been latent since commit ed23b106.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemumonitorjsontest: Introduce DO_TEST_SIMPLE
Michal Privoznik [Wed, 18 Sep 2013 15:28:31 +0000 (17:28 +0200)]
qemumonitorjsontest: Introduce DO_TEST_SIMPLE

This macro is there to test the simplest monitor functions we have,
those in the form of: int ( *func) (qemuMonitorPtr). So far, we have
seven such functions.

11 years agoqemumonitorjsontest: Test CPU state handling code
Michal Privoznik [Wed, 18 Sep 2013 13:11:06 +0000 (15:11 +0200)]
qemumonitorjsontest: Test CPU state handling code

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
11 years agodaemon: Remove more hardcoded paths from help output
Christophe Fergeau [Wed, 18 Sep 2013 14:45:14 +0000 (16:45 +0200)]
daemon: Remove more hardcoded paths from help output

A previous patch used existing #define for the various files in /etc/pki
instead of hardcoding them in the help output. However I missed that
remote_driver.h contains #define for more paths that are present
in the daemon help output.
This commit uses the existing constants for the path to the
configuration file and to the libvirt sockets.

11 years agoFix LIBVIRTD_CONFIGURATION_FILE constant
Christophe Fergeau [Wed, 18 Sep 2013 14:44:26 +0000 (16:44 +0200)]
Fix LIBVIRTD_CONFIGURATION_FILE constant

It's not used anywhere, but should be pointing to
$sysconfdir/libvirt/libvirtd.conf, not $sysconfdir/libvirtd.conf

11 years agodocs: fix virEventAddHandle return details
Jonathan Lebon [Wed, 18 Sep 2013 18:56:01 +0000 (14:56 -0400)]
docs: fix virEventAddHandle return details

In commit 6d41cb8, the interface for virEventAddHandleFunc was changed.
This patch updates the documentation for virEventAddHandle to reflect
the new significance of the return value. Also, both functions now
mention -1 for failure.

11 years agoFix crash in remoteDispatchDomainMemoryStats (CVE-2013-4296)
Daniel P. Berrange [Tue, 3 Sep 2013 15:52:06 +0000 (16:52 +0100)]
Fix crash in remoteDispatchDomainMemoryStats (CVE-2013-4296)

The 'stats' variable was not initialized to NULL, so if some
early validation of the RPC call fails, it is possible to jump
to the 'cleanup' label and VIR_FREE an uninitialized pointer.
This is a security flaw, since the API can be called from a
readonly connection which can trigger the validation checks.

This was introduced in release v0.9.1 onwards by

  commit 158ba8730e44b7dd07a21ab90499996c5dec080a
  Author: Daniel P. Berrange <berrange@redhat.com>
  Date:   Wed Apr 13 16:21:35 2011 +0100

    Merge all returns paths from dispatcher into single path

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agodoc: fix XML for the RNG device example
Giuseppe Scrivano [Wed, 18 Sep 2013 15:12:18 +0000 (17:12 +0200)]
doc: fix XML for the RNG device example

Add a missing '/' to close the "source" element.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
11 years agoAdd support for using 3-arg pkcheck syntax for process (CVE-2013-4311)
Daniel P. Berrange [Wed, 28 Aug 2013 14:25:40 +0000 (15:25 +0100)]
Add support for using 3-arg pkcheck syntax for process (CVE-2013-4311)

With the existing pkcheck (pid, start time) tuple for identifying
the process, there is a race condition, where a process can make
a libvirt RPC call and in another thread exec a setuid application,
causing it to change to effective UID 0. This in turn causes polkit
to do its permission check based on the wrong UID.

To address this, libvirt must get the UID the caller had at time
of connect() (from SO_PEERCRED) and pass a (pid, start time, uid)
triple to the pkcheck program.

This fix requires that libvirt is re-built against a version of
polkit that has the fix for its CVE-2013-4288, so that libvirt
can see 'pkg-config --variable pkcheck_supports_uid polkit-gobject-1'

Signed-off-by: Colin Walters <walters@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoEnsure system identity includes process start time
Daniel P. Berrange [Wed, 28 Aug 2013 14:22:05 +0000 (15:22 +0100)]
Ensure system identity includes process start time

The polkit access driver will want to use the process start
time field. This was already set for network identities, but
not for the system identity.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAlso store user & group ID values in virIdentity
Daniel P. Berrange [Thu, 22 Aug 2013 15:00:01 +0000 (16:00 +0100)]
Also store user & group ID values in virIdentity

Future improvements to the polkit code will require access to
the numeric user ID, not merely user name.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agodaemon: Don't hardcode pki paths in help output
Christophe Fergeau [Wed, 18 Sep 2013 12:01:27 +0000 (14:01 +0200)]
daemon: Don't hardcode pki paths in help output

There are constants for these paths in remote_driver.h so we can
use these rather than duplicating them in the help output.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agodaemon: Fix 'caert.pem' typo in privileged help output
Christophe Fergeau [Wed, 18 Sep 2013 12:01:26 +0000 (14:01 +0200)]
daemon: Fix 'caert.pem' typo in privileged help output

The help message indicates that the CA certificate is
$sysconfdir/pki/CA/caert.pem while the actual path is
$sysconfdir/pki/CA/cacert.pem

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: Avoid dangling job in qemuDomainSetBlockIoTune
Jiri Denemark [Wed, 18 Sep 2013 08:37:48 +0000 (10:37 +0200)]
qemu: Avoid dangling job in qemuDomainSetBlockIoTune

virDomainSetBlockIoTuneEnsureACL was incorrectly called after we already
started a job. As a result of this, the job was not cleaned up when an
access driver had forbidden the action.

11 years agovirsh: Add vshCompleter to each option
Tomas Meszaros [Tue, 10 Sep 2013 15:54:26 +0000 (17:54 +0200)]
virsh: Add vshCompleter to each option

completer and completer_flags added to the _vshCmdOptDef
structure so it will be possible for completion generators to
conveniently call option completer functions with desired flags.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoAdd forwarder attribute to <dns/> element
Diego Woitasen [Fri, 13 Sep 2013 16:31:07 +0000 (13:31 -0300)]
Add forwarder attribute to <dns/> element

Useful to set custom forwarders instead of using the contents of
/etc/resolv.conf. It helps me to setup dnsmasq as local nameserver to
resolve VM domain names from domain 0, when domain option is used.

Signed-off-by: Diego Woitasen <diego.woitasen@vhgroup.net>
Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoVMX: Add a VMWare Fusion 5 configuration for tests
Doug Goldstein [Tue, 13 Aug 2013 15:56:56 +0000 (10:56 -0500)]
VMX: Add a VMWare Fusion 5 configuration for tests

A user was having an issue with this specific VMWare Fusion config and
he gave me permission to add it as part of our test suite to further
expand our VMX test coverage. Unfortunately our VMX parser and
generator does not support many features contained within and just
silently ignores fields it does not understand so they had to
be removed out in the xml2vmx test. The original unmodified version
exists in the vmx2xml test.

11 years agoVMX: Add support for 'auto detect' fileNames
Doug Goldstein [Tue, 13 Aug 2013 15:56:01 +0000 (10:56 -0500)]
VMX: Add support for 'auto detect' fileNames

VMWare Fusion 5 can set the CD-ROM's device name to be 'auto detect' when
using the physical drive via 'cdrom-raw' device type. VMWare will then
connect to first available host CD-ROM to the virtual machine upon start
up according to VMWare documentation. If no device is available, it
appears that the device will remain disconnected.

To better model this a CD-ROM that is marked as "auto detect" when in
the off state would be modeled as the following with this patch:
  <disk type='block' device='lun'>
    <source startupPolicy='optional'/>
    <target dev='hda' bus='ide'/>
    <address type='drive' controller='0' bus='0' target='0' unit='0'/>
  </disk>

Once the domain transitions to the powered on state, libvirt can
populate the remaining source data with what is connected, if anything.
However future power cycles, the domain may not always start with that
device attached.

11 years agoAllow <source> for type=block to have no dev
Doug Goldstein [Mon, 9 Sep 2013 02:08:06 +0000 (21:08 -0500)]
Allow <source> for type=block to have no dev

Currently the XML parser already allows the following syntax:
  <disk type='block' device='cdrom'>
    <source startupPolicy='optional'/>
    <target dev='hda' bus='ide'/>
    <address type='drive' controller='0' bus='0' target='0' unit='0'/>
  </disk>

But it if the dev value is NULL then it would not have the leading
"<source ", resulting in invalid XML.

11 years agobuild: skip ld_preload tests on non-Linux systems
Eric Blake [Tue, 17 Sep 2013 17:11:25 +0000 (11:11 -0600)]
build: skip ld_preload tests on non-Linux systems

A cross build to mingw fails with:

  CC       virsystemdtest-virsystemdtest.o
../../tests/virsystemdtest.c: In function 'testCreateNoSystemd':
../../tests/virsystemdtest.c:97:9: error: implicit declaration of function 'unsetenv' [-Werror=implicit-function-declaration]
         unsetenv("FAIL_NO_SERVICE");
         ^
../../tests/virsystemdtest.c:97:9: error: nested extern declaration of 'unsetenv' [-Werror=nested-externs]

We could cop out and pull in the gnulib unsetenv module.  But when
you stop and think about it, this test requires LD_PRELOAD to work,
and systemd is a Linux-only concept anyways, both of which mean
the test could never work on mingw in the first place.  Simpler is
to just fix the test to behave like our other LD_PRELOAD tests.

* tests/virsystemdtest.c: Provide non-Linux implementation.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agobuild: hoist system-specific checks before library checks
Eric Blake [Tue, 17 Sep 2013 16:25:42 +0000 (10:25 -0600)]
build: hoist system-specific checks before library checks

Commit f92c7e3 fixed a regression for native builds, but introduced
a regression for cross-compilation builds; in particular,
./autobuild.sh on a Fedora system with mingw cross-compiler fails
with:

checking for qemu-kvm... /usr/bin/qemu-kvm
checking for yajl_parse_complete in -lyajl... no
checking for yajl_tree_parse in -lyajl... no
configure: error: You must install the libyajl library & headers to compile libvirt

Since we default $with_qemu to 'yes' rather than 'check', and then
flip that default based on platform-specific checks, those platform
specifics need to come prior to any library checks that depend on
the value of $with_qemu.

* configure.ac: Ensure system defaults are sane before checking
for things that make decisions based on system default.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agomaint: ignore recently-added test
Eric Blake [Tue, 17 Sep 2013 16:24:41 +0000 (10:24 -0600)]
maint: ignore recently-added test

* .gitignore: Ignore metadatatest.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agotests: metadatatest: Quiesce errors on expected paths
Peter Krempa [Tue, 17 Sep 2013 13:22:42 +0000 (15:22 +0200)]
tests: metadatatest: Quiesce errors on expected paths

Use the helper added in previous patch to quiesce errors from this test
that was spamming logs on normal test runs.

11 years agotest: Refactor setting of dummy error handlers
Peter Krempa [Tue, 17 Sep 2013 13:20:24 +0000 (15:20 +0200)]
test: Refactor setting of dummy error handlers

Multiple tests need to register a function to quiesce errors from
libvirt when using a connection and doing negative tests. Each of those
tests had a static function to do so. This can be replaced by a utility
function that enables the errors when debug is enabled.

This patch adds virtTestQuiesceLibvirtErrors() and refactors test that
use private handlers.

11 years agoAdd tftp protocol support for cdrom disk
Aline Manera [Mon, 16 Sep 2013 17:12:53 +0000 (14:12 -0300)]
Add tftp protocol support for cdrom disk

qemu/KVM also supports a tftp URL while specifying the cdrom ISO image.

The xml should be as following:

    <disk type='network' device='cdrom'>
      <source protocol='tftp' name='/url/path'>
        <host name='host.name' port='69'/>
      </source>
    </disk>

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
11 years agoAdd ftps protocol support for cdrom disk
Aline Manera [Mon, 16 Sep 2013 17:12:52 +0000 (14:12 -0300)]
Add ftps protocol support for cdrom disk

The ftps protocol is another protocol supported by qemu/KVM while specifying
the cdrom ISO image.

The xml should be as following:

    <disk type='network' device='cdrom'>
      <source protocol='ftps' name='/url/path'>
        <host name='host.name' port='990'/>
      </source>
    </disk>

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
11 years agoAdd https protocol support for cdrom disk
Aline Manera [Mon, 16 Sep 2013 17:12:51 +0000 (14:12 -0300)]
Add https protocol support for cdrom disk

The https protocol is also accepted by qemu/KVM when specifying the cdrom ISO
image.

The xml should be as following:

    <disk type='network' device='cdrom'>
      <source protocol='https' name='/url/path'>
        <host name='host.name' port='443'/>
      </source>
    </disk>

Signed-off-by: Aline Manera <alinefm@br.ibm.com>
11 years agovirsh: Don't shadow global variable "remove" in cmdMetadata
Peter Krempa [Tue, 17 Sep 2013 11:40:08 +0000 (13:40 +0200)]
virsh: Don't shadow global variable "remove" in cmdMetadata

Some systems apparently have a global variable/function called remove
and thus break compilation of virsh-domain.c. Rename the variable to
avoid this.

Reported by GuanQiang.

11 years agoconf: Avoid false positive of uninitialized variable use
Peter Krempa [Tue, 17 Sep 2013 11:27:58 +0000 (13:27 +0200)]
conf: Avoid false positive of uninitialized variable use

GCC 4.8.0+ whines about variable "new" being uninitialized since
commit 73bfac0e7182a3abd. This is a false positive as the
xmlFreeNode(new) statement can be only reached if new was actually
allocated successfully.

  CC       conf/libvirt_conf_la-domain_conf.lo
  conf/domain_conf.c: In function 'virDomainDefSetMetadata':
  conf/domain_conf.c:18650:24: error: 'new' may be used uninitialized in this function [-Werror=maybe-uninitialized]
               xmlFreeNode(new);

Reported independently by John Ferlan and Michal Privoznik.

11 years agobuild: fix VPATH build of remote driver
Eric Blake [Tue, 17 Sep 2013 11:29:23 +0000 (05:29 -0600)]
build: fix VPATH build of remote driver

Commit 073e1575 tried to set things up so that 1) generated files
to be shipped in the tarball always live in srcdir, and 2) we have
no files in SOURCES that depend on any other files with a literal
$(srcdir) in the name, because that situation can cause confusing
results for the make expansion of $@ depending on whether the file
is found locally or via VPATH.  But all my testing for that patch
was done incrementally, where all the protocol.[ch] files had
already been generated prior to the patch and were up-to-date in
the srcdir, and thus I missed one case where $@ causes grief in a
VPATH build from a fresh checkout:

We have a pattern rule for generating remote_protocol.[ch], and
what's more, the rule for protocol.c depends on protocol.h AND
on the protocol.x file.  The pattern for protocol.c is only
satisfied via the VPATH lookup for protocol.x, and if protocol.h
doesn't yet exist, the VPATH rule kicks in and we end up with a
dependency on a file with $(srcdir) in the name.  Based on make's
rules for $@, this resulted in make building remote_protocol.h
into srcdir (where we want it), then remote_protocol.c into
builddir (oops, not so good for the tarball), and also causes
the build to fail (the compiler can't find the .h if it lives
in a different directory than the .c):

  CC       remote/libvirt_driver_remote_la-remote_protocol.lo
remote/remote_protocol.c:7:29: fatal error: remote_protocol.h: No such file or directory
 #include "remote_protocol.h"
                             ^
compilation terminated.

As before, the fix is to hard-code the output file to go into
srcdir in spite of $@; but since this is in a pattern rule, we
are forced to use $@ in the recipe, so the patch is a bit
trickier than what was done in commit 073e1575.

* src/Makefile.am (%protocol.c, %protocol.h): Force output to srcdir.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoconf: Don't corrupt metadata on OOM
Peter Krempa [Tue, 17 Sep 2013 09:16:30 +0000 (11:16 +0200)]
conf: Don't corrupt metadata on OOM

Eric Blake suggested that we could do a little better in case copying of
the metadata to be set fails. With this patch, the old metadata is
discarded after the new string is copied successfuly.

11 years agoqemu: Fix memleak after commit 59898a88ce8431bd3ea249b8789edc2ef9985827
Peter Krempa [Tue, 17 Sep 2013 09:01:34 +0000 (11:01 +0200)]
qemu: Fix memleak after commit 59898a88ce8431bd3ea249b8789edc2ef9985827

If the ABI compatibility check with the "migratable" user XML is
successful, we would leak the originally parsed XML from the user that
would not be used in this case.

Reported by Ján Tomko.

11 years agotests: Add metadata tests
Peter Krempa [Mon, 9 Sep 2013 17:22:19 +0000 (19:22 +0200)]
tests: Add metadata tests

This test exercises the virDomain[Get|Set]Metadata API and tests it for
regressions

11 years agotest: Add <metadata> support into the test driver
Peter Krempa [Mon, 9 Sep 2013 16:02:59 +0000 (18:02 +0200)]
test: Add <metadata> support into the test driver

11 years agolxc: Add metadata modification APIs
Peter Krempa [Fri, 6 Sep 2013 15:42:38 +0000 (17:42 +0200)]
lxc: Add metadata modification APIs

11 years agolib: Don't force the key argument when deleting metadata
Peter Krempa [Tue, 10 Sep 2013 09:25:55 +0000 (11:25 +0200)]
lib: Don't force the key argument when deleting metadata

virDomainSetMetadata when operating on the metadata element was
requesting the @key argument to be passed even if @metadata was NULL
used to delete the corresponding metadata element. This is not needed as
the key is only used when adding the element and matching is done via
the XML namespace.

11 years agoconf: allow to add XML metadata using the virDomainSetMetadata api
Peter Krempa [Mon, 9 Sep 2013 09:49:11 +0000 (11:49 +0200)]
conf: allow to add XML metadata using the virDomainSetMetadata api

The functionality wasn't originally implemented. This patch adds the
ability to modify domain's XML metadata using the API.

11 years agoconf: Add support for requesting of XML metadata via the API
Peter Krempa [Fri, 6 Sep 2013 15:34:43 +0000 (17:34 +0200)]
conf: Add support for requesting of XML metadata via the API

The virDomainGetMetadata function was designed to support also retrieval
of app specific metadata from the <metadata> element. This functionality
was never implemented originally.

11 years agovirsh-domain: Add command to allow modifications of XML metadata
Peter Krempa [Mon, 9 Sep 2013 08:54:04 +0000 (10:54 +0200)]
virsh-domain: Add command to allow modifications of XML metadata

The metadata modification functions will support modification of the XML
metadata. Add a virsh command to allow using this approach.

11 years agovirsh-domain: use virXMLNodeToString instead of xmlNodeDump
Peter Krempa [Wed, 4 Sep 2013 15:27:27 +0000 (17:27 +0200)]
virsh-domain: use virXMLNodeToString instead of xmlNodeDump

11 years agoutil: Add helper to convert libxml2 nodes to a string
Peter Krempa [Wed, 4 Sep 2013 14:49:40 +0000 (16:49 +0200)]
util: Add helper to convert libxml2 nodes to a string

11 years agoconf: Factor out setting of metadata to simplify code
Peter Krempa [Fri, 6 Sep 2013 14:38:55 +0000 (16:38 +0200)]
conf: Factor out setting of metadata to simplify code

The code to set the metadata in a domain definition is common to live
and inactive domains. Factor it out into a common func.

11 years agoqemu: Factor out body of qemuDomainSetMetadata for universal use
Peter Krempa [Tue, 11 Jun 2013 13:45:05 +0000 (15:45 +0200)]
qemu: Factor out body of qemuDomainSetMetadata for universal use

The function implemented common behavior that can be reused for other
hypervisor drivers that use the virDomainObj data structures. Factor out
the core into a separate helper func.

11 years agoqemu: Factor out body of qemuDomainGetMetadata for universal use
Peter Krempa [Tue, 11 Jun 2013 13:45:05 +0000 (15:45 +0200)]
qemu: Factor out body of qemuDomainGetMetadata for universal use

The function implemented common behavior that can be reused for other
hypervisor drivers that use the virDomainObj data structures. Factor out
the core into a separate helper func.

11 years agovirsh-domain: Line up signal names array
Peter Krempa [Mon, 9 Sep 2013 09:47:20 +0000 (11:47 +0200)]
virsh-domain: Line up signal names array

Line up the array so that the grid is visible.

11 years agovirsh-domain: Remove spurious ATTRIBUTE_UNUSED from cmdDesc
Peter Krempa [Mon, 9 Sep 2013 08:52:08 +0000 (10:52 +0200)]
virsh-domain: Remove spurious ATTRIBUTE_UNUSED from cmdDesc

The "cmd" variable is actually used so remove the attribute.

11 years agoqemu: Use "migratable" XML definition when doing external checkpoints
Peter Krempa [Mon, 16 Sep 2013 11:40:42 +0000 (13:40 +0200)]
qemu: Use "migratable" XML definition when doing external checkpoints

In the original implementation of external checkpoints I've mistakenly
used the live definition to be stored in the save image. The normal
approach is to use the "migratable" definition. This was discovered when
commit 07966f6a8b5ccb5bb4c716b25deb8ba2e572cc67 changed the behavior to
use a converted XML from the user to do the compatibility check to fix
problem when using the regular machine saving.

As the previous patch added a compatibility layer, we can now change the
type of the XML in the image.

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

11 years agoqemu: Fix checking of ABI stability when restoring external checkpoints
Peter Krempa [Mon, 16 Sep 2013 11:37:34 +0000 (13:37 +0200)]
qemu: Fix checking of ABI stability when restoring external checkpoints

External checkpoints have a bug in the implementation where they use the
normal definition instead of the "migratable" one. This causes errors
when the snapshot is being reverted using the workaround method via
qemuDomainRestoreFlags() with a custom XML. This issue was introduced
when commit 07966f6a8b5ccb5bb4c716b25deb8ba2e572cc67 changed the code to
compare "migratable" XMLs from the user as we should have used
migratable in the image too.

This patch adds a compatibility layer, so that fixing the snapshot code
won't make existing snapshots fail to load.

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

11 years agovirsh: Fix a wrong check in cmdEcho()
Hongwei Bi [Tue, 17 Sep 2013 06:21:32 +0000 (14:21 +0800)]
virsh: Fix a wrong check in cmdEcho()

What should be checked here is xmlbuf rather than buf.

11 years agoAllow LUN type disks to have no source
Doug Goldstein [Sun, 8 Sep 2013 18:58:06 +0000 (13:58 -0500)]
Allow LUN type disks to have no source

CD-ROMs and Floppies are allowed to have no source to imply they are
empty or disconnected. Since the LUN type is used for raw CD-ROM access
with QEMU (and VMWare in the future), it also needs to allow an empty
source when the raw CD-ROM device is disconnected from the domain.

11 years agoAlways free network and graphics cookies
Ján Tomko [Mon, 16 Sep 2013 11:26:46 +0000 (13:26 +0200)]
Always free network and graphics cookies

qemuMigrationEatCookie has flags to control if these should
be parsed, but it does not fill mig->flags. These cookies might
get leaked if these flags are not set by qemuMigrationBakeCookie.

42 (32 direct, 10 indirect) bytes in 1 blocks are definitely lost in
loss record 361 of 662
==123== by 0x1BA33FCA: qemuMigrationEatCookie (qemu_migration.c:678)
==123== by 0x1BA34A1E: qemuMigrationRun (qemu_migration.c:3108)
==123== by 0x1BA3622B: doNativeMigrate (qemu_migration.c:3343)
==123== by 0x1BA3B408: qemuMigrationPerform (qemu_migration.c:4138)

11 years agoFree slicename in virSystemdCreateMachine
Ján Tomko [Mon, 16 Sep 2013 13:27:42 +0000 (15:27 +0200)]
Free slicename in virSystemdCreateMachine

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

1,003 bytes in 1 blocks are definitely lost in loss record 599 of 635
==404== by 0x50728A7: virBufferAddChar (virbuffer.c:185)
==404== by 0x50BC466: virSystemdEscapeName (virsystemd.c:67)
==404== by 0x50BC6B2: virSystemdMakeSliceName (virsystemd.c:108)
==404== by 0x50BC870: virSystemdCreateMachine (virsystemd.c:169)
==404== by 0x5078267: virCgroupNewMachine (vircgroup.c:1498)

11 years agobuild: make autobuild require rpm build deps
Eric Blake [Sat, 14 Sep 2013 11:29:42 +0000 (05:29 -0600)]
build: make autobuild require rpm build deps

I spent far too long on a new machine trying to figure out why
./autobuild.sh failed due to an rpm build failure (complaining
that libvirt_parthelper was supposed to be packaged but was not
built), and finally traced it to a missing parted-devel
installation.  I learned that --nodeps is in place for
autobuilder setups, but for developers, removing it would make
rpmbuild error out much sooner for a less cryptic failure.

* autobuild.sh: Conditionally drop --nodeps from rpmbuild lines.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agobuild: fix build with latest rawhide kernel headers
Eric Blake [Fri, 13 Sep 2013 16:11:26 +0000 (10:11 -0600)]
build: fix build with latest rawhide kernel headers

Bother those kernel developers.  In the latest rawhide, kernel
and glibc have now been unified so that <netinet/in.h> and
<linux/in6.h> no longer clash; but <linux/if_bridge.h> is still
not self-contained.  Because of the latest header change, the
build is failing with:

checking for linux/param.h... no
configure: error: You must install kernel-headers in order to compile libvirt with QEMU or LXC support

with details:

In file included from conftest.c:561:0:
/usr/include/linux/in6.h:71:18: error: field 'flr_dst' has incomplete type
  struct in6_addr flr_dst;

We need a workaround to avoid our workaround :)

* configure.ac (NETINET_LINUX_WORKAROUND): New test.
* src/util/virnetdevbridge.c (includes): Use it.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agocgroup: Move [qemu|lxc]GetCpuBWStatus to vicgroup.c and refactor it
Peter Krempa [Fri, 13 Sep 2013 14:03:14 +0000 (16:03 +0200)]
cgroup: Move [qemu|lxc]GetCpuBWStatus to vicgroup.c and refactor it

The function existed in two identical instances in lxc and qemu. Move it
to vircgroup.c and simplify it. Refactor the callers too.

11 years agocleanup: Kill usage of access(PATH, F_OK) in favor of virFileExists()
Peter Krempa [Fri, 13 Sep 2013 13:32:43 +0000 (15:32 +0200)]
cleanup: Kill usage of access(PATH, F_OK) in favor of virFileExists()

Semantics of the libvirt helper are more clear. This change also allows
to clean up some pieces of code.

11 years agoutil: Declare that virFileExists shall honor errno
Peter Krempa [Fri, 13 Sep 2013 12:35:34 +0000 (14:35 +0200)]
util: Declare that virFileExists shall honor errno

Explicitly state that some parts of the code may require virFileExists
to set or preserve a correct errno so that future modifications don't
break.

11 years agovirsh: move command maxvcpus from domain group to host group.
yangdongsheng [Mon, 9 Sep 2013 02:14:22 +0000 (10:14 +0800)]
virsh: move command maxvcpus from domain group to host group.

Since the maxvcpus command query the maximum number of virtual
CPUs supported for a guest VM on this connection, it should be
in virsh-host.c but not virsh-domain.c.

Signed-off-by: yangdongsheng <yangds.fnst@cn.fujitsu.com>
11 years agoExplicitly link libvirt_net_rpc against SELINUX_LIBS
Guido Günther [Fri, 13 Sep 2013 15:42:58 +0000 (17:42 +0200)]
Explicitly link libvirt_net_rpc against SELINUX_LIBS

Since virnetsocket conditionally uses selinux we need to link against it
otherwise the build fails with:

CCLD     libvirtd
/usr/bin/ld: ../src/.libs/libvirt-lxc.so: undefined reference to symbol 'freecon'
/lib/i386-linux-gnu/libselinux.so.1: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[3]: *** [libvirtd] Error 1

11 years agodocs: mention hostname subtlety
Eric Blake [Thu, 12 Sep 2013 19:19:23 +0000 (13:19 -0600)]
docs: mention hostname subtlety

An off-list bug report mentioned some confusion where the public
documentation of libvirt.c:virConnectGetHostname did not match
the private documentation of util/virutil.c:virGetHostname.

* src/libvirt.c (virConnectGetHostname): Tweak docs.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agotools: add missing 'interface' type and update man page
Alex Jia [Wed, 11 Sep 2013 03:47:14 +0000 (11:47 +0800)]
tools: add missing 'interface' type and update man page

Signed-off-by: Alex Jia <ajia@redhat.com>
11 years agotests: Don't test user config file if ran as root
Martin Kletzander [Thu, 12 Sep 2013 10:15:23 +0000 (12:15 +0200)]
tests: Don't test user config file if ran as root

11 years agotest-lib: Make case skipping possible
Martin Kletzander [Thu, 12 Sep 2013 10:12:23 +0000 (12:12 +0200)]
test-lib: Make case skipping possible

11 years agoFix naming of permission for detecting storage pools
Daniel P. Berrange [Thu, 12 Sep 2013 13:35:45 +0000 (14:35 +0100)]
Fix naming of permission for detecting storage pools

The VIR_ACCESS_PERM_CONNECT_DETECT_STORAGE_POOLS enum
constant had its string format be 'detect_storage_pool',
note the missing trailing 's'. This prevent the ACL
check from ever succeeding. Fix this and add a simple
test script to validate this problem of matching names.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoLXC: don't try to mount selinux filesystem when user namespace enabled
Gao feng [Thu, 12 Sep 2013 03:51:31 +0000 (11:51 +0800)]
LXC: don't try to mount selinux filesystem when user namespace enabled

Right now we mount selinuxfs even user namespace is enabled and
ignore the error. But we shouldn't ignore these errors when user
namespace is not enabled.

This patch skips mounting selinuxfs when user namespace enabled.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
11 years agoqemu: Fix checking of guest ABI compatibility when reverting snapshots
Peter Krempa [Thu, 12 Sep 2013 09:37:57 +0000 (11:37 +0200)]
qemu: Fix checking of guest ABI compatibility when reverting snapshots

When reverting a live internal snapshot with a live guest the ABI
compatiblity check was comparing a "migratable" definition with a normal
one. This resulted in the check failing with:

revert requires force: Target device address type none does not match source pci

This patch generates a "migratable" definition from the actual one to
check against the definition from the snapshot to avoid this problem.

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

11 years agonetcf driver: use a single netcf handle for all connections
Laine Stump [Wed, 28 Aug 2013 16:56:21 +0000 (12:56 -0400)]
netcf driver: use a single netcf handle for all connections

This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=983026

The netcf interface driver previously had no state driver associated
with it - as a connection was opened, it would create a new netcf
instance just for that connection, and close it when it was
finished. the problem with this is that each connection to libvirt
used up a netlink socket, and there is a per process maximum of ~1000
netlink sockets.

The solution is to create a state driver to go along with the netcf
driver. The state driver will opens a netcf instance, then all
connections share that same netcf instance, thus only a single
netlink socket will be used no matter how many connections are mde to
libvirtd.

This was rather simple to do - a new virObjectLockable class is
created for the single driverState object, which is created in
netcfStateInitialize and contains the single netcf handle; instead of
creating a new object for each client connection, netcfInterfaceOpen
now just increments the driverState object's reference count and puts
a pointer to it into the connection's privateData. Similarly,
netcfInterfaceClose() just un-refs the driverState object (as does
netcfStateCleanup()), and virNetcfInterfaceDriverStateDispose()
handles closing the netcf instance. Since all the functions already
have locking around them, the static lock functions used by all
functions just needed to be changed to call virObjectLock() and
virObjectUnlock() instead of directly calling the virMutex* functions.

11 years agorename "struct interface_driver" to virNetcfDriverState
Laine Stump [Tue, 27 Aug 2013 16:26:48 +0000 (12:26 -0400)]
rename "struct interface_driver" to virNetcfDriverState

This better fits the modern naming scheme in libvirt, and anticipates
an upcoming change where a single instance of this state will be
maintained by a separate state driver, and every instance of the netcf
driver will share the same state.

11 years agoEnsure root filesystem is recursively mounted readonly
Daniel P. Berrange [Mon, 9 Sep 2013 15:17:19 +0000 (16:17 +0100)]
Ensure root filesystem is recursively mounted readonly

If the guest is configured with

    <filesystem type='mount'>
      <source dir='/'/>
      <target dir='/'/>
      <readonly/>
    </filesystem>

Then any submounts under / should also end up readonly, except
for those setup as basic mounts. eg if the user has /home on a
separate volume, they'd expect /home to be readonly, but we
should not touch the /sys, /proc, etc dirs we setup ourselves.

Users can selectively make sub-mounts read-write again by
simply listing them as new mounts without the <readonly>
flag set

    <filesystem type='mount'>
      <source dir='/home'/>
      <target dir='/home'/>
    </filesystem>

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoMove array of mounts out of lxcContainerMountBasicFS
Daniel P. Berrange [Tue, 10 Sep 2013 12:35:12 +0000 (13:35 +0100)]
Move array of mounts out of lxcContainerMountBasicFS

Move the array of basic mounts out of the lxcContainerMountBasicFS
function, to a global variable. This is to allow it to be referenced
by other methods wanting to know what the basic mount paths are.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdd some notes about security considerations when using LXC
Daniel P. Berrange [Tue, 10 Sep 2013 09:58:45 +0000 (10:58 +0100)]
Add some notes about security considerations when using LXC

Describe some of the issues to be aware of when configuring LXC
guests with security isolation as a goal.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoFix launching of VMs on when only logind part of systemd is present
Daniel P. Berrange [Wed, 11 Sep 2013 18:15:52 +0000 (19:15 +0100)]
Fix launching of VMs on when only logind part of systemd is present

Debian systems may run the 'systemd-logind' daemon, which causes the
/sys/fs/cgroup/systemd  mount to be setup, but no other cgroup
controllers are created. While the LXC driver considers cgroups to
be mandatory, the QEMU driver is supposed to accept them as optional.

We detect whether they are present by looking in /proc/mounts for
any mounts of type 'cgroups', but this is not sufficient. We need to
skip any named mounts (as seen by a name=XXX string in the mount
options), so that we only detect actual resource controllers.

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=721979

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoFix polkit permission names for storage pools, vols & node devices
Daniel P. Berrange [Wed, 11 Sep 2013 13:23:24 +0000 (14:23 +0100)]
Fix polkit permission names for storage pools, vols & node devices

The polkit access driver used the wrong permission names for checks
on storage pools, volumes and node devices. This led to them always
being denied access.

The 'dettach' permission was also mis-spelt and should have been
'detach'. While permission names are ABI sensitive, the fact that
the code used the wrong object name for checking node device
permissions, means that no one could have used the mis-spelt
'dettach' permission.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agovirsh domjobinfo: Do not return 1 if job is NONE
Jiri Denemark [Wed, 11 Sep 2013 13:49:48 +0000 (15:49 +0200)]
virsh domjobinfo: Do not return 1 if job is NONE

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

Commit 38ab1225 changed the default value of ret from true to false but
forgot to set ret = true when job is NONE. Thus, virsh domjobinfo
returned 1 when there was no job running for a domain but it used to
(and should) return 0 in this case.

11 years agoRepair the search on libvirt.org
Daniel Veillard [Thu, 12 Sep 2013 09:18:32 +0000 (17:18 +0800)]
Repair the search on libvirt.org

First make sure that the input is xhtml as the stylesheets expect
namespaced element, then use a span element instead of a as a
is treated specially, finally adjust the makefile to check for
the new span element and replace it with the PHP code