]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
9 years agoqemu: Use heads parameter for QXL driver
Frediano Ziglio [Fri, 17 Jul 2015 08:29:44 +0000 (09:29 +0100)]
qemu: Use heads parameter for QXL driver

Allows to specify maximum number of head to QXL driver.

Actually can be a compatiblity problem as heads in the XML configuration
was set by default to '1'.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
9 years agostorage: Fix pool building when directory already exists
Christophe Fergeau [Fri, 17 Jul 2015 08:02:20 +0000 (10:02 +0200)]
storage: Fix pool building when directory already exists

Currently, when trying to virsh pool-define/virsh pool-build a new
'dir' pool, if the target directory already exists, virsh
pool-build/virStoragePoolBuild will error out. This is a change of
behaviour compared to eg libvirt 1.2.13

This is caused by the wrong type being used for the dir_create_flags
variable in virStorageBackendFileSystemBuild , it's defined as a bool
but is used as a flag bit field so should be unsigned int (this matches
the type virDirCreate expects for this variable).

This should fix https://bugzilla.gnome.org/show_bug.cgi?id=752417 (GNOME
Boxes) and https://bugzilla.redhat.com/show_bug.cgi?id=1244080
(downstream virt-manager).

9 years agorpc: ensure daemon is spawn even if dead socket exists
Daniel P. Berrange [Fri, 3 Jul 2015 15:51:56 +0000 (16:51 +0100)]
rpc: ensure daemon is spawn even if dead socket exists

The auto-spawn code would originally attempt to spawn the
daemon for both ENOENT and ECONNREFUSED errors from connect().
The various refactorings eventually lost this so we only
spawn the daemon on ENOENT. The result is if the daemon exits
uncleanly, so that the socket is left in the filesystem, we
will never be able to auto-spawn the daemon again.

9 years agoviraccessperm.h: Fix some typos
Michal Privoznik [Fri, 17 Jul 2015 07:41:31 +0000 (09:41 +0200)]
viraccessperm.h: Fix some typos

Like s/authoriation/authorization/ and s/requries/requires/

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agodocs: Document how libvirt handles companion controllers
Martin Kletzander [Mon, 13 Jul 2015 13:51:25 +0000 (15:51 +0200)]
docs: Document how libvirt handles companion controllers

The information on companion controllers we give in our documentation is
rather sparse.  For example, it looks like any controller can be used as
a companion one.  Also, when using ich9-uhci2, for example, we are able
to set some sensible defaults, but it might get confusing for the user
as we don't do that for all controller models.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agorbd: Return error from rbd_create for message processing
John Ferlan [Thu, 16 Jul 2015 16:28:58 +0000 (12:28 -0400)]
rbd: Return error from rbd_create for message processing

Resolving an error reporting bug introduced by commit id '761491e' which
just took the return of virStorageBackendRBDCreateImage and used it as
the basis for the message generated. This would generate EPERM regardless
of error seen.

9 years agorbd: Use RBD format 2 by default when creating images.
Wido den Hollander [Tue, 14 Jul 2015 08:15:26 +0000 (10:15 +0200)]
rbd: Use RBD format 2 by default when creating images.

We used to look at the librbd code version and depending on that
we would invoke rbd_create3() or rbd_create().

Since librbd version 0.67.9 we can however tell RBD that it should
create rbd format 2 images even if we invoke rbd_create().

The less options we pass to librbd, the more we can lean on the sane
defaults it uses.

For rbd_create3() we had things like the stripe count and unit hardcoded
in libvirt and that might cause problems down the road.

Signed-off-by: Wido den Hollander <wido@widodh.nl>
9 years agovirsh: Don't output node frequency if unknown
Martin Kletzander [Fri, 10 Jul 2015 09:05:07 +0000 (11:05 +0200)]
virsh: Don't output node frequency if unknown

Commit ed8155eafbff5c5ca0bdfe84a8388f58b718c2f9 documented that
mhz field in virNodeInfo might be 0 if the frequency is unknown.  Modify
virsh to know about that.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoqemu: Test for virtio-9p-ccw support
Boris Fiuczynski [Tue, 7 Jul 2015 15:30:43 +0000 (17:30 +0200)]
qemu: Test for virtio-9p-ccw support

This patch adds a test for the qemu command line generation.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Jason J. Herne <jjherne@us.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
9 years agoqemu: Make virtio-9p-ccw the default for s390-ccw-virtio machines
Boris Fiuczynski [Tue, 7 Jul 2015 15:30:42 +0000 (17:30 +0200)]
qemu: Make virtio-9p-ccw the default for s390-ccw-virtio machines

For s390-ccw-virtio machines the default bus type is set to ccw.
Specifing an address element allows to override the default.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Jason J. Herne <jjherne@us.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
9 years agoqemu: Support for virtio-9p-ccw
Boris Fiuczynski [Tue, 7 Jul 2015 15:30:41 +0000 (17:30 +0200)]
qemu: Support for virtio-9p-ccw

Adding the recently in qemu added 9pfs support for virtio-ccw.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Jason J. Herne <jjherne@us.ibm.com>
Reviewed-by: Stefan Zimmermann <stzi@linux.vnet.ibm.com>
9 years agodaemonRunStateInit: Fix a typo on a comment
Michal Privoznik [Wed, 15 Jul 2015 12:25:30 +0000 (14:25 +0200)]
daemonRunStateInit: Fix a typo on a comment

s/priviledged/privileged/

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agovirsh: Teach cmdFreepages to work with lxc driver
Michal Privoznik [Thu, 2 Jul 2015 08:21:50 +0000 (10:21 +0200)]
virsh: Teach cmdFreepages to work with lxc driver

