]> git.ipfire.org Git - thirdparty/libvirt.git/log
thirdparty/libvirt.git
4 years agotools: reduce scope of a DIR* in virHostValidateIOMMU()
Laine Stump [Sun, 25 Oct 2020 21:56:22 +0000 (17:56 -0400)] 
tools: reduce scope of a DIR* in virHostValidateIOMMU()

This will make the trivial nature of a conversion to g_autoptr (in a
later patch) more obvious.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agoconsistently use VIR_DIR_CLOSE() instead of virDirClose()
Laine Stump [Tue, 13 Oct 2020 13:40:54 +0000 (09:40 -0400)] 
consistently use VIR_DIR_CLOSE() instead of virDirClose()

This will make it easier to review upcoming patches that use g_autoptr
to auto-close all DIRs.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
4 years agovirDomainNetDefParseXML: Fix error message for unknown value of //mac/@type
Michal Privoznik [Mon, 2 Nov 2020 19:49:38 +0000 (20:49 +0100)] 
virDomainNetDefParseXML: Fix error message for unknown value of //mac/@type

In v6.6.0-rc1~124 we've introduced a new mechanism for MAC
addresses for ESX: ignore all checks (type='static') that libvirt
or ESX would do (and possibly fail) for specified MAC address.
Accepted values for the @type attribute are "generated" and
"static". But the error message mentions a different attribute.

Fixes 454e5961abf40c14f8b6d7ee216229e68fd170bf
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1892130
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: do not overwrite errors from hypervInvokeMethod()
Matt Coleman [Thu, 22 Oct 2020 16:38:24 +0000 (12:38 -0400)] 
hyperv: do not overwrite errors from hypervInvokeMethod()

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: reduce duplicate code for Msvm_ComputerSystem lookups
Matt Coleman [Thu, 22 Oct 2020 16:38:23 +0000 (12:38 -0400)] 
hyperv: reduce duplicate code for Msvm_ComputerSystem lookups

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: remove unneeded braces in hypervDomainGetInfo() and hypervDomainGetXMLDesc()
Matt Coleman [Thu, 22 Oct 2020 16:38:22 +0000 (12:38 -0400)] 
hyperv: remove unneeded braces in hypervDomainGetInfo() and hypervDomainGetXMLDesc()

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: remove duplicate function hypervGetMemSDByVSSDInstanceId()
Matt Coleman [Thu, 22 Oct 2020 16:38:21 +0000 (12:38 -0400)] 
hyperv: remove duplicate function hypervGetMemSDByVSSDInstanceId()

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: remove duplicate function hypervGetVSSDFromUUID()
Matt Coleman [Thu, 22 Oct 2020 16:38:20 +0000 (12:38 -0400)] 
hyperv: remove duplicate function hypervGetVSSDFromUUID()

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: reformat WQL query strings
Matt Coleman [Thu, 22 Oct 2020 16:38:19 +0000 (12:38 -0400)] 
hyperv: reformat WQL query strings

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: capabilities: Re-enable detection of QEMU_CAPS_BLOCK_EXPORT_ADD
Peter Krempa [Mon, 26 Oct 2020 12:09:17 +0000 (13:09 +0100)] 
qemu: capabilities: Re-enable detection of QEMU_CAPS_BLOCK_EXPORT_ADD

Now that qemu stabilized it's interface and we've switched to the new
design we can re-enable use of 'block-export-add'

This reverts commit b87cfc957f57c1d9f7e5bf828ee4b23972085991

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
4 years agoqemu: Update to new design of 'block-export-add'
Peter Krempa [Mon, 26 Oct 2020 12:06:17 +0000 (13:06 +0100)] 
qemu: Update to new design of 'block-export-add'

qemu decided to modify the arguments of 'block-export-add' to include an
array of bitmaps rather than a single bitmap.

Since we've added the code prior to qemu setting the interface in stone
and thus it will be changed incompatibly and we already have tests for
the new interface we need to update the code and qemu capabilities data
at the same time.

Use a array of bitmaps as the 'bitmaps' argument instead of 'bitmap' and
bump qemu capabilities for the upcoming 5.2.0 release to
v5.1.0-2827-g2c6605389c

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
4 years agoutil: virhash: Standardize on 'opaque' for opaque data
Peter Krempa [Fri, 23 Oct 2020 09:45:16 +0000 (11:45 +0200)] 
util: virhash: Standardize on 'opaque' for opaque data

Rename 'data' argument which is used for opaque data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemu: Add test cases for 'host_cdrom' blockdev backend via <disk>
Peter Krempa [Thu, 15 Oct 2020 11:47:46 +0000 (13:47 +0200)] 
qemu: Add test cases for 'host_cdrom' blockdev backend via <disk>

Simulate that the device is a cdrom when the path equals to /dev/cdrom
to provide testing for the 'host_cdrom' backend.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agodocs: page.xsl: Improve generation of paragraph anchor links
Peter Krempa [Mon, 26 Oct 2020 12:44:19 +0000 (13:44 +0100)] 
docs: page.xsl: Improve generation of paragraph anchor links

Use the 'parent' axis to check whether the parent is a div with
class='section' rather than looking for 'toc-backref' anchor to see
whether to generate one of the headerlink alternatives. Both hare
docutils-specific thus apply to docs generated from RST documents.

