]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agoDo not check for pkcheck
Ján Tomko [Wed, 7 Mar 2018 09:17:57 +0000 (10:17 +0100)]
Do not check for pkcheck

All we need is D-Bus.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoMerge WITH_POLKIT1 and WITH_POLKIT
Ján Tomko [Wed, 7 Mar 2018 09:14:23 +0000 (10:14 +0100)]
Merge WITH_POLKIT1 and WITH_POLKIT

There is just one polkit now.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoDo not generate polkit rules file
Ján Tomko [Wed, 14 Mar 2018 11:08:37 +0000 (12:08 +0100)]
Do not generate polkit rules file

This essentially reverts commit <e1019e9>, which added
an extra step for generating the policy file.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoRemove Policy-Kit support
Ján Tomko [Tue, 6 Mar 2018 15:47:44 +0000 (16:47 +0100)]
Remove Policy-Kit support

Policy-Kit has been replaced by polkit (referred to, respectively,
as POLKIT0 and POLKIT1 in our Makefiles).

The last build fix with old Policy-Kit was in May 2013:
commit <442eb2ba> and build with -Wunused-label was broken
since April 2016: commit <8437130>

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoconf: Extract parsing of storage source related data
Peter Krempa [Mon, 12 Mar 2018 14:09:28 +0000 (15:09 +0100)]
conf: Extract parsing of storage source related data

Split out the parser and separate it from the private data part so that
it can be later reused in other parts of the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Parse and validate disk source seclabels together with the source
Peter Krempa [Thu, 8 Mar 2018 16:32:15 +0000 (17:32 +0100)]
conf: Parse and validate disk source seclabels together with the source

Since seclabels are formatted along with the source element and will
also make sense to be passed for the backing chain we should parse them
in the place where we parse the disk source. Same applies for
validation.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Separate seclabel validation from parsing
Peter Krempa [Thu, 8 Mar 2018 15:42:04 +0000 (16:42 +0100)]
conf: Separate seclabel validation from parsing

Rather than checking that the security label is legal when parsing it
move the code into a separate function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Validate disk source configuration also for the backing store
Peter Krempa [Thu, 8 Mar 2018 16:23:46 +0000 (17:23 +0100)]
conf: Validate disk source configuration also for the backing store

Since we already parse the <backingStore> of a disk source, we should
also validate the configuration for the whole backing chain and not only
for the top level image.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: disk: Separate virStorageSource formatting
Peter Krempa [Mon, 5 Mar 2018 14:13:41 +0000 (15:13 +0100)]
conf: disk: Separate virStorageSource formatting

Move out formatting of 'startuPolicy' which is a property of the disk
out of the <source> element. Extracting the code formating the content
and attributes will also allow reuse in other parts of the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Refactor formatting of startupPolicy in virDomainDiskSourceFormatInternal
Peter Krempa [Wed, 7 Mar 2018 16:45:56 +0000 (17:45 +0100)]
conf: Refactor formatting of startupPolicy in virDomainDiskSourceFormatInternal

Move it to a single location which also allows to get rid of the
temporrary variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Remove virDomainDiskSourceDefFormatSeclabel
Peter Krempa [Wed, 7 Mar 2018 16:42:13 +0000 (17:42 +0100)]
conf: Remove virDomainDiskSourceDefFormatSeclabel

The wrapper functionality can be moved to the only user
virDomainDiskSourceFormatInternal. Also removes comment which does not
reflect the truth any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Refactor seclabel formatting in virDomainDiskSourceFormatInternal
Peter Krempa [Wed, 7 Mar 2018 16:41:21 +0000 (17:41 +0100)]
conf: Refactor seclabel formatting in virDomainDiskSourceFormatInternal

Call the formatter function only once.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Remove unnecessary condition from virDomainDiskSourceFormatInternal
Peter Krempa [Mon, 5 Mar 2018 13:52:38 +0000 (14:52 +0100)]
conf: Remove unnecessary condition from virDomainDiskSourceFormatInternal

Now that the function is using virXMLFormatElement we don't need to
conditionally format anything, since we'll format the element according
to the presence of content.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agodocs: Call reformat-news.py with $(PYTHON)
Andrea Bolognani [Wed, 14 Mar 2018 11:00:27 +0000 (12:00 +0100)]
docs: Call reformat-news.py with $(PYTHON)

This is the only Python script which we invoke directly, which
works pretty fine in general but becomes a problem if the user
has explicitly overridden Python binary detection at configure
time.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agom4: use pkgconfig to detect xenstore
Olaf Hering [Fri, 9 Mar 2018 13:47:31 +0000 (14:47 +0100)]
m4: use pkgconfig to detect xenstore

Since Xen 4.9 a pkgconfig file exists to gather info about building
against libxenstore.so. Use it if available.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
7 years agobuild: Add srpm make target
Jiri Denemark [Tue, 13 Mar 2018 10:13:09 +0000 (11:13 +0100)]
build: Add srpm make target

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agotests: Fix path to status XML test directory in makefile
Peter Krempa [Tue, 13 Mar 2018 14:41:53 +0000 (15:41 +0100)]
tests: Fix path to status XML test directory in makefile

Commit 99e30acfdce added 'qemustatusxml2xmloutdata' to EXTRA_DIST but
the directory added in the commit is called 'qemustatusxml2xmldata'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agovirSecurityDACChownListFree: Don't leak list->items array
Michal Privoznik [Tue, 13 Mar 2018 11:59:43 +0000 (12:59 +0100)]
virSecurityDACChownListFree: Don't leak list->items array

