Commit Graph

40662 Commits

Author SHA1 Message Date
Michal Privoznik
df9f1efc53 vsh: Don't break word on backslash
A backslash is the way we escape characters in virsh. For
instance:

  virsh # start domain\ with\ long\ name

For readline completion, we do not want to get four separate
words ("domain", "with", "long", "name").  This means, that we
can't use virBufferEscapeShell() because it doesn't escape spaces
the way we want.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-01-26 16:46:41 +01:00
Michal Privoznik
9b9542586c vshCommandStringGetArg: Drop @sz
This variable is unused since introduction of the function in
v0.8.5~150.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-01-26 16:46:41 +01:00
Jiri Denemark
4901314d0d cpu_map: Remove intel-pt from x86 CPU models
As explained in QEMU commit 4c257911dcc7c4189768e9651755c849ce9db4e8
intel-pt features should never be included in the CPU models as it was
not supported by KVM back then and even once it started to be supported,
users have to enable it by passing pt_mode=1 parameter to kvm_intel
module. The Icelake-* CPU models with intel-pt included were added to
QEMU 3.1.0 and removed right in the following 4.0.0 release (and even in
3.1.1 maintenance release).

In libvirt 6.10.0 I introduced 'removed' attribute for features included
in our CPU model definitions which we can use to drop intel-pt from
Icelake-* CPU models. Back then I explained we can safely do so only for
features which could never be enabled, which is not the case of intel-pt.

Theoretically, it could be possible to create an environment in which
QEMU would enable intel-pt without asking for it explicitly: it would
need to use a new enough kernel (not available at the time of QEMU
3.1.0) and pt_mode KVM parameter in combination with QEMU 3.1.0 running
a domain with q35 machine type and all that on a CPU which didn't really
exist at that time.

Migrating such domain to a host with newer SW stack including libvirt
with this patch applied would result in incompatible guest ABI (the
virtual CPU would lose intel-pt). However, QEMU changed its CPU models
unconditionally and thus migration would not work even without this
patch. That said, it is safe to follow QEMU and remove the feature from
Icelake-* CPU models in our cpu_map.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2021-01-26 15:44:50 +01:00
Cédric Bosdonnat
d5283b7be2 Fix format network dns doc
The code block on the srv name in the formatnetwork page is confusing
since the actual parameter is service. Moving the code block to the
service work makes it better.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Cédric Bosdonnat <cbosdonnat@suse.com>
2021-01-26 14:29:48 +01:00
Daniel P. Berrangé
e603efb6ec 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>
2021-01-26 12:33:31 +00:00
Andrea Bolognani
0947902d87 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>
2021-01-26 11:01:55 +01:00
Helmut Grohne
44b348134c 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>
2021-01-26 10:59:45 +01:00
Dmytro Linkin
5b1c525b1f 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>
2021-01-25 20:28:18 -05:00
Moshe Levi
97ebb98245 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>
2021-01-25 20:27:38 -05:00
Cole Robinson
36aabc86d5 docs: formatdomain: Fix poll-control XML example
Fixes: 3fc4412c6f

