]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
10 years agoconf: Introduce virStoragePoolSaveState
Erik Skultety [Thu, 2 Apr 2015 14:41:51 +0000 (16:41 +0200)]
conf: Introduce virStoragePoolSaveState

Introduce virStoragePoolSaveState to properly format the state XML in
the same manner as virStoragePoolDefFormat, except for adding a
<poolstate> ... </poolstate> around the definition. This is similar to
virNetworkObjFormat used to save the live/active network information.

10 years agoconf: Introduce virStoragePoolDefFormatBuf
Erik Skultety [Thu, 26 Mar 2015 15:44:38 +0000 (16:44 +0100)]
conf: Introduce virStoragePoolDefFormatBuf

When modifying config/status XML, it might be handy to include some
additional XML elements (e.g. <poolstate>). In order to do so,
introduce new formatting function virStoragePoolDefFormatBuf and make
virStoragePoolDefFormat call it.

10 years agolibxl: fix dom0 balloon logic
Jim Fehlig [Fri, 20 Mar 2015 23:08:34 +0000 (17:08 -0600)]
libxl: fix dom0 balloon logic

Recent testing on large memory systems revealed a bug in the Xen xl
tool's freemem() function.  When autoballooning is enabled, freemem()
is used to ensure enough memory is available to start a domain,
ballooning dom0 if necessary.  When ballooning large amounts of memory
from dom0, freemem() would exceed its self-imposed wait time and
return an error.  Meanwhile, dom0 continued to balloon.  Starting the
domain later, after sufficient memory was ballooned from dom0, would
succeed.  The libvirt implementation in libxlDomainFreeMem() suffers
the same bug since it is modeled after freemem().

In the end, the best place to fix the bug on the Xen side was to
slightly change the behavior of libxl_wait_for_memory_target().
Instead of failing after caller-provided wait_sec, the function now
blocks as long as dom0 memory ballooning is progressing.  It will return
failure only when more memory is needed to reach the target and wait_sec
have expired with no progress being made.  See xen.git commit fd3aa246.
There was a dicussion on how this would affect other libxl apps like
libvirt

http://lists.xen.org/archives/html/xen-devel/2015-03/msg00739.html

If libvirt containing this patch was build against a Xen containing
the old libxl_wait_for_memory_target() behavior, libxlDomainFreeMem()
will fail after 30 sec and domain creation will be terminated.
Without this patch and with old libxl_wait_for_memory_target() behavior,
libxlDomainFreeMem() does not succeed after 30 sec, but returns success
anyway.  Domain creation continues resulting in all sorts of fun stuff
like cpu soft lockups in the guest OS.  It was decided to properly fix
libxl_wait_for_memory_target(), and if anything improve the default
behavior of apps using the freemem reference impl in xl.

xl was patched to accommodate the change in libxl_wait_for_memory_target()
with xen.git commit 883b30a0.  This patch does the same in the libxl
driver.  While at it, I changed the logic to essentially match
freemem() in $xensrc/tools/libxl/xl_cmdimpl.c.  It was a bit cleaner
IMO and will make it easier to spot future, potentially interesting
divergences.

10 years agoTypos: Get rid of dependan(t|cies)
Martin Kletzander [Thu, 26 Mar 2015 06:36:07 +0000 (07:36 +0100)]
Typos: Get rid of dependan(t|cies)

Dependant is flagged as wrong in US dictionary (only valid in UK
dictionary, and even then, it has only the financial sense and not the
inter-relatedness sense that we are more prone to be wanting throughout
code).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agodocs: Add Host sFlow into monitoring apps
Martin Kletzander [Wed, 25 Mar 2015 15:34:58 +0000 (16:34 +0100)]
docs: Add Host sFlow into monitoring apps

Reported-by: Peter Phaal <peter.phaal@gmail.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
10 years agohostdev: Fix index error in loop after remove an element
Huanle Han [Thu, 26 Mar 2015 14:23:46 +0000 (22:23 +0800)]
hostdev: Fix index error in loop after remove an element

'virPCIDeviceList' is actually an array. Removing one element makes the
rest of the element move.

Use while loop, increase index only when not virPCIDeviceListDel(pcidevs, dev)

Signed-off-by: Huanle Han <hanxueluo@gmail.com>
10 years agoFix xlconfigtest with older libxl
Ján Tomko [Thu, 2 Apr 2015 12:57:54 +0000 (14:57 +0200)]
Fix xlconfigtest with older libxl

Commit cd5dc30 added this test, but it fails if
LIBXL_HAVE_BUILDINFO_USBDEVICE_LIST is not defined:

6) Xen XM-2-XML Format fullvirt-multiusb
... libvirt:  error : unsupported configuration: multiple USB
devices not supported
FAILED

10 years agoAuto add virtio-serial controllers
Ján Tomko [Tue, 24 Mar 2015 14:23:46 +0000 (15:23 +0100)]
Auto add virtio-serial controllers

In virDomainVirtioSerialAddrNext, add another controller
if we've exhausted all ports of the existing controllers.

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

10 years agoAssign an address when hotplugging a virtio-serial device
Ján Tomko [Mon, 2 Mar 2015 09:59:52 +0000 (10:59 +0100)]
Assign an address when hotplugging a virtio-serial device

10 years agoExpand the address set when attaching a virtio-serial controller
Ján Tomko [Mon, 2 Mar 2015 09:59:25 +0000 (10:59 +0100)]
Expand the address set when attaching a virtio-serial controller

10 years agoAllocate virtio-serial addresses when starting a domain
Ján Tomko [Mon, 2 Mar 2015 09:58:48 +0000 (10:58 +0100)]
Allocate virtio-serial addresses when starting a domain

Instead of always using controller 0 and incrementing port number,
respect the maximum port numbers of controllers and use all of them.

Ports for virtio consoles are quietly reserved, but not formatted
(neither in XML nor on QEMU command line).

Also rejects duplicate virtio-serial addresses.
https://bugzilla.redhat.com/show_bug.cgi?id=890606
https://bugzilla.redhat.com/show_bug.cgi?id=1076708

Test changes:
* virtio-auto.args
  Filling out the port when just the controller is specified.
  switched from using
    maxport + 1
  to:
    first free port on the controller
* virtio-autoassign.args
  Filling out the address when no <address> is specified.
  Started using all the controllers instead of 0, also discards
  the bus value.
