]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agoutil: log: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:53 +0000 (11:12 -0500)]
util: log: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: host: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:52 +0000 (11:12 -0500)]
util: host: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: firewall: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:51 +0000 (11:12 -0500)]
util: firewall: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: file: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:50 +0000 (11:12 -0500)]
util: file: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: arch.h: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:49 +0000 (11:12 -0500)]
util: arch.h: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: netdev: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:48 +0000 (11:12 -0500)]
util: netdev: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: storage: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:47 +0000 (11:12 -0500)]
util: storage: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: atomic: use #pragma once
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:46 +0000 (11:12 -0500)]
util: atomic: use #pragma once

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: alloc: use #pragma once
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:45 +0000 (11:12 -0500)]
util: alloc: use #pragma once

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: thread: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:44 +0000 (11:12 -0500)]
util: thread: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/test: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:43 +0000 (11:12 -0500)]
src/test: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/storage: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:42 +0000 (11:12 -0500)]
src/storage: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/security: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:41 +0000 (11:12 -0500)]
src/security: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/secret: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:40 +0000 (11:12 -0500)]
src/secret: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/rpc: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:39 +0000 (11:12 -0500)]
src/rpc: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/remote: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:38 +0000 (11:12 -0500)]
src/remote: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/qemu: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:37 +0000 (11:12 -0500)]
src/qemu: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/phyp: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:36 +0000 (11:12 -0500)]
src/phyp: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/openvz: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:35 +0000 (11:12 -0500)]
src/openvz: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/nwfilter: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:34 +0000 (11:12 -0500)]
src/nwfilter: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/network: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:33 +0000 (11:12 -0500)]
src/network: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/lxc: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:32 +0000 (11:12 -0500)]
src/lxc: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/locking: use #pragma once in headers
Jonathon Jongsma [Tue, 18 Jun 2019 16:12:31 +0000 (11:12 -0500)]
src/locking: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: delete unused QEMUD_CPUMASK_LEN macro
Ján Tomko [Wed, 19 Jun 2019 14:18:11 +0000 (16:18 +0200)]
qemu: delete unused QEMUD_CPUMASK_LEN macro

Unused as of:
commit f136b83139c63f20de0df3285d9e82df2fb97bfc
    qemu: Rework setting process affinity

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agotest_driver: validate @source in testDomainInterfaceAddresses
Ilias Stamatis [Wed, 19 Jun 2019 11:18:15 +0000 (13:18 +0200)]
test_driver: validate @source in testDomainInterfaceAddresses

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotest_driver: implement virDomainSendProcessSignal
Ilias Stamatis [Tue, 4 Jun 2019 13:17:43 +0000 (15:17 +0200)]
test_driver: implement virDomainSendProcessSignal

Only succeed when @pid_value is 1, since according to the docs this is
the minimum requirement for any driver to implement this API.
Since this is test driver, we assume that any signal from the supported
list can be sent to pid 1 and we therefore succeed every time.

Signed-off-by: Ilias Stamatis <stamatis.iliass@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agoremote: remove obsolete & incorrect comment from libvirtd.conf
Daniel P. Berrangé [Fri, 20 Apr 2018 11:32:44 +0000 (12:32 +0100)]
remote: remove obsolete & incorrect comment from libvirtd.conf

The libvirtd.conf file has a comment pointing people to format.html
which has nothing todo with the configuration file format.

It also has a comment about tests/daemon-conf which no longer exists,
and even if it did exist such comment is not relevant to end users
when this file is installed in /etc/.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoapparmor: Add openGraphicsFD rule for named profile
Christian Ehrhardt [Wed, 19 Jun 2019 07:04:55 +0000 (09:04 +0200)]
apparmor: Add openGraphicsFD rule for named profile

Commit a3ab6d42 changed the libvirtd profile to a named profile
but neglected to accommodate the change in the qemu profile
ptrace and signal rules.
Later on 4ec3cf9a fixed that for ptrace and signal but openGraphicsFD
is still missing.

As a result, libvirtd is unable to open UI on libvirt >=5.1 e.g. with
virt-manager.