Some drivers don't expose available huge page sizes in the
capabilities XML. For instance, LXC driver is one of those.
This has a downside that when virsh is trying to get
aggregated info on free pages per all NUMA nodes, it fails.
The problem is that the virNodeGetFreePages() API expects
caller to pass an array of page sizes he is interested in.
In virsh, this array is filled from the capabilities from
'/capabilities/host/cpu/pages' XPath. As said, in LXC
there's no such XPath and therefore virsh fails currently.
But hey, we can fallback: the page sizes are exposed under
'/capabilities/host/topology/cells/cell/pages'. The page
size can be collected from there, and voilà the command
works again. But now we must make sure that there are no
duplicates in the array passed to the public API. Otherwise
we won't get as beautiful output as we are getting now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agocmdVcpuPin: Remove dead code
Michal Privoznik [Tue, 14 Jul 2015 14:23:26 +0000 (16:23 +0200)]
cmdVcpuPin: Remove dead code

There's this condition:

flags & VIR_DOMAIN_AFFECT_CURRENT && virDomainIsActive(dom)

which can never be true since VIR_DOMAIN_AFFECT_CURRENT has hardcoded
value of zero. Therefore virDomainIsActive() is a dead code. However,
the condition could make sense if it is rewritten as the following:

!(flags & VIR_DOMAIN_AFFECT_CONFIG) && virDomainIsActive(dom)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemuMigrationRun: Don't leak @fd
Michal Privoznik [Tue, 14 Jul 2015 13:42:50 +0000 (15:42 +0200)]
qemuMigrationRun: Don't leak @fd

If we are migrating to an UNIX socket, we accept() a connection
from qemu and use that FD to set up a tunnel. However, the FD is
not closed as often as it should be.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agolxc: wait for nbd device to be up to get its PIDs
Cédric Bosdonnat [Wed, 15 Jul 2015 08:13:21 +0000 (10:13 +0200)]
lxc: wait for nbd device to be up to get its PIDs

The nbd device pid file doesn't appear immediately after starting
qemu-nbd: adding a small loop to wait for it before getting it's
processes PIDs.

9 years agoFix qemu-nbd cleanup crashes
Cédric Bosdonnat [Wed, 15 Jul 2015 07:58:18 +0000 (09:58 +0200)]
Fix qemu-nbd cleanup crashes

The virLXCControllerAppendNBDPids function didn't properly initialize
pids and npids. In case of failure it was crashing when freeing those.

9 years agonodeinfo: Formatting changes
Andrea Bolognani [Tue, 14 Jul 2015 09:40:14 +0000 (11:40 +0200)]
nodeinfo: Formatting changes

9 years agonodeinfo: Make sysfs_prefix usage more consistent
Andrea Bolognani [Tue, 14 Jul 2015 09:40:13 +0000 (11:40 +0200)]
nodeinfo: Make sysfs_prefix usage more consistent

Make sure sysfs_prefix, when present, is always the first argument
to a function; don't use a different name to refer to it; check
whether it is NULL, and hence SYSFS_SYSTEM_PATH should be used, only
when using it directly and not just passing it down to another
function; always pass down the same value we've been passed when
calling another function.

9 years agoqemu: process: Improve update of maximum balloon state at startup
Peter Krempa [Tue, 30 Jun 2015 14:31:24 +0000 (16:31 +0200)]
qemu: process: Improve update of maximum balloon state at startup

In commit 641a145d73fdc3dd9350fd57b3d3247abf101c05 I've added code that
resets the balloon memory value to full size prior to resuming the vCPUs
since the size certainly was not reduced at that point.

Since qemuProcessStart is used also in code paths with already booted
up guests (migration, save/restore) the assumption is not entirely true
since the guest might already been running before.

This patch adds a function that queries the monitor rather than using
the full size since a balloon event would not be reissued in case we are
recovering a saved migration state.

Additionally the new function is used also when reconnecting to a VM
after libvirtd restart since we might have missed a few balloon events
while libvirtd was not running.

9 years agoqemuDomainSetNumaParamsLive: Check for NUMA mode more wisely
Michal Privoznik [Mon, 13 Jul 2015 16:11:33 +0000 (18:11 +0200)]
qemuDomainSetNumaParamsLive: Check for NUMA mode more wisely

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

In one of my previous ptaches (bcd9a564) I've tried to fix the problem
that we blindly assumed strict NUMA mode for guests. This led to
several problems like us pinning a domain onto a nodeset via libnuma
among with CGroups. Once the nodeset was changed by user, well, it did
not result in desired effect. See the original commit for more info.
But, the commit I wrote had a bug: when NUMA parameters are changed on
a running domain we require domain to be strictly pinned onto a
nodeset. Due to a typo a condition was mis-evaluated.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agonetwork: Add another collision check into networkCheckRouteCollision
Martin Kletzander [Thu, 9 Jul 2015 13:53:25 +0000 (15:53 +0200)]
network: Add another collision check into networkCheckRouteCollision

The comment above that function says: "This function can be a lot more
exhaustive, ...", so let's be.

Check for collisions between routes in the system and static routes
being added explicitly from the <route/> element of the network XML.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoconf: Add getter for network routes
Martin Kletzander [Thu, 9 Jul 2015 13:50:41 +0000 (15:50 +0200)]
conf: Add getter for network routes

Add virNetworkDefGetRouteByIndex() similarly to
virNetworkDefGetIpByIndex(), but for routes.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agotests: Add nodeinfo test for non-present CPUs
Andrea Bolognani [Mon, 13 Jul 2015 16:37:37 +0000 (18:37 +0200)]
tests: Add nodeinfo test for non-present CPUs

Some of the possible CPUs in a system might not be present, eg. they
might be defective or might have been deconfigured from the ASM console
in a Power system. Due to this fact, Linux keeps track of what CPUs are
possible and what are present separately.

