]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
12 years agoStore a virCgroupPtr instance in qemuDomainObjPrivatePtr
Daniel P. Berrange [Thu, 21 Mar 2013 14:40:29 +0000 (14:40 +0000)]
Store a virCgroupPtr instance in qemuDomainObjPrivatePtr

Instead of calling virCgroupForDomain every time we need
the virCgrouPtr instance, just do it once at Vm startup
and cache a reference to the object in qemuDomainObjPrivatePtr
until shutdown of the VM. Removing the virCgroupPtr from
the QEMU driver state also means we don't have stale mount
info, if someone mounts the cgroups filesystem after libvirtd
has been started

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd missing param to virCgroupForDriver stub
Daniel P. Berrange [Mon, 15 Apr 2013 16:06:19 +0000 (17:06 +0100)]
Add missing param to virCgroupForDriver stub

The virCgroupForDriver method recently gained an 'int controllers'
parameter, but the stub impl did not

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoIntroduce a virFileDeleteTree method
Daniel P. Berrange [Thu, 28 Mar 2013 14:46:45 +0000 (14:46 +0000)]
Introduce a virFileDeleteTree method

Introduce a method virFileDeleteTree for recursively deleting
an entire directory tree

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoConditionally compile storagevolxml2argvtest
Daniel P. Berrange [Mon, 15 Apr 2013 16:01:02 +0000 (17:01 +0100)]
Conditionally compile storagevolxml2argvtest

Only compile storagevolxml2argvtest if WITH_STORAGE is
set, because it links to that driver

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoConditionalize use of symlink() function in test suite
Daniel P. Berrange [Mon, 15 Apr 2013 16:00:17 +0000 (17:00 +0100)]
Conditionalize use of symlink() function in test suite

On Win32 symlink() is not available, so virstoragetest.c
must be conditionalized to avoid compile failures.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoFix signature of dummy virNetlinkCommand stub
Daniel P. Berrange [Mon, 15 Apr 2013 15:59:36 +0000 (16:59 +0100)]
Fix signature of dummy virNetlinkCommand stub

The second param of virNetlinkCommand should be
struct nlmsghdr, not unsigned char.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd empty stub for virThreadCancel on Win32
Daniel P. Berrange [Mon, 15 Apr 2013 15:58:56 +0000 (16:58 +0100)]
Add empty stub for virThreadCancel on Win32

Win32 does not like undefined symbols, so define an
empty virThreadCancel impl.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoDon't enable -fPIE on Win32 platforms
Daniel P. Berrange [Mon, 15 Apr 2013 15:56:38 +0000 (16:56 +0100)]
Don't enable -fPIE on Win32 platforms

On win32, all code is position independent and adding -fPIE
to the compiler flags results in warnings being printed

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agomaint: update to latest gnulib
Eric Blake [Mon, 15 Apr 2013 14:54:53 +0000 (08:54 -0600)]
maint: update to latest gnulib

Upstream gnulib determined that we were needlessly compiling in
gnulib's regex instead of glibc's when targetting new-enough glibc,
because the m4 test was being too strict in requiring a particular
answer to undefined behavior.
https://lists.gnu.org/archive/html/bug-gnulib/2013-04/msg00032.html

* .gnulib: Update to latest, for regex.

12 years agoUse unsigned int instead of unsigned
Osier Yang [Mon, 15 Apr 2013 10:29:23 +0000 (18:29 +0800)]
Use unsigned int instead of unsigned

Though they are the same thing, mixed use of them is uncomfortable.
"unsigned" is used a lot in old codes, this just tries to change the
ones in utils.

12 years agoDo more complete initialization of libgcrypt
Daniel P. Berrange [Fri, 12 Apr 2013 16:25:03 +0000 (17:25 +0100)]
Do more complete initialization of libgcrypt

If libvirt makes any gcry_control() calls, then this
prevents gnutls for doing any initialization. As such
we must take care to do full initialization of libcrypt
on a par with what gnutls would have done. In particular
we must disable "sec mem" for cases where the user does
not have mlock() permission. We also skip our init of
libgcrypt if something else (ie the app using libvirt)
has beaten us to it.

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

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoqemu: Report also domain name in error message when domain object wasn't found
Peter Krempa [Wed, 10 Apr 2013 12:06:38 +0000 (14:06 +0200)]
qemu: Report also domain name in error message when domain object wasn't found

Report the errors as:
Domain not found: no domain with matching uuid '41414141-4141-4141-4141-414141414141' (crashtest)
instead of:
Domain not found: no domain with matching uuid '41414141-4141-4141-4141-414141414141'

12 years agoqemu: Refactor lookup of domain object
Peter Krempa [Wed, 10 Apr 2013 12:04:45 +0000 (14:04 +0200)]
qemu: Refactor lookup of domain object

Use the helper to lookup the domain object in the remaining places.

This patch also fixes error reporting when the domain was not found in several
functions that were printing the raw UUID buffer instead of the formatted
string. The offending functions were:

qemuDomainGetInterfaceParameters
qemuDomainSetInterfaceParameters
qemuGetSchedulerParametersFlags
qemuSetSchedulerParametersFlags
qemuDomainGetNumaParameters
qemuDomainSetNumaParameters
qemuDomainGetMemoryParameters
qemuDomainSetMemoryParameters
qemuDomainGetBlkioParameters
qemuDomainSetBlkioParameters
qemuDomainGetCPUStats

12 years agostorage: Fix the indention
Osier Yang [Sat, 13 Apr 2013 07:22:01 +0000 (15:22 +0800)]
storage: Fix the indention

Pushed under trivial rule

12 years agocleanup: Change datatype of net->stp to boolean
Osier Yang [Fri, 12 Apr 2013 09:08:59 +0000 (17:08 +0800)]
cleanup: Change datatype of net->stp to boolean

12 years agocleanup: Change datatype of usbdev->allow to boolean
Osier Yang [Fri, 12 Apr 2013 08:51:36 +0000 (16:51 +0800)]
cleanup: Change datatype of usbdev->allow to boolean