Add openGraphicsFD rule that references the libvirtd profile
by name in addition to full binary path.

Fixes: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/1833040
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
5 years agonetwork: add virNetworkPortRef API
Daniel P. Berrangé [Tue, 18 Jun 2019 11:44:39 +0000 (12:44 +0100)]
network: add virNetworkPortRef API

Normal practice is to provide a Ref API for all objects, but this was
forgotten for the virNetworkPortPtr object.

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: remove unused class_id variable
Daniel P. Berrangé [Wed, 19 Jun 2019 08:29:55 +0000 (09:29 +0100)]
conf: remove unused class_id variable

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: add error checking of UUID generation
Daniel P. Berrangé [Tue, 18 Jun 2019 17:36:52 +0000 (18:36 +0100)]
conf: add error checking of UUID generation

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: fix NULL deref when exporting ports
Daniel P. Berrangé [Tue, 18 Jun 2019 17:33:04 +0000 (18:33 +0100)]
conf: fix NULL deref when exporting ports

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: fix leak of directory handle when loading network ports
Daniel P. Berrangé [Tue, 18 Jun 2019 17:31:34 +0000 (18:31 +0100)]
conf: fix leak of directory handle when loading network ports

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: fix leak when parsing network port XML
Daniel P. Berrangé [Tue, 18 Jun 2019 17:29:26 +0000 (18:29 +0100)]
conf: fix leak when parsing network port XML

Use auto free to avoid leaking the "trustGuestRxFilters" strings

Reviewed-by: John Ferlan <jferlan@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agostorage: escape ipv6 for ceph mon hosts to librados
Yi Li [Sun, 28 Apr 2019 02:29:53 +0000 (10:29 +0800)]
storage: escape ipv6 for ceph mon hosts to librados

Hosts for rbd are ceph monitor daemons. These have fixed IP addresses,
so they are often referenced by IP rather than hostname for
convenience, or to avoid relying on DNS. Using IPv4 addresses as the
host name works already, but IPv6 addresses require rbd-specific
escaping because the colon is used as an option separator in the
string passed to librados.

Escape these colons, and enclose the IPv6 address in square brackets
so it is distinguished from the port, which is currently mandatory.

Signed-off-by: Yi Li <yili@winhong.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agodocs: fix some typos in networkport documentation
Ján Tomko [Mon, 17 Jun 2019 15:49:32 +0000 (17:49 +0200)]
docs: fix some typos in networkport documentation

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoProduce more verbose error if cppi not found
Michal Privoznik [Mon, 17 Jun 2019 16:19:03 +0000 (18:19 +0200)]
Produce more verbose error if cppi not found

It's fairly easy (especially for new contributors) to not spot
the 'cppi not installed' line in the syntax-check output. Add a
banner that is shown at the end of syntax-check output if no cppi
was found.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
ACKed-by: Andrea Bolognani <abologna@redhat.com>
5 years agovirpcitest: Separate two functions properly
Michal Privoznik [Mon, 17 Jun 2019 15:42:13 +0000 (17:42 +0200)]
virpcitest: Separate two functions properly

There is a missing empty line between two functions since its
introduction in v1.2.0-rc1~150.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: switch over to use network port APIs for virt drivers
Daniel P. Berrangé [Mon, 24 Dec 2018 10:45:00 +0000 (10:45 +0000)]
conf: switch over to use network port APIs for virt drivers

Change the domain conf so invoke the new network port public APIs instead
of the network callbacks.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: record a portid against the domain conf
Daniel P. Berrangé [Fri, 1 Feb 2019 18:07:08 +0000 (18:07 +0000)]
conf: record a portid against the domain conf

The portid will be the UUID of the virNetworkPort object associated
with the network interface when a guest is running.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agolxc, libxl: save domain status after reconnect
Daniel P. Berrangé [Fri, 1 Feb 2019 17:40:41 +0000 (17:40 +0000)]
lxc, libxl: save domain status after reconnect

The various steps involved in reconnecting to a domain may cause updates
to the virDomainObj struct that need to be reflected in the saved status
file.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agolxc, libxl: notify network driver of NICs during reconnect
Daniel P. Berrangé [Fri, 1 Feb 2019 17:11:22 +0000 (17:11 +0000)]
lxc, libxl: notify network driver of NICs during reconnect

