]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
11 years agoForbid use of ':' in RBD pool names
Daniel P. Berrange [Mon, 13 May 2013 12:58:22 +0000 (13:58 +0100)]
Forbid use of ':' in RBD pool names

The QEMU command line syntax for RBD disks is

   file=rbd:pool/image:opt1=val1:opt2=val2...

There is no way to escape the ':' if it appears in the
pool or image name. Thus it must be explicitly forbidden
if it occurs in the libvirt XML. People are known to
be abusing the lack of escaping in current libvirt to
pass arbitrary args to QEMU.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoDon't duplicate compiler warning flags when linking
Daniel P. Berrange [Mon, 13 May 2013 11:50:22 +0000 (12:50 +0100)]
Don't duplicate compiler warning flags when linking

Automake already passes all CFLAGS to the linker too, so it
is not necessary to set WARN_LDFLAGS in addition to the
WARN_CFLAGS variable.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoOnly pass -export-dynamic to linker, not compiler
Daniel P. Berrange [Mon, 13 May 2013 11:48:06 +0000 (12:48 +0100)]
Only pass -export-dynamic to linker, not compiler

Clang does not like the -export-dynamic flag. The compiler does
not need it in the first place, so we can avoid the problem by
only setting it for the linker

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoCorrectly detect warning flags with clang
Daniel P. Berrange [Mon, 13 May 2013 11:45:54 +0000 (12:45 +0100)]
Correctly detect warning flags with clang

Clang will happily claim to support any warning flags
unless the -Werror and -Wunknown-warning-option flags
are set. Thus we need to make sure these are set when
testing for clags.

We must also set the clang specific warning flags
-Wno-unused-command-line-argument to avoid a warning
from the ssp-buffer-size flag when linking .o files.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoIgnore cast alignment warnings in inotify code for Xen.
Daniel P. Berrange [Mon, 13 May 2013 11:44:15 +0000 (12:44 +0100)]
Ignore cast alignment warnings in inotify code for Xen.

The inotify Xen code causes a cast alignment warning, but this
is harmless since the kernel inotify interface will ensure
sufficient alignment of the inotify structs in the buffer being
read

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoWorkaround issue with clang and inline functions with static vars
Daniel P. Berrange [Mon, 13 May 2013 11:43:08 +0000 (12:43 +0100)]
Workaround issue with clang and inline functions with static vars

Clang does not like it when you pass a static variable to an
inline function

 vircgroupmock.c:462:22: error: static variable 'fakesysfsdir' is
  used in an inline function with external linkage [-Werror,-Wstatic-in-inline]

Just make the var non-static to avoid this

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoEnsure consistent enablement of gcc 'diagnostic' pragma
Daniel P. Berrange [Mon, 13 May 2013 11:41:07 +0000 (12:41 +0100)]
Ensure consistent enablement of gcc 'diagnostic' pragma

The virt-compile-warnings.m4 file would do an explicit
check for whether the compile could use the 'diagnostic'
pragma push/pop feature. The src/internal.h file would
then only enable it for GCC >= 4.6

This breaks with clang which supports the pragma but
does not claim GCC 4.6 compat. Export a variable from
the m4 check to the header file so they are consistent.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agodocs: Fix the wrong links in secret documentation
Osier Yang [Tue, 14 May 2013 13:48:31 +0000 (21:48 +0800)]
docs: Fix the wrong links in secret documentation

docs/formatsecret.html.in: (s/domain\.html/formatdomain\.html/g)

11 years agodocs: Add the missed usage type 'iscsi'
Osier Yang [Tue, 14 May 2013 13:42:51 +0000 (21:42 +0800)]
docs: Add the missed usage type 'iscsi'

Pushed under trivial rule.

11 years agoqemu: fix bad free
Eric Blake [Mon, 13 May 2013 22:48:55 +0000 (16:48 -0600)]
qemu: fix bad free

Commit bd56d0d8 could lead to freeing an uninitialized pointer:

qemu/qemu_monitor_json.c: In function 'qemuMonitorJSONGetCommandLineOptionParameters':
qemu/qemu_monitor_json.c:4284: warning: 'cmd' may be used uninitialized in this function

* src/qemu/qemu_monitor_json.c
(qemuMonitorJSONGetCommandLineOptionParameters): Initialize variable.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agobuild: avoid gcrypt deprecation warnings
Roman Bogorodskiy [Sat, 11 May 2013 14:27:26 +0000 (18:27 +0400)]
build: avoid gcrypt deprecation warnings

When combining old gcc (4.2.1) and new gcrypt (1.5.2), such as
when using the Ports repository on FreeBSD, the build fails with:

  CC       libvirt_driver_la-libvirt.lo
cc1: warnings being treated as errors
In file included from libvirt.c:58:
/usr/local/include/gcrypt.h:1336: warning: 'gcry_ac_io_mode_t' is deprecated [-Wdeprecated-declarations]