12 years agocleanup: Change datatype of graphic's members to boolean
Osier Yang [Fri, 12 Apr 2013 08:49:38 +0000 (16:49 +0800)]
cleanup: Change datatype of graphic's members to boolean

12 years agocleanup: Change datatype of accel's members to boolean
Osier Yang [Thu, 11 Apr 2013 04:10:37 +0000 (12:10 +0800)]
cleanup: Change datatype of accel's members to boolean

12 years agoAdd test case for TPM passthrough
Stefan Berger [Fri, 12 Apr 2013 20:55:46 +0000 (16:55 -0400)]
Add test case for TPM passthrough

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoTPM support for QEMU command line
Stefan Berger [Fri, 12 Apr 2013 20:55:46 +0000 (16:55 -0400)]
TPM support for QEMU command line

For TPM passthrough device support create command line parameters like:

-tpmdev passthrough,id=tpm-tpm0,path=/dev/tpm0,cancel-path=/sys/class/misc/tpm0/device/cancel -device tpm-tis,tpmdev=tpm-tpm0,id=tpm0

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoQEMU Cgroup support for TPM passthrough
Stefan Berger [Fri, 12 Apr 2013 20:55:46 +0000 (16:55 -0400)]
QEMU Cgroup support for TPM passthrough

Some refactoring for virDomainChrSourceDef type of devices so
we can use common code.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoAudit the starting of a guest using TPM passthrough
Stefan Berger [Fri, 12 Apr 2013 20:55:46 +0000 (16:55 -0400)]
Audit the starting of a guest using TPM passthrough

When a VM with a TPM passthrough device is started, the audit daemon
logs the following type of message:

type=VIRT_RESOURCE msg=audit(1365170222.460:3378): pid=16382 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:virtd_t:s0-s0:c0.c1023 msg='virt=kvm resrc=dev reason=start vm="TPM-PT" uuid=a4d7cd22-da89-3094-6212-079a48a309a1 device="/dev/tpm0" exe="/usr/sbin/libvirtd" hostname=? addr=? terminal=? res=success'

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoAdd SELinux and DAC labeling support for TPM passthrough
Stefan Berger [Fri, 12 Apr 2013 20:55:46 +0000 (16:55 -0400)]
Add SELinux and DAC labeling support for TPM passthrough

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoConvert QMP strings into QEMU capability bits
Stefan Berger [Fri, 12 Apr 2013 20:55:45 +0000 (16:55 -0400)]
Convert QMP strings into QEMU capability bits

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoParse TPM passthrough XML in the domain XML
Stefan Berger [Fri, 12 Apr 2013 20:55:45 +0000 (16:55 -0400)]
Parse TPM passthrough XML in the domain XML

Parse the domain XML with TPM passthrough support.
The TPM passthrough XML may look like this:

    <tpm model='tpm-tis'>
      <backend type='passthrough'>
        <device path='/dev/tpm0'/>
      </backend>
    </tpm>

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoHelper functions for host TPM support
Stefan Berger [Fri, 12 Apr 2013 20:55:45 +0000 (16:55 -0400)]
Helper functions for host TPM support

Implement helper function to create the TPM's sysfs cancel file.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoAdd documentation and schema for TPM passthrough
Stefan Berger [Fri, 12 Apr 2013 20:55:45 +0000 (16:55 -0400)]
Add documentation and schema for TPM passthrough

Supported TPM passthrough XML may look as follows:

    <tpm model='tpm-tis'>
      <backend type='passthrough'>
        <device path='/dev/tpm0'/>
      </backend>
    </tpm>

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoAdd function to find a needle in a string array
Stefan Berger [Fri, 12 Apr 2013 20:55:45 +0000 (16:55 -0400)]
Add function to find a needle in a string array

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoAdd QMP probing for TPM
Stefan Berger [Fri, 12 Apr 2013 20:55:45 +0000 (16:55 -0400)]
Add QMP probing for TPM

Probe for QEMU's QMP TPM support by querying the lists of
supported TPM models (query-tpm-models) and backend types
(query-tpm-types).

The setting of the capability flags following the strings
returned from the commands above is only provided in the
patch where domain_conf.c gets TPM support due to dependencies
on functions only introduced there.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: Corey Bryant <coreyb@linux.vnet.ibm.com>
12 years agoconf: Allow for non-contiguous device boot orders
Peter Krempa [Thu, 4 Apr 2013 13:29:16 +0000 (15:29 +0200)]
conf: Allow for non-contiguous device boot orders

This patch adds the ability to configure non-contiguous boot orders on boot
devices. This allows unplugging devices that have boot order specified without
breaking migration.

The new code now uses a slightly less memory efficient approach to store the
boot order fields in a hashtable instead of a bitmap.

12 years agoTweak EOF handling of streams
Daniel P. Berrange [Tue, 9 Apr 2013 12:24:02 +0000 (13:24 +0100)]
Tweak EOF handling of streams

Typically when you get EOF on a stream, poll will return
POLLIN|POLLHUP at the same time. Thus when we deal with
stream reads, if we see EOF during the read, we can then
clear the VIR_STREAM_EVENT_HANGUP & VIR_STREAM_EVENT_ERROR
event bits.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd USB option capability
Li Zhang [Sun, 7 Apr 2013 08:31:57 +0000 (16:31 +0800)]
Add USB option capability

To avoid the collision for creating USB controllers in machine->init()
and -device xx command line, it needs to set usb=off to avoid one USB
controller created in machine->init(). So that libvirt can use -device
or -usb to create USB controller sucessfully.
So QEMU_CAPS_MACHINE_USB_OPT capability is added, and it is for QEMU
v1.3.0 onwards which supports USB option.

Signed-off-by: Li Zhang <zhlcindy@linux.vnet.ibm.com>
12 years agoAdd error handling to optional arguments in cmdCPUStats
John Ferlan [Mon, 8 Apr 2013 14:49:34 +0000 (10:49 -0400)]
Add error handling to optional arguments in cmdCPUStats

12 years agoRemove extraneous comma in info_cpu_stats and opts_cpu_stats
John Ferlan [Mon, 8 Apr 2013 14:15:42 +0000 (10:15 -0400)]
Remove extraneous comma in info_cpu_stats and opts_cpu_stats

