domainsnapshotxml2xmltest: Allow for better testing of snapshots

Until now the test was only testing redefinition of snapshot XMLs stored
in tests/domainsnapshotxml2xmlout. This patch adds new infrastructure to
allow testing of files that may differ and will allow to utilize files
in tests/domainsnapshotxml2xmlin as new tests too.
domainsnapshotxml2xml: Move files with conflicting names

The new tests that will be added later would collide with files of
existing tests. Move and rename those files.
domainsnapshotxml2xmltest: Add existing files as new tests

There were plenty snapshot XMLs in the tests/domainsnapshotxml2xmlin
directory that actually weren't used in XML testing. The upgraded
domainsnapshotxml2xml test now allows us to use them.
domainsnapshotxml2xmltest: Add test case for empty driver element

Commit 5a66c667ff5cae61c2ad2e646c8eb3eedc67f925 fixed a NULL dereference
if the disk driver element was empty. Add a test for this case.
qemu: Fix indentation in qemuTranslateDiskSourcePool

Commit e1a4d08baf9a8cc86c8b5ca27da9aeedb34b5908 was pushed with bad
indentation the iSCSI pool translation code.
virThreadPoolFree: Set n(Prio)Workers after the pool is locked

In 78839da I am trying to join the worker threads. However, I can't
sipmly reuse pool->nWorkers (same applies for pool->nPrioWorkers),
because of the following flow that is currently implemented:

1) the main thread executing virThreadPoolFree sets pool->quit = true,
wakes up all the workers and wait on pool->quit_cond.

2) A worker is woken up and see quit request. It immediately jumps of
the while() loop and decrements pool->nWorkers (or pool->nPrioWorkers in
case of priority worker). The last thread signalizes pool->quit_cond.

3) Main thread is woken up, with both pool->nWorkers and
pool->nPrioWorkers being zero.

So there's a need to copy the original value of worker thread counts
into local variables. However, these need to set *after* the check for
pool being NULL (dereferencing a NULL is no no). And for safety they can
be set right after the pool is locked.

Reported-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
docs: fix double articles bug

Delete the extra article 'the'.

Signed-off-by: Wang Yufei <james.wangyufei@huawei.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
qemu: hotplug: Mark 2 private functions as static

They aren't used outside of qemu_hotplug.c
qemu: snapshot: Fix incorrect disk type for auto-generated disks

When changing the parsing and formatting functions in commit
43f2ccdc73090bd03f64de4d58d46ffa0134d705 I forgot to update the qemu
disk alignment function for snapshots that automatically adds snapshot
configs for disks that were not mentioned in the XML. The function
allocated a new disk snapshot definition but did not correctly
initialize the snapshot disk source type variable. This resulted into
the disks considered as block devices and invalid XML was generated.

Reported by John Ferlan.
conf: Fix XML formatting of RNG device info

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

When outputting the XML for the RNG device, the code didn't format the
PCI address info. Additionally the schema wasn't expecting the info
although it was being parsed and used internally. Fix those mistakes and
add test for the PCI info section.
qemu: Improve error when setting invalid count of vcpus via agent

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

When attempting to enable more vCPUs in the guest than is currently
enabled in the guest but less than the maximum count for the VM we
currently reported an unhelpful message:

 error: internal error: guest agent reports less cpu than requested

This patch changes it to:

 error: invalid argument: requested vcpu count is greater than the count
 of enabled vcpus in the domain: 3 > 2
Add qxl ram size to ABI stability check

55bfd02 added a 'ram' attribute for qxl video devices
but didn't update the ABI check.

https://bugzilla.redhat.com/show_bug.cgi?id=1035123
Cgroup: Replace 'newpath' with 'newPath'

Unifying codding style, replace 'newpath' with 'newPath'.

From: Zhou Yimin <zhouyimin@huawei.com>
lxcContainerMountFSDevPTS: Unify @ret usage pattern

Currently, if virFileMakePath() fails, the @ret is left initialized from
virAsprintf() just a few lines above leading to a wrong return value of
zero whereas -1 should be returned.

Signed-off-by: Chen Hanxiao <chenhanxiao@cn.fujitsu.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
spec: Fix unconditional references of nwfilter

Ensure nwfilter files lists and dependencies are conditional upon
with_nwfilter being defined.
spec: Only add libvirt-daemon pre install script if building with qemu

The %pre script in libvirt-daemon is specific to qemu, so only include
it if building with qemu support.
spec: Fix files list when building without driver modules

The daemon-config-{network,nwfilter} subpackages are built regardless
of whether or not with_driver_modules is defined, therefore don't
conditionally define their files list.
spec: Conditionally specify some hypervisor-specific files

Move some hypervisor-specific files in the libvirt-daemon subpackage
within conditionals for those hypervisors.
spec: Define hypervisor-specific files together

Collapse the various {with_<hypervisor>} conditionals in the
libvirt-daemon package files section into a single {with_<hypervisor>}
conditional
spec: move driver-specific files to driver subpackages

The libvirt-daemon package contains several driver-specific files,
directories, and script, which can be problematic when building the
package with multiple hypervisor support, e.g. both QEMU and Xen.

E.g. installing a QEMU+Xen enabled libvirt-daemon on a Xen-only system
will result in the creation of qemu and kvm groups and a qemu user.

Move the driver-specific files, directories, and script to the
respective driver subpackages.