* xml -> xml output of virtio-auto
  The port assignment is no longer done as a part of XML parsing,
  so the unspecified values stay 0.

10 years agoAdd functions to track virtio-serial addresses
Ján Tomko [Mon, 2 Mar 2015 09:57:51 +0000 (10:57 +0100)]
Add functions to track virtio-serial addresses

Create a sorted array of virtio-serial controllers.
Each of the elements contains the controller index
and a bitmap of available ports.

Buses are not tracked, because they aren't supported by QEMU.

10 years agoAdd test for virtio serial port assignment
Ján Tomko [Thu, 29 May 2014 13:16:47 +0000 (15:16 +0200)]
Add test for virtio serial port assignment

Add a test to demonstrate the effect of automatic virtio-serial
address assignment.

10 years agoscsi: Remove unused 'type_path' in processLU
John Ferlan [Wed, 1 Apr 2015 12:45:11 +0000 (08:45 -0400)]
scsi: Remove unused 'type_path' in processLU

Seems to be a remnant that was never cleaned up from original submit...

Signed-off-by: John Ferlan <jferlan@redhat.com>
10 years agoiscsi: Fix exit path for virStorageBackendISCSIFindLUs failure
John Ferlan [Wed, 1 Apr 2015 10:46:25 +0000 (06:46 -0400)]
iscsi: Fix exit path for virStorageBackendISCSIFindLUs failure

If the call to virStorageBackendISCSIGetHostNumber failed, we set
retval = -1, but yet still called virStorageBackendSCSIFindLUs.
Need to add a goto cleanup - while at it, adjust the logic to
initialize retval to -1 and only changed to 0 (zero) on success.

Signed-off-by: John Ferlan <jferlan@redhat.com>
10 years agoiscsi: Use error message from virStorageBackendSCSIFindLUs
John Ferlan [Mon, 30 Mar 2015 22:49:36 +0000 (18:49 -0400)]
iscsi: Use error message from virStorageBackendSCSIFindLUs

Don't supercede the error message virStorageBackendSCSIFindLUs as the
message such as "error: Failed to find LUs on host 60: ..." is not overly
clear as to what the real problem might be.

Signed-off-by: John Ferlan <jferlan@redhat.com>
10 years agoconf: Introduce virStoragePoolSaveXML
Erik Skultety [Thu, 26 Mar 2015 15:49:20 +0000 (16:49 +0100)]
conf: Introduce virStoragePoolSaveXML

Make XML definition saving more generic by moving the common code into
virStoragePoolSaveXML and leave case specific code to
PoolSave{Status,Config,...} functions.

10 years agostorage: Remove unused attribute conn from 'checkPool' callback
Erik Skultety [Mon, 9 Mar 2015 14:34:35 +0000 (15:34 +0100)]
storage: Remove unused attribute conn from 'checkPool' callback

In order to be able to use 'checkPool' inside functions which do not
have any connection reference, 'conn' attribute needs to be discarded
from the checkPool's signature, since it's not used by any storage backend
anyway.

10 years agoqemuDomainBlockCopy: Check @granularity to be a power of two
Luyao Huang [Fri, 27 Mar 2015 09:56:30 +0000 (17:56 +0800)]
qemuDomainBlockCopy: Check @granularity to be a power of two

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

As described in virDomainBlockCopy() parameters description, the
VIR_DOMAIN_BLOCK_COPY_GRANULARITY parameter may require the value to
have some specific attributes (e.g. be a power of two or fall within a
certain range). And in qemu, a power of two is required. However, our
code does not check that and let qemu operation fail. Moreover, the
virsh man page is not as exact as it could be in this respect.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agonodeinfodata: Remove broken symlinks and uneeded files
Michal Privoznik [Wed, 1 Apr 2015 08:48:04 +0000 (10:48 +0200)]
nodeinfodata: Remove broken symlinks and uneeded files

The 7c3c7f217ebae5 and f5c2d6 commits introduced a nodeinfo test.
In order to do that, some parts of sysfs had to be copied.
However, sysfs is full of symlinks, so during copying some
symlinks broke. Remove them, as on different systems they can
point to different files or be broken. At the same time, we don't
need all files added in those commits. For instance we don't care
about 'uevent' files, 'power' folders, and others.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agoqemu: lifecycle: make agent-mode shutdown and reboot timeout
zhang bo [Wed, 1 Apr 2015 09:13:08 +0000 (17:13 +0800)]
qemu: lifecycle: make agent-mode shutdown and reboot timeout

When we shutdown/reboot a guest using agent-mode, if the guest itself blocks infinitely,
libvirt would block in qemuAgentShutdown() forever.
Thus, we set a timeout for shutdown/reboot, from our experience, 60 seconds would be fine.

Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
Signed-off-by: Wang Yufei <james.wangyufei@huawei.com>
10 years agoFix indentation in cmdVcpuPin
Ján Tomko [Thu, 26 Mar 2015 14:10:50 +0000 (15:10 +0100)]
Fix indentation in cmdVcpuPin

10 years agovirsh: remove stale comment
Ján Tomko [Wed, 1 Apr 2015 17:53:28 +0000 (19:53 +0200)]
virsh: remove stale comment

Copied from the vcpupin command, which has two modes of operation.

10 years agoconf: Rename virDomainHasDiskMirror and detect block jobs properly
Shanzhi Yu [Tue, 24 Mar 2015 10:08:00 +0000 (18:08 +0800)]
conf: Rename virDomainHasDiskMirror and detect block jobs properly

virDomainHasDiskMirror() currently detects only jobs that add the mirror
elements. Since some operations like migration are interlocked by
existing block jobs on the given domain the check needs to be
instrumented to check regular jobs too.

This patch renames virDomainHasDiskMirror to virDomainHasDiskBlockjob
and adds an argument that allows to select that it returns true only for
block copy jobs as those interlock making the domain persistent.

Other two uses trigger on any block job type.

Signed-off-by: Shanzhi Yu <shyu@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
10 years agoqemu: snapshot: Check for block jobs individually
Peter Krempa [Mon, 30 Mar 2015 18:16:45 +0000 (20:16 +0200)]
qemu: snapshot: Check for block jobs individually

If any disk of a VM was involved in a (copy) block job we refused to do
a snapshot. As not only copy jobs interlock snapshots and the
interlocking is applicable to individual disks only we can make the
check in a more individual fashion and interlock all block job types
supported by libvirt.

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