12 years agoqemu: Do not report unsafe migration for local files
Jiri Denemark [Thu, 11 Apr 2013 16:28:35 +0000 (18:28 +0200)]
qemu: Do not report unsafe migration for local files

When migrating a domain with disk images stored locally (and using
storage migration), we should not complain about unsafe migration no
matter what cache policy is used for that disk.

12 years agovirsh: Document that using incomplete XML files may have unexpected results
Peter Krempa [Thu, 11 Apr 2013 14:27:23 +0000 (16:27 +0200)]
virsh: Document that using incomplete XML files may have unexpected results

Explicitly state that using incomplete XML definition snippets for hot-management
commands may have unexpected results due to autogenerating values for some of
the fields if they aren't specified explicitly.

12 years agoqemu: Try to use QMP for send-key if supported
Peter Krempa [Thu, 11 Apr 2013 12:33:43 +0000 (14:33 +0200)]
qemu: Try to use QMP for send-key if supported

Instead of always using HMP use the QMP send-key command introduced in qemu 1.3.

12 years agovirsh: Update list of shutdown/reboot modes
Michal Privoznik [Thu, 11 Apr 2013 11:03:55 +0000 (13:03 +0200)]
virsh: Update list of shutdown/reboot modes

As of 76d9f65644 we are supporting two new modes: initctl and signal.
However, these are missing in help listing.

12 years agoqemu: Set correct migrate host in client_migrate_info
Michal Privoznik [Wed, 10 Apr 2013 15:16:06 +0000 (17:16 +0200)]
qemu: Set correct migrate host in client_migrate_info

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

Currently, we are discarding listen attribute from qemu cookie even though
we strive to gather it. This result in not so cool bug: if user have
different networks, one for management/migration, and one for VNC/SPICE we
pass incorrect host to the qemu in client_migrate_info. What we actually
pass is remote hostname, while we should be passing remote listen address.
It doesn't matter as long as these two are the same, but they don't need
necessary to be like that.

12 years agoqemu: fix crash in qemuOpen
Ján Tomko [Thu, 11 Apr 2013 09:37:25 +0000 (11:37 +0200)]
qemu: fix crash in qemuOpen

If the path part of connection URI is not present, cfg is used
unitialized.

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

12 years agoconf: fix error for parallel port mismatch
Ján Tomko [Thu, 11 Apr 2013 07:13:32 +0000 (09:13 +0200)]
conf: fix error for parallel port mismatch

12 years agocleanup: Change datatype of secret->private to boolean
Osier Yang [Thu, 11 Apr 2013 03:54:37 +0000 (11:54 +0800)]
cleanup: Change datatype of secret->private to boolean

12 years agocleanup: Change datatype of secret->ephemeral to boolean
Osier Yang [Thu, 11 Apr 2013 03:50:23 +0000 (11:50 +0800)]
cleanup: Change datatype of secret->ephemeral to boolean

12 years agocleanup: Change datatype of fs->readonly to boolean
Osier Yang [Wed, 10 Apr 2013 12:15:31 +0000 (20:15 +0800)]
cleanup: Change datatype of fs->readonly to boolean

12 years agocleanup: Change datatype of disk->readonly to boolean
Osier Yang [Wed, 10 Apr 2013 11:23:56 +0000 (19:23 +0800)]
cleanup: Change datatype of disk->readonly to boolean

12 years agocleanup: Change datatype of disk->transient to boolean
Osier Yang [Wed, 10 Apr 2013 11:01:48 +0000 (19:01 +0800)]
cleanup: Change datatype of disk->transient to boolean

12 years agocleanup: Change datatype of disk->shared to boolean
Osier Yang [Wed, 10 Apr 2013 10:59:44 +0000 (18:59 +0800)]
cleanup: Change datatype of disk->shared to boolean

12 years agocleanup: Change datatype of auth->expires to boolean
Osier Yang [Wed, 10 Apr 2013 10:54:17 +0000 (18:54 +0800)]
cleanup: Change datatype of auth->expires to boolean

12 years agocleanup: Change datatype of hostdev->missing to boolean
Osier Yang [Wed, 10 Apr 2013 10:46:56 +0000 (18:46 +0800)]
cleanup: Change datatype of hostdev->missing to boolean

12 years agoCleanup: Change datatype of origstate's members to boolean
Osier Yang [Wed, 10 Apr 2013 10:44:41 +0000 (18:44 +0800)]
Cleanup: Change datatype of origstate's members to boolean

Members of struct virPCIDevice are changed together.

12 years agoCleanup: Change datatype of hostdev->managed to boolean
Osier Yang [Wed, 10 Apr 2013 10:09:23 +0000 (18:09 +0800)]
Cleanup: Change datatype of hostdev->managed to boolean

12 years agoconf: fix a memory leak when parsing nat port XML nodes
Guannan Ren [Wed, 10 Apr 2013 09:38:07 +0000 (17:38 +0800)]
conf: fix a memory leak when parsing nat port XML nodes

 ==5306== 8 bytes in 1 blocks are definitely lost in loss record 24 of 277
 ==5306==    at 0x4C28B2F: calloc (vg_replace_malloc.c:593)
 ==5306==    by 0x5293CAF: virAllocN (viralloc.c:152)
 ==5306==    by 0x52DFEAE: virXPathNodeSet (virxml.c:611)
 ==5306==    by 0x5313DD9: virNetworkDefParseXML (network_conf.c:1408)
 ==5306==    by 0x53170F6: virNetworkObjUpdateParseFile (network_conf.c:2031)
 ==5306==    by 0x131DA63C: networkStartup (bridge_driver.c:279)
 ==5306==    by 0x53481DF: virStateInitialize (libvirt.c:822)
 ==5306==    by 0x40DF44: daemonRunStateInit (libvirtd.c:877)
 ==5306==    by 0x52D2FF5: virThreadHelper (virthreadpthread.c:161)
 ==5306==    by 0x5D00C52: start_thread (in /usr/lib64/libpthread-2.17.so)
 ==5306==    by 0x6410ECC: clone (in /usr/lib64/libc-2.17.so)