When starting up it is important to notify the network driver of any
NICs which are used by running guests so that it can account for any
resources they are using.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: add implementation of network port APIs
Daniel P. Berrangé [Fri, 14 Dec 2018 17:36:45 +0000 (17:36 +0000)]
network: add implementation of network port APIs

This initial implementation just wires up the APIs and does tracking of
the port XML definitions. It is not yet integrated into the resource
allocation logic.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: support recording ports against virNetworkObjPtr
Daniel P. Berrangé [Wed, 19 Dec 2018 14:24:53 +0000 (14:24 +0000)]
conf: support recording ports against virNetworkObjPtr

The virNetworkObjPtr state will need to maintain a record of all
virNetworkPortDefPtr objects associated with the network. Record these
in a hash and add APIs for manipulating them.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agovirsh: add support for network port APIs
Daniel P. Berrangé [Wed, 12 Dec 2018 16:58:31 +0000 (16:58 +0000)]
virsh: add support for network port APIs

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoremote: add support for new network port APIs
Daniel P. Berrangé [Mon, 10 Dec 2018 17:43:42 +0000 (17:43 +0000)]
remote: add support for new network port APIs

Define the wire protocol for the virNetworkPort APIs and enable the
client/server RPC dispatch.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoaccess: add permissions for network port objects
Daniel P. Berrangé [Fri, 30 Nov 2018 16:34:21 +0000 (16:34 +0000)]
access: add permissions for network port objects

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: add public APIs for network port object
Daniel P. Berrangé [Fri, 30 Nov 2018 14:55:56 +0000 (14:55 +0000)]
network: add public APIs for network port object

Introduce a new virNetworPort object that will present an attachment to
a virtual network from a VM.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: introduce networkUpdatePortBandwidth
Daniel P. Berrangé [Thu, 20 Dec 2018 14:01:18 +0000 (14:01 +0000)]
network: introduce networkUpdatePortBandwidth

Separate network port bandwidth update code from the domain driver
network callback implementation.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: introduce networkReleasePort
Daniel P. Berrangé [Thu, 20 Dec 2018 14:01:18 +0000 (14:01 +0000)]
network: introduce networkReleasePort

Separate network port deletion code from the domain driver network
callback implementation.

Reivewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: introduce networkNotifyPort
Daniel P. Berrangé [Thu, 20 Dec 2018 14:01:18 +0000 (14:01 +0000)]
network: introduce networkNotifyPort

Separate network port notification code from the domain driver network
callback implementation.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: introduce networkAllocatePort
Daniel P. Berrangé [Thu, 20 Dec 2018 14:01:18 +0000 (14:01 +0000)]
network: introduce networkAllocatePort

Separate network port allocation code from the domain driver network
callback implementation.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: remove the virDomainNetBandwidthChangeAllowed callback
Daniel P. Berrangé [Tue, 26 Feb 2019 14:49:35 +0000 (14:49 +0000)]
network: remove the virDomainNetBandwidthChangeAllowed callback

The current qemu driver code for changing bandwidth on a NIC first asks
the network driver if the change is supported, then changes the
bandwidth on the VIF, and then tells the network driver to update the
bandwidth on the bridge.

This is potentially racing if a parallel API call causes the network
driver to allocate bandwidth on the bridge between the check and the
update phases.

Change the code to just try to apply the network bridge update
immediately and rollback at the end if something failed.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: convert hook script to take a network port XML
Daniel P. Berrangé [Wed, 19 Dec 2018 15:36:04 +0000 (15:36 +0000)]
network: convert hook script to take a network port XML

When (un)plugging an interface into a network, the 'plugged'
and 'unplugged' operations are invoked in the hook script.

The data provided to the script contains the network XML, the
domain XML and the domain interface XML. When we strictly split the
drivers up this will no longer be possible and thus breakage is
unavoidable. The hook scripts are not considered to be covered by the
API guarantee so this is OK.