This test uses the data from a system where not all the possible CPUs
are present to make sure libvirt handles this situation correctly.

9 years agonodeinfo: fix to parse present cpus rather than possible cpus
Kothapally Madhu Pavan [Fri, 26 Jun 2015 22:27:29 +0000 (03:57 +0530)]
nodeinfo: fix to parse present cpus rather than possible cpus

This patch resolves a situation where a core is defective and is not
in the present mask during boot. Optionally a host can have empty sockets
could be brought online if the socket is added. In this case the present
mask contains the cpu's that are actually there in the sockets even though
they might be offline for some reason. This patch excludes the cpu's that
are offline because the socket is defective/empty by checking the present
mask before reading the cpu directory. Otherwise, the nodeinfo on such
hosts always displays wrong output which includes the defective/empty
sockets as set of offline cpu's.

Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
9 years agonodeinfo: Add sysfs_prefix to nodeGetMemoryStats
John Ferlan [Tue, 7 Jul 2015 21:37:36 +0000 (17:37 -0400)]
nodeinfo: Add sysfs_prefix to nodeGetMemoryStats

Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_SYSTEM_PATH.

9 years agonodeinfo: Add sysfs_prefix to nodeCapsInitNUMA
John Ferlan [Tue, 7 Jul 2015 21:22:28 +0000 (17:22 -0400)]
nodeinfo: Add sysfs_prefix to nodeCapsInitNUMA

Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_CPU_PATH which is a
derivative of SYSFS_SYSTEM_PATH

Use cpupath for nodeCapsInitNUMAFake and remove SYSFS_CPU_PATH

9 years agonodeinfo: Add sysfs_prefix to nodeGetInfo
John Ferlan [Tue, 7 Jul 2015 11:27:53 +0000 (07:27 -0400)]
nodeinfo: Add sysfs_prefix to nodeGetInfo

Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_SYSTEM_PATH.

9 years agonodeinfo: Add sysfs_prefix to nodeGetCPUMap
John Ferlan [Mon, 6 Jul 2015 21:49:04 +0000 (17:49 -0400)]
nodeinfo: Add sysfs_prefix to nodeGetCPUMap

Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_SYSTEM_PATH.

9 years agonodeinfo: Add sysfs_prefix to nodeGetCPUBitmap
John Ferlan [Tue, 7 Jul 2015 23:26:52 +0000 (19:26 -0400)]
nodeinfo: Add sysfs_prefix to nodeGetCPUBitmap

Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_SYSTEM_PATH.

9 years agonodeinfo: Add sysfs_prefix to nodeGetPresentCPUBitmap
John Ferlan [Mon, 6 Jul 2015 20:31:36 +0000 (16:31 -0400)]
nodeinfo: Add sysfs_prefix to nodeGetPresentCPUBitmap

Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_SYSTEM_PATH.

9 years agonodeinfo: Add sysfs_prefix to nodeGetCPUCount
John Ferlan [Tue, 7 Jul 2015 23:49:10 +0000 (19:49 -0400)]
nodeinfo: Add sysfs_prefix to nodeGetCPUCount

Add the sysfs_prefix argument to the call to allow for setting the
path for tests to something other than SYSFS_SYSTEM_PATH.

9 years agonodeinfo: Introduce local linuxGetCPUPresentPath
John Ferlan [Mon, 6 Jul 2015 21:03:51 +0000 (17:03 -0400)]
nodeinfo: Introduce local linuxGetCPUPresentPath

The API will print the path to the /cpu/present file using the sysfs_prefix.

NB: This is setup for future patches which will allow local/test sysfs paths.

9 years agovirt-driver-vz: Require parallels-7.0.22 at least
Michal Privoznik [Fri, 10 Jul 2015 14:32:00 +0000 (17:32 +0300)]
virt-driver-vz: Require parallels-7.0.22 at least

With the latest patch to the vz driver (7d73ca06cefe) I was
getting some compilation errors. It turned out, my installation
of the parallels SDK was not as fresh as it could be. Parallels
installed in my system were missing the
PRL_USE_VNET_NAME_FOR_BRIDGE_NAME symbol which simply was not
introduced at the time I was installing the SDK. The symbol was
introduced in 86e62a5d which was then part of the 7.0.22 release.
Require that version at least therefore.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoconfigure: Move Virtuozzo checks to a specific module
Michal Privoznik [Fri, 10 Jul 2015 14:32:00 +0000 (17:32 +0300)]
configure: Move Virtuozzo checks to a specific module

Eventually, every driver will be moved to a special module.
But for today the winner is Virtuozzo driver.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemuProcessHandleMigrationStatus: Update migration status more frequently
Michal Privoznik [Mon, 13 Jul 2015 12:15:03 +0000 (14:15 +0200)]
qemuProcessHandleMigrationStatus: Update migration status more frequently

After Jirka's migration patches libvirt is listening on migration
events from qemu instead of actively polling on the monitor. There is,
however, a little regression (introduced in 6d2edb6a42d0d41). The
problem is, the current status of migration job is updated in
qemuProcessHandleMigrationStatus if and only if migration job was
started. But eventually every asynchronous job may result in
migration. Therefore, since this job is not strictly a
migration job, internal state was not updated and later checks failed:

  virsh # save fedora22 /tmp/fedora22_ble.save
  error: Failed to save domain fedora22 to /tmp/fedora22_ble.save
  error: operation failed: domain save job: is not active

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agolibxl: set dom0 state to running
Jim Fehlig [Thu, 9 Jul 2015 21:16:18 +0000 (15:16 -0600)]
libxl: set dom0 state to running

Commit 45697fe5 added dom0 to driver->domains, but missed
setting its state to 'running'

$ virsh list
 Id    Name                           State