12 years agoconf: Fix race between looking up a domain object and freeing it
Peter Krempa [Tue, 9 Apr 2013 11:56:26 +0000 (13:56 +0200)]
conf: Fix race between looking up a domain object and freeing it

This patch fixes crash of the daemon that happens due to the following race
condition:

Let's have two threads in the libvirtd daemon's qemu driver:
A - thread executing undefine on the same domain
B - thread executing a API call to get information about a domain

Assume following serialization of operations done by the threads:
1) A has the lock on the domain object and is executing some code prior to
   virDomainObjListRemove()
2) B takes the lock on the domain object list, looks up the domain object
pointer and blocks in the attempt to lock the domain object as A is holding the
lock
3) A reaches virDomainObjListRemove() and unlocks the lock on the domain object
4) A blocks on the attempt to get the domain list lock
5) B is able to lock the domain object now and unlocks the domain list
6) A is now able to lock the domain list, and sheds the last reference on the
domain object, this triggers the freeing function.
6) B starts executing the code on the pointer that is being freed
7) The libvirtd daemon crashes while attempting to access invalid pointer in
thread B.

This patch fixes the race by acquiring a reference on the domain object before
unlocking it in virDomainObjListRemove() and re-locks the object prior to
removing and freeing it. This ensures that no thread holds a lock on the domain
object at the time it is removed from the list, and that doing a list lookup
will never find a domain that is about to vanish.

This is a minimal fix of the problem, but a better solution will be to switch to
full reference counting for domain objects.

12 years agodocs: fix typo when using Kerberos principals
Eric Blake [Tue, 9 Apr 2013 22:39:19 +0000 (16:39 -0600)]
docs: fix typo when using Kerberos principals

Kerberos uses 'primary' or 'key' files (principals), not 'abstract
ideal' or 'rule' files (principles).  Reported by Jason Meinzer.

Reflow a paragraph to fit in 80 columns in the process.

* docs/auth.html.in: Fix spelling.

12 years agomaint: update to latest gnulib
Eric Blake [Mon, 1 Apr 2013 18:49:05 +0000 (12:49 -0600)]
maint: update to latest gnulib

While this update doesn't address any reported problems in libvirt,
doing a post-release update to latest gnulib makes it easier to
stay in sync with best upstream practices.

* .gnulib: Update to latest.
* bootstrap: Resynchronize.

12 years agoFix crash in virNetDevGetVirtualFunctions
Laine Stump [Tue, 9 Apr 2013 18:06:51 +0000 (14:06 -0400)]
Fix crash in virNetDevGetVirtualFunctions

Commit 9a3ff01d7f16cc280ce3176620c0714f55511a65 (which was ACKed at
the end of January, but for some reason didn't get pushed until during
the 1.0.4 freeze) fixed the logic in virPCIGetVirtualFunctions().
Unfortunately, a typo in the fix (replacing VIR_REALLOC_N with
VIR_ALLOC_N during code movement) caused not only a memory leak, but
also resulted in most of the elements of the result array being
replaced with NULL. virNetDevGetVirtualFunctions() assumed (and I think
rightly so) that virPCIGetVirtualFunctions() wouldn't return any NULL
elements in the array, so it ended up segfaulting.

This was found when attempting to use a virtual network with an
auto-created pool of SRIOV VFs, e.g.:

    <forward mode='hostdev' managed='yes'>
      <pf dev='eth4'/>
    </forward>

(the pool of PCI addresses is discovered by calling
virNetDevGetVirtualFunctions() on the PF dev).

12 years agodocs: use MiB/s instead of Mbps for migration speed
Ján Tomko [Tue, 9 Apr 2013 14:15:07 +0000 (16:15 +0200)]
docs: use MiB/s instead of Mbps for migration speed

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

12 years agoschemas: Move PortNumber and sourceinfoadapter to basictypes.rng
Han Cheng [Tue, 9 Apr 2013 02:32:41 +0000 (10:32 +0800)]
schemas: Move PortNumber and sourceinfoadapter to basictypes.rng

The definiton of scsi adapter in storagespool.rng (sourceinfoadapter)
can be used by scsi hostdev in later patch. Move it to basictypes.rng.

PortNumber is defined in both domaincommon.rng and storagespool.rng,
simplify it by moving it to basictypes.rng.

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
12 years agodocs: Add the missed <pre> tag
Osier Yang [Tue, 9 Apr 2013 14:29:39 +0000 (22:29 +0800)]
docs: Add the missed <pre> tag

12 years agoconf: Change help function
Han Cheng [Tue, 9 Apr 2013 02:32:40 +0000 (10:32 +0800)]
conf: Change help function

The helper function to look up disk controller model may be used by scsi
hostdev. But it should be changed to use device info.

Signed-off-by: Han Cheng <hanc.fnst@cn.fujitsu.com>
12 years agoqemu: Remove now obsolete assignment of default network card model for s390 hosts
Peter Krempa [Fri, 5 Apr 2013 09:58:26 +0000 (11:58 +0200)]
qemu: Remove now obsolete assignment of default network card model for s390 hosts

This effectively reverts commit 539d73dbf64cb35558ffd3992f82e0b482cd0e70 as the
changes aren't needed after introduction of the XML post parse callbacks.

12 years agoqemu: Clean up network device CLI generator
Peter Krempa [Fri, 5 Apr 2013 09:48:20 +0000 (11:48 +0200)]
qemu: Clean up network device CLI generator

With the default model assigned in the parse callback, this code is now obsolete.

12 years agoqemu: Use correct default model on s390
Viktor Mihajlovski [Fri, 5 Apr 2013 09:52:49 +0000 (11:52 +0200)]
qemu: Use correct default model on s390

Commit a68d6726679323823ee5be47f0144e9ccffa0757 breaks networking on s390 as it
changes the default network card model.

12 years agosanlock: add missing test command in virt-sanlock-cleanup.in
Alex Jia [Mon, 8 Apr 2013 09:41:50 +0000 (17:41 +0800)]
sanlock: add missing test command in virt-sanlock-cleanup.in

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