This adds the links for pages generated from RST documents which don't
have a table of contents (and thus lack the 'toc-backref' anchors) and
thus fixes pages such as hacking.html and news.html to have reasonable
links which can be shared.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonews: Remove empty section
Andrea Bolognani [Mon, 2 Nov 2020 11:07:24 +0000 (12:07 +0100)] 
news: Remove empty section

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
4 years agonews: Fix an RST alignment typo with '=' which breaks the pipeline
Erik Skultety [Mon, 2 Nov 2020 10:56:15 +0000 (11:56 +0100)] 
news: Fix an RST alignment typo with '=' which breaks the pipeline

This is just a warning, but because we're invoking rst2html5 with
--strict, it will fail at encountering a single minor issue.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
4 years agoPost-release version bump to 6.10.0
Jiri Denemark [Mon, 2 Nov 2020 10:18:13 +0000 (11:18 +0100)] 
Post-release version bump to 6.10.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoRelease of libvirt-6.9.0 v6.9.0
Jiri Denemark [Mon, 2 Nov 2020 10:16:26 +0000 (11:16 +0100)] 
Release of libvirt-6.9.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agonews: mention vdpa support
Jonathon Jongsma [Fri, 30 Oct 2020 20:01:42 +0000 (15:01 -0500)] 
news: mention vdpa support

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agonode_device: fix leak of DIR*
Laine Stump [Wed, 28 Oct 2020 01:43:47 +0000 (21:43 -0400)] 
node_device: fix leak of DIR*

Commit 53aec799fa31 introduced the function udevGetVDPACharDev(),
which scans a directory using virDirOpenIfExists() and
virDirRead(). It unfortunately forgets to close the DIR* when it is
finished with it. This patch fixes that omission.

Fixes: 53aec799fa31711ffaeacc7ec17ec6d3c2e3cadf
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Tue, 27 Oct 2020 09:32:02 +0000 (10:32 +0100)] 
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10399 of 10399 strings)

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

Translated using Weblate (Ukrainian)

Currently translated at 99.3% (10328 of 10399 strings)

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

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
4 years agoUpdate translation files
Weblate [Tue, 27 Oct 2020 09:32:00 +0000 (10:32 +0100)] 
Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
4 years agotests: fix stat mocking with Fedora rawhide v6.9.0-rc2
Daniel P. Berrangé [Thu, 29 Oct 2020 17:25:07 +0000 (17:25 +0000)] 
tests: fix stat mocking with Fedora rawhide

GLibC has a really complicated way of dealing with the 'stat' function
historically, which means our mocks in turn have to look at four
different possible functions to replace, stat, stat64, __xstat,
__xstat64.

In Fedora 33 and earlier:

 - libvirt.so links to __xstat64
 - libc.so library exports stat, stat64, __xstat, __xstat64
 - sys/stat.h header exposes stat and __xstat

In Fedora 34 rawhide:

 - libvirt.so links to stat64
 - libc.so library exports stat, stat64, __xstat, __xstat64
 - sys/stat.h header exposes stat

Historically we only looked at the exported symbols from libc.so to
decide which to mock.

In F34 though we must not consider __xstat / __xstat64 though because
they only existance for binary compatibility. Newly built binaries
won't reference them.

Thus we must introduce a header file check into our logic for deciding
which symbol to mock. We must ignore the __xstat / __xstat64 symbols
if they don't appear in the sys/stat.h header, even if they appear
in libc.so

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agorpm: tell meson whether to use libssh or libssh2 explicitly
Daniel P. Berrangé [Wed, 28 Oct 2020 12:24:38 +0000 (12:24 +0000)] 
rpm: tell meson whether to use libssh or libssh2 explicitly

The %meson macro sets "--auto-features=enabled", thus any feature in the
RPM which has a "with_XXX" condition, needs to explicitly pass a
"-DXXX=state" arg to %meson to override the auto features setting.

The with_libssh and with_libssh2 conditions were not exposed to meson,
so if either was set disabled, then meson would fail the build if the
-devel packages were not found.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agorpm: remove with_bash_completion condition
Daniel P. Berrangé [Wed, 28 Oct 2020 12:24:38 +0000 (12:24 +0000)] 
rpm: remove with_bash_completion condition

The %meson macro sets "--auto-features=enabled", thus any feature in the
RPM which has a "with_XXX" condition, needs to explicitly pass a
"-DXXX=state" arg to %meson to override the auto features setting.

The with_bash_completion condition is always set to 1, so rather than
adding an arg to %meson, just remove the condition.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemu: capabilities: Disable detection of QEMU_CAPS_BLOCK_EXPORT_ADD
Peter Krempa [Mon, 26 Oct 2020 10:26:50 +0000 (11:26 +0100)] 
qemu: capabilities: Disable detection of QEMU_CAPS_BLOCK_EXPORT_ADD

We use the capability to switch to using 'block-export-add' in the
upcoming qemu release instead of the at the same time deprecated
'nbd-server-add'.

Unfortunately qemu wants to change the interface of 'block-export-add'
before the release. Since we've tried to stay up to date and added the
code before it was written in stone, we need to disable the use of the
new interface for the upcoming libvirt release so that we don't have a
version of libvirt which would not work with the upcoming qemu version.