10 years agoRemove unnecessary includes from virsh.h
Ján Tomko [Wed, 1 Apr 2015 15:09:04 +0000 (17:09 +0200)]
Remove unnecessary includes from virsh.h

Include them in the files that need them instead.

10 years agoRemove unused includes from virsh
Ján Tomko [Wed, 1 Apr 2015 14:50:17 +0000 (16:50 +0200)]
Remove unused includes from virsh

After splitting out most of virsh command, some includes
are no longer needed.

Some files have the libXML includes despite not needing them.

10 years agoClean up headers in src/util/virutil.h
Ján Tomko [Wed, 25 Mar 2015 12:12:00 +0000 (13:12 +0100)]
Clean up headers in src/util/virutil.h

* "verify.h" from gnulib is included in internal.h
* <sys/select.h> is no longer needed
  added by commit da196338 to use fd_set in virExec prototype

10 years agoDo not include cpu_map.h in libvirtd.c
Ján Tomko [Wed, 25 Mar 2015 17:34:41 +0000 (18:34 +0100)]
Do not include cpu_map.h in libvirtd.c

No longer needed after commit dd47723

10 years agoUse the DEFAULT_DRIVER_DIR macro
Ján Tomko [Wed, 1 Apr 2015 10:38:42 +0000 (12:38 +0200)]
Use the DEFAULT_DRIVER_DIR macro

Unused since commit bc2f42a0.

Move it under the WITHOUT_DRIVER_MODULES #ifdef
and start using it again.

10 years agoRemove unused macros
Ján Tomko [Wed, 1 Apr 2015 10:30:02 +0000 (12:30 +0200)]
Remove unused macros

In the order of appearance:

* MAX_LISTEN - never used
  added by 23ad665c (qemud) and addec57 (lock daemon)

* NEXT_FREE_CLASS_ID - never used, added by 07d1b6b

* virLockError - never used, added by eb8268a4

* OPENVZ_MAX_ARG, CMDBUF_LEN, CMDOP_LEN
  unused since the removal of ADD_ARG_LIT in d8b31306

* QEMU_NB_PER_CPU_STAT_PARAM - unused since 897808e

* QEMU_CMD_PROMPT, QEMU_PASSWD_PROMPT - unused since 1dc10a7

* TEST_MODEL_WORDSIZE - unused since c25c18f7

* TEMPDIR - never used, added by 714bef5

* NSIG - workaround around old headers
  added by commit 60ed1d2
  unused since virExec was moved by commit 02e8691

* DO_TEST_PARSE - never used, added by 9afa006

* DIFF_MSEC, GETTIMEOFDAY - unused since eee6eb6

10 years agoqemu: Copy bitmap in a sane way
Peter Krempa [Fri, 27 Mar 2015 12:56:30 +0000 (13:56 +0100)]
qemu: Copy bitmap in a sane way

Use virBitmapNewCopy instead of a combination of virBitmapNew and
virBitmapCopy.

10 years agoqemu: cgroup: Kill qemuSetupCgroupVcpuPin()
Peter Krempa [Fri, 27 Mar 2015 12:51:17 +0000 (13:51 +0100)]
qemu: cgroup: Kill qemuSetupCgroupVcpuPin()

The function doesn't make sense. There's a simpler way to achieve the
same.

10 years agoqemu: cgroup: Kill qemuSetupCgroupIOThreadsPin()
Peter Krempa [Fri, 27 Mar 2015 12:51:17 +0000 (13:51 +0100)]
qemu: cgroup: Kill qemuSetupCgroupIOThreadsPin()

The function doesn't make sense. There's a simpler way to achieve the
same.

10 years agoqemu: cgroup: Rename qemuSetupCgroupEmulatorPin to qemuSetupCgroupCpusetCpus
Peter Krempa [Fri, 27 Mar 2015 12:28:59 +0000 (13:28 +0100)]
qemu: cgroup: Rename qemuSetupCgroupEmulatorPin to qemuSetupCgroupCpusetCpus

The function is used to set cpuset.cpus in various other helpers.

10 years agoqemu: cgroup: Use priv->autoCpuset instead of using qemuPrepareCpumap()
Peter Krempa [Fri, 27 Mar 2015 12:11:37 +0000 (13:11 +0100)]
qemu: cgroup: Use priv->autoCpuset instead of using qemuPrepareCpumap()

Two places would call to qemuPrepareCpumap() with priv->autoNodeset to
convert it to a cpuset. Remove the function and use the prepared cpuset
automatically.

10 years agoqemu: cgroup: Properly set up vcpu pinning
Peter Krempa [Fri, 27 Mar 2015 09:23:19 +0000 (10:23 +0100)]
qemu: cgroup: Properly set up vcpu pinning

When the default cpuset or automatic numa placement is used libvirt
would place the whole parent cgroup in the specified cpuset. This then
disallowed to re-pin the vcpus to a different cpu.

This patch pins only the vcpu threads to the default cpuset and thus
allows to re-pin them later.

The following config would fail to start:
<domain type='kvm'>
  ...
  <vcpu placement='static' cpuset='0-1' current='2'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='2-3'/>
    ...

This is a regression since a39f69d2b.

10 years agoqemu: cgroup: Refactor setup for IOThread cgroups
Peter Krempa [Fri, 27 Mar 2015 12:22:02 +0000 (13:22 +0100)]
qemu: cgroup: Refactor setup for IOThread cgroups

Use the default or auto cpuset if they are provided for IOThreads.

10 years agoqemu: cgroup: Store auto cpuset instead of re-creating it on demand
Peter Krempa [Fri, 27 Mar 2015 09:11:00 +0000 (10:11 +0100)]
qemu: cgroup: Store auto cpuset instead of re-creating it on demand

The automatic cpuset can be stored along with automatic nodeset and it
does not have to be recreated when used.

10 years agoBump version to 1.2.15 for new dev cycle
Peter Krempa [Thu, 2 Apr 2015 08:10:21 +0000 (10:10 +0200)]
Bump version to 1.2.15 for new dev cycle

10 years agoRelease of libvirt-1.2.14
Daniel Veillard [Thu, 2 Apr 2015 07:48:08 +0000 (15:48 +0800)]
Release of libvirt-1.2.14

