]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
7 years agoqemu: Build usb controller command line more wisely
Michal Privoznik [Fri, 16 Mar 2018 14:53:32 +0000 (15:53 +0100)]
qemu: Build usb controller command line more wisely

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

When building command line for USB controllers we have to do more
than just put controller's alias onto the command line. QEMU has
concept of these joined USB controllers. For instance ehci and
uhci controllers need to create the same USB bus. To achieve that
the slave controller needs to refer the master controller. This
worked until we've introduced user aliases because both master
and slave had the same alias. With user aliases slave can have
different alias than master. Therefore, when generating command
line for slave we need to look up the master's alias.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoqemu: Use correct bus type for input devices
Farhan Ali [Thu, 8 Mar 2018 16:07:04 +0000 (11:07 -0500)]
qemu: Use correct bus type for input devices

commit 7210cef452db 'qemu: build command line for virtio input devices'
introduced an error, by checking if input bus type is
VIR_DOMAIN_DISK_BUS_VIRTIO.

Fix it by using the correct bus type for input devices.

Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoqemu: Fix comment for 'qemuValidateDevicePCISlotsChipsets'
Farhan Ali [Thu, 8 Mar 2018 16:07:01 +0000 (11:07 -0500)]
qemu: Fix comment for 'qemuValidateDevicePCISlotsChipsets'

Commit id '177db487' renamed 'qemuValidateDevicePCISlotsChipsets' to
'qemuDomainValidateDevicePCISlotsChipsets', but didn't adjust comment.

Signed-off-by: Farhan Ali <alifm@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agovirnetlink: Provide virNetlinkGetNeighbor non-Linux stub
Michal Privoznik [Fri, 16 Mar 2018 07:44:20 +0000 (08:44 +0100)]
virnetlink: Provide virNetlinkGetNeighbor non-Linux stub

This function is exported and therefore we have to have
implementation for all platforms.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agovirarptable: Avoid cast align warnings
Michal Privoznik [Thu, 15 Mar 2018 14:08:58 +0000 (15:08 +0100)]
virarptable: Avoid cast align warnings

We have to use VIR_WARNINGS_NO_CAST_ALIGN to avoid clang warning
about increased required alignment caused by some netlink macros.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoremote: Set eventID explicitly to an invalid value
Marc Hartmayer [Thu, 8 Mar 2018 12:20:39 +0000 (13:20 +0100)]
remote: Set eventID explicitly to an invalid value

Set the eventID for remoteRelayDomainQemuMonitorEvent explicitly to an
invalid value. Although the value is not used by
remoteRelayDomainQemuMonitorEvent, but it might be less prone to
errors for further refactorings.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agostream: Access stream->prog instead of a hard-coded global variable
Marc Hartmayer [Thu, 8 Mar 2018 12:20:38 +0000 (13:20 +0100)]
stream: Access stream->prog instead of a hard-coded global variable

Use stream->prog instead of a hard-coded "remoteProgram" since at
stream creation in daemonCreateClientStream "remoteProgram" is used
so we should use that especially since these functions are intended
as generic helpers for streams.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agoremote: remove unneeded global variables
Marc Hartmayer [Thu, 8 Mar 2018 12:20:37 +0000 (13:20 +0100)]
remote: remove unneeded global variables

Remove unneeded global variables and convert them into local variables
where they're needed.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotest: fix error path in testConnectOpen
Marc Hartmayer [Thu, 8 Mar 2018 12:20:35 +0000 (13:20 +0100)]
test: fix error path in testConnectOpen

In case of an error do the cleanup of the private data of the
connection.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotest: introduce testDriverCloseInternal
Marc Hartmayer [Thu, 8 Mar 2018 12:20:34 +0000 (13:20 +0100)]
test: introduce testDriverCloseInternal

Refactor testConnectClose as it's then obvious that conn->privateData
is set to NULL in all cases. In addition, 'testConnectCloseInternal'
can be better reused.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotest: rename defaultConn to defaultPrivconn
Marc Hartmayer [Thu, 8 Mar 2018 12:20:33 +0000 (13:20 +0100)]
test: rename defaultConn to defaultPrivconn

