]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 years agogitlab: force dwarf4 format for debuginfo in Fedora rawhide
Daniel P. Berrangé [Mon, 25 Jan 2021 18:13:57 +0000 (18:13 +0000)] 
gitlab: force dwarf4 format for debuginfo in Fedora rawhide

Fedora 34 rawhide has pulled in a new GCC 11 build which now
defaults to dwarf5 format. This format is not compatible with
the pdwtags program used in our test suite to validate the
RPC files.

We have no need for debuginfo in CI except for pdwtags,
so the simplest short term fix is to force the older dwarf
version in the hope that a fixed dwarves release will
arrive before Fedora 34 is released, or GCC 11 becomes more
widespread. Eventually we might need to figure out a way to
probe for compatibility but for now, we'll hope that any
distro with GCC 11 will be able to have a fixed dwarves too.

https://bugzilla.redhat.com/show_bug.cgi?id=1919965
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoci: Refresh dockerfiles
Andrea Bolognani [Wed, 20 Jan 2021 16:28:03 +0000 (17:28 +0100)] 
ci: Refresh dockerfiles

dtrace is now also installed when cross-building.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agomeson: Fix cross-building of dtrace probes
Helmut Grohne [Mon, 18 Jan 2021 23:08:23 +0000 (00:08 +0100)] 
meson: Fix cross-building of dtrace probes

dtrace invokes the C compiler, so when cross-building we need
to make sure that $CC is set in the environment and that it
points to the cross-compiler rather than the native one.

Until https://github.com/mesonbuild/meson/issues/266
is addressed, the workaround is to call dtrace via env(1).

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980334

Signed-off-by: Helmut Grohne <helmut@subdivi.de>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoutil: Add phys_port_name support on virPCIGetNetName
Dmytro Linkin [Thu, 21 Jan 2021 12:15:22 +0000 (14:15 +0200)] 
util: Add phys_port_name support on virPCIGetNetName

virPCIGetNetName is used to get the name of the netdev associated with
a particular PCI device. This is used when we have a VF name, but need
the PF name in order to send a netlink command (e.g. in order to
get/set the MAC address of the VF).

In simple cases there is a single netdev associated with any PCI
device, so it is easy to figure out the PF netdev for a VF - just look
for the PCI device that has the VF listed in its "virtfns" directory;
the only name in the "net" subdirectory of that PCI device's sysfs
directory is the PF netdev that is upstream of the VF in question.

In some cases there can be more than one netdev in a PCI device's net
directory though. In the past, the only case of this was for SR-IOV
NICs that could have multiple PF's per PCI device. In this case, all
PF netdevs associated with a PCI address would be listed in the "net"
subdirectory of the PCI device's directory in sysfs. At the same time,
all VF netdevs and all PF netdevs have a phys_port_id in their sysfs,
so the way to learn the correct PF netdev for a particular VF netdev
is to search through the list of devices in the net subdirectory of
the PF's PCI device, looking for the one netdev with a "phys_port_id"
matching that of the VF netdev.

But starting in kernel 5.8, the NVIDIA Mellanox driver began linking
the VFs' representor netdevs to the PF PCI address [1], and so the VF
representor netdevs would also show up in the net
subdirectory. However, all of the devices that do so also only have a
single PF netdev for any given PCI address.

This means that the net directory of the PCI device can still hold
multiple net devices, but only one of them will be the PF netdev (the
others are VF representors):

$ ls '/sys/bus/pci/devices/0000:82:00.0/net'
ens1f0  eth0  eth1

In this case the way to find the PF device is to look at the
"phys_port_name" attribute of each netdev in sysfs. All PF devices
have a phys_port_name matching a particular regex

  (p[0-9]+$)|(p[0-9]+s[0-9]+$)

Since there can only be one PF in the entire list of devices, once we
match that regex, we've found the PF netdev.

[1] - https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
      commit/?id=123f0f53dd64b67e34142485fe866a8a581f12f1

Co-Authored-by: Moshe Levi <moshele@nvidia.com>
Signed-off-by: Dmytro Linkin <dlinkin@nvidia.com>
Reviewed-by: Adrian Chiris <adrianc@nvidia.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoutil: add virNetDevGetPhysPortName
Moshe Levi [Thu, 21 Jan 2021 12:15:21 +0000 (14:15 +0200)] 
util: add virNetDevGetPhysPortName