- docs/news.html.in libvirt.spec.in: update for the release
- po/*.po*: regenerated localization

10 years agotests: nodeinfo: Add test for RHELSA on APM mustang
Cole Robinson [Tue, 31 Mar 2015 20:40:28 +0000 (14:40 -0600)]
tests: nodeinfo: Add test for RHELSA on APM mustang

This would have caught the bug fixed by Wei's commit c13de016

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agotests: nodeinfo: Test F21 aarch64 on APM mustang
Cole Robinson [Tue, 31 Mar 2015 20:38:41 +0000 (14:38 -0600)]
tests: nodeinfo: Test F21 aarch64 on APM mustang

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoqemu: blockjob: Synchronously update backing chain in XML on ABORT/PIVOT
Peter Krempa [Mon, 30 Mar 2015 09:26:20 +0000 (11:26 +0200)]
qemu: blockjob: Synchronously update backing chain in XML on ABORT/PIVOT

When the synchronous pivot option is selected, libvirt would not update
the backing chain until the job was exitted. Some applications then
received invalid data as their job serialized first.

This patch removes polling to wait for the ABORT/PIVOT job completion
and replaces it with a condition. If a synchronous operation is
requested the update of the XML is executed in the job of the caller of
the synchronous request. Otherwise the monitor event callback uses a
separate worker to update the backing chain with a new job.

This is a regression since 1a92c719101e5bfa6fe2b78006ad04c7f075ea28

When the ABORT job is finished synchronously you get the following call
stack:
 #0  qemuBlockJobEventProcess
 #1  qemuDomainBlockJobImpl
 #2  qemuDomainBlockJobAbort
 #3  virDomainBlockJobAbort

While previously or while using the _ASYNC flag you'd get:
 #0  qemuBlockJobEventProcess
 #1  processBlockJobEvent
 #2  qemuProcessEventHandler
 #3  virThreadPoolWorker

10 years agoqemu: Extract internals of processBlockJobEvent into a helper
Peter Krempa [Mon, 30 Mar 2015 09:26:19 +0000 (11:26 +0200)]
qemu: Extract internals of processBlockJobEvent into a helper

Later on I'll be adding a condition that will allow to synchronise a
SYNC block job abort. The approach will require this code to be called
from two different places so it has to be extracted into a helper.

10 years agoqemu: processBlockJob: Don't unlock @vm twice
Peter Krempa [Mon, 30 Mar 2015 09:26:18 +0000 (11:26 +0200)]
qemu: processBlockJob: Don't unlock @vm twice

Commit 1a92c719 moved code to handle block job events to a different
function that is executed in a separate thread. The caller of
processBlockJob handles locking and unlocking of @vm, so the we should
not do it in the function itself.

10 years agoqemu: blockCopy: Pass adjusted bandwidth when called via blockRebase
Peter Krempa [Mon, 30 Mar 2015 15:34:13 +0000 (17:34 +0200)]
qemu: blockCopy: Pass adjusted bandwidth when called via blockRebase

The block copy API takes the speed in bytes/s rather than MiB/s that was
the prior approach in virDomainBlockRebase. We correctly converted the
speed to bytes/s in the old API but we still called the common helper
virDomainBlockCopyCommon with the unadjusted variable.

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

10 years agovirsh: blockCopy: Add missing jump on error path
Luyao Huang [Fri, 27 Mar 2015 09:56:29 +0000 (17:56 +0800)]
virsh: blockCopy: Add missing jump on error path

The overflow check for the bandwidth parameter did not jump to the
cleanup label.

Additionally virsh should use vshError instead of virReportError.

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
10 years agoqemuDomainGetNumaParameters: Check for the correct CGroup controller
Michal Privoznik [Fri, 27 Mar 2015 14:16:43 +0000 (15:16 +0100)]
qemuDomainGetNumaParameters: Check for the correct CGroup controller

When getting info on NUMA parameters for domain,
virCgroupGetCpusetMems() may be called. However, as of 43b67f2e
the call is guarded by check if memory controller is present.
Even though it may be not obvious instantly, NUMA parameters are
stored under cpuset controller. Therefore the check needs to look
like this:

  if (!virCgroupHasController(priv->cgroup,
                              VIR_CGROUP_CONTROLLER_CPUSET) ||
      virCgroupGetCpusetMems(priv->cgroup, &nodeset) < 0) {

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agovirCgroupController: Check the enum fits into 'int'
Michal Privoznik [Fri, 27 Mar 2015 12:45:33 +0000 (13:45 +0100)]
virCgroupController: Check the enum fits into 'int'

Throughout our code, the virCgroupController enum is used in two ways.
First as an index to an array of cgroup controllers:

struct virCgroup {
    char *path;

    struct virCgroupController controllers[VIR_CGROUP_CONTROLLER_LAST];
};

Second way is that when calling virCgroupNew() a bitmask of the enum
items can be passed to selectively detect only some controllers. For
instance:

int
virCgroupNewVcpu(virCgroupPtr domain,
                 int vcpuid,
                 bool create,
                 virCgroupPtr *group)
{
    ...
    controllers = ((1 << VIR_CGROUP_CONTROLLER_CPU) |
                   (1 << VIR_CGROUP_CONTROLLER_CPUACCT) |
                   (1 << VIR_CGROUP_CONTROLLER_CPUSET));

    if (virCgroupNew(-1, name, domain, controllers, group) < 0)
        goto cleanup;
}

Even though it's highly unlikely that so many new controllers will be
invented so that we would overflow when constructing the bitmask, it
doesn't hurt to check at compile time either.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agovirCgroupNew: Enhance debug message
Michal Privoznik [Fri, 27 Mar 2015 10:29:25 +0000 (11:29 +0100)]
virCgroupNew: Enhance debug message

When creating new internal representation of cgroups, all passed
arguments are logged. Well, except for two: pid and pointer for
return value. Lets log them too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agovirCgroupNewPartition: Fix comment
Michal Privoznik [Fri, 27 Mar 2015 10:24:16 +0000 (11:24 +0100)]
virCgroupNewPartition: Fix comment

The function has no argument named @name rather than @path
instead.  The comment is, however, referring to @name while it
should have been referring to @path really.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
10 years agobuild: avoid variable named 'interface', for mingw
Eric Blake [Sat, 28 Mar 2015 20:04:27 +0000 (14:04 -0600)]
build: avoid variable named 'interface', for mingw

Commit 2f36e6944 (re-)introduced a use of an identifier 'interface',
which causes this build failure on mingw:

../../tools/virsh-domain-monitor.c: In function 'cmdDomIfAddr':
../../tools/virsh-domain-monitor.c:2233:17: error: expected identifier or '(' before 'struct'
     const char *interface = NULL;
                      ^

See also commit 6512c8b.  Sadly, I'm not quite sure how to write a
syntax check that can poison the use of this identifier.

* tools/virsh-domain-monitor.c (cmdDomIfAddr): Use ifacestr instead.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agovircgroup: Fix build issue mingw cross compile
John Ferlan [Fri, 27 Mar 2015 16:36:04 +0000 (12:36 -0400)]
vircgroup: Fix build issue mingw cross compile

Commit id '2dbfa716' exposed virCgroupDetectMountsFromFile, but did not
add the corresponding entry in the "#else /* !VIR_CGROUP_SUPPORTED */"
section of the module.