Remove the detection of 'block-export-add' until we are more sure how
the qemu interface will look.

This patch partially reverts commit adb9f7123adb94645

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
4 years agoutil: Avoid double free in virProcessSetAffinity
Martin Kletzander [Tue, 27 Oct 2020 12:48:38 +0000 (13:48 +0100)] 
util: Avoid double free in virProcessSetAffinity

The cpu mask was free()'d immediately on any error and at the end of the
function, where it was expected that it would either error out and return or
goto another allocation if the code was to fail.  However since commit
9514e24984ee the error path did not return in one new case which caused
double-free in such situation.  In order to make the code more straightforward
just free the mask after it's been used even before checking the return code of
the call.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agonews: Mention nodedev support for CSS on S390
Boris Fiuczynski [Tue, 27 Oct 2020 12:52:04 +0000 (13:52 +0100)] 
news: Mention nodedev support for CSS on S390

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
4 years agoqemu: honour fatal errors dealing with qemu slirp helper
Daniel P. Berrangé [Thu, 15 Oct 2020 11:12:15 +0000 (12:12 +0100)] 
qemu: honour fatal errors dealing with qemu slirp helper

Currently all errors from qemuInterfacePrepareSlirp() are completely
ignored by the callers. The intention is that missing qemu-slirp binary
should cause the caller to fallback to the built-in slirp impl.

Many of the possible errors though should indeed be considered fatal.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoRevert "spec: Simplify setting features off by default"
Neal Gompa [Mon, 26 Oct 2020 21:53:55 +0000 (17:53 -0400)] 
Revert "spec: Simplify setting features off by default"

As it turns out, the rather complicated structure that is
currently used for enabling or disabling features in the libvirt
build does not cleanly map well to RPM's bcond feature.

Consequently, we need these back in order to support trivially
activating these features through extra macros as build inputs.

This reverts commit 31d687a3218c9072d7050dd608e013e063ca180f.

Signed-off-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agonews: Mention virt-ssh-helper detection fix
Andrea Bolognani [Mon, 26 Oct 2020 23:25:53 +0000 (00:25 +0100)] 
news: Mention virt-ssh-helper detection fix

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agorpc: Fix virt-ssh-helper detection
Andrea Bolognani [Mon, 26 Oct 2020 23:15:33 +0000 (00:15 +0100)] 
rpc: Fix virt-ssh-helper detection

When trying to figure out whether virt-ssh-helper is available
on the remote host, we mistakenly look for the helper by the
name it had while the feature was being worked on instead of
the one that was ultimately picked, and thus end up using the
netcat fallback every single time.

Fixes: f8ec7c842df9e40c6607eae9b0223766cb226336
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Neal Gompa <ngompa13@gmail.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agopo: Refresh potfile for v6.9.0 v6.9.0-rc1
Jiri Denemark [Mon, 26 Oct 2020 17:56:11 +0000 (18:56 +0100)] 
po: Refresh potfile for v6.9.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
4 years agoqemuMonitorJSONCheckReply: Use g_autofree
Yi Li [Wed, 21 Oct 2020 09:23:40 +0000 (17:23 +0800)] 
qemuMonitorJSONCheckReply: Use g_autofree

Eliminate cleanup code by using g_autofree.

Signed-off-by: Yi Li <yili@winhong.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
4 years agoNEWS: Fix vertical spacing between sections
Andrea Bolognani [Mon, 26 Oct 2020 13:37:23 +0000 (14:37 +0100)] 
NEWS: Fix vertical spacing between sections

Looking at the entire repository reveals we're not too consistent
about this, but at least in this specific document we mostly have
two blank lines between sections, so let's stick with that.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
4 years agoqemu_migration: Don't mangle NBD part of migration cookie
Michal Privoznik [Mon, 26 Oct 2020 10:28:13 +0000 (11:28 +0100)] 
qemu_migration: Don't mangle NBD part of migration cookie

In recent commit v6.8.0-135-g518be41aaa the formatting of NBD
into migration cookie was moved into a separate function and with
it it was switched from direct printing into the output buffer to
virXMLFormatElement(). But there was a typo. The
virXMLFormatElement() accepts two buffers on input, one for
element attributes and another for child elements. Well, the line
that was supposed to add NBD port into the attributes buffer
printed the attribute directly into the output buffer which
produced this mangled XML:

<qemu-migration>
   port='49153'<nbd>
    <disk target='vda' capacity='8589934592'/>
    <disk target='vdb' capacity='12746752000'/>
  </nbd>
</qemu-migration>

Changing the incriminated line to print into the attributes
buffer fixes the problem.

Fixes: 518be41aaa3ebaac5f2307f268d24dc1b40b6b5c
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoqemu: Don't try to start NBD server twice
Michal Privoznik [Mon, 26 Oct 2020 08:49:35 +0000 (09:49 +0100)] 
qemu: Don't try to start NBD server twice

In one of recent patches the way that we start NBD server for
incoming migration was reworked (v6.8.0-rc1~298). A new boolean
was introduced that tracks whether the NBD server was started so
that we don't start it twice nor record in the port in the port
allocator twice. Well, this idea is good, but in the
implementation the boolean is never set, so we are reserving the
port twice and would be starting the NBD server twice too if it
wasn't for port reservation fail.