----------------------------------------------------
 0     Domain-0                       shut off

9 years agovz: fix cleanup of nets of bridged type
Dmitry Guryanov [Thu, 9 Jul 2015 16:20:00 +0000 (19:20 +0300)]
vz: fix cleanup of nets of bridged type

We create a virtual network of special type, which
has the same name as bridge name to create bridged
network adapter in vz. So when we delete such an
adapter we have to remove corresponding virtual
network.

So let's rename prlsdkDelNet to prlsdkCleanupBridgedNet
and don't check for return value.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
9 years agoqemu: Use error from Finish instead of "unexpectedly failed"
Jiri Denemark [Thu, 2 Jul 2015 19:46:56 +0000 (21:46 +0200)]
qemu: Use error from Finish instead of "unexpectedly failed"

When QEMU exits on destination during migration, the source reports
either success (if the failure happened at the very end) or unhelpful
"unexpectedly failed" error message. However, the Finish API called on
the destination may report a real error so let's use it instead of the
generic one.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Don't report false error from MigrateFinish
Jiri Denemark [Thu, 2 Jul 2015 20:32:54 +0000 (22:32 +0200)]
qemu: Don't report false error from MigrateFinish

virDomainMigrateFinish* APIs were unfortunately designed to return the
pointer to the domain on destination and NULL on error. This looks OK in
normal cases but the same API is also called when we know migration
failed and thus we expect Finish to return NULL even if it actually did
all it was supposed to do without any error. The call is defined to
return nonnull domain pointer over RPC, which means returning NULL will
always result in an error being send. If this was not in fact an error,
the API itself wouldn't set anything to the thread local virError, which
makes the RPC layer come up with it's own "Library function returned
error but did not set virError" error.

This is quite confusing and also hard to detect by the caller. This
patch adds a special error code which can be used to check that Finish
successfully aborted migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Remember incoming migration errors
Jiri Denemark [Thu, 2 Jul 2015 06:26:48 +0000 (08:26 +0200)]
qemu: Remember incoming migration errors

If QEMU fails during incoming migration, the domain disappears including
a possibly useful error message read from QEMU log file. Let's remember
the error in virQEMUDriver so that Finish can report more than just "no
such domain".

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoIntroduce virErrorCopyNew
Jiri Denemark [Fri, 10 Jul 2015 06:44:41 +0000 (08:44 +0200)]
Introduce virErrorCopyNew

A helper function for copying error objects.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoIntroduce virHashAtomic
Jiri Denemark [Thu, 2 Jul 2015 12:21:27 +0000 (14:21 +0200)]
Introduce virHashAtomic

This is a self-locking wrapper around virHashTable. Only a limited set
of APIs are implemented now (the ones which are used in the following
patch) as more can be added on demand.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agocpu: Add support for MPX and AVX512 Intel features
Jiri Denemark [Thu, 9 Jul 2015 07:47:34 +0000 (09:47 +0200)]
cpu: Add support for MPX and AVX512 Intel features

Corresponding QEMU commits:
    MPX     79e9ebebbf2a00c46fcedb6dc7dd5e12bbd30216
    AVX512  9aecd6f8aef653cea58932f06a2740299dbe5fd3

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agovirt-aa-helper: add DomainGuest to mockup caps
Cédric Bosdonnat [Thu, 25 Jun 2015 14:08:42 +0000 (16:08 +0200)]
virt-aa-helper: add DomainGuest to mockup caps

With commit 3f9868a virt-aa-helper stopped working due to missing
DomainGuest in the caps.

The test with -c without arch also needs to be
removed since the new capabilities code uses the host arch when none is
provided.

9 years agovirt-aa-helper: rename ctl->hvm to ctl->os
Cédric Bosdonnat [Thu, 25 Jun 2015 11:01:40 +0000 (13:01 +0200)]
virt-aa-helper: rename ctl->hvm to ctl->os

ctl->hvm contains os.type string value, change the name to reflect it.

9 years agoGet more libvirt errors from virt-aa-helper
Cédric Bosdonnat [Thu, 25 Jun 2015 08:36:52 +0000 (10:36 +0200)]
Get more libvirt errors from virt-aa-helper

Initializing libvirt log in virt-aa-helper and getting it to output
libvirt log to stderr. This will help debugging problems happening in
libvirt functions called from within virt-aa-helper

9 years agovirt-aa-helper: fix rules for paths with trailing slash
Cédric Bosdonnat [Wed, 24 Jun 2015 07:56:04 +0000 (09:56 +0200)]
virt-aa-helper: fix rules for paths with trailing slash

Rules generated for a path like '/' were having '//' which isn't
correct for apparmor. Make virt-aa-helper smarter to avoid these.

9 years agorpc: Rework timerActive logic in daemon
Martin Kletzander [Fri, 10 Jul 2015 08:35:31 +0000 (10:35 +0200)]
rpc: Rework timerActive logic in daemon

Daemon used false logic for determining whether there were any clients.
When the timer was inactive, it was activated if at least one of the
servers did not have clients.  So the bool was being flipped there and
back all the time in case there was one client, for example.

Initially introduced by fa1420736882.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agorpc: Add virNetDaemonHasClients
Martin Kletzander [Fri, 10 Jul 2015 08:34:52 +0000 (10:34 +0200)]
rpc: Add virNetDaemonHasClients

So callers don't have to iterate over each server.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
9 years agoqemu: Check duplicate WWNs also for hotplugged disks
Peter Krempa [Wed, 8 Jul 2015 14:10:05 +0000 (16:10 +0200)]
qemu: Check duplicate WWNs also for hotplugged disks

In commit 714b38cb232bcbbd7487af4c058fa6d0999b3326 I tried to avoid
having two disks with the same WWN in a VM. I forgot to check the
hotplug paths though which make it possible bypass that check. Reinforce
the fix by checking the wwn when attaching the disk.

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