We're freeing individual items in it but not the array itself.

==19200== 40 bytes in 1 blocks are definitely lost in loss record 847 of 1,059
==19200==    at 0x4C2D12F: realloc (vg_replace_malloc.c:785)
==19200==    by 0x52C5532: virReallocN (viralloc.c:245)
==19200==    by 0x52C5628: virExpandN (viralloc.c:294)
==19200==    by 0x52C58FC: virInsertElementsN (viralloc.c:436)
==19200==    by 0x542856B: virSecurityDACChownListAppend (security_dac.c:115)
==19200==    by 0x54286B4: virSecurityDACTransactionAppend (security_dac.c:167)
==19200==    by 0x542902F: virSecurityDACSetOwnershipInternal (security_dac.c:560)
==19200==    by 0x54295D6: virSecurityDACSetOwnership (security_dac.c:650)
==19200==    by 0x542AEE0: virSecurityDACSetInputLabel (security_dac.c:1472)
==19200==    by 0x542B61D: virSecurityDACSetAllLabel (security_dac.c:1693)
==19200==    by 0x542DD67: virSecurityManagerSetAllLabel (security_manager.c:869)
==19200==    by 0x54279C2: virSecurityStackSetAllLabel (security_stack.c:361)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirSysinfoParseX86Chassis: Store asset tag into correct pointer
Michal Privoznik [Tue, 13 Mar 2018 11:48:28 +0000 (12:48 +0100)]
virSysinfoParseX86Chassis: Store asset tag into correct pointer

Probably due to copy-paste error we're storing asset tag into
def->sku which we even use in the next step to store SKU number
and thus the asset tag leaks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agotests: bhyvexml2xml: Fix call to testCompareDomXML2XMLFiles
Peter Krempa [Tue, 13 Mar 2018 14:32:31 +0000 (15:32 +0100)]
tests: bhyvexml2xml: Fix call to testCompareDomXML2XMLFiles

Commit 1b28038300b forgot to fix the arguments for this one caller.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemuAssignDeviceInputAlias: Be tolerant to pre-existent alias
Michal Privoznik [Tue, 13 Mar 2018 12:01:11 +0000 (13:01 +0100)]
qemuAssignDeviceInputAlias: Be tolerant to pre-existent alias

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

This is missing in 6bc4a371cf and therefore we are effectively
overwriting user provided aliases for <input/> devices.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: domain: Extract parsing of job-related private XML
Peter Krempa [Thu, 1 Mar 2018 17:58:24 +0000 (18:58 +0100)]
qemu: domain: Extract parsing of job-related private XML

Similarly to the formatter extract the parser code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemu: domain: Use virXMLFormatElement in qemuDomainObjPrivateXMLFormatJob
Peter Krempa [Thu, 1 Mar 2018 17:16:38 +0000 (18:16 +0100)]
qemu: domain: Use virXMLFormatElement in qemuDomainObjPrivateXMLFormatJob

Modernize the code by using the clever formatter rather than checking
manually when to format the end of the element.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemu: domain: Return early in qemuDomainObjPrivateXMLFormatJob
Peter Krempa [Thu, 1 Mar 2018 17:07:37 +0000 (18:07 +0100)]
qemu: domain: Return early in qemuDomainObjPrivateXMLFormatJob

Remove one level of nesting by returing early.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemu: domain: Don't overwrite job type in private data
Peter Krempa [Thu, 1 Mar 2018 17:01:08 +0000 (18:01 +0100)]
qemu: domain: Don't overwrite job type in private data

The code overwrote the internal job type and then fixed it back. Since
the job type is not accessed in the code this does not make much sense.
Use the temporary value instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemu: domain: Split out formating of Job data from private data formatter
Peter Krempa [Thu, 1 Mar 2018 16:56:50 +0000 (17:56 +0100)]
qemu: domain: Split out formating of Job data from private data formatter

Separate the code for later refactoring

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2xml: Add status XML with outgoing migration with NBD
Peter Krempa [Fri, 2 Mar 2018 16:45:31 +0000 (17:45 +0100)]
tests: qemuxml2xml: Add status XML with outgoing migration with NBD

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2xml: Add modern example of status XML to the test
Peter Krempa [Fri, 2 Mar 2018 16:36:46 +0000 (17:36 +0100)]
tests: qemuxml2xml: Add modern example of status XML to the test

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: util: Remove callback from testCompareDomXML2XMLFiles
Peter Krempa [Fri, 2 Mar 2018 15:58:50 +0000 (16:58 +0100)]
tests: util: Remove callback from testCompareDomXML2XMLFiles

The testCompareDomXML2XMLPreFormatCallback is no longer used and thus
can be removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2xml: Remove fake status XML testing
Peter Krempa [Fri, 2 Mar 2018 15:53:01 +0000 (16:53 +0100)]
tests: qemuxml2xml: Remove fake status XML testing

Now that the better approach is in place we can remove the old functions
doing the fake formatting.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2xml: Add synthetic test for <lockstate> in status XML
Peter Krempa [Wed, 7 Mar 2018 14:37:27 +0000 (15:37 +0100)]
tests: qemuxml2xml: Add synthetic test for <lockstate> in status XML

Add a random lockstate string to the status XML2XML test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2xml: Add proper domain status XML testing
Peter Krempa [Fri, 2 Mar 2018 15:47:32 +0000 (16:47 +0100)]
tests: qemuxml2xml: Add proper domain status XML testing