Signed-off-by: Alex Jia <ajia@redhat.com>
12 years agoGenerate RFC4122 compliant UUIDs
Milos Vyletel [Mon, 8 Apr 2013 18:10:54 +0000 (14:10 -0400)]
Generate RFC4122 compliant UUIDs

Even though http://libvirt.org/formatdomain.html#elementsMetadata
states that it requires RFC4122 compliance UUIDs that are generated
by virUUIDGenerate() are not. Following patch modifies generated
UUIDs to conform to rules described in RFC.

Signed-off-by: Milos Vyletel <milos.vyletel@sde.cz>
12 years agoUnmount existing filesystems under user specified mounts in LXC
Daniel P. Berrange [Mon, 8 Apr 2013 15:10:16 +0000 (16:10 +0100)]
Unmount existing filesystems under user specified mounts in LXC

If the user requests a mount for /run, this may hide any existing
mounts that are lower down in /run. The result is that the
container still sees the mounts in /proc/mounts, but cannot
access them

sh-4.2# df
df: '/run/user/501/gvfs': No such file or directory
df: '/run/media/berrange/LIVE': No such file or directory
df: '/run/media/berrange/SecureDiskA1': No such file or directory
df: '/run/libvirt/lxc/sandbox': No such file or directory
Filesystem                      1K-blocks      Used Available Use% Mounted on
/dev/mapper/vg_t500wlan-lv_root 151476396 135390200   8384900  95% /
tmpfs                             1970888      3204   1967684   1% /run
/dev/sda1                          194241    155940     28061  85% /boot
devfs                                  64         0        64   0% /dev
tmpfs                                  64         0        64   0% /sys/fs/cgroup
tmpfs                             1970888      1200   1969688   1% /etc/libvirt-sandbox/scratch

Before mounting any filesystem at a particular location, we
must recursively unmount anything at or below the target mount
point

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoMove lxcContainerUnmountSubtree further up in file
Daniel P. Berrange [Mon, 8 Apr 2013 15:10:16 +0000 (16:10 +0100)]
Move lxcContainerUnmountSubtree further up in file

Ensure lxcContainerUnmountSubtree is at the top of the
lxc_container.c file so it is easily referenced from
any other method. No functional change

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoImplement support for <hostdev caps=net>
Bogdan Purcareata [Fri, 5 Apr 2013 12:26:40 +0000 (08:26 -0400)]
Implement support for <hostdev caps=net>

This allows a container-type domain to have exclusive access to one of
the host's NICs.

Wire <hostdev caps=net> with the lxc_controller - when moving the newly
created veth devices into a new namespace, also look for any hostdev
devices that should be moved. Note: once the container domain has been
destroyed, there is no code that moves the interfaces back to the
original namespace. This does happen, though, probably due to default
cleanup on namespace destruction.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
12 years agoUpdate structure & XML definitions to support <hostdev caps=net>
Bogdan Purcareata [Fri, 5 Apr 2013 12:26:39 +0000 (08:26 -0400)]
Update structure & XML definitions to support <hostdev caps=net>

This updates the definitions and supporting structures in the XML
schema and domain configuration files.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com>
12 years agospec: Require pod2man when running autoreconf
Jiri Denemark [Mon, 8 Apr 2013 12:48:18 +0000 (14:48 +0200)]
spec: Require pod2man when running autoreconf

Since commit b8a32e0e94d75702714167539310f0df4d268e0f, all man pages
depend on configure.ac so that they are properly regenerated whenever
libvirt version changes. Thus libvirt.spec needs to have a build
dependency on pod2man when %{enable_autotools} is set.

12 years agoRename virCgroupMounted to virCgroupHasController & make it more robust
Daniel P. Berrange [Thu, 21 Mar 2013 13:38:31 +0000 (13:38 +0000)]
Rename virCgroupMounted to virCgroupHasController & make it more robust

The virCgroupMounted method is badly named, since a controller can be
mounted, but disabled in the current object. Rename the method to be
virCgroupHasController. Also make it tolerant to a  NULL virCgroupPtr
and out-of-range controller index, to avoid duplication of these
checks in all callers

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoqemu: Allow volume type disk for device 'lun'
Osier Yang [Fri, 5 Apr 2013 17:07:13 +0000 (01:07 +0800)]
qemu: Allow volume type disk for device 'lun'

This allows one use block type volume as the disk source for device
'lun'.

12 years agoqemu: Support sgio setting for volume type disk
Osier Yang [Thu, 4 Apr 2013 19:38:02 +0000 (03:38 +0800)]
qemu: Support sgio setting for volume type disk

12 years agoqemu: Support shareable volume type disk
Osier Yang [Thu, 4 Apr 2013 19:38:01 +0000 (03:38 +0800)]
qemu: Support shareable volume type disk

Since the source is already translated before. This just adds the
checking. Move !disk->shared and !disk->src to improve the performance
a bit.

12 years agoqemu: Translate the pool disk source earlier
Osier Yang [Thu, 4 Apr 2013 19:38:00 +0000 (03:38 +0800)]
qemu: Translate the pool disk source earlier

To support "shareable" for volume type disk, we have to translate
the source before trying to add the shared disk entry. To achieve
the goal, this moves the helper qemuTranslateDiskSourcePool into
src/qemu/qemu_conf.c, and introduce an internal only member (voltype)
for struct _virDomainDiskSourcePoolDef, to record the underlying
volume type for use when building the drive string.

Later patch will support "shareable" volume type disk.

12 years agoSupport seclabels for volume type disk
Osier Yang [Thu, 4 Apr 2013 19:37:59 +0000 (03:37 +0800)]
Support seclabels for volume type disk

"seclabels" is only valid for 'file' or 'block' type storage volume.

12 years agoSupport startupPolicy for 'volume' disk
Osier Yang [Thu, 4 Apr 2013 19:37:58 +0000 (03:37 +0800)]
Support startupPolicy for 'volume' disk

"startupPolicy" is only valid for file type storage volume, otherwise
it fails on starting the domain.