10 years agovircgroup: Fix build issue on mingw cross compile
John Ferlan [Fri, 27 Mar 2015 16:13:56 +0000 (12:13 -0400)]
vircgroup: Fix build issue on mingw cross compile

Commit id 'ba1dfc5' added virCgroupSetCpusetMemoryMigrate and
virCgroupGetCpusetMemoryMigrate, but did not add the corresponding
entry points into the "#else /* !VIR_CGROUP_SUPPORTED */" section

10 years agotests: introduce qemucaps2xmlmock
Pavel Hrdina [Wed, 25 Mar 2015 14:35:46 +0000 (15:35 +0100)]
tests: introduce qemucaps2xmlmock

We need to mock virFileExists to return true for "/dev/kvm" because the
test should not depend on host system.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agoRevert "qemucaps2xmltest: fix test to successfully run without kvm support"
Pavel Hrdina [Wed, 25 Mar 2015 14:17:13 +0000 (15:17 +0100)]
Revert "qemucaps2xmltest: fix test to successfully run without kvm support"

This reverts commit 49bf09d16cb7050795f6963a2746d686a2fbaece.  That
commit is wrong and doesn't fix the issue.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agovirnetlink: fix build error
Pavel Hrdina [Fri, 27 Mar 2015 10:06:05 +0000 (11:06 +0100)]
virnetlink: fix build error

Commint 0473b45cc introduced new function virNetlinkDelLink, but in
it's counterpart for non-linux platform there should be ATTRIBUTE_UNUSED
instead of ATTRIBUTE_UNSUPPORTED.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agoqemu: end the job when try to blockcopy to non-file destination
Shanzhi Yu [Fri, 27 Mar 2015 09:16:41 +0000 (17:16 +0800)]
qemu: end the job when try to blockcopy to non-file destination

Blockcopy to non-file destination is not supported according the code,
but a 'goto endjob' is missed after checking the destination.

This leads to calling drive-mirror with wrong parameters.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1206406
Signed-off-by: Shanzhi Yu <shyu@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
10 years agonodeinfo: Increase the num of CPU thread siblings to a larger value
Wei Huang [Thu, 26 Mar 2015 04:48:13 +0000 (00:48 -0400)]
nodeinfo: Increase the num of CPU thread siblings to a larger value

Current libvirt can only handle up to 1023 bytes when it
reads Linux sysfs topology/thread_siblings. This isn't enough for
Linux distributions that support a large value. This patch fixes
the problem by using VIR_ALLOC()/VIR_FREE(), instead of using a
fixed-size (1024) local char array. In the meanwhile
SYSFS_THREAD_SIBLINGS_LIST_LENGTH_MAX is increased to 8192 which
should be large enough for a foreseeable future.

Signed-off-by: Wei Huang <wei@redhat.com>
10 years agorelaxng: allow : in /dev/disk/by-path names
Eric Blake [Thu, 26 Mar 2015 22:48:07 +0000 (16:48 -0600)]
relaxng: allow : in /dev/disk/by-path names

On IRC, Hydrar pointed a problem where 'virsh edit' failed on
his domain created through an ISCSI pool managed by virt-manager,
all because the XML included a block device with colons in the
name.

* docs/schemas/basictypes.rng (absFilePath): Add colon as safe.
* tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.xml: New file.
* tests/qemuxml2argvdata/qemuxml2argv-disk-iscsi.args: Likewise.
* tests/qemuxml2argvtest.c (mymain): Test it.

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agolibxl: Fix memory leak if pthread_create fails.
Konrad Rzeszutek Wilk [Thu, 26 Mar 2015 01:35:11 +0000 (21:35 -0400)]
libxl: Fix memory leak if pthread_create fails.

If we fail to create the thread we leak the shutdown_info
structure.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
10 years agoutil: use netlink to create bridge devices
Laine Stump [Mon, 23 Mar 2015 18:17:44 +0000 (14:17 -0400)]
util: use netlink to create bridge devices

Just as it is possible to delete a bridge device with the netlink
RTM_DELLINK message, one can be created with the RTM_NEWLINK
message. Because of differences in the format of the message, it's not
as straightforward as with virNetlinkDelLink() to create a single
utility function that can be used to create any type of interface, so
the new netlink version of virNetDevBridgeCreate() does its own
construction of the netlink message and calls virNetlinkCommand()
itself.

This doesn't provide any extra functionality, just provides symmetry
with the previous commit.

NB: We *could* alter the API of virNetDevBridgeCreate() to take a MAC
address, and directly program that mac address into the bridge (by
adding an IFLA_ADDRESS attribute, as is done in
virNetDevMacVLanCreate()) rather than separately creating the "dummy
tap" (e.g. virbr0-nic) to maintain a fixed mac address on the bridge,
but the commit history of virnetdevbridge.c shows that the presence of
this dummy tap is essential in some older versions of the kernel
(between 2.6.39 and 3.1 or 3.2, possibly?) to proper operation of IPv6
DAD, and I don't want to take the chance of breaking something that I
don't have the time/setup to test (my RHEL6 box is at kernel
2.6.32-544, and the next lowest kernel I have is 3.17)

10 years agoutil: use netlink to delete bridge devices
Laine Stump [Tue, 17 Mar 2015 19:45:01 +0000 (15:45 -0400)]
util: use netlink to delete bridge devices

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

reported that a stray bridge device was left on the system when a
libvirt network failed to start due to an illegal iptables rule caused
by bad config. Apparently the reason this was happening was that
NetworkManager was noticing immediately when the bridge device was
created and automatically setting it IFF_UP. libvirt would then try to
setup the iptables rules, get an error back, and since libvirt had
never IFF_UPed the bridge, it didn't expect that it needed to set it
~IFF_UP before deleting it during the cleanup process. But the
ioctl(SIOCBRDELBR) ioctl will fail to delete a bridge if it is IFF_UP.