Add new approach to properly test status XML files by supplying a full
XML file rather than generating synthetic test cases by prepending the
status header. The two tests introduced here are copies of existing
cases using the synthetic header so that current level of testing is
kept. The files are chosen to excercising the vcpu and blockjob quirks
present in the current testing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: domainsnapshotxml2xml: Remove testing with allowed format detection
Peter Krempa [Wed, 7 Mar 2018 09:44:55 +0000 (10:44 +0100)]
tests: domainsnapshotxml2xml: Remove testing with allowed format detection

We have a test of the domain XML that allows format detection, so
there's no need to do it for snapshot XMLs where the parameter would
influence the domain XML portion.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2xml: Remove testing with allowed format detection
Peter Krempa [Fri, 2 Mar 2018 14:43:55 +0000 (15:43 +0100)]
tests: qemuxml2xml: Remove testing with allowed format detection

Nobody should use format detection due to security implications. The
result of the change is that 'raw' format will be printed unless
specified explicitly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemu: Explicitly add tests with format probing allowed
Peter Krempa [Wed, 7 Mar 2018 12:55:05 +0000 (13:55 +0100)]
tests: qemu: Explicitly add tests with format probing allowed

Add a single testcase for the case where format probing is allowed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agotests: qemuxml2xml: Rename testInfoFree to testInfoClear
Peter Krempa [Fri, 2 Mar 2018 14:41:46 +0000 (15:41 +0100)]
tests: qemuxml2xml: Rename testInfoFree to testInfoClear

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemuDomainUSBAddressAddHubs: use numeric comparison
Ján Tomko [Tue, 13 Mar 2018 09:38:48 +0000 (10:38 +0100)]
qemuDomainUSBAddressAddHubs: use numeric comparison

Since data.count is not a pointer, but an integer,
compare it against an integer value instead of using
the implicit "boolean" conversion that is customarily
used for pointers.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoAdjust whitespace in virDomainDefHasUSB prototype
Ján Tomko [Tue, 13 Mar 2018 09:27:01 +0000 (10:27 +0100)]
Adjust whitespace in virDomainDefHasUSB prototype

To match the rest of the file.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agolibvirtd: fix potential deadlock when reloading
Jim Fehlig [Thu, 8 Mar 2018 22:04:48 +0000 (15:04 -0700)]
libvirtd: fix potential deadlock when reloading

It is possible to deadlock libvirtd when concurrently starting a domain
and restarting the daemon. Threads involved in the deadlock are

Thread 4 (Thread 0x7fc13b53e700 (LWP 64084)):
/lib64/libpthread.so.0
    at util/virthread.c:154
    at qemu/qemu_monitor.c:1083
    cmd=0x7fc110017700, scm_fd=-1, reply=0x7fc13b53d318) at
qemu/qemu_monitor_json.c:305
cmd=0x7fc110017700,
    reply=0x7fc13b53d318) at qemu/qemu_monitor_json.c:335
    at qemu/qemu_monitor_json.c:1298
    at qemu/qemu_monitor.c:1697
    vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START) at qemu/qemu_process.c:1763
vm=0x7fc110003d00,
    asyncJob=6, logCtxt=0x7fc1100089c0) at qemu/qemu_process.c:1835
    vm=0x7fc110003d00, asyncJob=6, logCtxt=0x7fc1100089c0) at
qemu/qemu_process.c:2180
driver=0x7fc12004e1e0,
    vm=0x7fc110003d00, asyncJob=QEMU_ASYNC_JOB_START, incoming=0x0, snapshot=0x0,
    vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE, flags=17) at qemu/qemu_process.c:6111
driver=0x7fc12004e1e0,
    vm=0x7fc110003d00, updatedCPU=0x0, asyncJob=QEMU_ASYNC_JOB_START,
migrateFrom=0x0,
    migrateFd=-1, migratePath=0x0, snapshot=0x0,
vmop=VIR_NETDEV_VPORT_PROFILE_OP_CREATE,
    flags=17) at qemu/qemu_process.c:6334
    xml=0x7fc110000ed0 "<!--\nWARNING: THIS IS AN AUTO-GENERATED FILE.
CHANGES TO IT ARE LIKELY TO BE\nOVERWRITTEN AND LOST. Changes to this xml
configuration should be made using:\n  virsh edit testvv\nor other
applicati"..., flags=0) at qemu/qemu_driver.c:1776
...

Thread 1 (Thread 0x7fc143c66880 (LWP 64081)):
/lib64/libpthread.so.0
    at util/virthread.c:122
conf/nwfilter_conf.c:159
sig=0x7ffe0a831e30,
    opaque=0x0) at remote/remote_daemon.c:724
    opaque=0x558c5328b230) at rpc/virnetdaemon.c:654
    at util/vireventpoll.c:508
rpc/virnetdaemon.c:858
remote/remote_daemon.c:1496
(gdb) thr 1
[Switching to thread 1 (Thread 0x7fc143c66880 (LWP 64081))]
/lib64/libpthread.so.0
(gdb) f 1
    at util/virthread.c:122
122     pthread_rwlock_wrlock(&m->lock);
(gdb) p updateLock
$1 = {lock = {__data = {__lock = 0, __nr_readers = 1, __readers_wakeup = 0,
      __writer_wakeup = 0, __nr_readers_queued = 0, __nr_writers_queued = 1,
__writer = 0,
      __shared = 0, __rwelision = 0 '\000', __pad1 = "\000\000\000\000\000\000",
      __pad2 = 0, __flags = 0},
    __size = "\000\000\000\000\001", '\000' <repeats 15 times>, "\001",
'\000' <repeats 34 times>, __align = 4294967296}}