Rename the variable @defaultConn to @defaultPrivconn as it doesn't
point to a default connection but to the private data used for the
shared default connection of the test driver.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotest: testConnectClose: Set privateData to NULL in all cases
Marc Hartmayer [Thu, 8 Mar 2018 12:20:32 +0000 (13:20 +0100)]
test: testConnectClose: Set privateData to NULL in all cases

Set privateData to NULL also for a connection that uses @defaultConn
as privateData regardless of whether @defaultConn was freed or
not. @defaultConn is shared between multiple connections and it's
ensured that there will be no memory leak by counting references.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotest: testConnectAuthenticate: Take the lock when accessing mutable values
Marc Hartmayer [Thu, 8 Mar 2018 12:20:31 +0000 (13:20 +0100)]
test: testConnectAuthenticate: Take the lock when accessing mutable values

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotest: testOpenFromFile: return VIR_DRV_OPEN_SUCCESS in case of success
Marc Hartmayer [Thu, 8 Mar 2018 12:20:30 +0000 (13:20 +0100)]
test: testOpenFromFile: return VIR_DRV_OPEN_SUCCESS in case of success

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotest: testOpenDefault: introduce cleanup path
Marc Hartmayer [Thu, 8 Mar 2018 12:20:29 +0000 (13:20 +0100)]
test: testOpenDefault: introduce cleanup path

The two code paths have some cleanup in common so lets refactor it.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agodriver: Add typedef for the anonymous enum used for driver features
Marc Hartmayer [Thu, 8 Mar 2018 12:20:24 +0000 (13:20 +0100)]
driver: Add typedef for the anonymous enum used for driver features

Add typedef for the anonymous enum used for the driver features. This
allows the usage of the type in a switch statement and taking
advantage of the compilers feature to detect uncovered cases.

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
7 years agotools: Clean up the vol-resize man page
John Ferlan [Mon, 12 Mar 2018 20:26:40 +0000 (16:26 -0400)]
tools: Clean up the vol-resize man page

Instead of appearing as one long paragraph, split the output to list
each command option on its own line for better readability.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Fix man page argument ordering for vol-{path|name|key} commands
John Ferlan [Mon, 12 Mar 2018 20:14:56 +0000 (16:14 -0400)]
virsh: Fix man page argument ordering for vol-{path|name|key} commands

The proper command order is 'virsh vol-path volume pool', or
'virsh vol-name volume pool', or 'virsh vol-key volume'. While
making the modification clean up the description a bit too in order
to help clarify under what circumstances the volume could be found
if the pool name was not provided.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Clean up man page formatting for vol-list and vol-pool
John Ferlan [Mon, 12 Mar 2018 20:12:25 +0000 (16:12 -0400)]
virsh: Clean up man page formatting for vol-list and vol-pool

Make the output more readable.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Fix man page argument ordering for vol-info command
John Ferlan [Mon, 12 Mar 2018 20:08:11 +0000 (16:08 -0400)]
virsh: Fix man page argument ordering for vol-info command

The proper command order is 'virsh vol-info volume pool'. While
making the modification clean up the description a bit too in order
to help clarify under what circumstances the volume could be found
if the pool name was not provided.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Fix man page argument ordering for vol-dumpxml command
John Ferlan [Mon, 12 Mar 2018 19:45:28 +0000 (15:45 -0400)]
virsh: Fix man page argument ordering for vol-dumpxml command

The proper command order is 'virsh vol-dumpxml volume pool'. While
making the modification clean up the description a bit too in order
to help clarify under what circumstances the volume could be found
if the pool name was not provided.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Fix man page argument ordering for vol-wipe command
John Ferlan [Mon, 12 Mar 2018 17:14:18 +0000 (13:14 -0400)]
virsh: Fix man page argument ordering for vol-wipe command

The proper command order is 'virsh vol-wipe volume pool algorithm'. While
making the modification clean up the description a bit too in order
to help clarify under what circumstances the volume could be found
if the pool name was not provided.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Fix man page argument ordering for vol-download command
John Ferlan [Mon, 12 Mar 2018 19:18:06 +0000 (15:18 -0400)]
virsh: Fix man page argument ordering for vol-download command

The proper command order is 'virsh vol-download volume file pool'. While
making the modification clean up the description a bit too in order
to help clarify under what circumstances the volume could be found
if the pool name was not provided.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Fix man page argument ordering for vol-upload command
John Ferlan [Mon, 12 Mar 2018 19:12:23 +0000 (15:12 -0400)]
virsh: Fix man page argument ordering for vol-upload command