Since that bug was reported, NetworkManager has gotten a bit more
polite in this respect, but just in case something similar happens in
the future, this patch switches to using the netlink RTM_DELLINK
message to delete the bridge - unlike SIOCBRDELBR, it will delete the
requested bridge no matter what the setting of IFF_UP.

10 years agoutil: replace body of virNetDevMacVLanDelete() with virNetlinkDelLink()
Laine Stump [Tue, 17 Mar 2015 18:42:24 +0000 (14:42 -0400)]
util: replace body of virNetDevMacVLanDelete() with virNetlinkDelLink()

These two functions are identical, so no sense in having the
duplication. I resisted the temptation to replace calls to
virNetDevMacVLanDelete() with calls to virNetlinkDelLink() just in
case some mythical future platform has macvtap devices that aren't
managed with netlink (or in case we some day need to do more than just
tell the kernel to delete the device).

10 years agoutil: netlink function to delete any network device
Laine Stump [Tue, 17 Mar 2015 18:27:21 +0000 (14:27 -0400)]
util: netlink function to delete any network device

libvirt has always used the netlink RTM_DELLINK message to delete
macvtap/macvlan devices, but it can actually be used to delete other
types of network devices, such as bonds and bridges. This patch makes
virNetDevMacVLanDelete() available as a generic function so it can
intelligibly be called to delete these other types of interfaces.

10 years agomaint: update to latest gnulib
Eric Blake [Tue, 24 Feb 2015 15:58:46 +0000 (08:58 -0700)]
maint: update to latest gnulib

Usual update to latest gnulib status.  In particular this update
fixes at least one issue that can be seen in libvirt, by silencing
a valgrind detection of uninitialized memory:
https://bugzilla.redhat.com/show_bug.cgi?id=1174147

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

Signed-off-by: Eric Blake <eblake@redhat.com>
10 years agoRename DomainGetIOThreadsInfo to DomainGetIOThreadInfo
Ján Tomko [Wed, 25 Mar 2015 16:02:26 +0000 (17:02 +0100)]
Rename DomainGetIOThreadsInfo to DomainGetIOThreadInfo

While it returns info about multiple threads, the version
without the plural is easier to read.

10 years agoRename qemuMonitorIOThreadsInfo* to qemuMonitorIOThreadInfo*
Ján Tomko [Wed, 25 Mar 2015 15:59:37 +0000 (16:59 +0100)]
Rename qemuMonitorIOThreadsInfo* to qemuMonitorIOThreadInfo*

It only deals with a single thread.

10 years agoRename virDomainIOThreadsInfoFree to virDomainIOThreadInfoFree
Ján Tomko [Wed, 25 Mar 2015 15:47:49 +0000 (16:47 +0100)]
Rename virDomainIOThreadsInfoFree to virDomainIOThreadInfoFree

This function only frees the info for one thread.

10 years agovirsh: rename iothreadsinfo to iothreadinfo
Ján Tomko [Wed, 25 Mar 2015 16:15:04 +0000 (17:15 +0100)]
virsh: rename iothreadsinfo to iothreadinfo

The plural seems unnecessary.

10 years agoqemu: command: Fix property name for start address of a pc-dimm module
Luyao Huang [Thu, 26 Mar 2015 06:30:56 +0000 (14:30 +0800)]
qemu: command: Fix property name for start address of a pc-dimm module

Starting a qemu VM with a memory module that has the base address
specified results in the following error:

 error: internal error: early end of file from monitor: possible problem:
 2015-03-26T03:45:52.338891Z qemu-kvm: -device pc-dimm,node=0,memdev=memdimm0,
 id=dimm0,slot=0,base=4294967296: Property '.base' not found

The correct property name for the base address is 'addr'.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
10 years agoqemu: Give hint about -noTSX CPU model
Jiri Denemark [Tue, 24 Mar 2015 13:12:07 +0000 (14:12 +0100)]
qemu: Give hint about -noTSX CPU model

Because of the microcode update to Haswell/Broadwell CPUs, existing
domains using these CPUs may fail to start even though they used to run
just fine. To help users solve this issue we try to suggest switching to
-noTSX variant of the CPU model:

    virsh # start cd
    error: Failed to start domain cd
    error: unsupported configuration: guest and host CPU are not
    compatible: Host CPU does not provide required features: rtm, hle;
    try using 'Haswell-noTSX' CPU model

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agocpu: Add {Haswell,Broadwell}-noTSX CPU models
Jiri Denemark [Mon, 23 Mar 2015 16:19:28 +0000 (17:19 +0100)]
cpu: Add {Haswell,Broadwell}-noTSX CPU models

QEMU 2.3 adds these new models to cover Haswell and Broadwell CPUs with
updated microcode. Luckily, they also reverted former the machine type
specific changes to existing models. And since these changes were never
released, we don't need to hack around them in libvirt.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agoqemu: command: Check for empty network source when formatting drive cmd
Peter Krempa [Tue, 24 Mar 2015 15:16:29 +0000 (16:16 +0100)]
qemu: command: Check for empty network source when formatting drive cmd

Use the virStorageSourceIsEmpty helper to determine whether the drive
source is empty rather than checking for src->path. This will fix start
of VM with empty network cdrom that would not report any error.

10 years agoqemu: command: Report error when formatting network source with protocol _NONE
Peter Krempa [Tue, 24 Mar 2015 15:13:41 +0000 (16:13 +0100)]
qemu: command: Report error when formatting network source with protocol _NONE

The function that formats the string for network drives would return
error code but did not set the error message when called on storage
source with VIR_STORAGE_NET_PROTOCOL_LAST or _NONE.

Report an error in this case if it would ever be called in that way.

10 years agobuild: fix race when creating the cpu_map.xml symlink
Amy Fong [Mon, 23 Mar 2015 17:44:03 +0000 (13:44 -0400)]
build: fix race when creating the cpu_map.xml symlink

In some circumstances where the build tree differs from the source,
libvirt's compile will try to create the symlink for cpu_map.xml before
creating the directory $(abs_builddir)/cpu:

'src/cpu/cpu_map.xml': No such file or directory'

Do not create the symlink, it is no longer needed after
commit e562e82f
    Load CPU map from builddir when run uninstalled