9 years agoFix cloning of raw, sparse volumes
Prerna Saxena [Fri, 26 Jun 2015 11:43:26 +0000 (17:13 +0530)]
Fix cloning of raw, sparse volumes

When virsh vol-clone is attempted on a raw file where capacity > allocation,
the resulting cloned volume has a size that matches the virtual-size of
the parent; in place of matching its actual, disk size.
This patch fixes the cloned disk to have same _allocated_size_ as
the parent file from which it was cloned.

Ref: http://www.redhat.com/archives/libvir-list/2015-May/msg00050.html

Also fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1130739

Signed-off-by: Prerna Saxena <prerna@linux.vnet.ibm.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
9 years agoRewrite allocation tracking when cloning volumes
Ján Tomko [Fri, 3 Jul 2015 10:47:02 +0000 (12:47 +0200)]
Rewrite allocation tracking when cloning volumes

Instead of storing the remaining bytes, store the position of the first
unallocated byte. This will allow changing the amount of bytes copied
by virStorageBackendCopyToFD without changing the safezero call.

No functional impact.

9 years agoqemu: Drop LFs at the end of error from QEMU log
Jiri Denemark [Fri, 3 Jul 2015 17:35:06 +0000 (19:35 +0200)]
qemu: Drop LFs at the end of error from QEMU log

Libvirt's error messages do not end with a LF. However, when reading the
error from QEMU log, we would read the LF from the log and keep it in
the message.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Log all arguments of qemuProcessStart
Jiri Denemark [Tue, 30 Jun 2015 13:25:06 +0000 (15:25 +0200)]
qemu: Log all arguments of qemuProcessStart

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Wait for migration events on domain condition
Jiri Denemark [Fri, 29 May 2015 06:38:44 +0000 (08:38 +0200)]
qemu: Wait for migration events on domain condition

Since we already support the MIGRATION event, we just need to make sure
the domain condition is signalled whenever a p2p connection drops or the
domain is paused due to IO error and we can avoid waking up every 50 ms
to check whether something happened.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Update migration state according to MIGRATION event
Jiri Denemark [Fri, 29 May 2015 06:37:59 +0000 (08:37 +0200)]
qemu: Update migration state according to MIGRATION event

We don't need to call query-migrate every 50ms when we get the current
migration state via MIGRATION event.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemuDomainGetJobStatsInternal: Support migration events
Jiri Denemark [Tue, 26 May 2015 11:42:06 +0000 (13:42 +0200)]
qemuDomainGetJobStatsInternal: Support migration events

When QEMU supports migration events the qemuDomainJobInfo structure will
no longer be updated with migration statistics. We have to enter a job
and explicitly ask QEMU every time virDomainGetJob{Info,Stats} is
called.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: Enable migration events on QMP monitor
Jiri Denemark [Tue, 7 Jul 2015 16:17:25 +0000 (18:17 +0200)]
qemu: Enable migration events on QMP monitor

Even if QEMU supports migration events it doesn't send them by default.
We have to enable them by calling migrate-set-capabilities. Let's enable
migration events everytime we can and clear QEMU_CAPS_MIGRATION_EVENT in
case migrate-set-capabilities does not support events.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu_monitor: Wire up MIGRATION event
Jiri Denemark [Thu, 28 May 2015 11:35:52 +0000 (13:35 +0200)]
qemu_monitor: Wire up MIGRATION event

Thanks to Juan's work QEMU finally emits an event whenever migration
state changes.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9 years agoqemu: don't use initialized ret in qemuRemoveSharedDevice
Guido Günther [Thu, 9 Jul 2015 17:08:49 +0000 (19:08 +0200)]
qemu: don't use initialized ret in qemuRemoveSharedDevice

This fixes

  CC     qemu/libvirt_driver_qemu_impl_la-qemu_conf.lo
  qemu/qemu_conf.c: In function 'qemuRemoveSharedDevice':
  qemu/qemu_conf.c:1384:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]

9 years agoqemu_hotplug: try harder to eject media
Pavel Hrdina [Mon, 29 Jun 2015 14:19:44 +0000 (16:19 +0200)]
qemu_hotplug: try harder to eject media

Some guests lock the tray and QEMU eject command will simply fail to
eject the media.  But the guest OS can handle this attempt to eject the
media and can unlock the tray and open it. In this case, we should try
again to actually eject the media.

If the first attempt fails to detect a tray_open we will fail with
error, from monitor.  If we receive that event, we know, that the guest
properly reacted to the eject request, unlocked the tray and opened it.
In this case, we need to run the command again to actually eject the
media from the device.  The reason to call it again is, that QEMU
doesn't wait for the guest to react and report an error, that the tray
is locked.

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

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agomonitor: detect that eject fails because the tray is locked
Pavel Hrdina [Mon, 29 Jun 2015 14:18:53 +0000 (16:18 +0200)]
monitor: detect that eject fails because the tray is locked

Modify the eject monitor functions to parse the return code and detect,
whether the error contains "is locked" to report this type of failure to
upper layers.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agovirDomainObjSignal: drop this function
Pavel Hrdina [Mon, 29 Jun 2015 14:28:35 +0000 (16:28 +0200)]
virDomainObjSignal: drop this function

There are multiple consumers for the domain condition and we should
always wake them all.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agovirCondWaitUntil: add another return value
Pavel Hrdina [Mon, 29 Jun 2015 14:10:36 +0000 (16:10 +0200)]
virCondWaitUntil: add another return value

We should distinguish between success and timeout, to let the user
handle those two events differently.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agoqemu: report error for non-existing disk in blockjobinfo
Luyao Huang [Thu, 9 Jul 2015 03:49:15 +0000 (11:49 +0800)]
qemu: report error for non-existing disk in blockjobinfo