Reloading of the nwfilter driver is stuck waiting for a write lock, which
already has a reader (from qemuDomainCreateXML) in the critical section.
Since the reload occurs in the context of the main event loop thread,
libvirtd becomes deadlocked. The deadlock can be avoided by offloading
the reload work to a thread.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agobhyve: fix crash on missing interface model
Roman Bogorodskiy [Sun, 11 Mar 2018 16:00:08 +0000 (20:00 +0400)]
bhyve: fix crash on missing interface model

The bhyve driver crashes in bhyveBuildNetArgStr() when
network interface model is not defined. As it has to be provided
explicitly, add a check to report an error if it's missing.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoFix build with clang 6.0.0
Roman Bogorodskiy [Sun, 11 Mar 2018 15:27:22 +0000 (19:27 +0400)]
Fix build with clang 6.0.0

Clang 6.0.0 complains when initializing structure with { NULL }:

conf/domain_addr.c:1494:38: error: missing field 'type' initializer [-Werror,-Wmissing-field-initializers]
    virDomainDeviceInfo nfo = { NULL };

Use { 0 } instead to make it happy.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
7 years agokeycodemapdb: Update submodule
Andrea Bolognani [Mon, 12 Mar 2018 11:10:47 +0000 (12:10 +0100)]
keycodemapdb: Update submodule

This time around it's not enough to just pick the latest commit,
because with aed87bb2aa6ed83b49574eb982e3bdd4c36acf17 keycodemapdb
renamed the 'rfb' keycode to 'qnum' and we need to accept the new
name while maintaining backwards compatibility.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotools: Add support for additional adapter parent options
John Ferlan [Thu, 8 Mar 2018 23:17:10 +0000 (18:17 -0500)]
tools: Add support for additional adapter parent options

Add the ability to provide the adapter parent_wwnn and parent_wwpn
or the parent_fabric_wwn on the virsh command line for the pool
define/create as commands.  Update the virsh.pod description.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotools: Update the help description of the adapter-parent field
John Ferlan [Thu, 8 Mar 2018 23:19:58 +0000 (18:19 -0500)]
tools: Update the help description of the adapter-parent field

One short sentence won't do it justice, but it could help by listing
scsi_hostN and vHBA to point one in the right direction.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agotools: Add the wwnn/wwpn to the man page for storage pool fields
John Ferlan [Thu, 8 Mar 2018 23:03:00 +0000 (18:03 -0500)]
tools: Add the wwnn/wwpn to the man page for storage pool fields

The description was missing the wwnn and wwpn names for the
--adapter-wwnn and --adapter-wwpn switches. Just add it to be
clear that the fields cannot be empty (IOW they are not boolean).

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoconf: Check for user aliases duplicates only
Michal Privoznik [Tue, 6 Feb 2018 11:18:40 +0000 (12:18 +0100)]
conf: Check for user aliases duplicates only

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

When validating a device XML config we check if user provided
alias is unique. We do this by maintaining a hash table of device
aliases as we iterated over all devices defined for the domain.
However, it may happen that what appears as two devices in domain
XML is in fact just one interface in hypervisor.  We can assume
libvirt generated aliases to be unique and thus really check user
provided ones only.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirDomainDeviceValidateAliasForHotplug: Use correct domain defintion
Michal Privoznik [Fri, 9 Mar 2018 07:31:44 +0000 (08:31 +0100)]
virDomainDeviceValidateAliasForHotplug: Use correct domain defintion

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

For some weird reason this function is getting live and
persistent def for domain but then accesses vm->def and
vm->newDef directly. This is rather unsafe as we can be
accessing NULL pointer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoUpdate to latest gnulib
Daniel P. Berrangé [Mon, 5 Mar 2018 19:03:43 +0000 (19:03 +0000)]
Update to latest gnulib

GnuLib has now fixed the incompatibility with latest GLibC
that was affecting builds on Fedora rawhide. We can thus
update and drop our local workaround.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoqemu: different declarations for the same method
Julio Faracco [Fri, 9 Mar 2018 03:24:15 +0000 (00:24 -0300)]
qemu: different declarations for the same method

Recently, this warning is appearing while libvirt is being compiled:
Function 'qemuAssignDeviceDiskAlias' argument order different:
declaration 'vmdef, def' definition 'def, disk'

This commit change the default declaration for qemuAssignDeviceDiskAlias
specified at src/qemu/qemu_alias.c.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agolibvirt:spec: Require gcc for build
Michal Privoznik [Thu, 8 Mar 2018 08:05:05 +0000 (09:05 +0100)]
libvirt:spec: Require gcc for build

According to latest discussion on fedora devel list [1] gcc will
be removed from default buildroot and packages requiring it must
have explicit build dependency,

1: https://lists.fedoraproject.org/archives/list/devel-announce@lists.fedoraproject.org/thread/IJFYI5Q2BYZKIGDFS2WLOBDUSEGWHIKV/

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
7 years agoqemu: Add qemu functions for storage source private data handling
Peter Krempa [Thu, 1 Mar 2018 14:13:26 +0000 (15:13 +0100)]
qemu: Add qemu functions for storage source private data handling