Fixes: e74d627bb3bc2684cbe3edc1e2f7cc745b4e1ff3
Reported-by: Vjaceslavs Klimovs <vklimovs@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agonews: introduce memory failure event
zhenwei pi [Fri, 23 Oct 2020 13:53:49 +0000 (21:53 +0800)] 
news: introduce memory failure event

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agovirt-aa-helper: allow hard links for mounts
Christian Schoenebeck [Thu, 22 Oct 2020 14:58:00 +0000 (16:58 +0200)] 
virt-aa-helper: allow hard links for mounts

Guests should be allowed to create hard links on mounted pathes, since
many applications rely on this functionality and would error on guest
with current "rw" AppArmor permission with 9pfs.

Signed-off-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: Don't pass mode when opening domain log file for reading
Michal Privoznik [Fri, 23 Oct 2020 17:39:03 +0000 (19:39 +0200)] 
qemu: Don't pass mode when opening domain log file for reading

In qemuDomainLogContextNew() the domain log file is opened.
Twice, the first time for writing, and the second time for
reading (if required by caller). When opening the log file for
reading a mode is provided. This doesn't do much harm, but is
unnecessary. Drop the mode.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoInclude vdpa devices in node device list
Jonathon Jongsma [Wed, 14 Oct 2020 17:08:30 +0000 (12:08 -0500)] 
Include vdpa devices in node device list

The current udev node device driver ignores all events related to vdpa
devices. Since libvirt now supports vDPA network devices, include these
devices in the device list.

Example output:

virsh # nodedev-list
[...ommitted long list of nodedevs...]
vdpa_vdpa0

virsh # nodedev-dumpxml vdpa_vdpa0
<device>
  <name>vdpa_vdpa0</name>
  <path>/sys/devices/vdpa0</path>
  <parent>computer</parent>
  <driver>
    <name>vhost_vdpa</name>
  </driver>
  <capability type='vdpa'>
    <chardev>/dev/vhost-vdpa-0</chardev>
  </capability>
</device>

NOTE: normally the 'parent' would be a PCI device instead of 'computer',
but this example output is from the vdpa_sim kernel module, so it
doesn't have a normal parent device.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agoqemu: combine conditionals
Jonathon Jongsma [Fri, 23 Oct 2020 21:40:09 +0000 (16:40 -0500)] 
qemu: combine conditionals

Trivial fix to improve readability by combining these into a compound
conditional.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoqemu: fix memory leak reported by coverity
Jonathon Jongsma [Fri, 23 Oct 2020 21:40:08 +0000 (16:40 -0500)] 
qemu: fix memory leak reported by coverity

Let g_autoptr clean up on early return.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoqemu: fix potential resource leak
Jonathon Jongsma [Wed, 21 Oct 2020 21:50:06 +0000 (16:50 -0500)] 
qemu: fix potential resource leak

Coverity reported a potential resource leak. While it's probably not
a real-world scenario, the code could technically jump to cleanup
between the time that vdpafd is opened and when it is used. Ensure that
it gets cleaned up in that case.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agotests: Use flat namespace for qemu test driver
Roman Bolshakov [Sun, 18 Oct 2020 15:30:58 +0000 (18:30 +0300)] 
tests: Use flat namespace for qemu test driver