Before:

 # virsh blockjob r7 vdc
 error: An error occurred, but the cause is unknown

After:

 # virsh blockjob r7 vdc
 error: Disk 'vdc' not found in the domain

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: Don't allow duplicated target names regardless of bus
John Ferlan [Thu, 18 Jun 2015 20:00:53 +0000 (16:00 -0400)]
conf: Don't allow duplicated target names regardless of bus

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

Commit id 'e0e290552' added a check to determine if the same bus
had the same target value.  It seems that's not quite good enough
as the check should check the target name value regardless of bus type.

Also added a DO_TEST_DIFFERENT to exhibit the issue

9 years agostorage: Revert volume obj list updating after volume creation (4749d82a)
Erik Skultety [Thu, 9 Jul 2015 09:17:12 +0000 (11:17 +0200)]
storage: Revert volume obj list updating after volume creation (4749d82a)

This patch reverts commit 4749d82a which tried to tweak the logic in
volume creation. We did realloc and update our object list before we executed
volume building within a specific storage backend. If that failed, we
had to update (again) our object list to the original state as it was before the
build and delete the volume from the pool (even though it didn't exist - this
truly depends on the backend).
I misunderstood the base idea to be able to poll the status of the volume
creation using vol-info. After commit 4749d82a this wasn't possible
anymore, although no BZ has been reported yet.

Commit 4749d82a also claimed to fix
https://bugzilla.redhat.com/show_bug.cgi?id=1223177, but commit c8be606b of the
same series as 4749d82ad (which was more of a refactor than a fix)
fixes the same issue so the revert should be pretty straightforward.
Further more, BZ https://bugzilla.redhat.com/show_bug.cgi?id=1241454 can be
fixed with this revert.

9 years agoqemu: Fix integer/boolean logic in qemuSetUnprivSGIO
John Ferlan [Mon, 6 Jul 2015 15:00:13 +0000 (11:00 -0400)]
qemu: Fix integer/boolean logic in qemuSetUnprivSGIO

Setting of 'val' is a boolean expression, so handle it that way and
adjust the check/return logic to be clearer

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: Refactor qemuSetUnprivSGIO return values
John Ferlan [Mon, 6 Jul 2015 14:33:04 +0000 (10:33 -0400)]
qemu: Refactor qemuSetUnprivSGIO return values

Set to ret = -1 and prove otherwise, like usual

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: Inline qemuGetHostdevPath
John Ferlan [Tue, 16 Jun 2015 15:34:06 +0000 (11:34 -0400)]
qemu: Inline qemuGetHostdevPath

Since a future patch will need the device path generated when adding a
shared host device, remove the qemuAddSharedHostdev and inline the two
calls into qemuAddSharedHostdev and qemuRemoveSharedHostdev

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: Refactor qemuCheckSharedDisk to create qemuCheckUnprivSGIO
John Ferlan [Mon, 6 Jul 2015 17:08:32 +0000 (13:08 -0400)]
qemu: Refactor qemuCheckSharedDisk to create qemuCheckUnprivSGIO

Split out the current function in order to share the code with hostdev
in a future patch. Failure to match the expected sgio value against what
is stored will cause an error which the caller would need to handle since
only the caller has the disk (or eventually hostdev) specific data in
order to uniquely identify the disk in an error message.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agolibxl: rework setting the state of virDomainObj
Jim Fehlig [Tue, 7 Jul 2015 18:29:24 +0000 (12:29 -0600)]
libxl: rework setting the state of virDomainObj

Set the state of virDomainObj in the functions that
actually change the domain state, instead of the generic
libxlDomainCleanup function. This approach gives functions
calling libxlDomainCleanup more flexibility wrt when and
how they change virDomainObj state via virDomainObjSetState.

The prior approach of calling virDomainObjSetState in
libxlDomainCleanup resulted in the following incorrect
coding pattern in the various functions that change
domain state

 libxlDomain<DoStateTransition>
   call libxl function to do state transition
   emit lifecycle event
   libxlDomainCleanup
     virDomainObjSetState

Once simple manifestation of this bug is seeing a domain
running in virt-manager after selecting the shutdown button,
even after the domain has long shutdown.

9 years agolibxl: support dom0
Jim Fehlig [Mon, 22 Jun 2015 17:36:59 +0000 (11:36 -0600)]
libxl: support dom0

In Xen, dom0 is really just another domain that supports ballooning,
adding/removing devices, changing vcpu configuration, etc. This patch
adds support to the libxl driver for managing dom0. Note that the
legacy xend driver has long supported managing dom0.

Operations that are not supported on dom0 are filtered in libvirt
where a sensible error is reported. Errors from libxl are not
always helpful. E.g., attempting a save on dom0 results in

2015-06-23 15:25:05 MDT libxl: debug: libxl_dom.c:1570:libxl__toolstack_save: domain=0 toolstack data size=8
2015-06-23 15:25:05 MDT libxl: debug: libxl.c:979:do_libxl_domain_suspend: ao 0x7f7e68000b70: inprogress: poller=0x7f7e68000930, flags=i
2015-06-23 15:25:05 MDT libxl-save-helper: debug: starting save: Success
2015-06-23 15:25:05 MDT xc: detail: xc_domain_save_suse: starting save of domid 0
2015-06-23 15:25:05 MDT xc: error: Couldn't map live_shinfo (3 = No such process): Internal error
2015-06-23 15:25:05 MDT xc: detail: Save exit of domid 0 with errno=3
2015-06-23 15:25:05 MDT libxl-save-helper: debug: complete r=1: No such process
2015-06-23 15:25:05 MDT libxl: error: libxl_dom.c:1876:libxl__xc_domain_save_done: saving domain: domain did not respond to suspend request: No such process
2015-06-23 15:25:05 MDT libxl: error: libxl_dom.c:2033:remus_teardown_done: Remus: failed to teardown device for guest with domid 0, rc -8

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
9 years agoqemu: Introduce qemuGetHostdevPath
John Ferlan [Tue, 16 Jun 2015 17:58:44 +0000 (13:58 -0400)]
qemu: Introduce qemuGetHostdevPath