The proper command order is 'virsh vol-upload volume file pool'. While
making the modification clean up the description a bit too in order
to help clarify under what circumstances the volume could be found
if the pool name was not provided.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Fix man page argument ordering for vol-delete command
John Ferlan [Mon, 12 Mar 2018 15:26:24 +0000 (11:26 -0400)]
virsh: Fix man page argument ordering for vol-delete command

The proper command order is 'virsh vol-delete volume pool'. While
making the modification clean up the description a bit too in order
to help clarify under what circumstances the volume could be found
if the pool name was not provided.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Fix man page argument ordering for vol-clone command
John Ferlan [Mon, 12 Mar 2018 16:59:14 +0000 (12:59 -0400)]
virsh: Fix man page argument ordering for vol-clone command

The proper command order is 'virsh vol-clone source-vol target-vol pool'.
While making the modification clean up the description a bit too in
order to help clarify under what circumstances the source-vol could be
found if the pool name was not provided.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agovirsh: Clean up formatting of the vol-create* commands
John Ferlan [Mon, 12 Mar 2018 20:01:48 +0000 (16:01 -0400)]
virsh: Clean up formatting of the vol-create* commands

Clean up the formatting to make the output a bit more readable at
least with respect to not having one paragraph of output. Each
option will start on its own line.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agodocs: Fix apibuild.py syntax
John Ferlan [Thu, 15 Mar 2018 20:17:05 +0000 (16:17 -0400)]
docs: Fix apibuild.py syntax

Commit id '477502de3' altered the entry to add one too many closing
parenthesis ')' and that propagated into commit id '9176b42bd'.

Signed-off-by: John Ferlan <jferlan@redhat.com>
7 years agopython3: Fix sort function
Andrea Bolognani [Thu, 15 Mar 2018 09:57:16 +0000 (10:57 +0100)]
python3: Fix sort function

This deals with cls.version possibly being None.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopython3: Open files in text instead of binary mode
Andrea Bolognani [Thu, 15 Mar 2018 09:56:42 +0000 (10:56 +0100)]
python3: Open files in text instead of binary mode

We use text operations on the contents after reading them.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopython3: Replace keys() + sort() with sorted()
Andrea Bolognani [Thu, 15 Mar 2018 09:51:57 +0000 (10:51 +0100)]
python3: Replace keys() + sort() with sorted()

The keys() method no longer returns a list, so converting the
return value would be necessary before calling sort() on it;
alternatively, we can just call sorted(), which returns a
sorted list.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopython3: Call list() explicitly as needed
Andrea Bolognani [Thu, 15 Mar 2018 09:54:07 +0000 (10:54 +0100)]
python3: Call list() explicitly as needed

For list concatenation to work, the value returned by the
keys() method must be converted to a list first.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopython3: Remove uses of string.*() functions
Andrea Bolognani [Thu, 15 Mar 2018 09:42:44 +0000 (10:42 +0100)]
python3: Remove uses of string.*() functions

All of these have been replaced with methods.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopython3: Use the 'in' keyword
Andrea Bolognani [Thu, 15 Mar 2018 09:39:49 +0000 (10:39 +0100)]
python3: Use the 'in' keyword

This replaces uses of the has_key() method.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopython3: Use the repr() function
Andrea Bolognani [Thu, 15 Mar 2018 09:36:06 +0000 (10:36 +0100)]
python3: Use the repr() function

This replaces the `` built-in.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agopython3: Use the print() function
Andrea Bolognani [Thu, 15 Mar 2018 09:30:03 +0000 (10:30 +0100)]
python3: Use the print() function

It has replaced the 'print' statement.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotravis: Don't install xz on macOS
Andrea Bolognani [Thu, 15 Mar 2018 15:01:21 +0000 (16:01 +0100)]
travis: Don't install xz on macOS

It's already being dragged in by Python.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agolockd: fix typo in virtlockd-admin.socket
Jim Fehlig [Wed, 14 Mar 2018 22:42:39 +0000 (16:42 -0600)]
lockd: fix typo in virtlockd-admin.socket

Commit ce7ae55ea1 introduced a typo in virtlockd-admin socket file