To avoid existing scripts taking the wrong action, the existing
operations are changed to 'port-created' and 'port-deleted'
instead. These will receive the network XML and the network port
XML.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: convert networkReleaseActualDevice to virNetworkPortDef
Daniel P. Berrangé [Mon, 12 Nov 2018 16:32:31 +0000 (16:32 +0000)]
network: convert networkReleaseActualDevice to virNetworkPortDef

Convert the virDomainNetDef object into a virNetworkPortDef object
at the start of networkReleaseActualDevice. This largely decouples
the method impl from the domain object type.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: convert networkNotifyActualDevice to virNetworkPortDef
Daniel P. Berrangé [Mon, 12 Nov 2018 16:32:31 +0000 (16:32 +0000)]
network: convert networkNotifyActualDevice to virNetworkPortDef

Convert the virDomainNetDef object into a virNetworkPortDef object
at the start of networkNotifyActualDevice. This largely decouples
the method impl from the domain object type.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: convert networkAllocateActualDevice to virNetworkPortDef
Daniel P. Berrangé [Mon, 3 Sep 2018 16:34:22 +0000 (17:34 +0100)]
network: convert networkAllocateActualDevice to virNetworkPortDef

Convert the virDomainNetDef object into a virNetworkPortDef object
at the start of networkAllocateActualDevice. This largely decouples
the method impl from the domain object type.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: add APIs to convert virDomainNetDef to virNetworkPortDef
Daniel P. Berrangé [Mon, 3 Sep 2018 15:59:52 +0000 (16:59 +0100)]
conf: add APIs to convert virDomainNetDef to virNetworkPortDef

Helper APIs are needed to

 - Populate basic virNetworkPortDef from virDomainNetDef
 - Set a virDomainActualNetDef from virNetworkPortDef
 - Populate a full virNetworkPortDef from virDomainActualNetDef

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agonetwork: make networkLogAllocation independent of domain conf
Daniel P. Berrangé [Mon, 3 Sep 2018 13:04:57 +0000 (14:04 +0100)]
network: make networkLogAllocation independent of domain conf

Stop passing a virDomainNetDefPtr parameter to networkLogAllocation,
instead just pass in the MAC address. The actual device type is also not
required, since virNetworkForwardIfDefPtr has a type field that can be
used instead.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: introduce virNetworkPortDefPtr struct and XML support
Daniel P. Berrangé [Fri, 31 Aug 2018 14:21:34 +0000 (15:21 +0100)]
conf: introduce virNetworkPortDefPtr struct and XML support

Introduce a virNetworkPortDefPtr struct to represent the data associated
with a virtual network port. Add APIs for parsing/formatting XML docs
with the data.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoconf: allow bandwidth parsing / formatting to include class ID
Daniel P. Berrangé [Tue, 14 May 2019 14:44:55 +0000 (15:44 +0100)]
conf: allow bandwidth parsing / formatting to include class ID

The domain conf actual network def stores a <class id='3'/> element
separately from the <bandwidth>. The class ID should really just be
an attribute on the <bandwidth> element. We can't change existing
XML, and this isn't visible to users since it is internal XML only.
When we expose the new network port XML to users though, we should
get the design right.

Reviewed-by: Laine Stump <laine@laine.org>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agodocs: storage: document the 'lvm2' disk format oddness
Ján Tomko [Sat, 15 Jun 2019 12:47:37 +0000 (14:47 +0200)]
docs: storage: document the 'lvm2' disk format oddness

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agodocs: storage: type out two
Ján Tomko [Sat, 15 Jun 2019 12:47:23 +0000 (14:47 +0200)]
docs: storage: type out two

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agodocs: storage: fix spacing when enumerating volume formats
Ján Tomko [Sat, 15 Jun 2019 12:40:11 +0000 (14:40 +0200)]
docs: storage: fix spacing when enumerating volume formats