Relevant part of gcrypt.h:
1333 typedef struct gcry_ac_io
1334 {
1335   /* This is an INTERNAL structure, do NOT use manually.  */
1336   gcry_ac_io_mode_t mode _GCRY_ATTR_INTERNAL;
1337   gcry_ac_io_type_t type _GCRY_ATTR_INTERNAL;
1338   union

The sad part is that we aren't even using the deprecated symbols - their
mere inclusion in the installed header is provoking the problems.  It
looks like newer gcc is a bit more tolerant (that is, this is a
shortcoming of FreeBSD's use of an older compiler).

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: query command line options in QMP
Eric Blake [Fri, 26 Apr 2013 17:13:45 +0000 (11:13 -0600)]
qemu: query command line options in QMP

Ever since the conversion to using only QMP for probing features
of qemu 1.2 and newer, we have been unable to detect features
that are added only by additional command line options.  For
example, we'd like to know if '-machine mem-merge=on' (added
in qemu 1.5) is present.  To do this, we will take advantage
of qemu 1.5's query-command-line-parameters QMP call [1].

This patch wires up the framework for probing the command results;
if the QMP command is missing, or if a particular command line
option does not output any parameters (for example, -net uses
a polymorphic parser, which showed up as no parameters as of qemu
1.5), we silently treat that command as having no results.

[1] https://lists.gnu.org/archive/html/qemu-devel/2013-04/msg05180.html

* src/qemu/qemu_monitor.h (qemuMonitorGetOptions)
(qemuMonitorSetOptions)
(qemuMonitorGetCommandLineOptionParameters): New functions.
* src/qemu/qemu_monitor_json.h
(qemuMonitorJSONGetCommandLineOptionParameters): Likewise.
* src/qemu/qemu_monitor.c (_qemuMonitor): Add cache field.
(qemuMonitorDispose): Clean it.
(qemuMonitorGetCommandLineOptionParameters): Implement new function.
* src/qemu/qemu_monitor_json.c
(qemuMonitorJSONGetCommandLineOptionParameters): Likewise.
(testQemuMonitorJSONGetCommandLineParameters): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: simplify string cleanup
Eric Blake [Fri, 26 Apr 2013 17:47:23 +0000 (11:47 -0600)]
qemu: simplify string cleanup

No need to open code a string list cleanup, if we are nice
to the caller by guaranteeing a NULL-terminated result.

* src/qemu/qemu_monitor_json.c (qemuMonitorJSONGetCPUDefinitions)
(qemuMonitorJSONGetCommands, qemuMonitorJSONGetEvents)
(qemuMonitorJSONGetObjectTypes, qemuMonitorJSONGetObjectProps):
Use simpler cleanup.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoqemu: use bool in monitor struct
Eric Blake [Fri, 26 Apr 2013 02:32:41 +0000 (20:32 -0600)]
qemu: use bool in monitor struct

Follows on the heels of other bool cleanups, such as commit 93002b98.

* src/qemu/qemu_monitor.h (qemuMonitorOpen, qemuMonitorOpenFD):
Update json parameter type.
* src/qemu/qemu_monitor.c (qemuMonitorOpen, qemuMonitorOpenFD):
Likewise.
(_qemuMonitor): Adjust field type.
* src/qemu/qemu_domain.h (_qemuDomainObjPrivate): Likewise.
* src/qemu/qemu_domain.c (qemuDomainObjPrivateXMLParse): Adjust
client.
* src/qemu/qemu_process.c (qemuProcessStart): Likewise.
* tests/qemumonitortestutils.c (qemuMonitorTestNew): Likewise.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agojson: support removing a value from an object
Eric Blake [Fri, 26 Apr 2013 14:59:02 +0000 (08:59 -0600)]
json: support removing a value from an object

In an upcoming patch, I need the way to safely transfer a nested
virJSON object out of its parent container for independent use,
even after the parent is freed.

* src/util/virjson.h (virJSONValueObjectRemoveKey): New function.
(_virJSONObject, _virJSONArray): Use correct type.
* src/util/virjson.c (virJSONValueObjectRemoveKey): Implement it.
* src/libvirt_private.syms (virjson.h): Export it.
* tests/jsontest.c (mymain): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoSupport for static routes on a virtual bridge
Gene Czarcinski [Tue, 7 May 2013 17:42:55 +0000 (13:42 -0400)]
Support for static routes on a virtual bridge

network: static route support for <network>

This patch adds the <route> subelement of <network> to define a static
route.  the address and prefix (or netmask) attribute identify the
destination network, and the gateway attribute specifies the next hop
address (which must be directly reachable from the containing
<network>) which is to receive the packets destined for
"address/(prefix|netmask)".

These attributes are translated into an "ip route add" command that is
executed when the network is started. The command used is of the
following form:

  ip route add <address>/<prefix> via <gateway> \
               dev <virbr-bridge> proto static metric <metric>

Tests are done to validate that the input data are correct.  For
example, for a static route ip definition, the address must be a
network address and not a host address.  Additional checks are added
to ensure that the specified gateway is directly reachable via this
network (i.e. that the gateway IP address is in the same subnet as one
of the IP's defined for the network).

prefix='0' is supported for both family='ipv4' address='0.0.0.0'
netmask='0.0.0.0' or prefix='0', and for family='ipv6' address='::',
prefix=0', although care should be taken to not override a desired
system default route.

Anytime an attempt is made to define a static route which *exactly*
duplicates an existing static route (for example, address=::,
prefix=0, metric=1), the following error message will be sent to
syslog:

    RTNETLINK answers: File exists

This can be overridden by decreasing the metric value for the route
that should be preferred, or increasing the metric for the route that
shouldn't be preferred (and is thus in place only in anticipation that
the preferred route may be removed in the future).  Caution should be
used when manipulating route metrics, especially for a default route.

Note: The use of the command-line interface should be replaced by
direct use of libnl so that error conditions can be handled better.  But,
that is being left as an exercise for another day.

Signed-off-by: Gene Czarcinski <gene@czarc.net>
Signed-off-by: Laine Stump <laine@laine.org>
11 years agobuild: avoid shadowed variable in fdstreamtest
Eric Blake [Mon, 13 May 2013 19:38:18 +0000 (13:38 -0600)]
build: avoid shadowed variable in fdstreamtest

On RHEL 6.4 (gcc 4.4.7), I got:

fdstreamtest.c: In function 'testFDStreamReadCommon':
fdstreamtest.c:44: error: declaration of 'tmpfile' shadows a global declaration [-Wshadow]

* tests/fdstreamtest.c (testFDStreamReadCommon)
(testFDStreamWriteCommon): Rename 'tmpfile' variable.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoDon't overwrite useful message when creating macvlan fails
Daniel P. Berrange [Mon, 13 May 2013 16:32:55 +0000 (17:32 +0100)]
Don't overwrite useful message when creating macvlan fails

Currently we report a bogus error message when macvlan
creation fails:

error: Failed to start domain migtest
error: operation failed: Unable to create macvlan device

With this removed, we see the real error:

error: Failed to start domain migtest
error: Unable to get index for interface p31p1: No such device

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRemove & ban use of select() for waiting for I/O
Daniel P. Berrange [Mon, 13 May 2013 13:43:20 +0000 (14:43 +0100)]
Remove & ban use of select() for waiting for I/O

Use of the select() system call is inherantly dangerous since
applications will hit a buffer overrun if any FD number exceeds
the size of the select set size (typically 1024). Replace the
two uses of select() with poll() and use cfg.mk to ban any
future use of select().

NB: This changes the phyp driver so that it uses an infinite
timeout, instead of busy-waiting for 1ms at a time.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoqemu: Add hotplug support for scsi host device
Han Cheng [Fri, 3 May 2013 18:07:31 +0000 (02:07 +0800)]
qemu: Add hotplug support for scsi host device

This adds both attachment and detachment support for scsi host
device.

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat>
11 years agoFix starting domains when kernel has no cgroups support
Jim Fehlig [Fri, 10 May 2013 18:05:00 +0000 (12:05 -0600)]
Fix starting domains when kernel has no cgroups support

Found that I was unable to start existing domains after updating
to a kernel with no cgroups support

  # zgrep CGROUP /proc/config.gz
  # CONFIG_CGROUPS is not set
  # virsh start test
  error: Failed to start domain test
  error: Unable to initialize /machine cgroup: Cannot allocate memory

virCgroupPartitionNeedsEscaping() correctly returns errno (ENOENT) when
attempting to open /proc/cgroups on such a system, but it was being
dropped in virCgroupSetPartitionSuffix().

Change virCgroupSetPartitionSuffix() to propagate errors returned by
its callees.  Also check for ENOENT in qemuInitCgroup() when determining
if cgroups support is available.

11 years ago.gitignore: add fchosttest
Ján Tomko [Mon, 13 May 2013 15:16:54 +0000 (17:16 +0200)]
.gitignore: add fchosttest

11 years agoqemu: Refactor helpers for USB device attachment
Osier Yang [Fri, 3 May 2013 18:07:30 +0000 (02:07 +0800)]
qemu: Refactor helpers for USB device attachment

It's better to put the usb related codes into qemuDomainAttachHostUsbDevice
instead of qemuDomainAttachHostDevice.

And in the old qemuDomainAttachHostDevice, just stealing the "usb" from
driver->activeUsbHostdevs leaks the memory.

11 years agoEscaping leading '.' in cgroup names
Daniel P. Berrange [Fri, 3 May 2013 19:56:50 +0000 (20:56 +0100)]
Escaping leading '.' in cgroup names

Escaping a leading '.' with '_' in the cgroup names

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoqemu: Introduce activeScsiHostdevs list for scsi host devices
Han Cheng [Fri, 3 May 2013 18:07:29 +0000 (02:07 +0800)]
qemu: Introduce activeScsiHostdevs list for scsi host devices

Although virtio-scsi supports SCSI PR (Persistent Reservations),
the device on host may do not support it. To avoid losing data,
Just like PCI and USB pass through devices, only one live guest
is allowed per SCSI host pass through device."

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
11 years agoAdapt to VIR_STRDUP and VIR_STRNDUP in src/vbox/*
Michal Privoznik [Fri, 3 May 2013 12:50:19 +0000 (14:50 +0200)]
Adapt to VIR_STRDUP and VIR_STRNDUP in src/vbox/*

11 years agoSupport NBD backed disks/filesystems in LXC driver
Daniel P. Berrange [Mon, 22 Apr 2013 14:06:18 +0000 (15:06 +0100)]
Support NBD backed disks/filesystems in LXC driver

The LXC driver can already configure <disk> or <filesystem>
devices to use the loop device. This extends it to also allow
for use of the NBD device, to support non-raw formats.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdd 'nbd' as a valid filesystem driver type
Daniel P. Berrange [Mon, 22 Apr 2013 14:06:17 +0000 (15:06 +0100)]
Add 'nbd' as a valid filesystem driver type

The <filesystem> element can now accept a <driver type='nbd'/>
as an alternative to 'loop'. The benefit of NBD is support
for non-raw disk image formats.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdd a helper API for setting up a NBD device with qemu-nbd
Daniel P. Berrange [Mon, 22 Apr 2013 14:06:16 +0000 (15:06 +0100)]
Add a helper API for setting up a NBD device with qemu-nbd

Add a virFileNBDDeviceAssociate method, which given a filename
will setup a NBD device, using qemu-nbd as the server.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoFix error handling of readdir() in virFileLoopDeviceOpen
Daniel P. Berrange [Fri, 3 May 2013 13:26:56 +0000 (14:26 +0100)]
Fix error handling of readdir() in virFileLoopDeviceOpen

To correctly handle errors from readdir() you must set 'errno'
to zero before invoking it & check its value afterwards to
distinguish error from EOF.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoRe-arrange code setting up ifs/disk loop devices for LXC
Daniel P. Berrange [Mon, 22 Apr 2013 14:06:15 +0000 (15:06 +0100)]
Re-arrange code setting up ifs/disk loop devices for LXC

The current code for setting up loop devices to LXC disks first
does a switch() based on the disk format, then looks at the
disk driver name. Reverse this so it first looks at the driver
name, and then the disk format. This is more useful since the
list of supported disk formats depends on what driver is used.

The code for setting loop devices for LXC fs entries also needs
to have the same logic added, now the XML schema supports this.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdd support for storage format in FS <driver>
Daniel P. Berrange [Mon, 22 Apr 2013 14:06:14 +0000 (15:06 +0100)]
Add support for storage format in FS <driver>

Extend the <driver> element in filesystem devices to
allow a storage format to be set. The new attribute
uses 'format' to reflect the storage format. This is
different from the <driver> element in disk devices
which use 'type' to reflect the storage format. This
is because the 'type' attribute on filesystem devices
is already used for the driver backend, for which the
disk devices use the 'name' attribute. Arggggh.

Anyway for disks we have

   <driver name="qemu" type="raw"/>

And for filesystems this change means we now have

   <driver type="loop" format="raw"/>

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agosecurity_apparmor.c: Include virscsi.h
Michal Privoznik [Mon, 13 May 2013 12:01:14 +0000 (14:01 +0200)]
security_apparmor.c: Include virscsi.h

After introducing AppArmorSetSecuritySCSILabel() in 2691cd5f
we are using virSCSIDevicePtr type without proper include.

11 years agosecurity: Manage the security label for scsi host device
Osier Yang [Fri, 3 May 2013 18:07:28 +0000 (02:07 +0800)]
security: Manage the security label for scsi host device

To not introduce more redundant code, helpers are added for
both "selinux", "dac", and "apparmor" backends.

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat>
v2.5 - v3:
  * Splitted from 8/10 of v2.5
  * Don't forget the other backends (DAC, and apparmor)

11 years agoqemu: Allow the scsi-generic device in cgroup
Han Cheng [Fri, 3 May 2013 18:07:27 +0000 (02:07 +0800)]
qemu: Allow the scsi-generic device in cgroup

This adds the scsi-generic device into the device controller's
whitelist, so that it's allowed to used by the qemu process.

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat.com>
11 years agoqemu: Support bootindex for scsi host device
Osier Yang [Fri, 3 May 2013 18:07:26 +0000 (02:07 +0800)]
qemu: Support bootindex for scsi host device

11 years agoAdd docs about cgroups layout and usage
Daniel P. Berrange [Fri, 3 May 2013 15:58:26 +0000 (16:58 +0100)]
Add docs about cgroups layout and usage

Describe the new cgroups layout, how to customize placement
of guests and what virsh commands are used to access the
parameters.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoIntroduce <readonly> for hostdev
Osier Yang [Fri, 3 May 2013 18:07:25 +0000 (02:07 +0800)]
Introduce <readonly> for hostdev

Since it's generic enough to be used by other types in future, I
put it in <hostdev> as sub-element, though now it's only used by
scsi host device.

11 years agorng: Interleave hostdev elements
Osier Yang [Fri, 3 May 2013 18:07:24 +0000 (02:07 +0800)]
rng: Interleave hostdev elements

11 years agoqemu: Build qemu command line for scsi host device
Han Cheng [Fri, 3 May 2013 18:07:23 +0000 (02:07 +0800)]
qemu: Build qemu command line for scsi host device

Except the scsi host device's controller is "lsilogic", mapping
between the libvirt attributes and scsi-generic properties is:

  libvirt     qemu
-----------------------------------------
  controller  bus ($libvirt_controller.0)
  bus         channel
  target      scsi-id
  unit        lun

For scsi host device with "lsilogic" controller, the mapping is:
('target (libvirt)' must be 0, as it's not used; 'unit (libvirt)
must <= 7).

  libvirt            qemu
----------------------------------------------------------
  controller && bus  bus ($libvirt_controller.$libvirt_bus)
  unit               scsi-id

It's not good to hardcode/hard-check limits of these attributes,
and even worse, these limits are not documented, one has to find
out by either testing or reading the qemu code, I'm looking forward
to qemu expose limits like these one day). For example, exposing
"max_target", "max_lun" for megasas:

static const struct SCSIBusInfo megasas_scsi_info = {
    .tcq = true,
    .max_target = MFI_MAX_LD,
    .max_lun = 255,

    .transfer_data = megasas_xfer_complete,
    .get_sg_list = megasas_get_sg_list,
    .complete = megasas_command_complete,
    .cancel = megasas_command_cancel,
};

Example of the qemu command line (lsilogic controller):

  -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
  -device scsi-generic,bus=scsi0.0,scsi-id=8,\
  drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0

Example of the qemu command line (virtio-scsi controller):

  -drive file=/dev/sg2,if=none,id=drive-hostdev-scsi_host7-0-0-0 \
  -device scsi-generic,bus=scsi0.0,channel=0,scsi-id=128,lun=128,\
  drive=drive-hostdev-scsi_host7-0-0-0,id=hostdev-scsi_host7-0-0-0

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat.com>
11 years agoutils: util functions for scsi hostdev
Han Cheng [Fri, 3 May 2013 18:07:22 +0000 (02:07 +0800)]
utils: util functions for scsi hostdev

This patch adds util functions for scsi hostdev.

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat.com>
11 years agoqemu: New cap flags for scsi-generic
Han Cheng [Fri, 3 May 2013 18:07:21 +0000 (02:07 +0800)]
qemu: New cap flags for scsi-generic

Adding two cap flags for scsi-generic:
  QEMU_CAPS_SCSI_GENERIC
  QEMU_CAPS_SCSI_GENERIC_BOOTINDEX

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat.com>
11 years agonode_device: Clean up unused macros
Osier Yang [Mon, 13 May 2013 10:09:54 +0000 (18:09 +0800)]
node_device: Clean up unused macros

All of these macros are now unused, so remove.

11 years agoconf: Generic XMLs for scsi hostdev
Han Cheng [Fri, 3 May 2013 18:07:20 +0000 (02:07 +0800)]
conf: Generic XMLs for scsi hostdev

An example of the scsi hostdev XML:

    <hostdev mode='subsystem' type='scsi'>
      <source>
        <adapter name='scsi_host0'/>
        <address bus='0' target='0' unit='0'/>
      </source>
      <address type='drive' controller='0' bus='0' target='4' unit='8'/>
    </hostdev>

Controller is implicitly added for scsi hostdev, though the scsi
controller's model defaults to "lsilogic", which might be not what
the user wants (same problem exists for virtio-scsi disk). It's
the existing problem, will be addressed later.

The device address must be specified manually. Later patch will let
libvirt generate it automatically.

This only introduces the generic XMLs for scsi hostdev, later patches
will add other elements, e.g. <readonly>, <shareable>.

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
Signed-off-by: Osier Yang <jyang@redhat.com>
11 years agotests: Add tests for fc_host
Osier Yang [Mon, 6 May 2013 12:45:17 +0000 (20:45 +0800)]
tests: Add tests for fc_host

Since the NPIV machine is not easy to get, it's very likely to
introduce regressions when doing changes on the existing code.
This patch dumps part of the sysfs files (the necessary ones)
of fc_host as test input data, to test the related util functions.
It could be extended for more fc_host related testing in future.

11 years agoutil: Honor the passed sysfs_prefix
Osier Yang [Mon, 6 May 2013 12:45:16 +0000 (20:45 +0800)]
util: Honor the passed sysfs_prefix

The helper works for default sysfs_prefix, but for user specified
prefix, it doesn't work. (Detected when writing test cases. A later
patch will add the test cases for fc_host).

11 years agoutil: Update the comment for virGetFCHostNameByWWN
Osier Yang [Mon, 6 May 2013 12:45:15 +0000 (20:45 +0800)]
util: Update the comment for virGetFCHostNameByWWN

The returned result is something like "host5" acutally.

11 years agoutil: Change virIsCapable* to return bool
Osier Yang [Mon, 6 May 2013 12:45:14 +0000 (20:45 +0800)]
util: Change virIsCapable* to return bool

Function name with "aIsB" generally means its return value is
in Bi-state (true/false).

11 years agoutil: Don't miss the slash in constructed path
Osier Yang [Mon, 6 May 2013 12:45:13 +0000 (20:45 +0800)]
util: Don't miss the slash in constructed path

In case of the caller can pass a "prefix" (or "sysfs_prefix")
without the trailing slash, and Unix-Like system always eats
up the redundant "slash" in the filepath, let's add it explicitly.

11 years agoutil: Fix regression introduced by commit 4360a098441
Osier Yang [Mon, 6 May 2013 12:45:12 +0000 (20:45 +0800)]
util: Fix regression introduced by commit 4360a098441

Which refactored the old code, and introduced new helper
virIsCapableVport, but the path for checking with access() is not
correctly constructed.

11 years agoutil: Fix regression of wwn reading
Osier Yang [Mon, 6 May 2013 12:45:11 +0000 (20:45 +0800)]
util: Fix regression of wwn reading

Introduced by commit 244ce462e29, which refactored the helper for wwn
reading, however, it forgot to change the old "strndup" and "sizeof(buf)",
"sizeof(buf)" operates on the fixed length array ("buf") in the old code,
but now "buf" is a pointer.

Before the fix:

% virsh nodedev-dumpxml scsi_host5
<device>
  <name>scsi_host5</name>
  <parent>pci_0000_04_00_1</parent>
  <capability type='scsi_host'>
    <host>5</host>
    <capability type='fc_host'>
      <wwnn>2001001b</wwnn>
      <wwpn>2101001b</wwpn>
      <fabric_wwn>2001000d</fabric_wwn>
    </capability>
  </capability>
</device>

With the fix:

% virsh nodedev-dumpxml scsi_host5
<device>
  <name>scsi_host5</name>
  <parent>pci_0000_04_00_1</parent>
  <capability type='scsi_host'>
    <host>5</host>
    <capability type='fc_host'>
      <wwnn>0x2001001b32a9da4e</wwnn>
      <wwpn>0x2101001b32a9da4e</wwpn>
      <fabric_wwn>0x2001000dec9877c1</fabric_wwn>
    </capability>
  </capability>
</device>

11 years agobuild: fix use of mmap
Eric Blake [Sat, 11 May 2013 02:46:36 +0000 (20:46 -0600)]
build: fix use of mmap

Commit bfe7721d introduced a regression, but only on platforms
like FreeBSD that lack posix_fallocate and where mmap serves as
a nice fallback for safezero.

util/virfile.c: In function 'safezero':
util/virfile.c:837: error: 'PROT_READ' undeclared (first use in this function)

* src/util/virutil.c (includes): Move use of <sys/mman.h>...
* src/util/virfile.c (includes): ...to the file that uses mmap.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agobuild: update to latest gnulib, for syntax-check
Eric Blake [Sat, 11 May 2013 02:43:50 +0000 (20:43 -0600)]
build: update to latest gnulib, for syntax-check

This picks up a fix for a syntax-check weakness mentioned here:
https://www.redhat.com/archives/libvir-list/2013-May/msg00811.html

* .gnulib: Update to latest, for maint.mk improvement.

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoUpdate hellolibvirt to demo virGetLastErrorMessage()
Daniel P. Berrange [Fri, 10 May 2013 17:43:38 +0000 (18:43 +0100)]
Update hellolibvirt to demo virGetLastErrorMessage()

Update the hellolibvirt example program to demonstrate use of
the virGetLastErrorMessage() API for quick error reporting

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdd a test case for the fdstream file read/write code
Daniel P. Berrange [Fri, 10 May 2013 17:14:40 +0000 (18:14 +0100)]
Add a test case for the fdstream file read/write code

Add a test case which exercises the virFDStreamOpenFile
and virFDStreamCreateFile methods. Ensure that both the
synchronous and non-blocking iohelper code paths work.
This validates the regression recently fixed which
broke reading in non-blocking mode

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAllow the iohelper path to be customized by test programs
Daniel P. Berrange [Fri, 10 May 2013 17:12:20 +0000 (18:12 +0100)]
Allow the iohelper path to be customized by test programs

Currently the fdstream function hardcodes the location
of the iohelper to LIBEXECDIR "/libvirt_iohelper". This
is not convenient when trying to write test cases which
use this code. Add a virFDStreamSetIOHelper method to
allow the test cases to point to the location of the
un-installed iohelper binary.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoAdd a virGetLastErrorMessage() function
Daniel P. Berrange [Fri, 10 May 2013 17:09:44 +0000 (18:09 +0100)]
Add a virGetLastErrorMessage() function

Apps using libvirt will often have code like

   if (virXXXX() < 0) {
      virErrorPtr err = virGetLastError();
      fprintf(stderr, "Something failed: %s\n",
              err && err->message ? err->message :
              "unknown error");
      return -1;
   }

Checking for a NULL error object or message leads to very
verbose code. A virGetLastErrorMessage() helper from libvirt
can simplify this to

   if (virXXXX() < 0) {
      fprintf(stderr, "Something failed: %s\n",
              virGetLastErrorMessage());
      return -1;
   }

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoFix iohelper usage with streams opened for read
Daniel P. Berrange [Fri, 10 May 2013 13:45:05 +0000 (14:45 +0100)]
Fix iohelper usage with streams opened for read

In b2878ed860ceceec3cd6481424fed0b543b687cd we added the O_NOCTTY
flag when opening files in the stream code. Unfortunately a later
piece of code was comparing the flags == O_RDONLY, without masking
out the non-access mode flags. This broke the iohelper when used
with streams for read, since it caused us to attach the stream
output pipe to the stream input FD instead of output FD :-(

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoCope with missing swap cgroup controls
Daniel P. Berrange [Thu, 9 May 2013 12:53:39 +0000 (13:53 +0100)]
Cope with missing swap cgroup controls

It is possible to build a kernel without swap cgroup controls
present. This causes a fatal error when querying memory
parameters. Treat missing swap controls as meaning "unlimited".
The fatal error remains if the user tries to actually change
the limit.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
11 years agoportability: fix virNetDevSetMAC and virNetDevExists on BSD
Roman Bogorodskiy [Fri, 3 May 2013 13:35:20 +0000 (17:35 +0400)]
portability: fix virNetDevSetMAC and virNetDevExists on BSD

- provide virNetDevSetMAC() implementation based on SIOCSIFLLADDR
  ioctl.
- adjust virNetDevExists() to check for ENXIO error because
  FreeBSD throws it when device doesn't exist

Signed-off-by: Eric Blake <eblake@redhat.com>
11 years agoutil: move virFile* functions from virutil.c to virfile.c
Laine Stump [Thu, 9 May 2013 18:59:04 +0000 (14:59 -0400)]
util: move virFile* functions from virutil.c to virfile.c

These all existed before virfile.c was created, and for some reason
weren't moved.

This is mostly straightfoward, although the syntax rule prohibiting
write() had to be changed to have an exception for virfile.c instead
of virutil.c.

This movement pointed out that there is a function called
virBuildPath(), and another almost identical function called
virFileBuildPath(). They really should be a single function, which
I'll take care of as soon as I figure out what the arglist should look
like.

11 years agoutil: fix virFileOpenAs return value and resulting error logs
Laine Stump [Wed, 8 May 2013 19:02:14 +0000 (15:02 -0400)]
util: fix virFileOpenAs return value and resulting error logs

This resolves:

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

The first problem was that virFileOpenAs was returning fd (-1) in one
of the error cases rather than ret (-errno), so the caller thought
that the error was EPERM rather than ENOENT.

The second problem was that some log messages in the general purpose
qemuOpenFile() function would always say "Failed to create" even if
the caller hadn't included O_CREAT (i.e. they were trying to open an
existing file).

This fixes virFileOpenAs to jump down to the error return (which
returns ret instead of fd) in the previously mentioned incorrect
failure case of virFileOpenAs(), removes all error logging from
virFileOpenAs() (since the callers report it), and modifies
qemuOpenFile to appropriately use "open" or "create" in its log
messages.

NB: I seriously considered removing logging from all callers of
virFileOpenAs(), but there is at least one case where the caller
doesn't want virFileOpenAs() to log any errors, because it's just
going to try again (qemuOpenFile()). We can't simply make a silent
variation of virFileOpenAs() though, because qemuOpenFile() can't make
the decision about whether or not it wants to retry until after
virFileOpenAs() has already returned an error code.

Likewise, I also considered changing virFileOpenAs() to return -1 with
errno set on return, and may still do that, but only as a separate
patch, as it obscures the intent of this patch too much.

12 years agoBuild breaker - requires VIR_FROM_THIS
John Ferlan [Fri, 10 May 2013 12:52:43 +0000 (08:52 -0400)]
Build breaker - requires VIR_FROM_THIS

12 years agoAdapt to VIR_STRDUP and VIR_STRNDUP in src/test/*
Michal Privoznik [Fri, 3 May 2013 12:49:30 +0000 (14:49 +0200)]
Adapt to VIR_STRDUP and VIR_STRNDUP in src/test/*

12 years agovirGetStorageVol: Don't ignore NULL pool name
Michal Privoznik [Fri, 10 May 2013 10:05:28 +0000 (12:05 +0200)]
virGetStorageVol: Don't ignore NULL pool name

The function takes pool name as argument. However,
it is not acceptable for it to be NULL. Hence, we
should check it and report error in case it is.

12 years agoAdapt to VIR_STRDUP and VIR_STRNDUP in src/*
Michal Privoznik [Fri, 3 May 2013 12:52:48 +0000 (14:52 +0200)]
Adapt to VIR_STRDUP and VIR_STRNDUP in src/*

12 years agoAdapt to VIR_STRDUP and VIR_STRNDUP in tests/*
Michal Privoznik [Fri, 3 May 2013 12:52:21 +0000 (14:52 +0200)]
Adapt to VIR_STRDUP and VIR_STRNDUP in tests/*

12 years agoAdapt to VIR_STRDUP and VIR_STRNDUP in src/storage/*
Michal Privoznik [Fri, 3 May 2013 12:49:08 +0000 (14:49 +0200)]
Adapt to VIR_STRDUP and VIR_STRNDUP in src/storage/*

12 years agodom event example: Add error check to impl call
Jesse J. Cook [Thu, 9 May 2013 21:17:44 +0000 (16:17 -0500)]
dom event example: Add error check to impl call

Added error checking to virEventRegisterDefaultImpl call for consistency.

12 years agodom event example: init before register event impl
Jesse J. Cook [Thu, 9 May 2013 21:17:43 +0000 (16:17 -0500)]
dom event example: init before register event impl

In the domain-events example C code virEventRegisterDefaultImpl was being
called before virConnectOpen without first calling virInitialize. While this
code worked, it is incorrect. Adding a call to g_string_new prior to the call
to virEventRegisterDefaultImpl would cause the code to break. This fix will
help avoid unintentional misue of the API.

Relates to: Ret Hat Bugzilla - Bug 961155

12 years agoconf: Fix typo in error message in ABI stability check
Peter Krempa [Fri, 10 May 2013 07:54:56 +0000 (09:54 +0200)]
conf: Fix typo in error message in ABI stability check

s/vpu/vCPU/

12 years agotests: use portable shell code
Eric Blake [Thu, 9 May 2013 17:36:58 +0000 (11:36 -0600)]
tests: use portable shell code

'make check' fails since commit 470d5c46 on any system with dash
as /bin/sh, because '<<<' is a bash extension.  For example:

nwfilterschematest: 23: /home/eblake/libvirt/tests/schematestutils.sh: Syntax error: redirection unexpected

Also, there is no need to spawn a grep process when shell globbing
can do the same.

* tests/schematestutils.sh: Replace bashism and subprocess with a
faster and portable construct.

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agoReplace 'goto clean' with 'goto cleanup' in apparmor code
Daniel P. Berrange [Mon, 29 Apr 2013 17:38:21 +0000 (18:38 +0100)]
Replace 'goto clean' with 'goto cleanup' in apparmor code

Some of the apparmor code files did not follow the normal
goto label naming pratices

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoReplace list of driver source files with variables
Daniel P. Berrange [Mon, 29 Apr 2013 13:39:44 +0000 (14:39 +0100)]
Replace list of driver source files with variables

Update the DRIVER_SOURCE_FILES variable to reference the
other various XXX_SOURCES variables, instead of duplicating
the filename lists. This results in a bunch of extra files
being processed, but the test scripts can easily skip those

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoFix naming of methods in ESX storage backends to follow public APIs
Daniel P. Berrange [Mon, 29 Apr 2013 13:37:58 +0000 (14:37 +0100)]
Fix naming of methods in ESX storage backends to follow public APIs

The previous update of method naming missed the ESX storage
backend files. Update them is that the driver impl methods
follow the naming of the public API but with s/vir/esx/

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSkip virNWFilterTechDriver when validating API naming
Daniel P. Berrange [Mon, 29 Apr 2013 13:39:04 +0000 (14:39 +0100)]
Skip virNWFilterTechDriver when validating API naming

The virNWFilterTechDriver struct is an internal only driver
API with no public API equivalent. It should be skipped by
the 'check-driverimpls' test case

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoReplace 'goto cleanup' with 'goto error' in udev interface driver
Daniel P. Berrange [Thu, 9 May 2013 16:09:12 +0000 (17:09 +0100)]
Replace 'goto cleanup' with 'goto error' in udev interface driver

Some methods in the udev interface driver used 'cleanup' as the
label for separate error codepaths. Change these to use 'error'
as required by coding standards

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoReplace 'goto err' with 'goto cleanup' in udev interface driver
Daniel P. Berrange [Mon, 29 Apr 2013 17:37:48 +0000 (18:37 +0100)]
Replace 'goto err' with 'goto cleanup' in udev interface driver

The udev interface driver did not follow standard naming
convention for goto labels.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoDisable some URI tests on older libxml2
Daniel P. Berrange [Wed, 8 May 2013 15:11:09 +0000 (16:11 +0100)]
Disable some URI tests on older libxml2

Older versions of libxml2 could not correctly parse certain
URIs. This causes test failures. There's nothing libvirt can
do about this, so disable the problem tests on old libxml2
versions

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoFix build of python bindings on Python 2.4
Daniel P. Berrange [Wed, 8 May 2013 14:42:03 +0000 (15:42 +0100)]
Fix build of python bindings on Python 2.4

The PyDict_Next method on Python <= 2.4 used 'int' instead
of "Py_ssize_t" for the 'pos' parameter

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agobuild: fix build with old polkit0
Jim Fehlig [Thu, 9 May 2013 15:46:29 +0000 (09:46 -0600)]
build: fix build with old polkit0

Commit 979e9c56 missed one case of providing the timestamp
parameter to virNetServerClientGetUNIXIdentity() when WITH_POLKIT0
is defined.

12 years agoconf: don't crash on a tpm device with no backends
Ján Tomko [Thu, 9 May 2013 10:33:11 +0000 (12:33 +0200)]
conf: don't crash on a tpm device with no backends

Print an error instead of crashing when a TPM device without
a backend is specified.

Add a test for tpm device with no backend, which should fail
with a parse error.

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

12 years agotests: files named '.*-invalid.xml' should fail validation
Ján Tomko [Thu, 9 May 2013 11:43:32 +0000 (13:43 +0200)]
tests: files named '.*-invalid.xml' should fail validation

Currently, using an invalid XML in tests fails, because
the schema test expects all of them to be valid.

Treat files with -invalid.xml suffix as invalid and expect
them to fail validation.

12 years agodon't mention disk controllers in generic controller errors
Ján Tomko [Thu, 9 May 2013 09:39:21 +0000 (11:39 +0200)]
don't mention disk controllers in generic controller errors

The controller element supports non-disk controller types too.

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

12 years agoiscsi: don't leak portal string when starting a pool
Ján Tomko [Mon, 6 May 2013 12:36:23 +0000 (14:36 +0200)]
iscsi: don't leak portal string when starting a pool

12 years agoSimplify the Xen domain stats/peek / node memory driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 16:55:18 +0000 (17:55 +0100)]
Simplify the Xen domain stats/peek / node memory driver methods

Make the Xen domain stats / peek and node memory driver
methods unconditionally call the sub-drivers which are
guaranteed to be open.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain autostart driver method
Daniel P. Berrange [Thu, 2 May 2013 13:36:45 +0000 (14:36 +0100)]
Simplify the Xen domain autostart driver method

Unconditionally call into the XenD or XM drivers for autostart
handling, since they are guaranteed to be open

12 years agoSimplify the Xen domain scheduler parameter driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 16:52:19 +0000 (17:52 +0100)]
Simplify the Xen domain scheduler parameter driver methods

Make the Xen domain scheduler parameter methods directly
call into XenD or Xen hypervisor drivers

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain attach/dettach driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 16:43:07 +0000 (17:43 +0100)]
Simplify the Xen domain attach/dettach driver methods

Make the domain attach/dettach driver methods directly call
into either the XenD or XM drivers

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain define/undefine driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 16:39:29 +0000 (17:39 +0100)]
Simplify the Xen domain define/undefine driver methods

Make the domain define/undefine driver methods directly call
into either the XenD or XM drivers

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain start driver method
Daniel P. Berrange [Tue, 30 Apr 2013 16:33:48 +0000 (17:33 +0100)]
Simplify the Xen domain start driver method

Directly call either the XenD or XM driver when starting
a persistent domain

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen driver define domain driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 16:31:40 +0000 (17:31 +0100)]
Simplify the Xen driver define domain driver methods

Directly call either XenD or the XM driver for handling
domain define operations.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain migration driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 16:27:59 +0000 (17:27 +0100)]
Simplify the Xen domain migration driver methods

All the migration code is done by the XenD subdriver which
can be assumed to always be present

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain get XML driver method
Daniel P. Berrange [Tue, 30 Apr 2013 16:26:30 +0000 (17:26 +0100)]
Simplify the Xen domain get XML driver method

The xenUnifiedDomainGetXMLDesc driver can assume that
the XM and XenD drivers are always present

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain VCPU driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 16:25:27 +0000 (17:25 +0100)]
Simplify the Xen domain VCPU driver methods

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain save/restore driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 15:44:21 +0000 (16:44 +0100)]
Simplify the Xen domain save/restore driver methods

Unconditionally call the XenD APIs for save/restore, since that
driver will always be open.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain get info/state driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 15:42:29 +0000 (16:42 +0100)]
Simplify the Xen domain get info/state driver methods

Make the xenUnifiedDomainGetInfo and xenUnifiedDomainGetState drivers
call the correct sub-driver APIs directly.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain get/set (max) memory driver methods
Daniel P. Berrange [Tue, 30 Apr 2013 15:31:33 +0000 (16:31 +0100)]
Simplify the Xen domain get/set (max) memory driver methods

Simplify the Xen memory limit driver methods to directly call
the most appropriate sub-driver

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoRemove Xen get hostname driver method
Daniel P. Berrange [Tue, 30 Apr 2013 15:15:28 +0000 (16:15 +0100)]
Remove Xen get hostname driver method

The xenGetHostname entry point in the xenUnifiedDriver table
was unused.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoSimplify the Xen domain get OS type driver method
Daniel P. Berrange [Tue, 30 Apr 2013 15:04:36 +0000 (16:04 +0100)]
Simplify the Xen domain get OS type driver method

Make xenUnifiedDomainGetOSType directly call either the
xenHypervisorDomainGetOSType or xenDaemonDomainGetOSType
method depending on whether the domain is active or not.

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