/usr/lib/systemd/system/virtlockd-admin.socket:7: Unknown lvalue
'Server' in section 'Socket'

Change 'Server' to 'Service'.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
7 years agotravis: unlink python package before upgrading brew packages
Daniel P. Berrangé [Thu, 15 Mar 2018 13:05:55 +0000 (13:05 +0000)]
travis: unlink python package before upgrading brew packages

The 'brew upgrade' command is pulling in the python2 package which
promptly fails due to clashing symlinks installed by the new python
package (which is python3 based):

==> Pouring python@2-2.7.14_3.sierra.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/2to3-2
Target /usr/local/bin/2to3-2
is a symlink belonging to python. You can unlink it:
  brew unlink python
To force the link and overwrite all conflicting files:
  brew link --overwrite python@2
To list all files that would be deleted:
  brew link --overwrite --dry-run python@2

By running 'brew unlink python' we can get rid of the python3 links that
we didn't want in the first place and avoid this error.

This is the working fix for what we previously attempted todo in:

  commit c9c9fc90ce77ac4a3079c99f42b621937b464700
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Mon Mar 5 10:13:12 2018 +0000

    travis: force install of python2 into $PATH on macOS

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agotravis: move macOS before_install tasks into osx matrix entry
Daniel P. Berrangé [Thu, 15 Mar 2018 10:10:53 +0000 (10:10 +0000)]
travis: move macOS before_install tasks into osx matrix entry

The list of commands we're running for the before_install task
is rather large. We have it all on one line because we're
wrapping it all in a test against TRAVIS_OS_NAME env variable.

By moving it into the osx matrix entry we can remove the need
for the conditional shell test. This lets us put each command
on a separate line making the steps clear to understand.

Fortunately the 'before_install' task does not have the crazy
behaviour whereby travis ignores errors and runs all commands
regardless, like the 'script' task does. The first command
failing will cause an immediate stop with error status.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agovirarptable: Include rtnetlink.h only on Linux
Michal Privoznik [Thu, 15 Mar 2018 12:27:55 +0000 (13:27 +0100)]
virarptable: Include rtnetlink.h only on Linux

And at the same time, do that from .c rather than .h file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Chen Hanxiao<chenhanxiao@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agosrc: Don't add virarptable.c to setuid library
Michal Privoznik [Thu, 15 Mar 2018 12:46:48 +0000 (13:46 +0100)]
src: Don't add virarptable.c to setuid library

The setuid-rpc-client.la is intended to be small and contain only
bare minimum of source files. virarptable.c is not one of them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Chen Hanxiao<chenhanxiao@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agospec: Drop polkit-devel from BuildRequires
Andrea Bolognani [Thu, 15 Mar 2018 11:25:09 +0000 (12:25 +0100)]
spec: Drop polkit-devel from BuildRequires

As of 2499d1a09508 we don't link against libpolkit anymore, so
we only need the polkit package to be available during build.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
7 years agonews: qemu: use arp table of host to get the IP address of guests
Chen Hanxiao [Thu, 8 Mar 2018 07:11:59 +0000 (15:11 +0800)]
news: qemu: use arp table of host to get the IP address of guests

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
7 years agovirsh: add --source arp to domifaddr
Chen Hanxiao [Thu, 8 Mar 2018 07:11:58 +0000 (15:11 +0800)]
virsh: add --source arp to domifaddr

We can use:
  domifaddr f26-cloud --source arp
to get the address.

Acked-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
7 years agoqemu: introduce qemuARPGetInterfaces to get IP from host's arp table
Chen Hanxiao [Thu, 8 Mar 2018 07:11:57 +0000 (15:11 +0800)]
qemu: introduce qemuARPGetInterfaces to get IP from host's arp table

introduce VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_ARP to get ip address
of VM from the message of netlink RTM_GETNEIGH

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoutil: introduce helper to parse message from RTM_GETNEIGH query
Chen Hanxiao [Thu, 8 Mar 2018 07:11:56 +0000 (15:11 +0800)]
util: introduce helper to parse message from RTM_GETNEIGH query

introduce helper to parse RTM_GETNEIGH query message and
store it in struct virArpTable.

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agoutil: introduce virNetlinkGetNeighbor to get neighbor table entry
Chen Hanxiao [Thu, 8 Mar 2018 07:11:55 +0000 (15:11 +0800)]
util: introduce virNetlinkGetNeighbor to get neighbor table entry