Signed-off-by: Amy Fong <amy.fong@windriver.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
10 years agotests: qemuxml2xml: Test status XML formatting and parsing
Peter Krempa [Tue, 24 Mar 2015 12:25:27 +0000 (13:25 +0100)]
tests: qemuxml2xml: Test status XML formatting and parsing

Recently we've fixed a bug where the status XML could not be parsed as
the parser used absolute path XPath queries. This test enhancement tests
all XML files used in the qemu-xml-2-xml test as a part of a status XML
snippet to see whether they are parsed correctly. The status XML-2-XML is
currently tested in 223 cases with this patch.

10 years agoutil: buffer: Add support for adding text blocks with indentation
Peter Krempa [Tue, 24 Mar 2015 09:53:29 +0000 (10:53 +0100)]
util: buffer: Add support for adding text blocks with indentation

The current auto-indentation buffer code applies indentation only on
complete strings. To allow adding a string containing newlines and
having it properly indented this patch adds virBufferAddStr.

10 years agoDon't validata filesystem target type
Guido Günther [Sat, 21 Mar 2015 10:37:12 +0000 (11:37 +0100)]
Don't validata filesystem target type

When using QEMU's 9pfs the target "dir" element is not necessarily an
absolute path but merely an arbitrary identifier. So validation in that
case currently fails with the misleading

   $ virt-xml-validate /tmp/test.xml
   Relax-NG validity error : Extra element devices in interleave
   /tmp/test.xml:24: element devices: Relax-NG validity error : Element domain failed to validate content
   /tmp/test.xml fails to validate

10 years agorpc: Don't unref identity object while callbacks still can be executed
Peter Krempa [Wed, 25 Mar 2015 07:56:07 +0000 (08:56 +0100)]
rpc: Don't unref identity object while callbacks still can be executed

While this thread is cleaning up the client and connection objects:
 #2  virFileReadAll (path=0x7f28780012b0 "/proc/1319/stat", maxlen=maxlen@entry=1024, buf=buf@entry=0x7f289c60fc40) at util/virfile.c:1287
 #3  0x00007f28adbb1539 in virProcessGetStartTime (pid=<optimized out>, timestamp=timestamp@entry=0x7f289c60fc98) at util/virprocess.c:838
 #4  0x00007f28adb91981 in virIdentityGetSystem () at util/viridentity.c:151
 #5  0x00007f28ae73f17c in remoteClientFreeFunc (data=<optimized out>) at remote.c:1131
 #6  0x00007f28adcb7f33 in virNetServerClientDispose (obj=0x7f28aecad180) at rpc/virnetserverclient.c:858
 #7  0x00007f28adba8eeb in virObjectUnref (anyobj=<optimized out>) at util/virobject.c:265
 #8  0x00007f28ae74ad05 in virNetServerHandleJob (jobOpaque=<optimized out>, opaque=0x7f28aec93ff0) at rpc/virnetserver.c:205
 #9  0x00007f28adbbef4e in virThreadPoolWorker (opaque=opaque@entry=0x7f28aec88030) at util/virthreadpool.c:145

