]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
12 years agoqemu: Allow migration over IPv6
Ján Tomko [Fri, 22 Mar 2013 13:52:25 +0000 (14:52 +0100)]
qemu: Allow migration over IPv6

Allow migration over IPv6 by listening on [::] instead of 0.0.0.0
when QEMU supports it (QEMU_CAPS_IPV6_MIGRATION) and there is
at least one v6 address configured on the system.

Use virURIParse in qemuMigrationPrepareDirect to allow parsing
IPv6 addresses, which would cause an 'incorrect :port' error
message before.

Move setting of migrateFrom from qemuMigrationPrepare{Direct,Tunnel}
after domain XML parsing, since we need the QEMU binary path from it
to get its capabilities.

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

12 years agovirsh: Add a helper to parse cpulist
Osier Yang [Thu, 28 Mar 2013 11:36:30 +0000 (19:36 +0800)]
virsh: Add a helper to parse cpulist

The 'virsh vcpupin' and 'virsh emulatorpin' commands use the same
code to parse the cpulist. This patch abstracts the same code as
a helper. Along with various code style fixes, and error improvement
(only error "Physical CPU %d doesn't exist" if the specified CPU
exceed the range, no "cpulist: Invalid format", see the following
for an example of the error prior to this patch).

% virsh vcpupin 4 0 0-8
error: Physical CPU 4 doesn't exist.
error: cpulist: Invalid format.

12 years agoResolve valgrind failure
John Ferlan [Mon, 1 Apr 2013 17:13:31 +0000 (13:13 -0400)]
Resolve valgrind failure

Code added by commit id '523207fe8'

TEST: qemuxml2argvtest
      ........................................ 40
      ........................................ 80
      ........................................ 120
      ........................................ 160
      ........................................ 200
      ........................................ 240
      .................................        273 OK