The qemu driver registered the helpers from util code, but it will be
necessary to format also some qemu-specific data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemu: Remove old qemuDomainDeviceDefValidateControllerPCI()
Andrea Bolognani [Tue, 20 Feb 2018 14:59:25 +0000 (15:59 +0100)]
qemu: Remove old qemuDomainDeviceDefValidateControllerPCI()

We've implemented all existing checks, and more, in the new
function, so we can finally drop the old one.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controllers (QEMU capabilities)
Andrea Bolognani [Wed, 21 Feb 2018 09:18:19 +0000 (10:18 +0100)]
qemu: Validate PCI controllers (QEMU capabilities)

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (chassis and port)
Andrea Bolognani [Tue, 20 Feb 2018 14:24:29 +0000 (15:24 +0100)]
qemu: Validate PCI controller options (chassis and port)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (chassisNr)
Andrea Bolognani [Tue, 20 Feb 2018 14:21:11 +0000 (15:21 +0100)]
qemu: Validate PCI controller options (chassisNr)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (numaNode)
Andrea Bolognani [Wed, 21 Feb 2018 09:17:56 +0000 (10:17 +0100)]
qemu: Validate PCI controller options (numaNode)

This change catches an invalid use of the option in our
test suite.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (busNr)
Andrea Bolognani [Tue, 20 Feb 2018 14:12:37 +0000 (15:12 +0100)]
qemu: Validate PCI controller options (busNr)

This change catches an invalid use of the option in our
test suite.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (pcihole64)
Andrea Bolognani [Tue, 20 Feb 2018 14:07:15 +0000 (15:07 +0100)]
qemu: Validate PCI controller options (pcihole64)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (targetIndex)
Andrea Bolognani [Tue, 20 Feb 2018 14:01:05 +0000 (15:01 +0100)]
qemu: Validate PCI controller options (targetIndex)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (index)
Andrea Bolognani [Tue, 20 Feb 2018 13:38:19 +0000 (14:38 +0100)]
qemu: Validate PCI controller options (index)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Validate PCI controller options (modelName)
Andrea Bolognani [Tue, 20 Feb 2018 13:47:55 +0000 (14:47 +0100)]
qemu: Validate PCI controller options (modelName)

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoqemu: Create new qemuDomainDeviceDefValidateControllerPCI()
Andrea Bolognani [Tue, 20 Feb 2018 13:26:01 +0000 (14:26 +0100)]
qemu: Create new qemuDomainDeviceDefValidateControllerPCI()

The existing function is renamed and called from the new one, so
that even while we're in the process of implementing new checks
all the existing ones will be performed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@laine.org>
7 years agoremote: simplify condition
Ján Tomko [Thu, 8 Mar 2018 16:34:56 +0000 (17:34 +0100)]
remote: simplify condition

In remoteConnectOpen, conn->uri cannot be NULL in the second
part of the OR expression due to short-circuit evaluation.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoqemu: simplify condition
Ján Tomko [Thu, 8 Mar 2018 16:34:34 +0000 (17:34 +0100)]
qemu: simplify condition

In qemuMigrationSrcRun, we already checked for non-NULL mig
and then dereferenced it. It's only possible for mig to be
NULL in the error section.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoapparmor: add ro rule for sasl GSSAPI plugin on /etc/gss/mech.d/
Christian Ehrhardt [Wed, 7 Mar 2018 10:02:23 +0000 (11:02 +0100)]
apparmor: add ro rule for sasl GSSAPI plugin on /etc/gss/mech.d/

If a system has sasl GSSAPI plugin available qemu with sasl support will
try to read /etc/gss/mech.d/.

It is required to allow that to let the modules fully work and it should
be safe to do so as it only registers/configures plugins but has no secrets.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Acked-by: Jamie Strandboge <jamie@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
7 years agovirsh: use logical or for boolean values
Ján Tomko [Tue, 6 Mar 2018 13:13:55 +0000 (14:13 +0100)]
virsh: use logical or for boolean values

Bitwise or just looks wrong here.
Introduced by <commit 69e0cd3>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agovirsh-edit: remove unreachable break
Ján Tomko [Tue, 6 Mar 2018 13:01:17 +0000 (14:01 +0100)]
virsh-edit: remove unreachable break

Introduced by <commit 1bb1de8>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoopenvz: pass sizeof to snprintf
Ján Tomko [Tue, 6 Mar 2018 12:56:31 +0000 (13:56 +0100)]
openvz: pass sizeof to snprintf

The size argument accounts for the nul-byte to terminate
the string. Use sizeof and remove the pointless assignment.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agonwfilter: remove pointless assignment
Ján Tomko [Tue, 6 Mar 2018 12:43:35 +0000 (13:43 +0100)]
nwfilter: remove pointless assignment

Changing a parameter passed by value has no effect.

Introduced by <commit 3f74b2eb>.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agomaint: use parentheses after if
Ján Tomko [Tue, 6 Mar 2018 12:06:56 +0000 (13:06 +0100)]
maint: use parentheses after if

Some instances of ARCH_IS_PPC64 did not use them.

Introduced by commits da636d8 and ef08a54

Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agorpc: switch virtlockd and virtlogd to use single-threaded dispatch
Daniel P. Berrangé [Tue, 6 Mar 2018 17:12:20 +0000 (17:12 +0000)]
rpc: switch virtlockd and virtlogd to use single-threaded dispatch