In stack frame #6 the client->identity object got unref'd, but the code
that removes the event callbacks in frame #5 did not run yet as we are
trying to obtain the system identity (frames #4, #3, #2).

In other thead:
 #0  virObjectUnref (anyobj=anyobj@entry=0x7f288c162c60) at util/virobject.c:264
        klass = 0xdeadbeef
        obj = 0x7f288c162c60
 #1  0x00007f28ae71c709 in remoteRelayDomainEventCheckACL (client=<optimized out>, conn=<optimized out>, dom=dom@entry=0x7f28aecaafc0) at remote.c:164
 #2  0x00007f28ae71fc83 in remoteRelayDomainEventTrayChange (conn=<optimized out>, dom=0x7f28aecaafc0, ... ) at remote.c:717
 #3  0x00007f28adc04e53 in virDomainEventDispatchDefaultFunc (conn=0x7f287c0009a0, event=0x7f28aecab1a0, ...) at conf/domain_event.c:1455
 #4  0x00007f28adc03831 in virObjectEventStateDispatchCallbacks (callbacks=<optimized out>, ....) at conf/object_event.c:724
 #5  virObjectEventStateQueueDispatch (callbacks=0x7f288c083730, queue=0x7fff51f90030, state=0x7f288c18da20) at conf/object_event.c:738
 #6  virObjectEventStateFlush (state=0x7f288c18da20) at conf/object_event.c:816
 #7  virObjectEventTimer (timer=<optimized out>, opaque=0x7f288c18da20) at conf/object_event.c:562
 #8  0x00007f28adb859cd in virEventPollDispatchTimeouts () at util/vireventpoll.c:459

Frame #0 is unrefing an invalid identity object while frame #2 hints
that the client is still dispatching the event.

For untrimmed backtrace see the bugzilla attachment.

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

10 years agodaemon: Clear fake domain def object that is used to check ACL prior to use
Peter Krempa [Wed, 25 Mar 2015 07:52:26 +0000 (08:52 +0100)]
daemon: Clear fake domain def object that is used to check ACL prior to use

The fake object is used to pass the domain name and UUID to the ACL code
for events where we don't have the full domain def when dispatching
events. The rest of the entries would be left uninitialized. While this
is not a problem code-wise as the used fields are initialized it looks
ugly in the debugger.

10 years agoutil: identity: Harden virIdentitySetCurrent()
Peter Krempa [Wed, 25 Mar 2015 07:25:45 +0000 (08:25 +0100)]
util: identity: Harden virIdentitySetCurrent()

Don't unref the old identity unless we set the new one correctly and
unref the new one on failure to set it so that we don't leak any
references or use invalid pointers.

10 years agotests: qemuxml2xml: Refactor the qemuxml2xml test
Peter Krempa [Mon, 23 Mar 2015 16:24:43 +0000 (17:24 +0100)]
tests: qemuxml2xml: Refactor the qemuxml2xml test

To allow adding more tests, refactor the XML-2-XML test so that the
files are not reloaded always and clarify the control flow.

Result of this changes is that the active and inactive portions of the
XML are tested in separate steps rather than one test step.

10 years agoqemu: domain: Don't leak device alias list
Peter Krempa [Tue, 24 Mar 2015 13:52:11 +0000 (14:52 +0100)]
qemu: domain: Don't leak device alias list

While adding tests for status XML parsing and formatting I've noticed
that the device alias list is leaked.

==763001== 81 (48 direct, 33 indirect) bytes in 1 blocks are definitely lost in loss record 414 of 514
==763001==    at 0x4C2B8F0: calloc (vg_replace_malloc.c:623)
==763001==    by 0x6ACF70F: virAllocN (viralloc.c:191)
==763001==    by 0x447B64: qemuDomainObjPrivateXMLParse (qemu_domain.c:727)
==763001==    by 0x6B848F9: virDomainObjParseXML (domain_conf.c:15491)
==763001==    by 0x6B84CAC: virDomainObjParseNode (domain_conf.c:15608)

10 years agoqemucaps2xmltest: fix test to successfully run without kvm support
Pavel Hrdina [Wed, 25 Mar 2015 09:40:57 +0000 (10:40 +0100)]
qemucaps2xmltest: fix test to successfully run without kvm support

Function virQEMUCapsInitGuestFromBinary detect kvm support by testing
whether /dev/kvm exists or whether we pass path to kvmbin.  Provide the
path we are testing via kvmbin for testing purpose instead of detecting
presence of /dev/kvm to successfully run the tests on all hosts.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agoqemu: Report better error when memory device source has wrong NUMA node
Luyao Huang [Wed, 25 Mar 2015 06:34:04 +0000 (14:34 +0800)]
qemu: Report better error when memory device source has wrong NUMA node

When starting a VM with hotpluggable memory devices the user may specify
an invalid source NUMA node. Libvirt would pass through the error from
qemu:

 # virsh start test3
 error: Failed to start domain test3
 error: internal error: process exited while connecting to monitor:
 2015-03-25T01:12:17.205913Z qemu-kvm: -object memory-backend-ram,id=memdimm0
 ,size=536870912,host-nodes=1-3,policy=bind: cannot bind memory to host NUMA nodes:
 Invalid argument

This patch adds a check that allows to report better error:

 # virsh start test3
 error: Failed to start domain test3
 error: configuration unsupported: NUMA node 1 is unavailable

Signed-off-by: Luyao Huang <lhuang@redhat.com>
10 years agoutil: NUMA: Change error code in virNumaNodesetIsAvailable()
Peter Krempa [Wed, 25 Mar 2015 09:05:58 +0000 (10:05 +0100)]
util: NUMA: Change error code in virNumaNodesetIsAvailable()

An invalid nodeset is a configuration problem rather than an internal
error.

10 years agoconf: Add missing apostrophe to error message
Luyao Huang [Tue, 24 Mar 2015 14:12:37 +0000 (22:12 +0800)]
conf: Add missing apostrophe to error message

Signed-off-by: Luyao Huang <lhuang@redhat.com>
10 years agoMakefile: fix typo
Pavel Hrdina [Wed, 25 Mar 2015 10:30:38 +0000 (11:30 +0100)]
Makefile: fix typo

Commit 95695388 introduced new util/virthreadjob.c/h files but the
makefile has type that breaks rpm build.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
10 years agodocs: route element must specify network address
Chen Fan [Wed, 25 Mar 2015 03:48:04 +0000 (11:48 +0800)]
docs: route element must specify network address

because network address is required by route, so
here we should add one avoid user misunderstand.

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
10 years agodocs: no 'via' attribute in route element
Chen Fan [Wed, 25 Mar 2015 03:48:03 +0000 (11:48 +0800)]
docs: no 'via' attribute in route element

via -> gateway

Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
10 years agoqemu: Add timing to domain jobs
Jiri Denemark [Mon, 23 Mar 2015 11:46:45 +0000 (12:46 +0100)]
qemu: Add timing to domain jobs

Whenever we fail to acquire a job, we can report how long ago it was
locked by another API.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agoqemu: Track the API which started the current job
Jiri Denemark [Mon, 16 Mar 2015 17:18:46 +0000 (18:18 +0100)]
qemu: Track the API which started the current job

This is very helpful when we want to log and report why we could not
acquire a state change lock. Reporting what job keeps it locked helps
with understanding the issue. Moreover, after calling
virDomainGetControlInfo, it's possible to tell whether libvirt is just
stuck somewhere within the API (or it just forgot to cleanup the job) or
whether libvirt is waiting for QEMU to reply.

The error message will look like the following:

    # virsh resume cd
    error: Failed to resume domain cd
    error: Timed out during operation: cannot acquire state change lock
    (held by remoteDispatchDomainSuspend)

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agoSet thread job for every RPC call
Jiri Denemark [Wed, 11 Mar 2015 12:58:42 +0000 (13:58 +0100)]
Set thread job for every RPC call

Since all APIs are also RPC calls, we automatically get all APIs covered
with thread jobs.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agovirThreadPool: Set thread worker name
Jiri Denemark [Fri, 20 Mar 2015 16:44:25 +0000 (17:44 +0100)]
virThreadPool: Set thread worker name

Every thread created as a worker thread within a pool gets a name
according to virThreadPoolJobFunc name.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agovirThread: Set thread job
Jiri Denemark [Fri, 20 Mar 2015 16:43:55 +0000 (17:43 +0100)]
virThread: Set thread job

Automatically assign a job to every thread created by virThreadCreate.
The name of the virThreadFunc function passed to virThreadCreate is used
as the job or worker name in case no name is explicitly passed.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agoForce usage of virThreadCreate
Jiri Denemark [Fri, 20 Mar 2015 15:25:15 +0000 (16:25 +0100)]
Force usage of virThreadCreate

We want all threads to be set as workers or to have a job assigned to
them, which can easily be achieved in virThreadCreate wrapper to
pthread_create. Let's make sure we always use the wrapper.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agoAdd support for tracking thread jobs
Jiri Denemark [Mon, 8 Jul 2013 10:27:34 +0000 (12:27 +0200)]
Add support for tracking thread jobs

Each thread can use a thread local variable to keep the name of a job
which is currently running in the job.

The virThreadJobSetWorker API is supposed to be called once by any
thread which is used as a worker, i.e., it is waiting in a pool, woken
up to do a job, and returned back to the pool.

The virThreadJobSet/virThreadJobClear APIs are to be called at the
beginning/end of each job.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
10 years agoPOTFILES.in: Sort
Jiri Denemark [Wed, 11 Mar 2015 09:24:09 +0000 (10:24 +0100)]
POTFILES.in: Sort

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>