12 years agoqemu: Translate the pool disk source when building drive string
Osier Yang [Thu, 4 Apr 2013 19:37:57 +0000 (03:37 +0800)]
qemu: Translate the pool disk source when building drive string

This adds a new helper qemuTranslateDiskSourcePool which uses the
storage pool/vol APIs to translate the disk source before building
the drive string. Network volume is not supported yet. Disk chain
for volume type disk may be supported later, but before I'm confident
it doesn't break anything, it's just disabled now.

12 years agoIntroduce new XMLs to specify disk source using libvirt storage
Osier Yang [Thu, 4 Apr 2013 19:37:56 +0000 (03:37 +0800)]
Introduce new XMLs to specify disk source using libvirt storage

With this patch, one can specify the disk source using libvirt
storage like:

  <disk type='volume' device='disk'>
    <driver name='qemu' type='raw' cache='none'/>
    <source pool='default' volume='fc18.img'/>
    <target dev='vdb' bus='virtio'/>
  </disk>

"seclabels" and "startupPolicy" are not supported for this new
disk type ("volume"). They will be supported in later patches.

docs/formatdomain.html.in:
  * Add documents for new XMLs
docs/schemas/domaincommon.rng:
  * Add rng for new XMLs;
src/conf/domain_conf.h:
  * New struct for 'volume' type disk source (virDomainDiskSourcePoolDef)
  * Add VIR_DOMAIN_DISK_TYPE_VOLUME for enum virDomainDiskType
src/conf/domain_conf.c:
  * New helper virDomainDiskSourcePoolDefParse to parse the 'volume'
    type disk source.
  * New helper virDomainDiskSourcePoolDefFree to free the source def
    if 'volume' type disk.
tests/qemuxml2argvdata/qemuxml2argv-disk-source-pool.xml:
tests/qemuxml2xmltest.c:
  * New test

12 years agoconf: New helper virDomainDiskSourceDefFormat to format the disk source
Osier Yang [Thu, 4 Apr 2013 19:37:55 +0000 (03:37 +0800)]
conf: New helper virDomainDiskSourceDefFormat to format the disk source

The code to format disk source is long enough to have a helper.

12 years agostorage: Guess the parent if it's not specified for vHBA
Osier Yang [Mon, 25 Mar 2013 16:43:42 +0000 (00:43 +0800)]
storage: Guess the parent if it's not specified for vHBA

This finds the parent for vHBA by iterating over all the HBA
which supports vport_ops capability on the host, and return
the first one which is online, not saturated (vports in use
is less than max_vports).

12 years agostorage: Add startPool and stopPool for scsi backend
Osier Yang [Mon, 25 Mar 2013 16:43:41 +0000 (00:43 +0800)]
storage: Add startPool and stopPool for scsi backend

startPool creates the vHBA if it's not existed yet, stopPool destroys
the vHBA. Also to support autostart, checkPool will creates the vHBA
if it's not existed yet.

12 years agoutil: Add helper to get the scsi host name by iterating over sysfs
Osier Yang [Mon, 25 Mar 2013 16:43:40 +0000 (00:43 +0800)]
util: Add helper to get the scsi host name by iterating over sysfs

The helper iterates over sysfs, to find out the matched scsi host
name by comparing the wwnn,wwpn pair. It will be used by checkPool
and refreshPool of storage scsi backend. New helper getAdapterName
is introduced in storage_backend_scsi.c, which uses the new util
helper virGetFCHostNameByWWN to get the fc_host adapter name.

12 years agophyp: Prohibit fc_host adapter for phyp driver
Osier Yang [Mon, 25 Mar 2013 16:43:39 +0000 (00:43 +0800)]
phyp: Prohibit fc_host adapter for phyp driver

It's possible to support fc_host adapter for phyp driver too, but
at this stage I'd like to not allow it when I'm not that clear
how it works.

12 years agostorage: Move virStorageBackendSCSIGetHostNumber into iscsi backend
Osier Yang [Mon, 25 Mar 2013 16:43:38 +0000 (00:43 +0800)]
storage: Move virStorageBackendSCSIGetHostNumber into iscsi backend

It's only used by iscsi backend.

12 years agostorage: Make the adapter name be consistent with node device driver
Osier Yang [Mon, 25 Mar 2013 16:43:37 +0000 (00:43 +0800)]
storage: Make the adapter name be consistent with node device driver

node device driver names the HBA like "scsi_host5", but storage
driver uses "host5", which could make the user confused. This
changes them to be consistent. However, for back-compat reason,
adapter name like "host5" is still supported.

12 years agoNew XML attributes for storage pool source adapter
Osier Yang [Mon, 25 Mar 2013 16:43:36 +0000 (00:43 +0800)]
New XML attributes for storage pool source adapter

This introduces 4 new attributes for storage pool source adapter.
E.g.

<adapter type='fc_host' parent='scsi_host5' wwnn='20000000c9831b4b' wwpn='10000000c9831b4b'/>

Attribute 'type' can be either 'scsi_host' or 'fc_host', and defaults
to 'scsi_host' if attribute 'name' is specified. I.e. It's optional
for 'scsi_host' adapter, for back-compat reason. However, mandatory
for 'fc_host' adapter and any new future adapter types. Attribute
'parent' is to specify the parent for the fc_host adapter.

* docs/formatstorage.html.in:
  - Add documents for the 4 new attrs
* docs/schemas/storagepool.rng:
  - Add RNG schema
* src/conf/storage_conf.c:
  - Parse and format the new XMLs
* src/conf/storage_conf.h:
  - New struct virStoragePoolSourceAdapter, replace "char *adapter" with it;
  - New enum virStoragePoolSourceAdapterType
* src/libvirt_private.syms:
  - Export TypeToString and TypeFromString
* src/phyp/phyp_driver.c:
  - Replace "adapter" with "adapter.data.name", which is member of the union
    of the new struct virStoragePoolSourceAdapter now. Later patch will
    add the checking, as "adapter.data.name" is only valid for "scsi_host"
    adapter.
* src/storage/storage_backend_scsi.c:
  - Like above