use RTM_GETNEIGH to query arp table entry by netlink socket

Signed-off-by: Chen Hanxiao <chenhanxiao@gmail.com>
7 years agoqemu: hotplug: Clean up memory backing files after failed memory hotplug
Peter Krempa [Tue, 13 Mar 2018 17:19:39 +0000 (18:19 +0100)]
qemu: hotplug: Clean up memory backing files after failed memory hotplug

Libvirt provides full path to the backing file since commit
fec8f9c49afb479f6. This made qemu create the backend object but did not
delete it. This was fixed for unplug case in 4d83a6722f but not in case
of failure to hotplug the frontend. We'd leave the files behind which
would make memory unusable in case of hugepages.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
7 years agoqemu: Switch context for job related private XML parsing
Jiri Denemark [Tue, 13 Mar 2018 14:50:41 +0000 (15:50 +0100)]
qemu: Switch context for job related private XML parsing

Having to repeat "./job[1]/" XPath prefix for every single element or
attribute we want to parse is suboptimal. And even more so once we
further extract code from qemuDomainObjPrivateXMLParseJob into separate
functions.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agoqemu: Parse all job related private XML in dedicated function
Jiri Denemark [Tue, 13 Mar 2018 14:43:00 +0000 (15:43 +0100)]
qemu: Parse all job related private XML in dedicated function

Commit dc567cc22b introduced qemuDomainObjPrivateXMLParseJob, but forgot
to move "./job[1]/@type" parsing into it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7 years agodaemonStreamHandleWriteData: Preserve error when aborting stream
Michal Privoznik [Mon, 12 Mar 2018 09:18:05 +0000 (10:18 +0100)]
daemonStreamHandleWriteData: Preserve error when aborting stream

The daemonStreamHandleWriteData() function is called whenever
server side of stream is able to receive some data. Nevertheless,
it calls virStreamSend() (to pass data down to virFDStream) and
depending on its return value it may abort the stream. However,
the functions it called when doing so are public APIs and as such
reset any error set previously. Therefore, if there was any error
in writing data to stream (i.e. repored in virStreamSend) it is
reset before virNetServerProgramSendReplyError() can get to it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
7 years agovirsysinfo: Use more virSkipSpacesBackwards()
Michal Privoznik [Tue, 13 Mar 2018 15:03:13 +0000 (16:03 +0100)]
virsysinfo: Use more virSkipSpacesBackwards()

Some fields reported by dmidecode have plenty of useless spaces
(in fact some have nothing but spaces). To deal with this we have
introduced virSkipSpacesBackwards() and use it in
virSysinfoParseX86Processor() and virSysinfoParseX86Memory().
However, other functions (e.g. virSysinfoParseX86Chassis()) don't
use it at all and thus we are reporting nonsense:

  <sysinfo type='smbios'>
    <chassis>
      <entry name='manufacturer'>FUJITSU</entry>
      <entry name='version'>                      </entry>
      <entry name='serial'>                </entry>
      <entry name='asset'>                                        </entry>
      <entry name='sku'>Default string</entry>
    </chassis>
  </sysinfo>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
7 years agom4: Fix xenstore detection
Andrea Bolognani [Wed, 14 Mar 2018 14:40:07 +0000 (15:40 +0100)]
m4: Fix xenstore detection

Commit 596fc3e3897e introduced the ability to detect xenstore
using pkg-config for systems with Xen 4.9, but accidentally broke
detection for all other systems. Fix the logic so that it works
in all cases.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7 years agoqemu: avoid denial of service reading from QEMU guest agent (CVE-2018-1064)
Daniel P. Berrangé [Thu, 1 Mar 2018 14:55:26 +0000 (14:55 +0000)]
qemu: avoid denial of service reading from QEMU guest agent (CVE-2018-1064)

We read from the agent until seeing a \r\n pair to indicate a completed
reply or event. To avoid memory denial-of-service though, we must have a
size limit on amount of data we buffer. 10 MB is large enough that it
ought to cope with normal agent replies, and small enough that we're not
consuming unreasonable mem.

This is identical to the flaw we had reading from the QEMU monitor
as CVE-2018-5748, so rather embarrassing that we forgot to fix
the agent code at the same time.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
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>