]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
4 years agohyperv: use g_autoptr for WMI classes in hypervDomainGetInfo
Matt Coleman [Thu, 21 Jan 2021 18:51:07 +0000 (13:51 -0500)]
hyperv: use g_autoptr for WMI classes in hypervDomainGetInfo

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_DiskDrive in hypervDomainDefParsePhysicalDisk
Matt Coleman [Thu, 21 Jan 2021 18:51:06 +0000 (13:51 -0500)]
hyperv: use g_autoptr for Msvm_DiskDrive in hypervDomainDefParsePhysicalDisk

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for WMI classes in hypervDomainAttachStorage
Matt Coleman [Thu, 21 Jan 2021 18:51:05 +0000 (13:51 -0500)]
hyperv: use g_autoptr for WMI classes in hypervDomainAttachStorage

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ResourceAllocationSettingData in hypervDomainAttachPhy...
Matt Coleman [Thu, 21 Jan 2021 18:51:04 +0000 (13:51 -0500)]
hyperv: use g_autoptr for Msvm_ResourceAllocationSettingData in hypervDomainAttachPhysicalDisk

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Win32_ComputerSystemProduct in hypervLookupHostSystemBiosUuid
Matt Coleman [Thu, 21 Jan 2021 18:51:03 +0000 (13:51 -0500)]
hyperv: use g_autoptr for Win32_ComputerSystemProduct in hypervLookupHostSystemBiosUuid

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ComputerSystem in hypervRequestStateChange
Matt Coleman [Thu, 21 Jan 2021 18:51:02 +0000 (13:51 -0500)]
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervRequestStateChange

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for WMI classes in hypervDomainSetMemoryProperty
Matt Coleman [Thu, 21 Jan 2021 18:51:01 +0000 (13:51 -0500)]
hyperv: use g_autoptr for WMI classes in hypervDomainSetMemoryProperty

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for WMI classes in hypervDomainGetMaxMemory
Matt Coleman [Thu, 21 Jan 2021 18:51:00 +0000 (13:51 -0500)]
hyperv: use g_autoptr for WMI classes in hypervDomainGetMaxMemory

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainDestroyFlags
Matt Coleman [Thu, 21 Jan 2021 18:50:59 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainDestroyFlags

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for WMI classes in hypervDomainShutdownFlags
Matt Coleman [Thu, 21 Jan 2021 18:50:58 +0000 (13:50 -0500)]
hyperv: use g_autoptr for WMI classes in hypervDomainShutdownFlags

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainResume
Matt Coleman [Thu, 21 Jan 2021 18:50:57 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainResume

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByName
Matt Coleman [Thu, 21 Jan 2021 18:50:56 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByName

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByUUID
Matt Coleman [Thu, 21 Jan 2021 18:50:55 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByUUID

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByID
Matt Coleman [Thu, 21 Jan 2021 18:50:54 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainLookupByID

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectListDomains
Matt Coleman [Thu, 21 Jan 2021 18:50:53 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectListDomains

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectNumOfDomains
Matt Coleman [Thu, 21 Jan 2021 18:50:52 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectNumOfDomains

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for WMI classes in hypervNodeGetInfo
Matt Coleman [Thu, 21 Jan 2021 18:50:51 +0000 (13:50 -0500)]
hyperv: use g_autoptr for WMI classes in hypervNodeGetInfo

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Msvm_ProcessorSettingData in hypervConnectGetMaxVcpus
Matt Coleman [Thu, 21 Jan 2021 18:50:50 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Msvm_ProcessorSettingData in hypervConnectGetMaxVcpus

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Win32_ComputerSystem in hypervConnectGetHostname
Matt Coleman [Thu, 21 Jan 2021 18:50:49 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Win32_ComputerSystem in hypervConnectGetHostname

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use g_autoptr for Win32_OperatingSystem in hypervConnectOpen
Matt Coleman [Thu, 21 Jan 2021 18:50:48 +0000 (13:50 -0500)]
hyperv: use g_autoptr for Win32_OperatingSystem in hypervConnectOpen

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: enable automatic cleanup for OpenWSMAN types
Matt Coleman [Thu, 21 Jan 2021 18:50:47 +0000 (13:50 -0500)]
hyperv: enable automatic cleanup for OpenWSMAN types

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: enable use of g_autoptr for the rest of the CIM/WMI classes
Matt Coleman [Thu, 21 Jan 2021 18:50:46 +0000 (13:50 -0500)]
hyperv: enable use of g_autoptr for the rest of the CIM/WMI classes

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: enable use of g_autoptr for hypervObject
Matt Coleman [Thu, 21 Jan 2021 18:50:45 +0000 (13:50 -0500)]
hyperv: enable use of g_autoptr for hypervObject

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: store hypervPrivate in hypervObject
Matt Coleman [Thu, 21 Jan 2021 18:50:44 +0000 (13:50 -0500)]
hyperv: store hypervPrivate in hypervObject

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: add inheritance to the WMI generator
Matt Coleman [Thu, 21 Jan 2021 18:50:43 +0000 (13:50 -0500)]
hyperv: add inheritance to the WMI generator

This enables casting subtypes to their parent.

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: store the Hyper-V version when connecting
Matt Coleman [Thu, 21 Jan 2021 18:50:42 +0000 (13:50 -0500)]
hyperv: store the Hyper-V version when connecting

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: add a macro for retrieving setting data
Matt Coleman [Thu, 21 Jan 2021 18:50:41 +0000 (13:50 -0500)]
hyperv: add a macro for retrieving setting data

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agostorage_source: use virStorageSource prefix for all functions
Pavel Hrdina [Thu, 21 Jan 2021 15:46:14 +0000 (16:46 +0100)]
storage_source: use virStorageSource prefix for all functions

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: move virStorageEncryption code into conf
Pavel Hrdina [Tue, 8 Dec 2020 15:54:30 +0000 (16:54 +0100)]
util: move virStorageEncryption code into conf

The code handles XML bits and internal definition and should be
in conf directory.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: move virStorageSource code into conf
Pavel Hrdina [Thu, 21 Jan 2021 14:44:53 +0000 (15:44 +0100)]
util: move virStorageSource code into conf

The code handles XML bits and internal definition and should be
in conf directory.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: move virStorageFileProbe code into storage_file
Pavel Hrdina [Fri, 22 Jan 2021 09:39:10 +0000 (10:39 +0100)]
util: move virStorageFileProbe code into storage_file

Same as virStorageFileBackend, it doesn't belong into util directory.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: move virStorageFileBackend code into storage_file
Pavel Hrdina [Fri, 22 Jan 2021 09:37:33 +0000 (10:37 +0100)]
util: move virStorageFileBackend code into storage_file

It's used only by storage file code so it doesn't make sense to have
it in util directory.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: extract virStorageFile code into storage_source
Pavel Hrdina [Fri, 22 Jan 2021 09:36:21 +0000 (10:36 +0100)]
util: extract virStorageFile code into storage_source

Up until now we had a runtime code and XML related code in the same
source file inside util directory.

This patch takes the runtime part and extracts it into the new
storage_file directory.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: extract storage file probe code into virtstoragefileprobe.c
Pavel Hrdina [Thu, 21 Jan 2021 16:03:12 +0000 (17:03 +0100)]
util: extract storage file probe code into virtstoragefileprobe.c

This code is not directly relevant to virStorageSource so move it to
separate file.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: move virStorageSourceFindByNodeName into qemu_domain
Pavel Hrdina [Fri, 15 Jan 2021 19:52:00 +0000 (20:52 +0100)]
util: move virStorageSourceFindByNodeName into qemu_domain

It's only relevant for QEMU driver.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agostorage: move storage file sources to separate directory
Pavel Hrdina [Wed, 2 Dec 2020 12:10:59 +0000 (13:10 +0100)]
storage: move storage file sources to separate directory

Introduce a new storage_file directory where we will keep storage file
related code. Add a backend prefix to the file name to separate it from
other future files with 'storage_file' prefix.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirstoragefile: change virStorageSource->drv to void pointer
Pavel Hrdina [Tue, 8 Dec 2020 14:22:57 +0000 (15:22 +0100)]
virstoragefile: change virStorageSource->drv to void pointer

This will allow following patches to move virStorageSource into conf
directory and virStorageDriverData into a new storage_file directory.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirstoragefile: properly include virstoragefile.h header
Pavel Hrdina [Thu, 21 Jan 2021 15:47:52 +0000 (16:47 +0100)]
virstoragefile: properly include virstoragefile.h header

It was indirectly included by virstoragefilebackend.h.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agosrc: add missing virstoragefile.h includes
Pavel Hrdina [Thu, 21 Jan 2021 14:34:45 +0000 (15:34 +0100)]
src: add missing virstoragefile.h includes

These files are using functions from virstoragefile.h but are missing
explicit include.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirsh: Fix XPATH in virshDomainDeviceAliasCompleter()
Michal Privoznik [Fri, 22 Jan 2021 08:29:54 +0000 (09:29 +0100)]
virsh: Fix XPATH in virshDomainDeviceAliasCompleter()

The way this completer works is that it dumps XML of specified
domain and then tries to look for @name attribute of <alias/>
element. However, the XPATH it uses is not correct which results
in no aliases returned by the completer.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agovirNetworkDHCPLeaseTimeDefParseXML: Output error when 'expiry' can't be parsed
Peter Krempa [Thu, 21 Jan 2021 16:35:12 +0000 (17:35 +0100)]
virNetworkDHCPLeaseTimeDefParseXML: Output error when 'expiry' can't be parsed

virStrToLong_ul doesn't report it's own error.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1918674
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoapparmor: let image label setting loop over backing files
Christian Ehrhardt [Wed, 13 Jan 2021 11:32:18 +0000 (12:32 +0100)]
apparmor: let image label setting loop over backing files

When adding a rule for an image file and that image file has a chain
of backing files then we need to add a rule for each of those files.

To get that iterate over the backing file chain the same way as
dac/selinux already do and add a label for each.

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/118
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
4 years agoNEWS: Document virtio-pmem model
Michal Privoznik [Thu, 21 Jan 2021 12:21:35 +0000 (13:21 +0100)]
NEWS: Document virtio-pmem model

A few commits ago I've implemented virtio-pmem memory model.
Mention it in the news file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agohyperv: implement domainAttachDevice and domainAttachDeviceFlags
Matt Coleman [Thu, 14 Jan 2021 13:03:41 +0000 (08:03 -0500)]
hyperv: implement domainAttachDevice and domainAttachDeviceFlags

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: attach floppy disks when defining domains
Matt Coleman [Thu, 14 Jan 2021 13:03:40 +0000 (08:03 -0500)]
hyperv: attach floppy disks when defining domains

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: attach virtual optical disks when defining domains
Matt Coleman [Thu, 14 Jan 2021 13:03:39 +0000 (08:03 -0500)]
hyperv: attach virtual optical disks when defining domains

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: attach physical disks when defining domains
Matt Coleman [Thu, 14 Jan 2021 13:03:38 +0000 (08:03 -0500)]
hyperv: attach physical disks when defining domains

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: attach virtual disks when defining domains
Matt Coleman [Thu, 14 Jan 2021 13:03:37 +0000 (08:03 -0500)]
hyperv: attach virtual disks when defining domains

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: create SCSI controllers when defining domains
Matt Coleman [Thu, 14 Jan 2021 13:03:36 +0000 (08:03 -0500)]
hyperv: create SCSI controllers when defining domains

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: add hypervMsvmVSMSAddResourceSettings
Matt Coleman [Thu, 14 Jan 2021 13:03:35 +0000 (08:03 -0500)]
hyperv: add hypervMsvmVSMSAddResourceSettings

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: implement domainDefineXML
Matt Coleman [Thu, 14 Jan 2021 13:03:34 +0000 (08:03 -0500)]
hyperv: implement domainDefineXML

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: implement domainUndefine and domainUndefineFlags
Matt Coleman [Thu, 14 Jan 2021 13:03:33 +0000 (08:03 -0500)]
hyperv: implement domainUndefine and domainUndefineFlags

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: ambiguous VM names will throw an error
Matt Coleman [Thu, 14 Jan 2021 13:03:32 +0000 (08:03 -0500)]
hyperv: ambiguous VM names will throw an error

Since Hyper-V allows multiple VMs to be created with the same name,
some commands produce unpredictable results due to
hypervDomainLookupByName's WMI query selecting the wrong domain.

For example, this prevents `virsh dumpxml` from outputting XML for the
wrong domain.

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoci: Drop openSUSE Leap 15.1
Erik Skultety [Wed, 20 Jan 2021 07:06:35 +0000 (08:06 +0100)]
ci: Drop openSUSE Leap 15.1

Leap 15.1 will reach EOL on January 31st 2021, so we should not test on
it during the current development cycle ending on March 1st.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoci: Add openSUSE Leap 15.2
Erik Skultety [Tue, 19 Jan 2021 07:28:42 +0000 (08:28 +0100)]
ci: Add openSUSE Leap 15.2

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoci: Refresh Dockerfiles
Erik Skultety [Tue, 19 Jan 2021 07:21:26 +0000 (08:21 +0100)]
ci: Refresh Dockerfiles

In this refresh CentOS 7 now uses docker.io registry and the PowerTools
repo name regression was fixed for CentOS Stream this time.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agomeson: build vstorage only on linux
Nikolay Shirokovskiy [Tue, 19 Jan 2021 13:34:26 +0000 (16:34 +0300)]
meson: build vstorage only on linux

This should fix CI error:

    ../dist-unpack/libvirt-7.1.0/src/storage/storage_backend_vstorage.c:10:10: fatal error: 'mntent.h' file not found
    #include <mntent.h>
    ^~~~~~~~~~

on freebsd and mac.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agomeson: Fix build with -Dtest_coverage=true
Jiri Denemark [Fri, 15 Jan 2021 21:35:09 +0000 (22:35 +0100)]
meson: Fix build with -Dtest_coverage=true

As can be seen in commit 8a62a1592ae00eab4eb153c02661e56b9d8d9032 (from
autoconf era), the coverage flags have to be used also when linking
objects. However, this was not reflected when we switched to meson.

Without this patch linking fails with undefined references to various
__gcov_* symbols.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agodocs: Clarify use of virtio-scsi model for SCSI controllers
Andrea Bolognani [Tue, 19 Jan 2021 14:36:29 +0000 (15:36 +0100)]
docs: Clarify use of virtio-scsi model for SCSI controllers

The current formulation can lead people to believe SCSI
controllers only allow the virtio-scsi model, but really the
only difference is that you have to use model='virtio-scsi'
where you would use model='virtio' for another device.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agovstorage: remove build time checks for runtime binaries
Nikolay Shirokovskiy [Tue, 19 Jan 2021 06:22:11 +0000 (09:22 +0300)]
vstorage: remove build time checks for runtime binaries

Accoring to current agreement mentioned in list recently [1]. Now
vstorage driver will be build in default devs environment and also can
be included into CI. This also closes quite old abandoned thread on
alternative checks for binaries in case of this same driver [2].

[1] https://www.redhat.com/archives/libvir-list/2021-January/msg00750.html
[2] https://www.redhat.com/archives/libvir-list/2020-July/msg00697.html

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoconf: Move generation of NVDIMM UUID into post parse callback
Michal Privoznik [Mon, 18 Jan 2021 13:21:36 +0000 (14:21 +0100)]
conf: Move generation of NVDIMM UUID into post parse callback

It's better to fill in missing values in post parse callbacks
than during parsing.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoconf: Turn @uuid member of _virDomainMemoryDef struct into a pointer
Michal Privoznik [Mon, 18 Jan 2021 13:10:30 +0000 (14:10 +0100)]
conf: Turn @uuid member of _virDomainMemoryDef struct into a pointer

The _virDomainMemoryDef structure has @uuid member which is
needed for PPC64 guests. No other architectures use it. Since the
member is VIR_UUID_BUFLEN bytes long, the structure is
unnecessary big. If the member is just a pointer then we can also
replace some calls of virUUIDIsValid() with plain test against
NULL and also simplify formatter code which can now also check
the pointer against NULL.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 18 Jan 2021 12:36:59 +0000 (13:36 +0100)]
Translated using Weblate (Swedish)

Currently translated at 22.8% (2384 of 10451 strings)

Translation: libvirt/libvirt
Translate-URL: https://translate.fedoraproject.org/projects/libvirt/libvirt/sv/

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
4 years agoqemu: Build command line for virtio-pmem
Michal Privoznik [Sat, 31 Oct 2020 19:50:22 +0000 (20:50 +0100)]
qemu: Build command line for virtio-pmem

Now we have everything prepared for generating the command line.
The device alias prefix was chosen to be 'virtiopmem'.

Since virtio-pmem-pci device goes onto PCI bus generating device
alias must have been changed slightly because
qemuAssignDeviceMemoryAlias() might have used DIMM slot number to
generate the alias. This obviously won't work and thus the "old"
way (which includes qemuDomainDeviceAliasIndex()) must be used.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1735375
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu: Create virtio-pmem in namespace
Michal Privoznik [Thu, 10 Dec 2020 09:18:19 +0000 (10:18 +0100)]
qemu: Create virtio-pmem in namespace

Some users might want to have virtio-pmem backed by a block device
in which case we have to create the device in the domain private
namespace.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu: Allow virtio-pmem in CGroups
Michal Privoznik [Wed, 9 Dec 2020 15:47:15 +0000 (16:47 +0100)]
qemu: Allow virtio-pmem in CGroups

Some users might want to have virtio-pmem backed by a block
device in which case we have to allow the device in CGroups.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agosecurity: Relabel virtio-pmem
Michal Privoznik [Wed, 9 Dec 2020 15:33:20 +0000 (16:33 +0100)]
security: Relabel virtio-pmem

Just like with NVDIMM model, we have to relabel the path to
virtio-pmem so that QEMU can access it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoconf: Introduce virtio-pmem <memory/> model
Michal Privoznik [Mon, 7 Dec 2020 14:24:17 +0000 (15:24 +0100)]
conf: Introduce virtio-pmem <memory/> model

The virtio-pmem is a virtio variant of NVDIMM and just like
NVDIMM virtio-pmem also allows accessing host pages bypassing
guest page cache. The difference is that if a regular file is
used to back guest's NVDIMM (model='nvdimm') the persistence of
guest writes might not be guaranteed while with virtio-pmem it
is.

To express this new model at domain XML level, I've chosen the
following:

  <memory model='virtio-pmem' access='shared'>
    <source>
      <path>/tmp/virtio_pmem</path>
    </source>
    <target>
      <size unit='KiB'>524288</size>
    </target>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
  </memory>

Another difference between NVDIMM and virtio-pmem is that while
the former supports NUMA node locality the latter doesn't. And
also, the latter goes onto PCI bus and not into a DIMM module.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoqemu_capabilities: Introduce QEMU_CAPS_DEVICE_VIRTIO_PMEM_PCI
Michal Privoznik [Fri, 15 Jan 2021 12:31:51 +0000 (13:31 +0100)]
qemu_capabilities: Introduce QEMU_CAPS_DEVICE_VIRTIO_PMEM_PCI

This commit introduces a new capability that reflects virtio-pmem-pci
device support in qemu:

  QEMU_CAPS_DEVICE_VIRTIO_PMEM_PCI, /* -device virtio-pmem-pci */

The virtio-pmem-pci device was introduced in QEMU 4.1.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agodocs: add manpage for virtxend
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtxend

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtvzd
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtvzd

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtvboxd
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtvboxd

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtstoraged
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtstoraged

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtsecretd
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtsecretd

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtqemud
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtqemud

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtnwfilterd
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtnwfilterd

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtnodedevd
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtnodedevd

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtnetworkd
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtnetworkd

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtlxcd
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtlxcd

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtinterfaced
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtinterfaced

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtbhyved
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtbhyved

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: add manpage for virtproxyd
Daniel P. Berrangé [Thu, 24 Sep 2020 14:08:37 +0000 (15:08 +0100)]
docs: add manpage for virtproxyd

This is an adaptation of the libvirtd manpage.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: tweak heading for daemon manual pages
Daniel P. Berrangé [Tue, 17 Nov 2020 15:12:05 +0000 (15:12 +0000)]
docs: tweak heading for daemon manual pages

This group will be distinct from the per-driver modular daemon mapages.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: don't hardcode an ancient version in manpage examples
Daniel P. Berrangé [Tue, 17 Nov 2020 14:44:28 +0000 (14:44 +0000)]
docs: don't hardcode an ancient version in manpage examples

Subsitute in the current version so the example always reflect today's
version of reality.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agodocs: consistently mark libvirtd as preformatted text
Daniel P. Berrangé [Mon, 5 Oct 2020 16:18:30 +0000 (17:18 +0100)]
docs: consistently mark libvirtd as preformatted text

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agonetwork: explicitly set the MTU of the bridge device.
Laine Stump [Thu, 14 Jan 2021 16:57:45 +0000 (11:57 -0500)]
network: explicitly set the MTU of the bridge device.

In the past, the MTU of libvirt virtual network bridge devices was
implicitly set by setting the MTU of the "dummy tap device" (which was
being added in order to force a particular MAC address from the
bridge). But the dummy tap device was removed in commit ee6c936fbb
(libvirt-6.8.0), and so the mtu setting in the network is ignored.

The solution is, of course, to explicitly set the bridge device MTU
when it is created.

Note that any guest interface with a larger MTU that is attached will
cause the bridge to (temporarily) assume the larger MTU, but it will
revert to the bridge's own MTU when that device is deleted (this is
not due to anything libvirt does; it's just how Linux host bridges
work).

Fixes: ee6c936fbbfb217175326f0201d59cc6727a0678
Resolves: https://bugzilla.redhat.com/1913561
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemu: don't set interface MTU when managed='no'
Laine Stump [Tue, 12 Jan 2021 19:10:05 +0000 (14:10 -0500)]
qemu: don't set interface MTU when managed='no'

managed='no' on an <interface> allows an unprivileged libvirt to use a
pre-created tap/macvtap device that libvirt has permission to
open/read/write, but no permission to modify (i.e. set the MTU or MAC
address). But when the XML had an <mtu size='blah'/> setting (which
was put there in order to tell the *guest* OS what MTU to set for the
emulated device at the other end of the tap) we were attempting to set
the MTU of the tap device on the host, paying no attention to the
setting of 'managed'. That would of course end in failure.

This patch only sets the MTU if managed='no' is *not* set (so, if it
is 'yes', or just not set at all).

Note that MTU of the tap is also set when connecting the tap to a
bridge device, but managed='no' is only allowed for <interface
type='ethernet'>, which would never attach to a bridge anyway, so we
don't need the check there.

Resolves: https://bugzilla.redhat.com/1905929
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoscripts: Actually print filename of offending file
Peter Krempa [Tue, 12 Jan 2021 18:32:00 +0000 (19:32 +0100)]
scripts: Actually print filename of offending file

The error message printed by scripts/group-qemu-caps.py and
scripts/test-wrap-argv.py doesn't actually print the filename of the
offending file:

 Incorrect line wrapping in $file

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agonetlink: Introduce a helper function to simplify netlink functions
Shi Lei [Mon, 11 Jan 2021 02:23:37 +0000 (10:23 +0800)]
netlink: Introduce a helper function to simplify netlink functions

Extract common code as helper function virNetlinkTalk, then simplify
the functions virNetlink[DumpLink|NewLink|DelLink|GetNeighbor].

Signed-off-by: Shi Lei <shi_lei@massclouds.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonetlink: Introduce macro NETLINK_MSG_APPEND to wrap nlmsg_append
Shi Lei [Mon, 11 Jan 2021 02:23:36 +0000 (10:23 +0800)]
netlink: Introduce macro NETLINK_MSG_APPEND to wrap nlmsg_append

Introduce a macro NETLINK_MSG_APPEND to wrap nlmsg_append and
simplify code. Remove those labels 'buffer_too_small', since they
are now useless.

Signed-off-by: Shi Lei <shi_lei@massclouds.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonetlink: Minor changes for macros NETLINK_MSG_[NEST_START|NEST_END|PUT]
Shi Lei [Mon, 11 Jan 2021 02:23:35 +0000 (10:23 +0800)]
netlink: Minor changes for macros NETLINK_MSG_[NEST_START|NEST_END|PUT]

Move macros NETLINK_MSG_[NEST_START|NEST_END|PUT] from .h into .c;
within these macros, replace 'goto' with reporting error and returning;
simplify virNetlinkDumpLink and virNetlinkDelLink by using NETLINK_MSG_PUT.

Signed-off-by: Shi Lei <shi_lei@massclouds.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonetlink: Remove invalid flags(NLM_F_CREATE and NLM_F_EXCL) for RTM_DELLINK
Shi Lei [Mon, 11 Jan 2021 02:23:34 +0000 (10:23 +0800)]
netlink: Remove invalid flags(NLM_F_CREATE and NLM_F_EXCL) for RTM_DELLINK

NLM_F_CREATE and NLM_F_EXCL are invalid for RTM_DELLINK,
so remove them.

Signed-off-by: Shi Lei <shi_lei@massclouds.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agogitlab-ci.yml: Add an explicit env variable to mark a job as broken
Erik Skultety [Thu, 14 Jan 2021 10:36:54 +0000 (11:36 +0100)]
gitlab-ci.yml: Add an explicit env variable to mark a job as broken

Thanks to the 'rules' syntax, this will translate to
'allow_failure:true' and let the job fail but will not affect the rest
of the pipeline.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agogitlab-ci.yml: Convert only/except to the rules syntax
Erik Skultety [Thu, 14 Jan 2021 10:20:36 +0000 (11:20 +0100)]
gitlab-ci.yml: Convert only/except to the rules syntax

'rules' syntax replaces the only/except syntax with which it is
mutually exclusive. In some cases the 'rules' syntax is more readable
than the 'only/except' equivalent, in some cases it is not.
The idea behind this conversion is to introduce an explicit env variable
controlling the 'allow_failure' attribute which would then be attached
to a broken build job which would in turn result in a soft failure.
Such behaviour is not possible to achieve with the older 'only/except'
syntax.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agogitlab-ci.yml: Replace template anchors with extends
Erik Skultety [Wed, 13 Jan 2021 16:45:06 +0000 (17:45 +0100)]
gitlab-ci.yml: Replace template anchors with extends

'extends' is slightly more readable and definitely more flexible in
terms of allowing includes of templates.
The main reason for this patch though is that the next patch converts
the 'only/except' syntax to the new (preferable) 'rules' syntax.
Variable anchors are still kept intact because the use case there is
different from regular template anchors.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoPost-release version bump to 7.1.0
Jiri Denemark [Fri, 15 Jan 2021 08:52:51 +0000 (09:52 +0100)]
Post-release version bump to 7.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoRelease of libvirt-7.0.0
Jiri Denemark [Fri, 15 Jan 2021 08:50:09 +0000 (09:50 +0100)]
Release of libvirt-7.0.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoconf: disk: Parse and format <metadata_cache> also for <mirror>
Peter Krempa [Thu, 14 Jan 2021 12:57:52 +0000 (13:57 +0100)]
conf: disk: Parse and format <metadata_cache> also for <mirror>

Commit 154df5840d added support for <metadata_cache> as property of a
<disk>. Since the same parser is used to parse the XML used with
virDomainBlockCopy it starts the copy job with the appropriate cache
configured, but the <mirror> doesn't show this configuration nor it's
preserved if libvirtd is restarted during the mirror.

Add parsing, formatting and tests for <metadata_cache> for a <mirror>.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoqemu: Fix memstat for (non-)transitional memballoon
Andrea Bolognani [Tue, 12 Jan 2021 16:17:44 +0000 (17:17 +0100)]
qemu: Fix memstat for (non-)transitional memballoon

Depending on the memballoon model, the corresponding QOM node
will have a different type and we need to account for this
when searching for it in the QOM tree.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoNEWS: Mention stuff I've dealt with for 7.0.0
Michal Privoznik [Wed, 13 Jan 2021 09:22:14 +0000 (10:22 +0100)]
NEWS: Mention stuff I've dealt with for 7.0.0

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>