* tests/storagepoolxml2xmlin/pool-scsi-type-scsi-host.xml:
* tests/storagepoolxml2xmlin/pool-scsi-type-fc-host.xml:
  - New test for 'fc_host' and "scsi_host" adapter
* tests/storagepoolxml2xmlout/pool-scsi.xml:
  - Change the expected output, as the 'type' defaults to 'scsi_host' if 'name"
    specified now
* tests/storagepoolxml2xmlout/pool-scsi-type-scsi-host.xml:
* tests/storagepoolxml2xmlout/pool-scsi-type-fc-host.xml:
  - New test
* tests/storagepoolxml2xmltest.c:
  - Include the test

12 years agoAvoid cast alignment warnings in port allocator test
Daniel P. Berrange [Wed, 3 Apr 2013 14:55:37 +0000 (15:55 +0100)]
Avoid cast alignment warnings in port allocator test

To avoid

virportallocatortest.c: In function 'bind':
virportallocatortest.c:34:33: warning: cast increases required alignment of target type [-Wcast-align]
     struct sockaddr_in *saddr = (struct sockaddr_in *)addr;
                                 ^

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoDisable cast-align warnings in various places
Daniel P. Berrange [Wed, 3 Apr 2013 14:52:40 +0000 (15:52 +0100)]
Disable cast-align warnings in various places

There are a number of places which generate cast alignment
warnings, which are difficult or impossible to address. Use
pragmas to disable the warnings in these few places

conf/nwfilter_conf.c: In function 'virNWFilterRuleDetailsParse':
conf/nwfilter_conf.c:1806:16: warning: cast increases required alignment of target type [-Wcast-align]
         item = (nwItemDesc *)((char *)nwf + att[idx].dataIdx);
conf/nwfilter_conf.c: In function 'virNWFilterRuleDefDetailsFormat':
conf/nwfilter_conf.c:3238:16: warning: cast increases required alignment of target type [-Wcast-align]
         item = (nwItemDesc *)((char *)def + att[i].dataIdx);

storage/storage_backend_mpath.c: In function 'virStorageBackendCreateVols':
storage/storage_backend_mpath.c:247:17: warning: cast increases required alignment of target type [-Wcast-align]
         names = (struct dm_names *)(((char *)names) + next);

nwfilter/nwfilter_dhcpsnoop.c: In function 'virNWFilterSnoopDHCPDecode':
nwfilter/nwfilter_dhcpsnoop.c:994:15: warning: cast increases required alignment of target type [-Wcast-align]
         pip = (struct iphdr *) pep->eh_data;
nwfilter/nwfilter_dhcpsnoop.c:1004:11: warning: cast increases required alignment of target type [-Wcast-align]
     pup = (struct udphdr *) ((char *) pip + (pip->ihl << 2));

nwfilter/nwfilter_learnipaddr.c: In function 'procDHCPOpts':
nwfilter/nwfilter_learnipaddr.c:327:33: warning: cast increases required alignment of target type [-Wcast-align]
                 uint32_t *tmp = (uint32_t *)&dhcpopt->value;