==30993== 39 bytes in 1 blocks are definitely lost in loss record 33 of 87
==30993==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==30993==    by 0x41E501: fakeSecretGetValue (qemuxml2argvtest.c:33)
==30993==    by 0x427591: qemuBuildDriveURIString (qemu_command.c:2571)
==30993==    by 0x42C502: qemuBuildDriveStr (qemu_command.c:2627)
==30993==    by 0x4335FC: qemuBuildCommandLine (qemu_command.c:6443)
==30993==    by 0x41E8A0: testCompareXMLToArgvHelper (qemuxml2argvtest.c:154
==30993==    by 0x41FE8F: virtTestRun (testutils.c:157)
==30993==    by 0x418BE3: mymain (qemuxml2argvtest.c:506)
==30993==    by 0x4204CA: virtTestMain (testutils.c:719)
==30993==    by 0x38D6821A04: (below main) (in /usr/lib64/libc-2.16.so)
==30993==
==30993== 46 bytes in 1 blocks are definitely lost in loss record 64 of 87
==30993==    at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==30993==    by 0x38D690A167: __vasprintf_chk (in /usr/lib64/libc-2.16.so)
==30993==    by 0x4CB28E7: virVasprintf (stdio2.h:210)
==30993==    by 0x4CB29A3: virAsprintf (virutil.c:2017)
==30993==    by 0x4275B4: qemuBuildDriveURIString (qemu_command.c:2580)
==30993==    by 0x42C502: qemuBuildDriveStr (qemu_command.c:2627)
==30993==    by 0x4335FC: qemuBuildCommandLine (qemu_command.c:6443)
==30993==    by 0x41E8A0: testCompareXMLToArgvHelper (qemuxml2argvtest.c:154
==30993==    by 0x41FE8F: virtTestRun (testutils.c:157)
==30993==    by 0x418BE3: mymain (qemuxml2argvtest.c:506)
==30993==    by 0x4204CA: virtTestMain (testutils.c:719)
==30993==    by 0x38D6821A04: (below main) (in /usr/lib64/libc-2.16.so)
==30993==
==30993== 385 (56 direct, 329 indirect) bytes in 1 blocks are definitely los
==30993==    at 0x4A06B6F: calloc (vg_replace_malloc.c:593)
==30993==    by 0x4C6B2CF: virAllocN (viralloc.c:152)
==30993==    by 0x4C9C7EB: virObjectNew (virobject.c:191)
==30993==    by 0x4D21810: virGetSecret (datatypes.c:642)
==30993==    by 0x41E5D5: fakeSecretLookupByUsage (qemuxml2argvtest.c:51)
==30993==    by 0x4D4BEC5: virSecretLookupByUsage (libvirt.c:15295)
==30993==    by 0x4276A9: qemuBuildDriveURIString (qemu_command.c:2565)
==30993==    by 0x42C502: qemuBuildDriveStr (qemu_command.c:2627)
==30993==    by 0x4335FC: qemuBuildCommandLine (qemu_command.c:6443)
==30993==    by 0x41E8A0: testCompareXMLToArgvHelper (qemuxml2argvtest.c:154
==30993==    by 0x41FE8F: virtTestRun (testutils.c:157)
==30993==    by 0x418BE3: mymain (qemuxml2argvtest.c:506)
==30993==
PASS: qemuxml2argvtest

Interesting side note is that running the test singularly via 'make -C tests
check TESTS=qemuxml2argvtest' didn't trip the valgrind error; however,
running during 'make -C tests valgrind' did cause the error to be seen.

12 years agoRelease of libvirt-1.0.4
Daniel Veillard [Mon, 1 Apr 2013 02:57:04 +0000 (10:57 +0800)]
Release of libvirt-1.0.4

- configure.ac docs/news.html.in libvirt.spec.in: updates for the release
- po/*.po*: fetch translation updates from Transifex and regenerate

12 years agodocs: Fix truncated sentence in RDP 'multiUser' attribute
Christophe Fergeau [Fri, 29 Mar 2013 12:52:21 +0000 (13:52 +0100)]
docs: Fix truncated sentence in RDP 'multiUser' attribute

12 years agovirsh: don't call virSecretFree on NULL
Ján Tomko [Fri, 29 Mar 2013 11:55:38 +0000 (12:55 +0100)]
virsh: don't call virSecretFree on NULL

Since the refactoring in fbe2d49 we call virSecretFree even if
virSecretDefineXML fails, which leads to overwriting the error
message with:
error: Invalid secret: virSecretFree

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

12 years agostorage: Avoid double virCommandFree in virStorageBackendLogicalDeletePool
Martin Kletzander [Thu, 28 Mar 2013 15:36:50 +0000 (16:36 +0100)]
storage: Avoid double virCommandFree in virStorageBackendLogicalDeletePool

When logical pool has no PVs associated with itself (user-created),
virCommandFree(cmd) is called twice with the same pointer and that
causes a segfault in daemon.

12 years agonodedev: invert virIsCapableFCHost return value
Ján Tomko [Thu, 28 Mar 2013 15:46:55 +0000 (16:46 +0100)]
nodedev: invert virIsCapableFCHost return value

Both virIsCapableFCHost and virIsCapableVport return 0 when the
respective sysfs path is accessible.

12 years agosecurity_manager.c: Append seclabel iff generated
Michal Privoznik [Thu, 28 Mar 2013 15:13:01 +0000 (16:13 +0100)]
security_manager.c: Append seclabel iff generated

With my previous patches, we unconditionally appended a seclabel,
even if it wasn't generated but found in array of defined seclabels.
This resulted in double free later when doing virDomainDefFree
and iterating over the array of defined seclabels.

Moreover, there was another possibility of double free, if the
seclabel was generated in the last iteration of the process of
walking trough security managers array.

12 years agovirutil: Fix compilation on non-linux platforms
Michal Privoznik [Thu, 28 Mar 2013 12:20:41 +0000 (13:20 +0100)]
virutil: Fix compilation on non-linux platforms

There has been a typo in virIsCapbleVport function name.

12 years agoutil: Fix the conflict type for virIsCapableFCHost
Osier Yang [Thu, 28 Mar 2013 12:17:05 +0000 (20:17 +0800)]
util: Fix the conflict type for virIsCapableFCHost

---
Pushed under build-breaker rule.

12 years agolibvirt_private.syms: Correctly export seclabel APIs
Michal Privoznik [Thu, 28 Mar 2013 09:39:25 +0000 (10:39 +0100)]
libvirt_private.syms: Correctly export seclabel APIs

One of my previous patches manipulated virSecurityLabel* APIs,
some were added to header files, and some were renamed. However,
these changes were not reflected in libvirt_private.syms.

12 years agosecurity: Don't add seclabel of type none if there's already a seclabel
Michal Privoznik [Thu, 21 Mar 2013 15:32:07 +0000 (16:32 +0100)]
security: Don't add seclabel of type none if there's already a seclabel

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

The <seclabel type='none'/> should be added iff there is no other
seclabel defined within a domain. This bug can be easily reproduced:
1) configure selinux seclabel for a domain
2) disable system's selinux and restart libvirtd
3) observe <seclabel type='none'/> being appended to a domain on its
   startup

12 years agosecurity_manager: Don't manipulate domain XML in virDomainDefGetSecurityLabelDef
Michal Privoznik [Thu, 21 Mar 2013 15:12:55 +0000 (16:12 +0100)]
security_manager: Don't manipulate domain XML in virDomainDefGetSecurityLabelDef

The virDomainDefGetSecurityLabelDef was modifying the domain XML.
It tried to find a seclabel corresponding to given sec driver. If the
label wasn't found, the function created one which is wrong. In fact
it's security manager which should modify this part of domain XML.

12 years agoconf: fix memory leak of class_id bitmap
Guannan Ren [Thu, 28 Mar 2013 04:10:05 +0000 (12:10 +0800)]
conf: fix memory leak of class_id bitmap

When libvirtd loads active network configs from network state directory,
it should release the class_id memory block which was allocated
at the time of loading xml from network config directory.
virBitmapParse will create a new memory block of bitmap class_id which
causes a memory leak.

This happens when at least one virtual network is active before.

==12234== 8,216 (24 direct, 8,192 indirect) bytes in 1 blocks are definitely \
              lost in loss record 702 of 709
==12234==    at 0x4A06B2F: calloc (vg_replace_malloc.c:593)
==12234==    by 0x37AB04D77D: virAlloc (in /usr/lib64/libvirt.so.0.1000.3)
==12234==    by 0x37AB04EF89: virBitmapNew (in /usr/lib64/libvirt.so.0.1000.3)
==12234==    by 0x37AB0BFB37: virNetworkAssignDef (in /usr/lib64/libvirt.so.0.1000.3)
==12234==    by 0x37AB0BFD31: ??? (in /usr/lib64/libvirt.so.0.1000.3)
==12234==    by 0x37AB0BFE92: virNetworkLoadAllConfigs (in /usr/lib64/libvirt.so.0.1000.3)
==12234==    by 0x10650E5A: ??? (in /usr/lib64/libvirt/connection-driver/libvirt_driver_network.so)
==12234==    by 0x37AB0EB72F: virStateInitialize (in /usr/lib64/libvirt.so.0.1000.3)
==12234==    by 0x40DE04: ??? (in /usr/sbin/libvirtd)
==12234==    by 0x37AB0832E8: ??? (in /usr/lib64/libvirt.so.0.1000.3)
==12234==    by 0x3796807D14: start_thread (in /usr/lib64/libpthread-2.16.so)
==12234==    by 0x37960F246C: clone (in /usr/lib64/libc-2.16.so)

12 years agouml:release config object when uml driver shutdown
Guannan Ren [Wed, 27 Mar 2013 11:03:17 +0000 (19:03 +0800)]
uml:release config object when uml driver shutdown

12 years agoqemu:release qemu config object when qemu driver shutdown
Guannan Ren [Wed, 27 Mar 2013 11:02:57 +0000 (19:02 +0800)]
qemu:release qemu config object when qemu driver shutdown

12 years agonet: use newer iptables syntax
Stefan Seyfried [Mon, 25 Mar 2013 19:39:40 +0000 (20:39 +0100)]
net: use newer iptables syntax

iptables-1.4.18 removed the long deprecated "state" match.
Use "conntrack" instead in forwarding rules.
Fixes openSUSE bug https://bugzilla.novell.com/811251 #811251.

12 years agoremote: Don't call NULL closeFreeCallback
Viktor Mihajlovski [Tue, 26 Mar 2013 09:54:54 +0000 (10:54 +0100)]
remote: Don't call NULL closeFreeCallback

Check function pointer before calling.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
12 years agorpc: Fix client crash when server drops connection
Jiri Denemark [Tue, 26 Mar 2013 14:50:38 +0000 (15:50 +0100)]
rpc: Fix client crash when server drops connection

Despite the comment stating virNetClientIncomingEvent handler should
never be called with either client->haveTheBuck or client->wantClose
set, there is a sequence of events that may lead to both booleans being
true when virNetClientIncomingEvent is called. However, when that
happens, we must not immediately close the socket as there are other
threads waiting for the buck and they would cause SIGSEGV once they are
woken up after the socket was closed. Another thing is we should clear
all remaining calls in the queue after closing the socket.

The situation that can lead to the crash involves three threads, one of
them running event loop and the other two calling libvirt APIs. The
event loop thread detects an event on client->sock and calls
virNetClientIncomingEvent handler. But before the handler gets a chance
to lock client, the other two threads (T1 and T2) start calling some
APIs. T1 gets the buck and detects EOF on client->sock while processing
its RPC call. Since T2 is waiting for its own call, T1 passes the buck
on to it and unlocks client. But before T2 gets the signal, the event
loop thread wakes up, does its job and closes client->sock. The crash
happens when T2 actually wakes up and tries to do its job using a closed
client->sock.

12 years agolog: Separate thread ID from timestemp in ring buffer
Jiri Denemark [Mon, 25 Mar 2013 10:35:27 +0000 (11:35 +0100)]
log: Separate thread ID from timestemp in ring buffer

When we write a log message into a log, we separate thread ID from
timestamp using ": ". However, when storing the message into the ring
buffer, we omitted the separator, e.g.:

    2013-02-27 11:49:11.852+00003745: ...

12 years agoconf: fix a failure when detaching a usb device
Guannan Ren [Tue, 26 Mar 2013 14:17:43 +0000 (22:17 +0800)]
conf: fix a failure when detaching a usb device

 #virsh detach-device $guest usb.xml
 error: Failed to detach device from usb2.xml
 error: operation failed: host usb device vendor=0x0951 \
 product=0x1625 not found

This regresstion is due to a typo in matching function. The first
argument is always the usb device that we are checking for. If the
usb xml file provided by user contains bus and device info, we try
to search it by them, otherwise, we use vendor and product info.

The bug occurred only when detaching a usb device with no bus and
device info provided in the usb xml file.

12 years agovirsh: Correct DESCRIPTION for virsh help blockcopy
Yanbing Du [Tue, 26 Mar 2013 16:46:28 +0000 (00:46 +0800)]
virsh: Correct DESCRIPTION for virsh help blockcopy

Signed-off-by: Yanbing Du <ydu@redhat.com>
12 years agoqemu: Don't set address type too early during virtio disk hotplug
Guido Günther [Fri, 22 Mar 2013 09:25:42 +0000 (10:25 +0100)]
qemu: Don't set address type too early during virtio disk hotplug

f946462e14ac036357b7c11ce5c23f94a3ee4e49 changed behavior by settings
VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI upfront. If we do so before invoking
qemuDomainPCIAddressEnsureAddr we merely try to set the PCI slot via
qemuDomainPCIAddressReserveSlot instead reserving a new address via
qemuDomainPCIAddressSetNextAddr which fails with

$ ~/run-tck-test domain/200-disk-hotplug.t
./scripts/domain/200-disk-hotplug.t .. # Creating a new transient domain
./scripts/domain/200-disk-hotplug.t .. 1/5 # Attaching the new disk /var/lib/jenkins/jobs/libvirt-tck-build/workspace/scratchdir/200-disk-hotplug/extra.img

 #   Failed test 'disk has been attached'
 #   at ./scripts/domain/200-disk-hotplug.t line 67.
 # died: Sys::Virt::Error (libvirt error code: 1, message: internal error unable to reserve PCI address 0:0:0.0
 # )

12 years agovirsh: error out on non-numeric timeout values
Ján Tomko [Tue, 26 Mar 2013 15:41:06 +0000 (16:41 +0100)]
virsh: error out on non-numeric timeout values

Some block commands and migrate ignored incorrect values.

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

12 years agoqemu: Set migration FD blocking
Michal Privoznik [Tue, 26 Mar 2013 14:45:16 +0000 (15:45 +0100)]
qemu: Set migration FD blocking

Since we switched from direct host migration scheme to the one,
where we connect to the destination and then just pass a FD to a
qemu, we have uncovered a qemu bug. Qemu expects migration FD to
block. However, we are passing a nonblocking one which results in
cryptic error messages like:

  qemu: warning: error while loading state section id 2
  load of migration failed

The bug is already known to Qemu folks, but we should workaround
already released Qemus. Patch has been originally proposed by Stefan
Hajnoczi <stefanha@gmail.com>

12 years agoFix virConnectOpen.*() name requirements
Martin Kletzander [Mon, 25 Mar 2013 15:50:27 +0000 (16:50 +0100)]
Fix virConnectOpen.*() name requirements

virConnectOpenAuth didn't require 'name' to be specified (VIR_DEBUG
used NULLSTR() for the output) and by default, if name == NULL, the
default connection uri is used.  This was not indicated in the
documentation and wasn't checked for in other API's VIR_DEBUG outputs.

12 years agovirsh: Let the compiler check usage of all fields in vshCmdOptType enum
Peter Krempa [Mon, 25 Mar 2013 11:03:30 +0000 (12:03 +0100)]
virsh: Let the compiler check usage of all fields in vshCmdOptType enum

Get rid of the "default" labels to do so.

12 years agopython: set default value to optional arguments
Guannan Ren [Tue, 26 Mar 2013 04:34:49 +0000 (12:34 +0800)]
python: set default value to optional arguments

When prefixing with string (optional) or optional in the description
of arguments to libvirt C APIs, in python, these arguments will be
set as optional arugments, for example:

 * virDomainSaveFlags:
 * @domain: a domain object
 * @to: path for the output file
 * @dxml: (optional) XML config for adjusting guest xml used on restore
 * @flags: bitwise-OR of virDomainSaveRestoreFlags

 the corresponding python APIs is
 restoreFlags(self, frm, dxml=None, flags=0)

The following python APIs are changed to:
 blockCommit(self, disk, base, top, bandwidth=0, flags=0)
 blockPull(self, disk, bandwidth=0, flags=0)
 blockRebase(self, disk, base, bandwidth=0, flags=0)
 migrate(self, dconn, flags=0, dname=None, uri=None, bandwidth=0)
 migrate2(self, dconn, dxml=None, flags=0, dname=None, uri=None, bandwidth=0)
 migrateToURI(self, duri, flags=0, dname=None, bandwidth=0)
 migrateToURI2(self, dconnuri=None, miguri=None, dxml=None, flags=0, \
               dname=None, bandwidth=0)
 saveFlags(self, to, dxml=None, flags=0)
 migrate(self, domain, flags=0, dname=None, uri=None, bandwidth=0)
 migrate2(self, domain, dxml=None, flags=0, dname=None, uri=None, bandwidth=0)
 restoreFlags(self, frm, dxml=None, flags=0)

12 years agoRemove the redundant parentheses in migrate help
Yanbing Du [Tue, 26 Mar 2013 03:02:17 +0000 (11:02 +0800)]
Remove the redundant parentheses in migrate help

Signed-off-by: Yanbing Du <ydu@redhat.com>
12 years agoRevert "qemu: detect multi-head qxl via more than version check"
Eric Blake [Fri, 15 Mar 2013 18:22:59 +0000 (12:22 -0600)]
Revert "qemu: detect multi-head qxl via more than version check"

This reverts commit 5ac846e42e5b7e0475f6aa9cc1e0b0c8dac84d44.

After further discussions with Alon Levy, I learned the following:

The use of '-vga qxl' vs. '-device qxl-vga' is completely orthogonal
to whether ram_size can be exposed.  Downstream distros are interested
in backporting support for multi-head qxl, but this can be done in
one of two ways:
1. Support one head per PCI device.  If you do this, then it makes
sense to have full control over the PCI address of each device. For
full control, you need '-device qxl-vga' instead of '-vga qxl'.
2. Support multiple heads through a single PCI device.  If you do
this, then you need to allocate more RAM to that PCI device (enough
ram to cover the multiple screens).  Here, the device is hard-coded
to 0:0:2.0, both in qemu and libvirt code.

Apparently, backporting ram_size changes to allow multiple heads in
a single device is much easier than backporting multiple device
support.  Furthermore, the presence or absence of qxl-vga.surfaces
is no different than the presence or absence of qxl-vga.ram_size;
both properties can be applied regardless of whether you have one
PCI device (-vga qxl) or multiple (-device qxl-vga), so this property
is NOT a good witness of whether '-device qxl-vga' support has been
backported.

Downstream RHEL will NOT be using this patch; and worse, leaving this
patch in risks doing the wrong thing if compiling upstream libvirt
on RHEL, so the best course of action is to revert it.  That means
that libvirt will go back to only using '-device qxl-vga' for qemu
>= 1.2, but this is just fine because we know of no distros that plan
on backporting multiple PCI address support to any older version of
qemu.  Meanwhile, downstream can still use ram_size to pack multiple
heads through a single PCI device.

12 years agolibvirt-guests: newline between output sentences
Eric Blake [Wed, 20 Mar 2013 14:54:08 +0000 (08:54 -0600)]
libvirt-guests: newline between output sentences

Right now, libvirt-guests gives awkward output.  It's possible to
force faster failure by setting /etc/sysconfig/libvirt-guests to use:

ON_SHUTDOWN=shutdown
PARALLEL_SHUTDOWN=0
SHUTDOWN_TIMEOUT=1
ON_BOOT=ignore

at which point, we see:

$ service libvirt-guests restart
Running guests on default URI: a, b, d, c
Shutting down guests on default URI...
Starting shutdown on guest: a
Shutdown of guest a failed to complete in time.Starting shutdown on guest: b
Shutdown of guest b failed to complete in time.Starting shutdown on guest: d
Shutdown of guest d failed to complete in time.Starting shutdown on guest: c
Shutdown of guest c failed to complete in time.libvirt-guests is configured not to start any guests on boot

* tools/libvirt-guests.sh.in (shutdown_guest): Add missing newline.
Reported by Xuesong Zhang.

12 years agoutil: Fix bug of managing vport
Osier Yang [Mon, 4 Feb 2013 13:32:03 +0000 (21:32 +0800)]
util: Fix bug of managing vport

The string written to "vport_create" or "vport_delete" should
be "wwnn:wwpn", but not "wwpn:wwnn".

12 years agonodedev: Fix the improper logic when enumerating SRIOV VF
Osier Yang [Mon, 25 Mar 2013 13:10:51 +0000 (21:10 +0800)]
nodedev: Fix the improper logic when enumerating SRIOV VF

virPCIGetVirtualFunctions returns 0 even if there is no "virtfn"
entry under the device sysfs path.

And virPCIGetVirtualFunctions returns -1 when it fails to get
the PCI config space of one VF, however, with keeping the
the VFs already detected.

That's why udevProcessPCI and gather_pci_cap use logic like:

if (!virPCIGetVirtualFunctions(syspath,
                               &data->pci_dev.virtual_functions,
                               &data->pci_dev.num_virtual_functions) ||
    data->pci_dev.num_virtual_functions > 0)
    data->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION;

to tag the PCI device with "virtual_function" cap.

However, this results in a VF will aslo get "virtual_function" cap.

This patch fixes it by:
  * Ignoring the VF which has failure of getting PCI config space
    (given that the successfully detected VFs are kept , it makes
    sense to not give up on the failure of one VF too) with a warning,
    so virPCIGetVirtualFunctions will not return -1 except out of memory.

  * Free the allocated *virtual_functions when out of memory

And thus the logic can be changed to:

    /* Out of memory */
    int ret = virPCIGetVirtualFunctions(syspath,
                                        &data->pci_dev.virtual_functions,
                                        &data->pci_dev.num_virtual_functions);

    if (ret < 0 )
        goto out;
    if (data->pci_dev.num_virtual_functions > 0)
        data->pci_dev.flags |= VIR_NODE_DEV_CAP_FLAG_PCI_VIRTUAL_FUNCTION;

12 years agonodedev: Abstract nodeDeviceVportCreateDelete as util function
Osier Yang [Mon, 7 Jan 2013 17:05:34 +0000 (01:05 +0800)]
nodedev: Abstract nodeDeviceVportCreateDelete as util function

This abstracts nodeDeviceVportCreateDelete as an util function
virManageVport, which can be further used by later storage patches
(to support persistent vHBA, I don't want to create the vHBA
using the public API, which is not good).

12 years agonodedev: Dump max vports and vports in use for HBA's XML
Osier Yang [Mon, 7 Jan 2013 17:05:32 +0000 (01:05 +0800)]
nodedev: Dump max vports and vports in use for HBA's XML

This enrichs HBA's xml by dumping the number of max vports and
vports in use. Format is like:

  <capability type='vport_ops'>
    <max_vports>164</max_vports>
    <vports>5</vports>
  </capability>

* docs/formatnode.html.in: (Document the new XML)
* docs/schemas/nodedev.rng: (Add the schema)
* src/conf/node_device_conf.h: (New member for data.scsi_host)
* src/node_device/node_device_linux_sysfs.c: (Collect the value of
  max_vports and vports)

12 years agonodedev: Refactor the helpers
Osier Yang [Mon, 7 Jan 2013 17:05:31 +0000 (01:05 +0800)]
nodedev: Refactor the helpers

This adds two util functions (virIsCapableFCHost and virIsCapableVport),
and rename helper check_fc_host_linux as detect_scsi_host_caps,
check_capable_vport_linux is removed, as it's abstracted to the util
function virIsCapableVport. detect_scsi_host_caps nows detect both
the fc_host and vport_ops capabilities. "stat(2)" is replaced with
"access(2)" for saving.

* src/util/virutil.h:
  - Declare virIsCapableFCHost and virIsCapableVport
* src/util/virutil.c:
  - Implement virIsCapableFCHost and virIsCapableVport
* src/node_device/node_device_linux_sysfs.c:
  - Remove check_capable_vport_linux
  - Rename check_fc_host_linux as detect_scsi_host_caps, and refactor
    it a bit to detect both fc_host and vport_os capabilities
* src/node_device/node_device_driver.h:
  - Change/remove the related declarations
* src/node_device/node_device_udev.c: (Use detect_scsi_host_caps)
* src/node_device/node_device_hal.c: (Likewise)
* src/node_device/node_device_driver.c (Likewise)

12 years agonodedev: Use access instead of stat
Osier Yang [Mon, 7 Jan 2013 17:05:30 +0000 (01:05 +0800)]
nodedev: Use access instead of stat

The use of 'stat' in nodeDeviceVportCreateDelete is only to check
if the file exists or not, it's a bit overkill, and safe to replace
with the wrapper of access(2) (virFileExists).

12 years agoutil: Add one helper virReadFCHost to read the value of fc_host entry
Osier Yang [Mon, 7 Jan 2013 17:05:29 +0000 (01:05 +0800)]
util: Add one helper virReadFCHost to read the value of fc_host entry

"open_wwn_file" in node_device_linux_sysfs.c is redundant, on one
hand it duplicates work of virFileReadAll, on the other hand, it's
waste to use a function for it, as there is no other users of it.
So I don't see why the file opening work cannot be done in
"read_wwn_linux".

"read_wwn_linux" can be abstracted as an util function. As what all
it does is to read the sysfs entry.

So this patch removes "open_wwn_file", and abstract "read_wwn_linux"
as an util function "virReadFCHost" (a more general name, because
after changes, it can read each of the fc_host entry now).

* src/util/virutil.h: (Declare virReadFCHost)
* src/util/virutil.c: (Implement virReadFCHost)
* src/node_device/node_device_linux_sysfs.c: (Remove open_wwn_file,
  and read_wwn_linux)
src/node_device/node_device_driver.h: (Remove the declaration of
  read_wwn_linux, and the related macros)
src/libvirt_private.syms: (Export virReadFCHost)

12 years agonodedev: Introduce two new flags for listAll API
Osier Yang [Mon, 7 Jan 2013 17:05:28 +0000 (01:05 +0800)]
nodedev: Introduce two new flags for listAll API

VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST to filter the FC HBA,
and VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS to filter the FC HBA
which supports vport.

12 years agonodedev: Remove the unused enum
Osier Yang [Mon, 7 Jan 2013 17:05:27 +0000 (01:05 +0800)]
nodedev: Remove the unused enum

Guess it was created for the fc_host and vports_ops capabilities
purpose, but there is enum virNodeDevScsiHostCapFlags for them,
and enum virNodeDevHBACapType is unused, and actually both
VIR_ENUM_DECL and VIR_ENUM_IMPL use the wrong enum name
"virNodeDevHBACap".

12 years agovirsh: Fix docs for "virsh setmaxmem"
Peter Krempa [Fri, 22 Mar 2013 10:05:36 +0000 (11:05 +0100)]
virsh: Fix docs for "virsh setmaxmem"

The docs assumed the command works always for QEMU and other
hypervisors. As this is done using the balloon mechainism live increase
of the maximum memory limit isn't supported. Fix the docs to mention
this limitation.

12 years agolxc: Prevent shutting down the host
Martin Kletzander [Thu, 21 Mar 2013 14:59:50 +0000 (15:59 +0100)]
lxc: Prevent shutting down the host

When the container has the same '/dev' mount as host (no chroot),
calling domainShutdown(WithFlags) shouldn't shutdown the host it is
running on.

12 years agoEnsure root filesystem is mounted if a file/block mount.
Daniel P. Berrange [Fri, 22 Mar 2013 14:09:41 +0000 (14:09 +0000)]
Ensure root filesystem is mounted if a file/block mount.

For a root filesystem with type=file or type=block, the LXC
container was forgetting to actually mount it, before doing
the pivot root step.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoMount temporary devpts on /var/lib/libvirt/lxc/$NAME.devpts
Daniel P. Berrange [Fri, 22 Mar 2013 13:54:12 +0000 (13:54 +0000)]
Mount temporary devpts on /var/lib/libvirt/lxc/$NAME.devpts

Currently the lxc controller sets up the devpts instance on
$rootfsdef->src, but this only works if $rootfsdef is using
type=mount. To support type=block or type=file for the root
filesystem, we must use /var/lib/libvirt/lxc/$NAME.devpts
for the temporary devpts mount in the controller

12 years agoMove FUSE mount to /var/lib/libvirt/lxc/$NAME.fuse
Daniel P. Berrange [Fri, 22 Mar 2013 13:52:55 +0000 (13:52 +0000)]
Move FUSE mount to /var/lib/libvirt/lxc/$NAME.fuse

Instead of using /var/lib/libvirt/lxc/$NAME for the FUSE
filesystem, use /var/lib/libvirt/lxc/$NAME.fuse. This allows
room for other temporary mounts in the same directory

12 years agoFix thread safety in LXC callback handling
Daniel P. Berrange [Fri, 22 Mar 2013 12:10:39 +0000 (12:10 +0000)]
Fix thread safety in LXC callback handling

Some of the LXC callbacks did not lock the virDomainObjPtr
instance. This caused transient errors like

error: Failed to start domain busy-mount
error: cannot rename file '/var/run/libvirt/lxc/busy-mount.xml.new' as '/var/run/libvirt/lxc/busy-mount.xml': No such file or directory

as 2 threads tried to update the status file concurrently

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoRemove bogus filtering from virDomainGetRootFilesystem
Daniel P. Berrange [Fri, 22 Mar 2013 12:09:39 +0000 (12:09 +0000)]
Remove bogus filtering from virDomainGetRootFilesystem

The virDomainGetRootFilesystem was only returning filesystems
with type=mount. This is bogus - any type of filesystem is
valid as the root, if dst=/.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoFix parsing of bond interface XML
Jim Fehlig [Thu, 21 Mar 2013 21:44:11 +0000 (15:44 -0600)]
Fix parsing of bond interface XML

Noticed that parsing bond interface XML containing the miimon element
fails

  <interface type="bond" name="bond0">
    ...
    <bond mode="active-backup">
      <miimon freq="100" carrier="netif"/>
      ...
    </bond>
  </interface>

This configuration does not contain the optional updelay and downdelay
attributes, but parsing will fail due to returning the result of
virXPathULong (a -1 when the attribute doesn't exist) from
virInterfaceDefParseBond after examining the updelay attribute.

While fixing this bug, cleanup the function to use virXPathInt instead
of virXPathULong, and store the result directly instead of using a tmp
variable.  Using virXPathInt actually fixes a potential silent
truncation bug noted by Eric Blake.

Also, there is no cleanup in the error label.  Remove the label,
returning failure where failure occurs and success if the end of the
function is reached.

12 years agoutil: fix virAllocVar's comment
Ján Tomko [Fri, 22 Mar 2013 11:59:31 +0000 (12:59 +0100)]
util: fix virAllocVar's comment

12 years agovirsh: don't print --(null) in vol-name and vol-pool
Ján Tomko [Fri, 22 Mar 2013 11:32:32 +0000 (12:32 +0100)]
virsh: don't print --(null) in vol-name and vol-pool

Don't print the pool option name if it's null.

Before:
virsh # vol-name vol
error: failed to get vol 'vol', specifying --(null) might help
error: Storage volume not found: no storage vol with matching path vol

After:

virsh # vol-name vol
error: failed to get vol 'vol'
error: Storage volume not found: no storage vol with matching path vol

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

12 years agoviralloc: Export virAllocTest*
Michal Privoznik [Fri, 22 Mar 2013 09:18:48 +0000 (10:18 +0100)]
viralloc: Export virAllocTest*

If users build with --enable-test-oom configure option,
they get this error saying, virAllocTest* functions are
not defined within tests/testutils.c.

12 years agoFix free of uninitialized value in LXC numad setup
Daniel P. Berrange [Fri, 22 Mar 2013 11:44:00 +0000 (11:44 +0000)]
Fix free of uninitialized value in LXC numad setup

The 'nodeset' variable was never initialized, causing a later
VIR_FREE(nodeset) to free uninitialized memory.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoqemu: add support for LSI MegaRAID SAS1078 (aka megasas) SCSI controller
Paolo Bonzini [Thu, 21 Mar 2013 14:11:39 +0000 (15:11 +0100)]
qemu: add support for LSI MegaRAID SAS1078 (aka megasas) SCSI controller

This does nothing more than adding the new device and capability.
The device is present since QEMU 1.2.0.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoqemu: pass iscsi authorization credentials
Paolo Bonzini [Thu, 21 Mar 2013 11:53:54 +0000 (12:53 +0100)]
qemu: pass iscsi authorization credentials

A better way to do this would be to use a configuration file like

   [iscsi "target-name"]
   user = name
   password = pwd

and pass it via -readconfig.  This would remove the username and password
from the "ps" output.  For now, however, keep this solution.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agodomain: parse XML for iscsi authorization credentials
Paolo Bonzini [Thu, 21 Mar 2013 11:53:53 +0000 (12:53 +0100)]
domain: parse XML for iscsi authorization credentials

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agosecret: add iscsi to possible usage types
Paolo Bonzini [Thu, 21 Mar 2013 11:53:52 +0000 (12:53 +0100)]
secret: add iscsi to possible usage types

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agodomain: make port optional for network disks
Paolo Bonzini [Thu, 21 Mar 2013 11:53:51 +0000 (12:53 +0100)]
domain: make port optional for network disks

Only sheepdog actually required it in the code, and we can use 7000 as the
default---the same value that QEMU uses for the simple "sheepdog:VOLUME"
syntax.  With this change, the schema can be fixed to allow no port.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoqemu: support passthrough for iscsi disks
Paolo Bonzini [Thu, 21 Mar 2013 11:53:50 +0000 (12:53 +0100)]
qemu: support passthrough for iscsi disks

This enables usage of commands like persistent reservations.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoqemu: add support for libiscsi
Paolo Bonzini [Thu, 21 Mar 2013 11:53:49 +0000 (12:53 +0100)]
qemu: add support for libiscsi

libiscsi provides a userspace iSCSI initiator.

The main advantage over the kernel initiator is that it is very
easy to provide different initiator names for VMs on the same host.
Thus libiscsi supports usage of persistent reservations in the VM,
which otherwise would only be possible with NPIV.

libiscsi uses "iscsi" as the scheme, not "iscsi+tcp".  We can change
this in the tests (while remaining backwards-compatible manner, because
QEMU uses TCP as the default transport for both Gluster and NBD).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agopython:remove semicolon in python code
Guannan Ren [Fri, 22 Mar 2013 04:08:20 +0000 (12:08 +0800)]
python:remove semicolon in python code

This breaked "make syntax-check" testing

Pushed under trivial rule

12 years agomake: regenerate bindings when <classname>.py changes
Guannan Ren [Fri, 22 Mar 2013 03:51:48 +0000 (11:51 +0800)]
make: regenerate bindings when <classname>.py changes

12 years agopython: treat flags as default argument with value 0
Guannan Ren [Thu, 21 Mar 2013 08:27:09 +0000 (16:27 +0800)]
python: treat flags as default argument with value 0

The following four functions have not changed because default arguments
have to come after positional arguments. Changing them will break the
the binding APIs.

migrate(self, dconn, flags, dname, uri, bandwidth):
migrate2(self, dconn, dxml, flags, dname, uri, bandwidth):
migrateToURI(self, duri, flags, dname, bandwidth):
migrateToURI2(self, dconnuri, miguri, dxml, flags, dname, bandwidth):

12 years agoCorrect invalid RNG schemas
Martin Kletzander [Tue, 19 Mar 2013 11:26:02 +0000 (12:26 +0100)]
Correct invalid RNG schemas

The 'trang' utility, which is able to transform '.rng' files into
'.rnc' files, reported some errors in our schemas that weren't caught
by the tools we use in the build.  I haven't added a test for this,
but the validity can be checked by the following command:

trang -I rng -O rnc domain.rng domain.rnc

There were unescaped minuses in regular expressions and we were
constraining int (which is by default in the range of [-2^31;2^31-1]
to maximum of 2^32.  But what we wanted was exactly an unsignedInt.

12 years agovirsh-snapshot: Simplify cleanup path in cmdSnapshotEdit
Peter Krempa [Thu, 7 Mar 2013 10:18:18 +0000 (11:18 +0100)]
virsh-snapshot: Simplify cleanup path in cmdSnapshotEdit

12 years agovirsh-snapshot: Use the mutually exclusive params macro in cmdSnapshotEdit
Peter Krempa [Thu, 7 Mar 2013 10:17:48 +0000 (11:17 +0100)]
virsh-snapshot: Use the mutually exclusive params macro in cmdSnapshotEdit

12 years agovirsh-snapshot: Refactor cmdSnapshotCurrent
Peter Krempa [Thu, 7 Mar 2013 10:07:03 +0000 (11:07 +0100)]
virsh-snapshot: Refactor cmdSnapshotCurrent

Use the exclusive parameter checker and touch up some parts to simplify
code.

12 years agovirsh-domain: Fix flag name in error message to match the check
Peter Krempa [Thu, 7 Mar 2013 09:51:01 +0000 (10:51 +0100)]
virsh-domain: Fix flag name in error message to match the check

The check is done on the "--paused" flag but the error message stated
"--saved"

12 years agovirsh-host: Refactor cmdFreecell
Peter Krempa [Thu, 7 Mar 2013 09:36:08 +0000 (10:36 +0100)]
virsh-host: Refactor cmdFreecell

Use the new helpers to determine mutually exclusive options and touch up
some parts to simplify the code.

12 years agovirsh-snapshot: Refactor virsh snapshot-list
Peter Krempa [Fri, 1 Mar 2013 15:27:04 +0000 (16:27 +0100)]
virsh-snapshot: Refactor virsh snapshot-list

Simplify error handling and mutually exclusive option checking.

12 years agovirsh: Introduce macros to reject mutually exclusive arguments
Peter Krempa [Thu, 7 Mar 2013 09:16:20 +0000 (10:16 +0100)]
virsh: Introduce macros to reject mutually exclusive arguments

This patch adds three macros to the virsh source tree that help to
easily check for mutually exclusive parameters.

VSH_EXCLUSIVE_OPTIONS_EXPR has four arguments, two expressions to check
and two names of the parameters to print in the message.

VSH_EXCLUSIVE_OPTIONS is more specific and check the command structure
for the parameters using vshCommandOptBool.

VSH_EXCLUSIVE_OPTIONS_VAR is meant to check boolean variables with the
same name as the parameters.

12 years agopython: Fix emulatorpin API bindings
Peter Krempa [Wed, 20 Mar 2013 10:43:41 +0000 (11:43 +0100)]
python: Fix emulatorpin API bindings

The addition of emulator pinning APIs didn't think of doing the right
job with python APIs for them. The default generator produced unusable
code for this.

This patch switches to proper code as in the case of domain Vcpu pining.
This change can be classified as a python API-breaker but in the state
the code was before I doubt anyone was able to use it successfully.

12 years agoqemu: Un-mark volume as mirrored/copied if blockjob copy fails
Peter Krempa [Wed, 20 Mar 2013 15:48:23 +0000 (16:48 +0100)]
qemu: Un-mark volume as mirrored/copied if blockjob copy fails

When the blockjob fails for some reason an event is emitted but the disk
wasn't unmarked as being part of a active block copy operation.

12 years agoFix initialization of virIdentityPtr thread locals
Daniel P. Berrange [Thu, 21 Mar 2013 10:58:15 +0000 (10:58 +0000)]
Fix initialization of virIdentityPtr thread locals

Some code mistakenly called virIdentityOnceInit directly
instead of virIdentityInitialize(). This meant that one-time
initializer was run many times with predictably bad results.

12 years agoqemu: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_UNSUPPORTED
Michal Privoznik [Wed, 20 Mar 2013 15:57:08 +0000 (16:57 +0100)]
qemu: s/VIR_ERR_NO_SUPPORT/VIR_ERR_OPERATION_UNSUPPORTED

The VIR_ERR_NO_SUPPORT error code is reserved for cases where an
API is not implemented in a driver. It definitely should not be
used when an API execution fails due to unsupported operation.

12 years agoFix linkage of virt-aa-helper with numa library
Daniel P. Berrange [Wed, 20 Mar 2013 15:02:34 +0000 (15:02 +0000)]
Fix linkage of virt-aa-helper with numa library

The recent commit moved some of the use of libnuma out of the
driver code, and into src/util/. It did not, however, update
libvirt_util.la to link against libnuma. This caused linkage
failure with virt-aa-helper, since nothing else caused libnuma
to be pulled onto the linker command line.

The fix removes all reference to NUMACTL_LIBS/CFLAGS from the
various modules in src/Makefile.am and just adds them to the
libvirt_util.la module, which everything else depends on.

Technically a build-breaker fix, but wanted to wait for feedback
on this

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoqemu: Add the new disk src into shared disk table when updating disk
Osier Yang [Mon, 18 Mar 2013 13:52:04 +0000 (21:52 +0800)]
qemu: Add the new disk src into shared disk table when updating disk

We should record the new disk src in the shared disk table for
updating disk (CD-ROM or Floppy) API. Fortunately, we only allow
to update the disk source now, otherwise we might also want to
set the unpriv_sgio setting.

12 years agopython: fix bindings that don't raise an exception
Guannan Ren [Thu, 21 Mar 2013 03:24:49 +0000 (11:24 +0800)]
python: fix bindings that don't raise an exception

For example:
 >>> dom.memoryStats()
 libvir: QEMU Driver error : Requested operation is not valid:\
         domain is not running

There are six such python API functions like so.
The root reason is that generator.py script checks the type of return
value of a python stub function defined in libvirt-api.xml or
libvirt-override-api.xml to see whether to add the raise clause or not
in python wrapper code in libvirt.py.

The type of return value is supposed to be C types.
For those stub functions which return python non-integer data type like
string, list, tuple, dictionary, the existing type in functions varies
from each other which leads problem like this.

Currently, in generator.py, it maintains a buggy whitelist for stub functions
returning a list type. I think it is easy to forget adding new function name
in the whitelist.

This patch makes the value of type consistent with C type "char *"
in libvirt-override-api.xml. For python, any of types could be printed
as string, so I choose "char *" in this case. And the comment in xml
could explain it when adding new function definition.

      <function name='virNodeGetCPUStats' file='python'>
        ...
 -      <return type='virNodeCPUStats' info='...'/>
 +      <return type='char *' info='...'/>
        ...
      </function>

12 years agodomain: add support for iscsi network disks
Paolo Bonzini [Mon, 25 Feb 2013 17:44:26 +0000 (18:44 +0100)]
domain: add support for iscsi network disks

This plumbs in the XML description of iSCSI shares.  The next patches
will add support for the libiscsi userspace initiator.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 years agoClean redundant code about VCPU string checking
Li Zhang [Mon, 18 Mar 2013 09:57:14 +0000 (17:57 +0800)]
Clean redundant code about VCPU string checking

Now that VCPU number are removed from qemu_monitor_text.c
(commit cc78d7ba), VCPU string checking also should be removed.

Report-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
12 years agocgroup: export virCgroupRemoveRecursively
Gao feng [Wed, 20 Mar 2013 08:14:23 +0000 (16:14 +0800)]
cgroup: export virCgroupRemoveRecursively

We will use virCgroupRemoveRecursively to remove cgroup
directories in the coming patch.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
12 years agoDon't fail if SELinux is diabled
Guido Günther [Wed, 20 Mar 2013 19:01:18 +0000 (20:01 +0100)]
Don't fail if SELinux is diabled

but libvirt is built with --with-selinux. In this case getpeercon
returns ENOPROTOOPT so don't return an error in that case but simply
don't set seccon.

12 years agoclarify virsh net commands
Gene Czarcinski [Sat, 16 Mar 2013 17:36:32 +0000 (13:36 -0400)]
clarify virsh net commands

Clarify that net-create deals with a transient virtual
network whereas net-define defines a persistent virtual
network definition and will create the network (xml)
definition file.

Clarify that net-destroy works with both transient and
persistent virtual networks.

Signed-off-by: Gene Czarcinski <gene@czarc.net>
12 years agodoc/schema: disk storage volume formats
Philipp Hahn [Wed, 20 Mar 2013 11:53:32 +0000 (12:53 +0100)]
doc/schema: disk storage volume formats

The storage volume formats supported by the disk storage pool are
missing from the allowed values.

Add partition types.

Signed-off-by: Philipp Hahn <hahn@univention.de>
12 years agodoc: storage: Fix grammar
Philipp Hahn [Wed, 20 Mar 2013 11:42:35 +0000 (12:42 +0100)]
doc: storage: Fix grammar

Remove 'are' before 'have'.

Signed-off-by: Philipp Hahn <hahn@univention.de>
12 years agodoc/schema: Support iqn for storage pools
Philipp Hahn [Wed, 20 Mar 2013 10:45:29 +0000 (11:45 +0100)]
doc/schema: Support iqn for storage pools

iSCSI qualified names (iqn) from RFC3721 may contain colons (':'), which
neither matches the absFilePath nor genericName:

 $ virsh pool-dumpxml myiscsipool
 <pool type='iscsi'>
 ...
   <source>
 ...
     <device path='iqn.2003-01.org.linux-iscsi.phahn-sid93.x8664:sn.8a3daa0d4efd'/>
   </source>
 ...
 </pool>

Add IscsiQualifiedName type and allow its use in sourceiscsi.

Signed-off-by: Philipp Hahn <hahn@univention.de>
12 years agodoc/schema: add ocfs2 for disk vol
Philipp Hahn [Tue, 26 Feb 2013 12:41:21 +0000 (13:41 +0100)]
doc/schema: add ocfs2 for disk vol

Add ocfs2 for disk vol.

Signed-off-by: Philipp Hahn <hahn@univention.de>
12 years agoFix typos s/HAVE_SELINUX/WITH_SELINUX/
Daniel P. Berrange [Wed, 20 Mar 2013 13:06:04 +0000 (13:06 +0000)]
Fix typos s/HAVE_SELINUX/WITH_SELINUX/

The virNetSocket & virIdentity classes accidentally got some
conditionals using HAVE_SELINUX instead of WITH_SELINUX.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoLXC: add cpuset cgroup support for lxc
Gao feng [Wed, 20 Mar 2013 03:35:09 +0000 (11:35 +0800)]
LXC: add cpuset cgroup support for lxc

This patch adds cpuset cgroup support for LXC.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
12 years agoNUMA: cleanup for numa related codes
Gao feng [Wed, 20 Mar 2013 03:35:08 +0000 (11:35 +0800)]
NUMA: cleanup for numa related codes

Intend to reduce the redundant code,use virNumaSetupMemoryPolicy
to replace virLXCControllerSetupNUMAPolicy and
qemuProcessInitNumaMemoryPolicy.

This patch also moves the numa related codes to the
file virnuma.c and virnuma.h

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
12 years agofix TLS error with virNetServerClientCreateIdentity
Olivia Yin [Wed, 20 Mar 2013 02:13:27 +0000 (10:13 +0800)]
fix TLS error with virNetServerClientCreateIdentity

Compilation error when WITH_GNUTLS is 0, introduced in commit d5e83ad.

12 years agoLXC: allow uses advisory nodeset from querying numad
Gao feng [Mon, 18 Mar 2013 09:04:02 +0000 (17:04 +0800)]
LXC: allow uses advisory nodeset from querying numad

Allow lxc using the advisory nodeset from querying numad,
this means if user doesn't specify the numa nodes that
the lxc domain should assign to, libvirt will automatically
bind the lxc domain to the advisory nodeset which queried from
numad.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
12 years agorename qemuGetNumadAdvice to virNumaGetAutoPlacementAdvice
Gao feng [Mon, 18 Mar 2013 09:04:01 +0000 (17:04 +0800)]
rename qemuGetNumadAdvice to virNumaGetAutoPlacementAdvice

qemuGetNumadAdvice will be used by LXC driver, rename
it to virNumaGetAutoPlacementAdvice and move it to virnuma.c

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
12 years agoselinux: deal with dtb file
Olivia Yin [Thu, 14 Mar 2013 04:49:44 +0000 (12:49 +0800)]
selinux: deal with dtb file

12 years agoqemu: add dtb option support
Olivia Yin [Thu, 14 Mar 2013 04:49:43 +0000 (12:49 +0800)]
qemu: add dtb option support

The "dtb" option sets the filename for the device tree.
If without this option support, "-dtb file" will be converted into
<qemu:commandline> in domain XML file.
For example, '-dtb /media/ram/test.dtb' will be converted into
  <qemu:commandline>
    <qemu:arg value='-dtb'/>
    <qemu:arg value='/media/ram/test.dtb'/>
  </qemu:commandline>

This is not very friendly.
This patchset add special <dtb> tag like <kernel> and <initrd>
which is easier for user to write domain XML file.
  <os>
    <type arch='ppc' machine='ppce500v2'>hvm</type>
    <kernel>/media/ram/uImage</kernel>
    <initrd>/media/ram/ramdisk</initrd>
    <dtb>/media/ram/test.dtb</dtb>
    <cmdline>root=/dev/ram rw console=ttyS0,115200</cmdline>
  </os>

Signed-off-by: Eric Blake <eblake@redhat.com>
12 years agoconf: support <dtb> tag in XML domain file
Olivia Yin [Thu, 14 Mar 2013 04:49:42 +0000 (12:49 +0800)]
conf: support <dtb> tag in XML domain file

12 years agoFix --without-libvirtd builds
Doug Goldstein [Sun, 17 Mar 2013 01:57:55 +0000 (20:57 -0500)]
Fix --without-libvirtd builds

When building with --without-libvirtd and udev support is detected we
will fail to build with the following error:
    node_device/node_device_udev.c:1608:37: error: unknown type name
        'virStateInhibitCallback'

12 years agorename tests/conftest.c
Gene Czarcinski [Tue, 19 Mar 2013 18:36:28 +0000 (14:36 -0400)]
rename tests/conftest.c

To prevent confusion with configure's popular name
for a file, rename conftest.c to test_conf.c which
is consistent with the invoking test_conf.sh
Signed-off-by: Gene Czarcinski <gene@czarc.net>
12 years agostorage: fix unlikely memory leak in rbd backend
Laine Stump [Mon, 18 Mar 2013 20:04:11 +0000 (16:04 -0400)]
storage: fix unlikely memory leak in rbd backend

virStorageBackendRBDRefreshPool() first allocates an array big enough
to hold 1024 names, then calls rbd_list(), which returns ERANGE if the
array isn't big enough. When that happens, the VIR_ALLOC_N is called
again with a larger size. Unfortunately, the original array isn't
freed before allocating a new one.

12 years agoFix /pool/storage/name documentation
Christophe Fergeau [Tue, 19 Mar 2013 11:43:20 +0000 (12:43 +0100)]
Fix /pool/storage/name documentation

There was a 2 word sentence 'remote server' which is a left-over
from copy and paste.