Introduce a convenience function to handle formulating the hostdev path

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: Introduce qemuIsSharedHostdev
John Ferlan [Tue, 16 Jun 2015 17:33:37 +0000 (13:33 -0400)]
qemu: Introduce qemuIsSharedHostdev

Add a single boolean function to handle whether the hostdev is shared or not.

Use the new function for the qemu{Add|Remove}SharedHostdev calls as well
as qemuSetUnprivSGIO. NB: This third usage fixes a possible bug where
if this feature is enabled at some time in the future and the shareable flag
wasn't set, the sgio would have been erroneously set.

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agodocs: Clarify unprivileged sgio feature
John Ferlan [Mon, 6 Jul 2015 13:22:27 +0000 (09:22 -0400)]
docs: Clarify unprivileged sgio feature

Update the descriptions for disk and hostdev sgio in order to indicate
not all hypervisors and OS's support this feature

Signed-off-by: John Ferlan <jferlan@redhat.com>
9 years agoqemu: report error when shmem has an invalid address
Luyao Huang [Wed, 17 Jun 2015 03:56:21 +0000 (11:56 +0800)]
qemu: report error when shmem has an invalid address

If user passes an invalid address for shared memory device to qemu,
neither libvirt nor qemu will report an error, but qemu will auto assign
a pci address to the shared memory device.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoconf: use virDomainChrSourceDef to save server path
Luyao Huang [Wed, 17 Jun 2015 03:56:15 +0000 (11:56 +0800)]
conf: use virDomainChrSourceDef to save server path

As the backend of shmem server is a unix type chr device, save it in
virDomainChrSourceDef, so we can reuse the existing code for chr device.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: Refactor creation of shared memory device commandline
Luyao Huang [Wed, 17 Jun 2015 03:56:14 +0000 (11:56 +0800)]
qemu: Refactor creation of shared memory device commandline

Rename qemuBuildShmemDevCmd to qemuBuildShmemDevStr and change the
return type so that it can be reused in the device hotplug code later.

And split the chardev creation part in a new function
qemuBuildShmemBackendStr for reuse in the device hotplug code later.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: Assign IDs for shared memory devices
Luyao Huang [Wed, 17 Jun 2015 03:56:13 +0000 (11:56 +0800)]
qemu: Assign IDs for shared memory devices

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agoqemu: Auto assign pci addresses for shared memory devices
Luyao Huang [Wed, 17 Jun 2015 03:56:12 +0000 (11:56 +0800)]
qemu: Auto assign pci addresses for shared memory devices

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

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agovz: use PRL_USE_VNET_NAME_FOR_BRIDGE_NAME
Maxim Nestratov [Tue, 7 Jul 2015 01:49:00 +0000 (04:49 +0300)]
vz: use PRL_USE_VNET_NAME_FOR_BRIDGE_NAME

It is better not to assume that newly created network should be
connected to a bridge with same name, but specify it explicitly
by PRL_USE_VNET_NAME_FOR_BRIDGE_NAME flag.

Signed-off-by: Maxim Nestratov <mnestratov@virtuozzo.com>
9 years agoExplicitly format the isa-fdc controller for newer q35 machines
Ján Tomko [Mon, 22 Jun 2015 13:20:55 +0000 (15:20 +0200)]
Explicitly format the isa-fdc controller for newer q35 machines

Since QEMU commit ea96bc6 [1]:
i386: drop FDC in pc-q35-2.4+ if neither it nor floppy drives are wanted
the floppy controller is no longer implicit.

Specify it explicitly on the command line if the machine type version
is 2.4 or later.

Note that libvirt's floppy drives do not result in QEMU implying the
controller, because libvirt uses if=none instead of if=floppy.

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

[1] http://git.qemu.org/?p=qemu.git;a=commitdiff;h=ea96bc6

9 years agoSeparate isa-fdc options generation
Ján Tomko [Mon, 22 Jun 2015 13:20:34 +0000 (15:20 +0200)]
Separate isa-fdc options generation

For the implicit controller, we set them via -global.
Separating them will allow reuse for explicit fdc controller as well.

No functional impact apart from one extra allocation.

9 years agoAdd support for portable-rpcgen from portablexdr library
Pavel Fedin [Wed, 8 Jul 2015 11:29:23 +0000 (14:29 +0300)]
Add support for portable-rpcgen from portablexdr library

This allows to build libvirt under MinGW

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
9 years agoRemove explicit enum from protocol structures
Pavel Fedin [Wed, 8 Jul 2015 11:29:22 +0000 (14:29 +0300)]
Remove explicit enum from protocol structures

Explicit 'enum' keyword does not work with portablexdr-rpcgeb, causing its
parser to fail. Fix method is borrowed from virnetprotocol.x

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
9 years agovirt-aa-helper: add unix channels for nserials as well
Serge Hallyn [Fri, 3 Jul 2015 19:01:34 +0000 (19:01 +0000)]
virt-aa-helper: add unix channels for nserials as well

Commit 03d7462d added it for channels, but it is also needed for serials.  Add
it for serials, parallels, and consoles as well.

This solves https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1015154

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
9 years agostorage: Fix regression in storagePoolUpdateAllState
Erik Skultety [Thu, 2 Jul 2015 12:41:37 +0000 (14:41 +0200)]
storage: Fix regression in storagePoolUpdateAllState