Currently both virtlogd and virtlockd use a single worker thread for
dispatching RPC messages. Even this is overkill and their RPC message
handling callbacks all run in short, finite time and so blocking the
main loop is not an issue like you'd see in libvirtd with long running
QEMU commands.

By setting max_workers==0, we can turn off the worker thread and run
these daemons single threaded. This in turn fixes a serious problem in
the virtlockd daemon whereby it loses all fcntl() locks at re-exec due
to multiple threads existing. fcntl() locks only get preserved if the
process is single threaded at time of exec().

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agorpc: avoid crashing in pre-exec if no workers are present
Daniel P. Berrangé [Tue, 6 Mar 2018 17:56:57 +0000 (17:56 +0000)]
rpc: avoid crashing in pre-exec if no workers are present

If max_workers is set to zero, then the worker thread pool won't be
created, so when serializing state for pre-exec we must set various
parameters to zero.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agorpc: invoke the message dispatch callback with client unlocked
Daniel P. Berrangé [Tue, 6 Mar 2018 17:05:16 +0000 (17:05 +0000)]
rpc: invoke the message dispatch callback with client unlocked

Currently if the virNetServer instance is created with max_workers==0 to
request a non-threaded dispatch process, we deadlock during dispatch

  #0  0x00007fb845f6f42d in __lll_lock_wait () from /lib64/libpthread.so.0
  #1  0x00007fb845f681d3 in pthread_mutex_lock () from /lib64/libpthread.so.0
  #2  0x000055a6628bb305 in virMutexLock (m=<optimized out>) at util/virthread.c:89
  #3  0x000055a6628a984b in virObjectLock (anyobj=<optimized out>) at util/virobject.c:435
  #4  0x000055a66286fcde in virNetServerClientIsAuthenticated (client=client@entry=0x55a663a7b960)
      at rpc/virnetserverclient.c:1565
  #5  0x000055a66286cc17 in virNetServerProgramDispatchCall (msg=0x55a663a7bc50, client=0x55a663a7b960,
      server=0x55a663a77550, prog=0x55a663a78020) at rpc/virnetserverprogram.c:407
  #6  virNetServerProgramDispatch (prog=prog@entry=0x55a663a78020, server=server@entry=0x55a663a77550,
      client=client@entry=0x55a663a7b960, msg=msg@entry=0x55a663a7bc50) at rpc/virnetserverprogram.c:307
  #7  0x000055a662871d56 in virNetServerProcessMsg (msg=0x55a663a7bc50, prog=0x55a663a78020, client=0x55a663a7b960,
      srv=0x55a663a77550) at rpc/virnetserver.c:148
  #8  virNetServerDispatchNewMessage (client=0x55a663a7b960, msg=0x55a663a7bc50, opaque=0x55a663a77550)
      at rpc/virnetserver.c:227
  #9  0x000055a66286e4c0 in virNetServerClientDispatchRead (client=client@entry=0x55a663a7b960)
      at rpc/virnetserverclient.c:1322
  #10 0x000055a66286e813 in virNetServerClientDispatchEvent (sock=<optimized out>, events=1, opaque=0x55a663a7b960)
      at rpc/virnetserverclient.c:1507
  #11 0x000055a662899be0 in virEventPollDispatchHandles (fds=0x55a663a7bdc0, nfds=<optimized out>)
      at util/vireventpoll.c:508
  #12 virEventPollRunOnce () at util/vireventpoll.c:657
  #13 0x000055a6628982f1 in virEventRunDefaultImpl () at util/virevent.c:327
  #14 0x000055a6628716d5 in virNetDaemonRun (dmn=0x55a663a771b0) at rpc/virnetdaemon.c:858
  #15 0x000055a662864c1d in main (argc=<optimized out>,
  #argv=0x7ffd105b4838) at logging/log_daemon.c:1235

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agorpc: simplify calling convention of virNetServerClientDispatchFunc
Daniel P. Berrangé [Tue, 6 Mar 2018 16:44:34 +0000 (16:44 +0000)]
rpc: simplify calling convention of virNetServerClientDispatchFunc

Currently virNetServerClientDispatchFunc implementations are only
responsible for free'ing the "msg" parameter upon success. Simplify the
calling convention by making it their unconditional responsibility to
free the "msg", and close the client if desired.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agorpc: push ref acquisition into RPC dispatch function
Daniel P. Berrangé [Tue, 6 Mar 2018 16:07:35 +0000 (16:07 +0000)]
rpc: push ref acquisition into RPC dispatch function

There's no reason why the virNetServerClientDispatchRead method needs to
acquire an extra reference on the "client" object. An extra reference is
only needed if the registered dispatch callback is going to keep hold of
the "client" for work in the background. Thus we can push reference
acquisition into virNetServerDispatchNewMessage.

Reviewed-by: John Ferlan <jferlan@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotravis: Sync packages with libvirt-jenkins-ci
Andrea Bolognani [Wed, 28 Feb 2018 13:40:45 +0000 (14:40 +0100)]
travis: Sync packages with libvirt-jenkins-ci

Make sure we install the same packages lcitool would install on
the CentOS CI so that we have consistent results. The package
list is current as of libvirt-jenkins-ci commit ad84090b6f96.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoqemu: Remove virQEMUCapsProcessProps()
Andrea Bolognani [Tue, 6 Mar 2018 13:44:49 +0000 (14:44 +0100)]
qemu: Remove virQEMUCapsProcessProps()

This function was introduced in commit 41f5c2ca2776 as a way
to probe the same property for multiple devices at once.