This commit add virNetDevGetPhysPortName to read netdevice
phys_port_name from sysfs. It also refactor the code so
virNetDevGetPhysPortName and virNetDevGetPhysPortID will use
same method to read the netdevice sysfs.

Signed-off-by: Moshe Levi <moshele@nvidia.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agodocs: formatdomain: Fix poll-control XML example
Cole Robinson [Sun, 24 Jan 2021 23:40:17 +0000 (18:40 -0500)] 
docs: formatdomain: Fix poll-control XML example

Fixes: 3fc4412c6f5
Signed-off-by: Cole Robinson <crobinso@redhat.com>
4 years agospec: Increase meson test timeout 10x
Cole Robinson [Thu, 21 Jan 2021 21:54:45 +0000 (16:54 -0500)] 
spec: Increase meson test timeout 10x

Tests time out when building in slow environments, like emulated
s390x in Fedora copr. Bump up the test timeout

Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
4 years agohyperv: use g_auto for WsXmlDocH in hypervDomainAttachCDROM
Matt Coleman [Thu, 21 Jan 2021 18:51:35 +0000 (13:51 -0500)] 
hyperv: use g_auto for WsXmlDocH in hypervDomainAttachCDROM

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

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

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

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

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

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 hypervDomainAttachDeviceFlags
Matt Coleman [Thu, 21 Jan 2021 18:51:29 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for WMI classes in hypervDomainAttachDeviceFlags

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

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 hypervNodeGetFreeMemory
Matt Coleman [Thu, 21 Jan 2021 18:51:27 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Win32_OperatingSystem in hypervNodeGetFreeMemory

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

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agohyperv: use GLib auto-cleanup in hypervMsvmVSMSAddResourceSettings and hypervMsvmVSMS...
Matt Coleman [Thu, 21 Jan 2021 18:51:25 +0000 (13:51 -0500)] 
hyperv: use GLib auto-cleanup in hypervMsvmVSMSAddResourceSettings and hypervMsvmVSMSModifyResourceSettings

Fixes a memory leak when hypervCreateInvokeParamsList() fails.

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

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

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

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 hypervConnectListAllDomains
Matt Coleman [Thu, 21 Jan 2021 18:51:21 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectListAllDomains

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 hypervDomainManagedSaveRemove
Matt Coleman [Thu, 21 Jan 2021 18:51:20 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainManagedSaveRemove

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 hypervDomainHasManagedSaveImage
Matt Coleman [Thu, 21 Jan 2021 18:51:19 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainHasManagedSaveImage

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 hypervDomainManagedSave
Matt Coleman [Thu, 21 Jan 2021 18:51:18 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainManagedSave

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 hypervDomainIsActive
Matt Coleman [Thu, 21 Jan 2021 18:51:17 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainIsActive

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 hypervDomainGetSchedulerParametersFlags
Matt Coleman [Thu, 21 Jan 2021 18:51:16 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for WMI classes in hypervDomainGetSchedulerParametersFlags

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

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

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 hypervDomainCreateWithFlags
Matt Coleman [Thu, 21 Jan 2021 18:51:13 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainCreateWithFlags

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 hypervConnectNumOfDefinedDomains
Matt Coleman [Thu, 21 Jan 2021 18:51:12 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectNumOfDefinedDomains

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 hypervConnectListDefinedDomains
Matt Coleman [Thu, 21 Jan 2021 18:51:11 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectListDefinedDomains

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 hypervDomainGetVcpusFlags
Matt Coleman [Thu, 21 Jan 2021 18:51:10 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for WMI classes in hypervDomainGetVcpusFlags

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 hypervDomainSetVcpusFlags
Matt Coleman [Thu, 21 Jan 2021 18:51:09 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for WMI classes in hypervDomainSetVcpusFlags

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 hypervDomainGetState
Matt Coleman [Thu, 21 Jan 2021 18:51:08 +0000 (13:51 -0500)] 
hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainGetState

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 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>