There was a space missing after 'qcow'.
Delete 'qcow' and 'cow' as examples to make the document
more relevant for the current decade.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemuMonitorTestAddInvalidCommandResponse: VIR_AUTOFREE
Ján Tomko [Sat, 15 Jun 2019 10:07:04 +0000 (12:07 +0200)]
tests: qemuMonitorTestAddInvalidCommandResponse: VIR_AUTOFREE

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemuMonitorTestAddUnexpectedErrorResponse: VIR_AUTOFREE
Ján Tomko [Sat, 15 Jun 2019 10:06:54 +0000 (12:06 +0200)]
tests: qemuMonitorTestAddUnexpectedErrorResponse: VIR_AUTOFREE

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: refactor qemuMonitorTestProcessCommandDefaultValidate
Ján Tomko [Sat, 15 Jun 2019 09:54:03 +0000 (11:54 +0200)]
tests: refactor qemuMonitorTestProcessCommandDefaultValidate

Use VIR_AUTO* for cleanup and virBufferCurrentContent instead
of virBufferContentAndReset.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: refactor qemuMonitorTestProcessCommandDefault
Ján Tomko [Sat, 15 Jun 2019 09:43:09 +0000 (11:43 +0200)]
tests: refactor qemuMonitorTestProcessCommandDefault

Use VIR_AUTOPTR and get rid of the 'ret' variable.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemuMonitorReportError: use VIR_AUTOFREE
Ján Tomko [Sat, 15 Jun 2019 10:01:05 +0000 (12:01 +0200)]
tests: qemuMonitorReportError: use VIR_AUTOFREE

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: remove text monitor testing infrastructure
Ján Tomko [Sat, 15 Jun 2019 10:09:41 +0000 (12:09 +0200)]
tests: remove text monitor testing infrastructure

We removed testing for text monitor some time ago, remove
the remains from the test infrastructure.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemuMonitorReportError: use tmp variable properly
Ján Tomko [Sat, 15 Jun 2019 09:58:32 +0000 (11:58 +0200)]
tests: qemuMonitorReportError: use tmp variable properly

There is no obvious benefit in putting the escaped message
back into msg while tmp holds the original message.

Remove the assignment and use 'tmp' directly'.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: qemuMonitorTestAddErrorResponse: use VIR_AUTOFREE
Ján Tomko [Sat, 15 Jun 2019 10:06:36 +0000 (12:06 +0200)]
tests: qemuMonitorTestAddErrorResponse: use VIR_AUTOFREE

Use VIR_AUTOFREE.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: always assume JSON in qemuMonitorTestNew
Ján Tomko [Fri, 14 Jun 2019 18:14:23 +0000 (20:14 +0200)]
tests: always assume JSON in qemuMonitorTestNew

Now that all the callers call qemuMonitorTestNew with json=true,
remove the argument and always assume JSON.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: assume JSON monitor in qemuMonitorTestNewSimple
Ján Tomko [Fri, 14 Jun 2019 18:10:15 +0000 (20:10 +0200)]
tests: assume JSON monitor in qemuMonitorTestNewSimple

The only user of the qemuMonitorTestNewSimple macro is using JSON.
Always pass 'true' to qemuMonitorTestNew and remove the 'json'
argument.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agonodesuspend: report unsupported if systemd & pm-utils aren't available
Daniel P. Berrangé [Thu, 23 May 2019 15:55:22 +0000 (16:55 +0100)]
nodesuspend: report unsupported if systemd & pm-utils aren't available

When libvirtd is run inside a container it is normal that neither
systemd nor pm-utils will be available. In this case there is no way to
suspend the host, so libvirt should just report the feature unsupported
instead of raising an error.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Try harder to remove pr-helper object and kill pr-helper process
Jie Wang [Fri, 31 May 2019 07:33:31 +0000 (15:33 +0800)]
qemu: Try harder to remove pr-helper object and kill pr-helper process

If libvirt receives DISCONNECTED event and prDaemonRunning is set
to false, and qemuDomainRemoveDiskDevice() is performing in the
meantime, then qemuDomainRemoveDiskDevice() will fail to remove
pr-helper object because prDaemonRunning is false. But removing
that check from qemuHotplugRemoveManagedPR() is not enough,
because after removing the object through monitor the
qemuProcessKillManagedPRDaemon() is called which contains the
same check. Thus the pr-helper process might be left behind.