Although the resulting representation is very compact, it
doesn't provide any extra features compared to the existing
virQEMUCapsProcessStringFlags() mechanism, which is already
used for pretty much all device properties.

Drop the custom function and datatypes and start using the
standard ones instead.

Note that, in theory, the end result is not identical
because we're no longer probing properties for

  virtio-serial-pci
  virtio-9p-pci
  virtio-rng-pci
  virtio-input-host-pci
  virtio-keyboard-pci
  virtio-mouse-pci
  virtio-tablet-pci

However, chances of any of those devices being compiled
into a QEMU binary where

  virtio-balloon-pci
  virtio-blk-pci
  virtio-scsi-pci
  virtio-net-pci
  virtio-gpu-pci

are compiled out are slim enough that it doesn't make any
difference in practice, as the lack of test suite churn
shows.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Ignore subsequent attempts to probe device properties
Andrea Bolognani [Tue, 6 Mar 2018 12:43:26 +0000 (13:43 +0100)]
qemu: Ignore subsequent attempts to probe device properties

In some cases, we are probing multiple devices for the same
property and setting the corresponding capability if it's
found on any of the devices: when that happens, we can quit
early after finding the first property and avoiding a bunch
of string comparisons.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Take full advantage of conditional device property probing
Andrea Bolognani [Tue, 6 Mar 2018 12:49:39 +0000 (13:49 +0100)]
qemu: Take full advantage of conditional device property probing

Commit 4ae59411fa3f introduced the ability to make probing for
device properties conditional on a capability being set, but
didn't extend the use of this feature to existing devices.

This commit does the last bit of work, which results in a lot
of pointless QMP chatter no longer happening and our test suite
shrinking a fair bit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: Fix memory leak in qemuConnectGetAllDomainStats error path
John Ferlan [Wed, 7 Mar 2018 14:43:30 +0000 (09:43 -0500)]
qemu: Fix memory leak in qemuConnectGetAllDomainStats error path

If we return -1 on VIR_ALLOC_N failure, we leaked @vms, so
goto cleanup instead.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agoconf: Replace virDomainDiskSourceEncryptionParse by an XPath query
Peter Krempa [Tue, 6 Mar 2018 13:24:49 +0000 (14:24 +0100)]
conf: Replace virDomainDiskSourceEncryptionParse by an XPath query

Remove the rather bulky function in favor of an XPath query.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoutil: storage: Sanitize parsing of disk encryption XMLs
Peter Krempa [Tue, 6 Mar 2018 13:17:59 +0000 (14:17 +0100)]
util: storage: Sanitize parsing of disk encryption XMLs

Pass in the XPath context as we do in all other places rather than
allocating a new one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoutil: storageencryption: Refactor cleanup section in virStorageEncryptionParseXML
Peter Krempa [Tue, 6 Mar 2018 13:57:17 +0000 (14:57 +0100)]
util: storageencryption: Refactor cleanup section in virStorageEncryptionParseXML

The function used the 'cleanup' label only in error cases. This patch
makes the code pass the cleanup label in every case and removes few
unnecessary VIR_FREEs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoconf: Replace virDomainDiskSourceAuthParse by an XPath query
Peter Krempa [Tue, 6 Mar 2018 13:24:49 +0000 (14:24 +0100)]
conf: Replace virDomainDiskSourceAuthParse by an XPath query

Remove the rather bulky function in favor of an XPath query.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoutil: storage: Sanitize parsing of disk auth XMLs
Peter Krempa [Tue, 6 Mar 2018 13:17:59 +0000 (14:17 +0100)]
util: storage: Sanitize parsing of disk auth XMLs

Pass in the XPath context as we do in all other places rather than
allocating a new one.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoutil: storage: Simplify error handling in virStorageAuthDefParseXML
Peter Krempa [Tue, 6 Mar 2018 13:03:27 +0000 (14:03 +0100)]
util: storage: Simplify error handling in virStorageAuthDefParseXML

Unify the cleanup and error paths and simplify the code flow by removing
some unnecessary variables.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agovirt-aa-helper: resolve yet to be created paths
Christian Ehrhardt [Thu, 1 Mar 2018 13:58:39 +0000 (14:58 +0100)]
virt-aa-helper: resolve yet to be created paths

In certain cases a xml contains paths that do not yet exist, but
are valid as qemu will create them later on - for example
vhostuser mode=server sockets.

In any such cases so far the check to virFileExists failed and due to
that the paths stayed non-resolved in regard to symlinks.

But for apparmor those non-resolved rules are non functional as they
are evaluated after resolving any symlinks.

Therefore for non-existent files and partially non-existent paths
resolve as much as possible to get valid rules.

Example:
   <interface type='vhostuser'>
       <model type='virtio'/>
       <source type='unix' path='/var/run/symlinknet' mode='server'/>
   </interface>

Got rendered as:
  "/var/run/symlinknet" rw,

But correct with "/var/run" being a symlink to "/run" is:
  "/run/symlinknet" rw,

Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Acked-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoutil: mdev: Treat the 'name' sysfs attribute as optional
Erik Skultety [Mon, 5 Mar 2018 14:43:45 +0000 (15:43 +0100)]
util: mdev: Treat the 'name' sysfs attribute as optional