Signed-off-by: Cole Robinson <crobinso@redhat.com>
2021-01-24 18:40:17 -05:00
Cole Robinson
70307548d1 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>
2021-01-24 13:28:18 -05:00
Matt Coleman
f29815668a hyperv: use g_auto for WsXmlDocH in hypervDomainAttachCDROM
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:29 -05:00
Matt Coleman
8d8a7e7db2 hyperv: use g_auto for WsXmlDocH in hypervDomainAttachVirtualDisk
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:29 -05:00
Matt Coleman
cc7a4b0139 hyperv: use GLib auto-cleanup in hypervCreateInvokeXmlDoc
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:29 -05:00
Matt Coleman
57d668447b hyperv: use GLib auto-cleanup in hypervSerializeEmbeddedParam
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:29 -05:00
Matt Coleman
ca2b404f21 hyperv: use GLib auto-cleanup in hypervEnumAndPull
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:29 -05:00
Matt Coleman
e624dc7998 hyperv: use GLib auto-cleanup in hypervSerializeEprParam
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:29 -05:00
Matt Coleman
efd26e9bdc hyperv: use g_autoptr for WMI classes in hypervDomainAttachDeviceFlags
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:29 -05:00
Matt Coleman
5b53af6b20 hyperv: use GLib auto-cleanup in hypervDomainGetXMLDesc
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:28 -05:00
Matt Coleman
59daea438e hyperv: use g_autoptr for Win32_OperatingSystem in hypervNodeGetFreeMemory
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:28 -05:00
Matt Coleman
00beda0ee2 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>
2021-01-22 14:04:28 -05:00
Matt Coleman
7ddeafe083 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>
2021-01-22 14:04:28 -05:00
Matt Coleman
ba81dc6e2e hyperv: use GLib auto-cleanup in hypervInvokeMsvmComputerSystemRequestStateChange
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:28 -05:00
Matt Coleman
d68ef58963 hyperv: use GLib auto-cleanup in hypervInvokeMethod
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:28 -05:00
Matt Coleman
e9a9707fa3 hyperv: use GLib auto-cleanup in hypervDomainSendKey
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:28 -05:00
Matt Coleman
d9c015ec2c hyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectListAllDomains
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:28 -05:00
Matt Coleman
97c558b5d7 hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainManagedSaveRemove
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:28 -05:00
Matt Coleman
54d96d7fde hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainHasManagedSaveImage
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:28 -05:00
Matt Coleman
92853b9025 hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainManagedSave
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
acb9273074 hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainIsActive
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
5997e1e218 hyperv: use g_autoptr for WMI classes in hypervDomainGetSchedulerParametersFlags
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
230140f59c hyperv: use g_autoptr for Msvm_VirtualSystemSettingData in hypervDomainSetAutostart
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
c468080dce hyperv: use g_autoptr for Msvm_VirtualSystemSettingData in hypervDomainGetAutostart
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
e593d4671e hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainCreateWithFlags
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
8a0c80ab23 hyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectNumOfDefinedDomains
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
81c9102256 hyperv: use g_autoptr for Msvm_ComputerSystem in hypervConnectListDefinedDomains
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
917ed7592a hyperv: use g_autoptr for WMI classes in hypervDomainGetVcpusFlags
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
f0f0a77ee2 hyperv: use g_autoptr for WMI classes in hypervDomainSetVcpusFlags
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:27 -05:00
Matt Coleman
bf965ede11 hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainGetState
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:26 -05:00
Matt Coleman
7d24512891 hyperv: use g_autoptr for WMI classes in hypervDomainGetInfo
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:26 -05:00
Matt Coleman
51080a21f5 hyperv: use g_autoptr for Msvm_DiskDrive in hypervDomainDefParsePhysicalDisk
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:26 -05:00
Matt Coleman
d6d523e6cf hyperv: use g_autoptr for WMI classes in hypervDomainAttachStorage
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:26 -05:00
Matt Coleman
3836e11cec hyperv: use g_autoptr for Msvm_ResourceAllocationSettingData in hypervDomainAttachPhysicalDisk
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:26 -05:00
Matt Coleman
e1e58cb122 hyperv: use g_autoptr for Win32_ComputerSystemProduct in hypervLookupHostSystemBiosUuid
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:26 -05:00
Matt Coleman
08df82a72e hyperv: use g_autoptr for Msvm_ComputerSystem in hypervRequestStateChange
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:26 -05:00
Matt Coleman
f7c167a76e hyperv: use g_autoptr for WMI classes in hypervDomainSetMemoryProperty
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:26 -05:00
Matt Coleman
25faf51e01 hyperv: use g_autoptr for WMI classes in hypervDomainGetMaxMemory
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:26 -05:00
Matt Coleman
85fbc6c85d hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainDestroyFlags
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:25 -05:00
Matt Coleman
890f713579 hyperv: use g_autoptr for WMI classes in hypervDomainShutdownFlags
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:25 -05:00
Matt Coleman
4ca4c0f7f9 hyperv: use g_autoptr for Msvm_ComputerSystem in hypervDomainResume
Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-01-22 14:04:25 -05:00