Signed-off-by: Jie Wang <wangjie88@huawei.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirNodeDeviceCapPCIDefFormat: Drop useless space before end of tags
Michal Privoznik [Tue, 11 Jun 2019 14:51:37 +0000 (16:51 +0200)]
virNodeDeviceCapPCIDefFormat: Drop useless space before end of tags

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agosrc/logging: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:30 +0000 (15:20 -0500)]
src/logging: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/libxl: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:29 +0000 (15:20 -0500)]
src/libxl: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/libvirt_internal.h: use #pragma once
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:28 +0000 (15:20 -0500)]
src/libvirt_internal.h: use #pragma once

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/internal.h: use #pragma once
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:27 +0000 (15:20 -0500)]
src/internal.h: use #pragma once

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/interface: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:26 +0000 (15:20 -0500)]
src/interface: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/hyperv: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:25 +0000 (15:20 -0500)]
src/hyperv: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/esx: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:24 +0000 (15:20 -0500)]
src/esx: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/datatypes.h: use #pragma once
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:23 +0000 (15:20 -0500)]
src/datatypes.h: use #pragma once

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/cpu: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:22 +0000 (15:20 -0500)]
src/cpu: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: misc: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:21 +0000 (15:20 -0500)]
conf: misc: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: storage: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:20 +0000 (15:20 -0500)]
conf: storage: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: node device: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:19 +0000 (15:20 -0500)]
conf: node device: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: nwfilter: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:18 +0000 (15:20 -0500)]
conf: nwfilter: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: network: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:17 +0000 (15:20 -0500)]
conf: network: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: domain: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:16 +0000 (15:20 -0500)]
conf: domain: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/bhyve: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:15 +0000 (15:20 -0500)]
src/bhyve: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/admin: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:14 +0000 (15:20 -0500)]
src/admin: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agosrc/access: use #pragma once in headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:13 +0000 (15:20 -0500)]
src/access: use #pragma once in headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoUse #pragma once in driver headers
Jonathon Jongsma [Fri, 7 Jun 2019 20:20:12 +0000 (15:20 -0500)]
Use #pragma once in driver headers

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: domain: Log some useful data in qemuDomainStorageSourceAccessModify
Peter Krempa [Wed, 12 Jun 2019 11:49:57 +0000 (13:49 +0200)]
qemu: domain: Log some useful data in qemuDomainStorageSourceAccessModify

Log the flags passed to the function in a exploded state so that it's
easily visible what's happening to the image.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agotests: Include LDADDS in qemu_LDADDS
Andrea Bolognani [Tue, 11 Jun 2019 15:16:57 +0000 (17:16 +0200)]
tests: Include LDADDS in qemu_LDADDS

At this point, all test programs that use qemu_LDADDS also
use LDADDS, so we can remove a bunch of repetition by simply
including the latter in the former.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agotests: Tweak vircapstest_LDADD
Andrea Bolognani [Wed, 12 Jun 2019 09:42:39 +0000 (11:42 +0200)]
tests: Tweak vircapstest_LDADD

We optionally include QEMU and LXC support in this test and
depending on which is enabled (if either is enabled at all) we
need to link in different objects.

Right now we implicitly depend on the fact that qemu_LDADDS is
empty when QEMU is not enabled to get the correct set of objects,
but it's better to be explicit about it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agotests: Tweak cputest_LDADDS
Andrea Bolognani [Tue, 11 Jun 2019 14:03:24 +0000 (16:03 +0200)]
tests: Tweak cputest_LDADDS

We want all test programs using qemu_LDADDS to also use LDADDS,
and cputest is the only existing exception.

We can't just replace GNULIB_LIBS with LDADDS though, even though
the latter is a superset of the former, because that would result
in a linking error due to including the same object twice:

  /usr/bin/ld:
  ../src/libvirt_probes.o:.../src/libvirt_probes.o.dtrace-temp.c:141:
  multiple definition of `libvirt_object_new_semaphore';
  ../src/libvirt_probes.o:.../src/libvirt_probes.o.dtrace-temp.c:141:
  first defined here

To work around this, we include both qemu_LDADDS and LDADDS when
QEMU support is enabled, and just LDADDS otherwise.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>