When commit 3545cbef moved the sysfs attribute reading logic from
_udev.c module to virmdev.c, it had to replace our udev read wrappers
with the ones available from virfile.c. The problem is that the original
logic worked correctly with udev read wrappers which don't return an
error code for a missing attribute, virfile.c readers however - not so
much. Therefore add another parameter to the macro, so we can again
accept the fact that optional attributes may be missing.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: report a nicer error when USB is disabled
Ján Tomko [Thu, 14 Sep 2017 07:13:20 +0000 (09:13 +0200)]
qemu: report a nicer error when USB is disabled

If the user tries to define a domain that has

  <controller type='usb' model='none'/>

and also some USB devices, we report an error:
  error: internal error: No free USB ports

Which is technically still correct for a domain with no USB ports.

Change it to:

USB is disabled for this domain, but USB devices are present in the domain XML

https://bugzilla.redhat.com/show_bug.cgi?id=1347550
Signed-off-by: Ján Tomko <jtomko@redhat.com>
7 years agoqemuDomainObjBeginJob: Don't account DESTROY job to maxQueuedJobs
Michal Privoznik [Mon, 5 Mar 2018 09:13:29 +0000 (10:13 +0100)]
qemuDomainObjBeginJob: Don't account DESTROY job to maxQueuedJobs

When trying to destroy a domain (e.g. because we've seen EOF on
the monitor) we try to acquire QEMU_JOB_DESTROY. However, if
max_queued is set in qemu.conf this may fail and since our code
doesn't count on that we will still report domain as active even
though the qemu process is long gone. More specifically, if we've
seen EOF on the monitor, qemuProcessHandleMonitorEOF() is called
which sends MONITOR_EOF job to the event worker pool and
unregisters monitor from the event loop. The worker pool calls
processMonitorEOFEvent() which tries to set job which may fail
due to the limit as described above.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agonews: add logging of guest crash information on S390
Bjoern Walk [Tue, 27 Feb 2018 09:32:57 +0000 (10:32 +0100)]
news: add logging of guest crash information on S390

Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: log the crash information for S390
Bjoern Walk [Tue, 27 Feb 2018 09:32:56 +0000 (10:32 +0100)]
qemu: log the crash information for S390

Since QEMU 2.12 commit id '4ada99ade' guest crash information for
S390 is available in the QEMU monitor, e.g.:

  {
    "timestamp": {
        "seconds": 1518004739,
        "microseconds": 552563
    },
    "event": "GUEST_PANICKED",
    "data": {
        "action": "pause",
        "info": {
            "core": 0,
            "psw-addr": 1102832,
            "reason": "disabled-wait",
            "psw-mask": 562956395872256,
            "type": "s390"
        }
    }
  }

Let's log this information into the domain log file, e.g.:

    2018-02-08 13:11:26.075+0000: panic s390: core='0' psw-mask='0x0002000180000000' psw-addr='0x000000000010f146' reason='disabled-wait'

Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotests: Add capabilities for QEMU 2.11.0 on s390x
Shalini Chellathurai Saroja [Mon, 26 Feb 2018 10:20:18 +0000 (11:20 +0100)]
tests: Add capabilities for QEMU 2.11.0 on s390x

Let us introduce the xml and reply files for QEMU 2.11.0 on s390x.

Signed-off-by: Shalini Chellathurai Saroja <shalini@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
7 years agotests: force use of "NORMAL" TLS priority in test suite
Daniel P. Berrangé [Mon, 5 Mar 2018 12:46:16 +0000 (12:46 +0000)]
tests: force use of "NORMAL" TLS priority in test suite

When generating certificates we rely on GNUTLS' built-in default setup
for the ciphers used in the certs. We then currently run with the distro
specific TLS priority setup which can be much stronger, to the extent
that the certificates we generate are considered untrustworthy. We don't
care about the quality of the ciphers we use in the test suite, so just
force the priority to "NORMAL" which should ensure our certs are
accepted by GNUTLS.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agoqemu: Fix comparison assignment in qemuDomainUpdateDeviceLive
Erik Skultety [Tue, 6 Mar 2018 08:20:58 +0000 (09:20 +0100)]
qemu: Fix comparison assignment in qemuDomainUpdateDeviceLive

Fix this common typo and assign a value rather than implicitly
type-casted comparison result. Introduced by commit b6a264e855.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
7 years agocfg.mak: ignore trailing whitespace in gnulib local patches
Daniel P. Berrangé [Mon, 5 Mar 2018 18:46:24 +0000 (18:46 +0000)]
cfg.mak: ignore trailing whitespace in gnulib local patches

The diff files in gnulib/local may well contain trailing whitespace.
They are simply diff's of gnulib code which should not be modified to
follow libvirt style rules.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agognulib: temporary hacks to deal with glibc libio.h removal
Daniel P. Berrangé [Mon, 5 Mar 2018 17:20:03 +0000 (17:20 +0000)]
gnulib: temporary hacks to deal with glibc libio.h removal

GLibc deprecated libio.h in 2.27 and has removed it in current
code that will become 2.28. The latter is now in Fedora rawhide
and this change breaks gnulib which mistakenly still relies on
these ancient symbols. Add a local hack for gnulib until a
proper fix is available upstream.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agognulib: update to latest upstream changeset
Daniel P. Berrangé [Mon, 5 Mar 2018 16:47:31 +0000 (16:47 +0000)]
gnulib: update to latest upstream changeset

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split vmx driver build rules into vmx/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split vmx driver build rules into vmx/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agomake: split util build rules into util/Makefile.inc.am
Daniel P. Berrangé [Wed, 21 Feb 2018 18:05:56 +0000 (18:05 +0000)]
make: split util build rules into util/Makefile.inc.am

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>