The change re-introduces f6d6086dbfec ("tests: Make references to global
symbols indirect in test drivers") that got lost during meson
conversion.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests: Re-introduce stat/lstat mocks on macOS
Roman Bolshakov [Sun, 18 Oct 2020 15:30:57 +0000 (18:30 +0300)] 
tests: Re-introduce stat/lstat mocks on macOS

Commit d6b17edd5163 ("tests: Lookup extended stat/lstat in mocks")
adds support for mocking of stat() and lstat() on macOS.

The change was broken because virmockstathelpers.c only follows glibc
logic and MOCK_STAT and MOCK_LSTAT are not getting defined on macOS.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agotests: Fix lstat() mock initialization on macOS
Roman Bolshakov [Sun, 18 Oct 2020 15:30:56 +0000 (18:30 +0300)] 
tests: Fix lstat() mock initialization on macOS

There is a typo that prevents initialization of real_lstat.

Fixes: d6b17edd5163 ("tests: Lookup extended stat/lstat in mocks")
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoqemu: implement memory failure event
zhenwei pi [Wed, 14 Oct 2020 10:37:51 +0000 (18:37 +0800)] 
qemu: implement memory failure event

Since QEMU 5.2 (commit-77b285f7f6), QEMU supports 'memory failure'
event, posts event to monitor if hitting a hardware memory error.
Fully support this feature for QEMU.

Test with commit 'libvirt: support memory failure event', build a
little complex environment(nested KVM):
1, install newly built libvirt in L1, and start a L2 vm. run command
in L1:
 ~# virsh event l2 --event memory-failure

2, run command in L0 to inject MCE to L1:
 ~# virsh qemu-monitor-command l1 --hmp mce 0 9 0xbd000000000000c0 0xd 0x62000000 0x8c

Test result in l1(recipient hypervisor case):
event 'memory-failure' for domain l2:
recipient: hypervisor
action: ignore
flags:
        action required: 0
        recursive: 0

Test result in l1(recipient guest case):
event 'memory-failure' for domain l2:
recipient: guest
action: inject
flags:
        action required: 0
        recursive: 0

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agolibvirt: support memory failure event
zhenwei pi [Wed, 14 Oct 2020 10:37:50 +0000 (18:37 +0800)] 
libvirt: support memory failure event

Introduce memory failure event. Libvirt should monitor domain's
event, then posts it to uplayer. According to the hardware memory
corrupted message, a cloud scheduler could migrate domain to another
health physical server.

Several changes in this patch:
public API:
    include/*
    src/conf/*
    src/remote/*
    src/remote_protocol-structs

client:
    examples/c/misc/event-test.c
    tools/virsh-domain.c

With this patch, each driver could implement its own method to run
this new event.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: Reformat
Michal Privoznik [Wed, 21 Oct 2020 12:53:12 +0000 (14:53 +0200)] 
hyperv: Reformat

This is mostly opening hyperv driver sources in vim, selecting
everything, hitting reformat and then fixing a very few places.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agohyperv: Use two empty lines between functions
Michal Privoznik [Wed, 21 Oct 2020 12:29:47 +0000 (14:29 +0200)] 
hyperv: Use two empty lines between functions

In some places we separate functions with only one line, in
others with three lines and the rest uses two lines.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agohyperv: Use hypervRequestStateChange() in hypervDomainSuspend()
Michal Privoznik [Wed, 21 Oct 2020 12:36:16 +0000 (14:36 +0200)] 
hyperv: Use hypervRequestStateChange() in hypervDomainSuspend()

A few commits ago, hypervRequestStateChange() helper was
introduced which has exactly the same code as a part of
hypervDomainSuspend(). Deduplicate by calling the helper.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agohyperv: Don't overwrite errors from hypervCreateInvokeParamsList()
Michal Privoznik [Wed, 21 Oct 2020 12:25:37 +0000 (14:25 +0200)] 
hyperv: Don't overwrite errors from hypervCreateInvokeParamsList()

The hypervCreateInvokeParamsList() function sets an error on a
failure, therefore there is no need to report another error in
callers.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Matt Coleman <matt@datto.com>
4 years agovirHashRemoveAll: Don't return number of removed items
Peter Krempa [Wed, 21 Oct 2020 12:57:36 +0000 (14:57 +0200)] 
virHashRemoveAll: Don't return number of removed items

Nobody uses the return value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoutil: virhash: Remove key handling callbacks
Peter Krempa [Wed, 21 Oct 2020 11:52:01 +0000 (13:52 +0200)] 
util: virhash: Remove key handling callbacks

Since we use virHashTable for string-keyed values only, we can remove
all the callbacks which allowed universal keys.

Code which wishes to use non-string keys should use glib's GHashTable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoutil: hash: Change type of hash table name/key to 'char'
Peter Krempa [Wed, 21 Oct 2020 11:31:16 +0000 (13:31 +0200)] 
util: hash: Change type of hash table name/key to 'char'

All users of virHashTable pass strings as the name/key of the entry.
Make this an official requirement by turning the variables to 'const
char *'.

For any other case it's better to use glib's GHashTable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoutil: hash: Remove virHashCreateFull
Peter Krempa [Tue, 20 Oct 2020 16:17:16 +0000 (18:17 +0200)] 
util: hash: Remove virHashCreateFull

The only place we call it is in virHashNew. Move the code to virHashNew
and remove virHashCreateFull.

Code wishing to use non-strings as hash table keys will be better off
using glib's GHashTable directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoutil: hash: Remove virHashValueFree
Peter Krempa [Wed, 21 Oct 2020 10:08:22 +0000 (12:08 +0200)] 
util: hash: Remove virHashValueFree

Use 'g_free' directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoReplace all instances of 'virHashCreate' with 'virHashNew'
Peter Krempa [Tue, 20 Oct 2020 16:43:20 +0000 (18:43 +0200)] 
Replace all instances of 'virHashCreate' with 'virHashNew'

It doesn't make much sense to configure the bucket count in the hash
table for each case specifically. Replace all calls of virHashCreate
with virHashNew which has a pre-set size and remove virHashCreate
completely.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoqemuDomainObjPrivateAlloc: Use virHashNew instead of virHashCreate
Peter Krempa [Wed, 21 Oct 2020 11:12:08 +0000 (13:12 +0200)] 
qemuDomainObjPrivateAlloc: Use virHashNew instead of virHashCreate

virHashCreate will be removed in upcoming patches. This change has an
impact on ordering of the blockjob entries in one of the status XML->XML
tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agotests: hash: Prepare for replacement of virHashCreate
Peter Krempa [Wed, 21 Oct 2020 07:41:50 +0000 (09:41 +0200)] 
tests: hash: Prepare for replacement of virHashCreate

Most callers pass a random number. We have virHashNew which doesn't give
the callers the option to configure the table. Since we are going to
switch to virHashNew replace it in tests and remove multiple instances
of the 'testHashGrow' case as it doesn't make sense with the new
semantics.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoconf: nwfilter: Replace 'virNWFilterHashTableCreate' with 'virHashNew'
Peter Krempa [Tue, 20 Oct 2020 16:41:27 +0000 (18:41 +0200)] 
conf: nwfilter: Replace 'virNWFilterHashTableCreate' with 'virHashNew'

Export the freeing function rather than having a wrapper for the hash
creation function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agovirHashAtomicNew: Remove 'size' argument
Peter Krempa [Tue, 20 Oct 2020 16:28:21 +0000 (18:28 +0200)] 
virHashAtomicNew: Remove 'size' argument

Use 'virHashNew' internally which uses a default size.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoconf: domain_addr: Refactor hash usage in zpci reservation code
Peter Krempa [Tue, 20 Oct 2020 15:31:23 +0000 (17:31 +0200)] 
conf: domain_addr: Refactor hash usage in zpci reservation code

Rewrite using GHashTable which already has interfaces for using a number
as hash key.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agovirCgroupKillRecursive: Refactor cleanup
Peter Krempa [Thu, 22 Oct 2020 07:59:52 +0000 (09:59 +0200)] 
virCgroupKillRecursive: Refactor cleanup

Remove 'cleanup' label and simplify remembering of the returned value
from the callback.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoutil: cgroup: Use GHashTable instead of virHashTable
Peter Krempa [Tue, 20 Oct 2020 15:01:51 +0000 (17:01 +0200)] 
util: cgroup: Use GHashTable instead of virHashTable

Rewrite using GHashTable which already has interfaces for using a number
as hash key. Glib's implementation doesn't copy the key by default, so
we need to allocate it, but overal the interface is more suited for this
case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoutil: virhash: Remove virHashTableSize
Peter Krempa [Tue, 20 Oct 2020 14:32:54 +0000 (16:32 +0200)] 
util: virhash: Remove virHashTableSize

It's used only in one place in tests which isn't even automatically
evaluated.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agovirCgroupKillRecursive: Return -1 on failure condition
Peter Krempa [Thu, 22 Oct 2020 07:56:46 +0000 (09:56 +0200)] 
virCgroupKillRecursive: Return -1 on failure condition

virCgroupKillRecursive sneakily initializes 'ret' to 0 rather than the
usual -1. 401030499bf moved an error condition but didn't actually
modify 'ret' return the proper error code.

Fixes: 401030499bf
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
4 years agoparthelper: Don't leak @canonical_path
Michal Privoznik [Thu, 22 Oct 2020 10:55:40 +0000 (12:55 +0200)] 
parthelper: Don't leak @canonical_path

The @canonical_path variable holds canonicalized path passed as
argv[1]. The canonicalized path is obtained either via
virFileResolveLink() or plain g_strdup(). Nevertheless, in both
cases it must be freed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoparthelper: Initialize error object
Michal Privoznik [Thu, 22 Oct 2020 10:49:44 +0000 (12:49 +0200)] 
parthelper: Initialize error object

Some functions called from parthelper can report an error. But
that means that the error object must be initialized otherwise
virResetError() (which happens as a part of virReportError())
will free random pointers.

Reported-by: Katerina Koukiou <kkoukiou@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
4 years agoqemu: stop passing -enable-fips to QEMU >= 5.2.0
Daniel P. Berrangé [Tue, 20 Oct 2020 16:48:59 +0000 (17:48 +0100)] 
qemu: stop passing -enable-fips to QEMU >= 5.2.0

Use of the -enable-fips option is being deprecated in QEMU >= 5.2.0. If
FIPS compliance is required, QEMU must be built with libcrypt which will
unconditionally enforce it.

Thus there is no need for libvirt to pass -enable-fips to modern QEMU.
Unfortunately there was never any way to probe for -enable-fips in the
first instance, it was enabled by libvirt based on version number
originally, and then later unconditionally enabled when libvirt dropped
support for older QEMU. Similarly we now use a version number check to
decide when to stop passing -enable-fips.

Note that the qemu-5.2 capabilities are currently from the pre-release
version and will be updated once qemu-5.2 is released.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoqemuxml2argvtest: Sanitize testing of '-enable-fips'
Peter Krempa [Wed, 21 Oct 2020 08:08:11 +0000 (10:08 +0200)] 
qemuxml2argvtest: Sanitize testing of '-enable-fips'

Rename 'FLAG_FIPS' to 'FLAG_FIPS_HOST' to signify that we are simulating
a host supporting fips mode and use the flag to assert 'enabeFips'
argument of 'qemuProcessCreatePretendCmdBuild' rather than passing it
via QEMU_CAPS_ENABLE_FIPS.

This prepares the testsuite for testing of -enable-fips deprecation in
qemu-5.2.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agoutil: remove unused function virPCIGetSysfsFile()
Laine Stump [Mon, 12 Oct 2020 19:07:31 +0000 (15:07 -0400)] 
util: remove unused function virPCIGetSysfsFile()

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: don't use virPCIGetSysfsFile()
Laine Stump [Mon, 12 Oct 2020 18:58:26 +0000 (14:58 -0400)] 
util: don't use virPCIGetSysfsFile()

virPCIDeviceAddressGetSysfsFile() is simpler to call.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: remove unneeded cleanup:/ret in virpci.c
Laine Stump [Mon, 12 Oct 2020 21:25:56 +0000 (17:25 -0400)] 
util: remove unneeded cleanup:/ret in virpci.c

These were nops once enough cleanup was g_auto'd.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: use more g_autofree in virpci.c
Laine Stump [Sun, 11 Oct 2020 03:05:49 +0000 (23:05 -0400)] 
util: use more g_autofree in virpci.c

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: avoid manual VIR_FREE of a g_autofree pointer in virPCIGetName()
Laine Stump [Sun, 11 Oct 2020 02:56:23 +0000 (22:56 -0400)] 
util: avoid manual VIR_FREE of a g_autofree pointer in virPCIGetName()

thisPhysPortID is only used inside a conditional, so reduce its scope
to just the body of that conditional, which will eliminate the need
for the undesirable manual VIR_FREE().

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: simplify virPCIProbeStubDriver()
Laine Stump [Sun, 11 Oct 2020 01:47:16 +0000 (21:47 -0400)] 
util: simplify virPCIProbeStubDriver()

This function had a loop that was only executed twice; it was
artificially constructed with a label, a goto, and a boolean to tell
that it had already been executed once. Aside from that, the body of
the loop contained only two lines that needed to be repeated (the
second time through, everything beyond those two lines would be
skipped).

One side effect of this strange loop was that a g_autofree string was
manually freed and re-initialized; I've been told that manually
freeing a g_auto_free object is highly discouraged.

This patch refactors the function to simply repeat the 2 lines that
might possibly be executed twice, thus eliminating the ugly use of
goto to construct a loop, and also takes advantage of the fact that
virPCIDriverDir() was previously returning *exactly* the same string
both times it was called to eliminate the manual VIR_FREE of drvpath.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: simplify virPCIDriverDir() and its callers
Laine Stump [Sat, 10 Oct 2020 21:50:11 +0000 (17:50 -0400)] 
util: simplify virPCIDriverDir() and its callers

There is no need for a temporary variable in this function, and since
it can't return NULL, no need for callers to check for it.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: simplify virPCIFile() and its callers
Laine Stump [Sat, 10 Oct 2020 21:46:20 +0000 (17:46 -0400)] 
util: simplify virPCIFile() and its callers

There is no need for a temporary variable in this function, and ever
since we switched to glib for memory allocation, there is no possibility
it can return NULL, so callers don't need to check for it.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: simplify virHostdevPCISysfsPath()
Laine Stump [Thu, 1 Oct 2020 18:33:17 +0000 (14:33 -0400)] 
util: simplify virHostdevPCISysfsPath()

Apparently at some point in the past, when there were multiple types
to represent PCI addresses, the function
virPCIDeviceAddressGetSysfsFile() used one of those types, while
virDomainHostDevDef used another. It's been quite awhile since we
reduced the number of different representations of PCI address, but
this function was still creating a temporary virPCIDeviceAddress, then
copying the individual elements into this temporary object from the
same type of object in the virDomainHostDevDef.

This patch just eliminates that pointless copy.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
4 years agoutil: fix very old bug/typo in virNetDevParseVfInfo()
Laine Stump [Wed, 21 Oct 2020 02:31:27 +0000 (22:31 -0400)] 
util: fix very old bug/typo in virNetDevParseVfInfo()

When this function was recently changed to add in parsing of
IFLA_VF_STATS, I noticed that the checks for existence of IFLA_VF_MAC
and IFLA_VF_VLAN were looking in the *wrong array*. The array that
contains the results of parsing each IFLA_VFINFO in
tb[IFLA_VFINFO_LIST] is tb_vf, but we were checking for these in tb
(which is the array containing the results of the toplevel parsing of
the netlink message, *not* the results of parsing one of the nested
IFLA_VFINFO's.

This incorrect code has been here since the function was originally
written in 2012. It has only worked all these years due to coincidence
- the items at those indexes in tb are IFLA_ADDRESS and IFLA_BROADCAST
(of the *PF*, not of any of its VFs), and those happen to always be
present in the toplevel netlink message; since we are only looking in
the incorrect place to check for mere existence of the attribute (but
are doing the actual retrieval of the attribute from the correct
place), this bug has no real consequences other than confusing anyone
trying to understand the code.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoTranslated using Weblate (Spanish)
Adolfo Jayme Barrientos [Fri, 16 Oct 2020 20:30:27 +0000 (22:30 +0200)] 
Translated using Weblate (Spanish)

Currently translated at 51.9% (5377 of 10354 strings)

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

Translated using Weblate (Portuguese (Brazil))

Currently translated at 52.3% (5418 of 10354 strings)

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

Translated using Weblate (Spanish)

Currently translated at 51.6% (5353 of 10354 strings)

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

Co-authored-by: Adolfo Jayme Barrientos <fitoschido@gmail.com>
Signed-off-by: Adolfo Jayme Barrientos <fitoschido@gmail.com>
4 years agorpm: disable LTO in Fedora 34
Daniel P. Berrangé [Wed, 21 Oct 2020 11:45:29 +0000 (12:45 +0100)] 
rpm: disable LTO in Fedora 34

A binutils change has caused breakage when linking the tests

/usr/bin/ld: tests/libtest_qemu_driver.so: undefined reference to `__open_missing_mode'

This is probably a regression in binutils, so disable LTO until we get
more clarity on the root cause and whether binutils or libvirt will need
changing.

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

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
4 years agonews: more Hyper-V APIs
Matt Coleman [Wed, 21 Oct 2020 08:46:13 +0000 (04:46 -0400)] 
news: more Hyper-V APIs

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: fix domainManagedSave on Hyper-V V2
Matt Coleman [Wed, 21 Oct 2020 08:46:12 +0000 (04:46 -0400)] 
hyperv: fix domainManagedSave on Hyper-V V2

Signed-off-by: Matt Coleman <matt@datto.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: fix domainSuspend and domainResume on Hyper-V V2
Matt Coleman [Wed, 21 Oct 2020 08:46:11 +0000 (04:46 -0400)] 
hyperv: fix domainSuspend and domainResume on Hyper-V V2

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: implement domainShutdown and domainShutdownFlags
Matt Coleman [Wed, 21 Oct 2020 08:46:10 +0000 (04:46 -0400)] 
hyperv: implement domainShutdown and domainShutdownFlags

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 domainReboot and domainReset
Matt Coleman [Wed, 21 Oct 2020 08:46:09 +0000 (04:46 -0400)] 
hyperv: implement domainReboot and domainReset

Co-authored-by: Sri Ramanujam <sramanujam@datto.com>
Signed-off-by: Matt Coleman <matt@datto.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: implement nodeGetFreeMemory
Matt Coleman [Wed, 21 Oct 2020 08:46:08 +0000 (04:46 -0400)] 
hyperv: implement nodeGetFreeMemory

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 domainSetAutostart
Matt Coleman [Wed, 21 Oct 2020 08:46:07 +0000 (04:46 -0400)] 
hyperv: implement domainSetAutostart

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: avoid overwriting errors from hypervGetWmiClass()
Matt Coleman [Wed, 21 Oct 2020 08:46:06 +0000 (04:46 -0400)] 
hyperv: avoid overwriting errors from hypervGetWmiClass()

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agohyperv: enable usage of g_autoptr for hypervInvokeParamsList
Matt Coleman [Wed, 21 Oct 2020 08:46:05 +0000 (04:46 -0400)] 
hyperv: enable usage of g_autoptr for hypervInvokeParamsList

Signed-off-by: Matt Coleman <matt@datto.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
4 years agoutil: rename virNetDevParseVfConfig to virNetDevParseVfInfo
zhenwei pi [Thu, 15 Oct 2020 11:21:15 +0000 (19:21 +0800)] 
util: rename virNetDevParseVfConfig to virNetDevParseVfInfo

virNetDevParseVfConfig has became a multifunctional helper function,
rename it to virNetDevParseVfInfo.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoutil: support device stats collection for <interface type='hostdev'>
zhenwei pi [Thu, 15 Oct 2020 11:21:14 +0000 (19:21 +0800)] 
util: support device stats collection for <interface type='hostdev'>

libvirt can retrieve traffic stats for emulated interfaces that are
backed by tap or macvtap devices, but this information wasn't
available for hostdev interfaces (those that are implemented by
assigning an SR-IOV VF device to a guest using vfio):

  #virsh domifstat instance --interface=52:54:00:2d:b2:35
  error: Failed to get interface stats instance 52:54:00:2d:b2:35
  error: internal error: Interface name not provided

For some SR-IOV VF devices this information is available via the
netlink VFINFO_LIST request/response, and that is what this patch uses
to implement stats retrieval for VF. Not that this is dependent on
support in the PF driver - for example, the Mellanox ConnectX-4 Lx
(mlx5) driver reports usable stats, while Intel 82599 (ixgbe) and
82576 (igb) just report all stats as 0.  (this is the same result as
"ip -s link show").

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoqemu: support hotplug of vdpa devices
Jonathon Jongsma [Wed, 14 Oct 2020 17:08:29 +0000 (12:08 -0500)] 
qemu: support hotplug of vdpa devices

By using the new qemu monitor functions to handle passing and removing
file descriptors, we can support hotplug of vdpa devices.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
4 years agoqemu: add monitor functions for handling file descriptors
Jonathon Jongsma [Wed, 14 Oct 2020 17:08:28 +0000 (12:08 -0500)] 
qemu: add monitor functions for handling file descriptors

add-fd, remove-fd, and query-fdsets provide functionality that can be
used for passing fds to qemu and closing fdsets that are no longer
necessary.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoqemu: add vdpa support
Jonathon Jongsma [Wed, 14 Oct 2020 17:08:27 +0000 (12:08 -0500)] 
qemu: add vdpa support

Enable <interface type='vdpa'> for qemu domains. This provides basic
support and does not support hotplug or migration.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoqemu: add vhost-vdpa capability
Jonathon Jongsma [Wed, 14 Oct 2020 17:08:26 +0000 (12:08 -0500)] 
qemu: add vhost-vdpa capability

Recent versions of qemu added the -netdev vhost-vdpa device. This
capability allows libvirt to know whether this is supported.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
4 years agoconf: Add support for vDPA network devices
Jonathon Jongsma [Wed, 14 Oct 2020 17:08:25 +0000 (12:08 -0500)] 
conf: Add support for vDPA network devices

This patch adds new schema and adds support for parsing and formatting
domain configurations that include vdpa devices.

vDPA network devices allow high-performance networking in a virtual
machine by providing a wire-speed data path. These devices require a
vendor-specific host driver but the data path follows the virtio
specification.

When a device on the host is bound to an appropriate vendor-specific
driver, it will create a chardev on the host at e.g.  /dev/vhost-vdpa-0.
That chardev path can then be used to define a new interface with
type='vdpa'.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>