nwfilter/nwfilter_learnipaddr.c: In function 'learnIPAddressThread':
nwfilter/nwfilter_learnipaddr.c:501:43: warning: cast increases required alignment of target type [-Wcast-align]
                     struct iphdr *iphdr = (struct iphdr*)(packet +
nwfilter/nwfilter_learnipaddr.c:538:43: warning: cast increases required alignment of target type [-Wcast-align]
                     struct iphdr *iphdr = (struct iphdr*)(packet +
nwfilter/nwfilter_learnipaddr.c:544:48: warning: cast increases required alignment of target type [-Wcast-align]
                         struct udphdr *udphdr= (struct udphdr *)

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoCopy struct inotify_event entries to avoid alignment problems
Daniel P. Berrange [Wed, 3 Apr 2013 13:33:56 +0000 (14:33 +0100)]
Copy struct inotify_event entries to avoid alignment problems

When reading the inotify FD, we get back a sequence of
struct inotify_event, each with variable length data following.
It is not safe to simply cast from the char *buf to the
struct inotify_event struct since this may violate data
alignment rules. Thus we must copy from the char *buf
into the struct inotify_event instance before accessing
the data.

uml/uml_driver.c: In function 'umlInotifyEvent':
uml/uml_driver.c:327:13: warning: cast increases required alignment of target type [-Wcast-align]
         e = (struct inotify_event *)tmp;

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoUse VIR_ALLOC_VAR instead of VIR_ALLOC_N for creating virObject
Daniel P. Berrange [Wed, 3 Apr 2013 13:14:23 +0000 (14:14 +0100)]
Use VIR_ALLOC_VAR instead of VIR_ALLOC_N for creating virObject

The current way virObject instances are allocated using
VIR_ALLOC_N causes alignment warnings

util/virobject.c: In function 'virObjectNew':
util/virobject.c:195:11: error: cast increases required alignment of target type [-Werror=cast-align]

Changing to use VIR_ALLOC_VAR will avoid the need todo
the casts entirely.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAvoid casts between unsigned char * and struct nlmsghdr
Daniel P. Berrange [Wed, 3 Apr 2013 13:09:19 +0000 (14:09 +0100)]
Avoid casts between unsigned char * and struct nlmsghdr

The virNetlinkCommand() method takes an 'unsigned char **'
parameter to be filled with the received netlink message.
The callers then immediately cast this to 'struct nlmsghdr',
triggering (bogus) warnings about increasing alignment
requirements

util/virnetdev.c: In function 'virNetDevLinkDump':
util/virnetdev.c:1300:12: warning: cast increases required alignment of target type [-Wcast-align]
     resp = (struct nlmsghdr *)*recvbuf;
            ^
util/virnetdev.c: In function 'virNetDevSetVfConfig':
util/virnetdev.c:1429:12: warning: cast increases required alignment of target type [-Wcast-align]
     resp = (struct nlmsghdr *)recvbuf;

Since all callers cast to 'struct nlmsghdr' we can avoid
the warning problem entirely by simply changing the
signature of virNetlinkCommand to return a 'struct nlmsghdr **'
instead of 'unsigned char **'. The way we do the cast inside
virNetlinkCommand does not have any alignment issues.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoRewrite keycode map to avoid a struct
Daniel P. Berrange [Wed, 3 Apr 2013 12:51:56 +0000 (13:51 +0100)]
Rewrite keycode map to avoid a struct

Playing games with field offsets in a struct causes all sorts
of alignment warnings on ARM platforms

util/virkeycode.c: In function '__virKeycodeValueFromString':
util/virkeycode.c:26:7: warning: cast increases required alignment of target type [-Wcast-align]
     (*(typeof(field_type) *)((char *)(object) + field_offset))
       ^
util/virkeycode.c:91:28: note: in expansion of macro 'getfield'
         const char *name = getfield(virKeycodes + i, const char *, name_offset);
                            ^
util/virkeycode.c:26:7: warning: cast increases required alignment of target type [-Wcast-align]
     (*(typeof(field_type) *)((char *)(object) + field_offset))
       ^
util/virkeycode.c:94:20: note: in expansion of macro 'getfield'
             return getfield(virKeycodes + i, unsigned short, code_offset);
                    ^
util/virkeycode.c: In function '__virKeycodeValueTranslate':
util/virkeycode.c:26:7: warning: cast increases required alignment of target type [-Wcast-align]
     (*(typeof(field_type) *)((char *)(object) + field_offset))
       ^
util/virkeycode.c:127:13: note: in expansion of macro 'getfield'
         if (getfield(virKeycodes + i, unsigned short, from_offset) == key_value)
             ^
util/virkeycode.c:26:7: warning: cast increases required alignment of target type [-Wcast-align]
     (*(typeof(field_type) *)((char *)(object) + field_offset))
       ^
util/virkeycode.c:128:20: note: in expansion of macro 'getfield'
             return getfield(virKeycodes + i, unsigned short, to_offset);

There is no compelling reason to use a struct for the keycode
tables. It can easily just use an array of arrays instead,
avoiding all alignment problems

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoAdd a test suite for keycode mapping functions
Daniel P. Berrange [Fri, 5 Apr 2013 16:49:27 +0000 (17:49 +0100)]
Add a test suite for keycode mapping functions

Validate that translations between different keycode sets
are functioning.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
12 years agoqemu: Error out if the bitmap for pinning is all clear
Osier Yang [Tue, 2 Apr 2013 05:42:14 +0000 (13:42 +0800)]
qemu: Error out if the bitmap for pinning is all clear

For both "live" and "config" changes of vcpupin and emulatorpin, an
all clear bitmap doesn't make sense, and it can just cause corruptions.
E.g (similar for emulatorpin).

% virsh vcpupin hame 0 8,^8 --config

% virsh vcpupin hame
VCPU: CPU Affinity
----------------------------------
   0:
   1: 0-63
   2: 0-63
   3: 0-63

% virsh dumpxml hame | grep cpuset
    <vcpupin vcpu='0' cpuset=''/>

% virsh start hame
error: Failed to start domain hame
error: An error occurred, but the cause is unknown

12 years agoutil: Add a helper to check if all bits of a bitmap are clear
Osier Yang [Fri, 5 Apr 2013 18:06:16 +0000 (02:06 +0800)]
util: Add a helper to check if all bits of a bitmap are clear

12 years agoqemu: Support multiple queue virtio-scsi
Osier Yang [Fri, 5 Apr 2013 16:21:23 +0000 (00:21 +0800)]
qemu: Support multiple queue virtio-scsi

This introduce a new attribute "num_queues" (same with the good name
QEMU uses) for virtio-scsi controller. An example of the XML:

<controller type='scsi' index='0' model='virtio-scsi' num_queues='8'/>

The corresponding QEMU command line:

-device virtio-scsi-pci,id=scsi0,num_queues=8,bus=pci.0,addr=0x3 \

12 years agobuild: check correct protocol.o file
Eric Blake [Fri, 5 Apr 2013 17:09:32 +0000 (11:09 -0600)]
build: check correct protocol.o file

By default, libtool builds two .o files for every .lo rule:
src/foo.o - static builds
src/.libs/foo.o - shared library builds

But since commit ad42b34b disabled static builds, src/foo.o is
no longer built by default.  On a fresh checkout, this means our
protocol check rules using pdwtags were testing a missing file,
and thanks to a lousy behavior of pdwtags happily giving no output
and 0 exit status (http://bugzilla.redhat.com/949034), we were
merely claiming that "dwarves is too old" and skipping the test.

However, if you swap between branches and do incremental builds,
such as building v0.10.2-maint and then switching back to master,
you end up with src/foo.o being leftover from its 0.10.2 state,
and then 'make check' fails because the .o file does not match
the protocol-structs file due to API additions in the meantime.

A simpler fix would be to always look in .libs for the .o to
be parsed; but since it is possible to pass ./configure options
to tell libtool to do a static-only build with no shared .o,
I went with the approach of finding the newest of the two files,
whenever both exist.

* src/Makefile.am (PDWTAGS): Ensure we test just-built file.

12 years agobuild: use proper pod for nested bulleted VIRSH_DEBUG list
Eric Blake [Fri, 5 Apr 2013 16:00:20 +0000 (10:00 -0600)]
build: use proper pod for nested bulleted VIRSH_DEBUG list

Newer pod (hello rawhide) complains if you attempt to mix bullets
and non-bullets in the same list:

virsh.pod around line 3177: Expected text after =item, not a bullet

As our intent was to nest an inner list, we make that explicit to
keep pod happy.

* tools/virsh.pod (ENVIRONMENT): Use correct pod syntax.

12 years agoqemu: Remove maximum cpu limit when setting processor count using the API
Peter Krempa [Fri, 7 Sep 2012 12:46:53 +0000 (14:46 +0200)]
qemu: Remove maximum cpu limit when setting processor count using the API

When setting processor count for a domain using the API libvirt enforced
a maximum processor count, while it isn't enforced when taking the XML path.

This patch removes the check to match the XML.