Commit 2a31c5f0 introduced support for storage pool state XMLs, however
it also introduced a regression:

if (!virstoragePoolObjIsActive(pool)) {
    virStoragePoolObjUnlock(pool);
    continue;
}

The idea behind this was that since we've got state XMLs and the pool
wasn't marked as active by autostart routine (if the autostart flag had been
set earlier), the pool is inactive and we can leave it be and continue with
other pools. However, filesystem type pools like fs,dir, possibly netfs are
supposed to be active if the filesystem is mounted on the host. And this is
exactly where the regression occurs, e.g. pool type 'dir' which has been
previously destroyed and marked as !autostart gets filtered out
by the condition above.
The resolution should be simply to remove the condition completely,
all pools will get their 'active' flag updated by check callback and if
they do not support such callback, the logic doesn't change and such
pools will be inactive by default (e.g. RBD, even if a state XML exists).

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

9 years agoutil: bitmap: Don't alloc overly large binary bitmaps
Peter Krempa [Thu, 2 Jul 2015 14:46:46 +0000 (16:46 +0200)]
util: bitmap: Don't alloc overly large binary bitmaps

Optimize the virBitmap to array-of-char bitmap conversion by skipping
trailing zero bytes.

This also fixes a regression when requesting iothread information from a
live VM since after commit 825df8c3158cfaf5f398418471f10f4ff3c3515a the
bitmap returned from virProcessGetAffinity is too big to be formatted
properly via RPC. A user would get the following error:

error: Unable to get domain IOThreads information
error: Unable to encode message payload

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

9 years agovz: Use virBitmapToDataBuf instead of virBitmapToData in vzDomainGetVcpus
Peter Krempa [Thu, 2 Jul 2015 14:26:59 +0000 (16:26 +0200)]
vz: Use virBitmapToDataBuf instead of virBitmapToData in vzDomainGetVcpus

9 years agovz: Remove dead code from vzDomainGetVcpus
Peter Krempa [Thu, 2 Jul 2015 14:11:35 +0000 (16:11 +0200)]
vz: Remove dead code from vzDomainGetVcpus

'maxcpu' and 'vcpus' are set but not used after that

9 years agoqemu: move the guest status check before agent config and status check
Luyao Huang [Fri, 3 Jul 2015 06:58:05 +0000 (14:58 +0800)]
qemu: move the guest status check before agent config and status check

When use setvcpus command with --guest option to a offline vm,
we will get error:

 # virsh setvcpus test3 1 --guest
 error: Guest agent is not responding: QEMU guest agent is not connected

However guest is not running, agent status could not be connected.
In this case, report domain is not running will be better than agent is
not connected. Move the guest status check more early to output error to
point out guest status is not right.

Also from the logic, a running vm is a basic requirement to use
agent, we cannot use agent if vm is not running.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
9 years agoqemu: remove deadcode in qemuDomain{HelperGetVcpus|GetIOThreadsLive}
Luyao Huang [Fri, 3 Jul 2015 01:57:53 +0000 (09:57 +0800)]
qemu: remove deadcode in qemuDomain{HelperGetVcpus|GetIOThreadsLive}

We set @hostcpus variable but not use it.

Signed-off-by: Luyao Huang <lhuang@redhat.com>
9 years agovz: assign static IPs and default gateways for network adapter
Mikhail Feoktistov [Tue, 7 Jul 2015 13:38:00 +0000 (16:38 +0300)]
vz: assign static IPs and default gateways for network adapter

We support only one IPv4 and one IPv6 default gateway.
If static IPs are not present in instance config,
then we switch on DHCP for this adapter.
PrlVmDevNet_SetAutoApply to makes necessary settings within guest OS
In linux case it creates network startup scripts
/etc/sysconfig/network-scripts/ifcfg-ethN and fills it with necessary
parameters.

9 years agovz: fix building capabilities
Dmitry Guryanov [Fri, 3 Jul 2015 17:26:00 +0000 (20:26 +0300)]
vz: fix building capabilities

There should be at least one domain for each guest
in cababilities. And in current code we don't add
domain for this guest for example.

    if ((guest = virCapabilitiesAddGuest(caps, VIR_DOMAIN_OSTYPE_HVM,
                                         VIR_ARCH_X86_64,
                                         "vz",
                                         NULL, 0, NULL)) == NULL)

Anyway, with two virt types it looks a litte messy, so let's
move adding guest and domain to a separate function.

Signed-off-by: Dmitry Guryanov <dguryanov@parallels.com>
9 years agoqemu_driver: live/config checks cleanup
Pavel Hrdina [Wed, 1 Jul 2015 09:58:04 +0000 (11:58 +0200)]
qemu_driver: live/config checks cleanup

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
9 years agobetter patch for the XSS search issue
Daniel Veillard [Fri, 3 Jul 2015 13:04:24 +0000 (21:04 +0800)]
better patch for the XSS search issue

Since the query string could be output when displaying the results too

9 years agoAvoid XSS vulnerability on the search engine
Daniel Veillard [Fri, 3 Jul 2015 12:47:08 +0000 (20:47 +0800)]
Avoid XSS vulnerability on the search engine

Raised by https://www.xssposed.org/incidents/69566/
Need to escape the user provided query before displaying it back

9 years agovz: fix SDK event dispatching
Nikolay Shirokovskiy [Thu, 25 Jun 2015 08:56:00 +0000 (11:56 +0300)]
vz: fix SDK event dispatching

Current version of SDK event dispatcing is incorrect. For most VM events (add,
delete etc) issuer type is PIE_DISPATCHER. Actually analyzing issuer type
doesn't have any benifints so this patch get rid of it. All dispatching is done
only on event type.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>