]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
5 years agovirnetserver: Check for virNetServerClientInitKeepAlive() retval
Michal Privoznik [Tue, 5 May 2020 09:29:13 +0000 (11:29 +0200)]
virnetserver: Check for virNetServerClientInitKeepAlive() retval

Since it's introduction in v0.9.7-147-gf4324e3292 the
virNetServerClientInitKeepAlive() function returned nothing than
a negative one. Fortunately, this did not pose any problem
because we ignored the retval happily. Well, it's time to check
for the retval because the function might fail regularly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoDrop needless variable
Michal Privoznik [Mon, 4 May 2020 15:03:42 +0000 (17:03 +0200)]
Drop needless variable

Instead of the following pattern:

  type ret;
  ...
  ret = func();
  return ret;

we can use:

  return func()

directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
5 years agomaint: Post-release version bump to 6.4.0
Michal Privoznik [Tue, 5 May 2020 08:52:22 +0000 (10:52 +0200)]
maint: Post-release version bump to 6.4.0

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoRelease of libvirt-6.3.0
Daniel Veillard [Tue, 5 May 2020 06:49:30 +0000 (08:49 +0200)]
Release of libvirt-6.3.0

* docs/news.xml: updated for the release

Signed-off-by: Daniel Veillard <veillard@redhat.com>
5 years agoCONTRIBUTING: Include note about build system tools
Andrea Bolognani [Mon, 27 Apr 2020 10:48:51 +0000 (12:48 +0200)]
CONTRIBUTING: Include note about build system tools

Debian always runs autoreconf at package build time, which means
that apt-get build-dep will bring in everything that's needed to
build libvirt from a git clone; Fedora and RHEL, however, skip
this step, so we have to install some extra packages manually.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoCONTRIBUTING: Indent command by three spaces
Andrea Bolognani [Mon, 27 Apr 2020 10:49:06 +0000 (12:49 +0200)]
CONTRIBUTING: Indent command by three spaces

This is the proper way to do it according to our reStructuredText
style guidelines.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agogitlab: update list of distros to use latest versions
Daniel P. Berrangé [Mon, 4 May 2020 12:06:56 +0000 (13:06 +0100)]
gitlab: update list of distros to use latest versions

Replace Fedora 30 with Fedora 32
Replace Ubuntu 16.04 with Ubuntu 20.04

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agogitlab: convert to shared container for DCO check
Daniel P. Berrangé [Fri, 1 May 2020 10:57:33 +0000 (11:57 +0100)]
gitlab: convert to shared container for DCO check

This removes the locally maintained DCO checking script in favour of the
shared container image provided by libvirt-ci.git.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agovirsh: Fix return code for dump
Xu Yandong [Mon, 4 May 2020 08:36:19 +0000 (16:36 +0800)]
virsh: Fix return code for dump

After the commit dc0771c, ret variable no longer
represents the status of the return code, use
data->ret replace it.

Signed-off-by: Xu Yandong <xuyandong2@huawei.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonews: Update for libvirt 6.3.0
Michal Privoznik [Mon, 4 May 2020 07:14:33 +0000 (09:14 +0200)]
news: Update for libvirt 6.3.0

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agodocs: Fix grammar in virsh.rst
Andrea Bolognani [Fri, 1 May 2020 09:37:19 +0000 (11:37 +0200)]
docs: Fix grammar in virsh.rst

"allows to" -> "allows one to"

Spotted by Lintian (spelling-error-in-manpage tag).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
5 years agoqemu: re-add padding to the saved state images
Daniel P. Berrangé [Mon, 27 Apr 2020 13:35:43 +0000 (14:35 +0100)]
qemu: re-add padding to the saved state images

In the past we added 1024 bytes of padding to saved state images so that
users can run "virsh managedsave-edit $GUEST" and make XML changes which
increase the size of the XML document. This padding was accidentally
lost a while back

  commit 6b9b21db7079888a05d192b079e68290bdf14a76
  Author: Peter Krempa <pkrempa@redhat.com>
  Date:   Wed Feb 17 13:10:11 2016 +0100

    qemu: Remove unnecessary calculations in qemuDomainSaveMemory

The original 1024 bytes was unreasonably stingy when we consider that
the QEMU state is typically going to be many 100's of MB in size. Thus
this adds 64 KB of padding after the XML which should cope with any
plausible modifications a user will want to make.

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

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoqemu: Add virQEMUCapsGetVirtType convenience function
Tobin Feldman-Fitzthum [Wed, 22 Apr 2020 21:50:43 +0000 (17:50 -0400)]
qemu: Add virQEMUCapsGetVirtType convenience function

Signed-off-by: Tobin Feldman-Fitzthum <tobin@linux.vnet.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Fix capabilities probing with TCG
Tobin Feldman-Fitzthum [Wed, 22 Apr 2020 21:50:42 +0000 (17:50 -0400)]
qemu: Fix capabilities probing with TCG

Only probe QEMU binary with accel=tcg if TCG is not disabled.
Similarly, only add a VIR_DOMAIN_VIRT_QEMU guest if TCG
is available.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@linux.vnet.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Introduce QEMU_CAPS_TCG
Tobin Feldman-Fitzthum [Tue, 28 Apr 2020 09:04:14 +0000 (11:04 +0200)]
qemu: Introduce QEMU_CAPS_TCG

Since QEMU 2.10 it is possible to disable TCG when building
QEMU. Introduce a capability that reflects this.

Signed-off-by: Tobin Feldman-Fitzthum <tobin@linux.vnet.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: command: make qemuBuildVirtioOptionsStr void
Bjoern Walk [Thu, 23 Apr 2020 13:15:09 +0000 (15:15 +0200)]
qemu: command: make qemuBuildVirtioOptionsStr void

Now that qemuBuildVirtioOptionsStr can not fail anymore, remove its
return value and make it void.

Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agoqemu: move virtio capability validation
Bjoern Walk [Thu, 23 Apr 2020 13:15:08 +0000 (15:15 +0200)]
qemu: move virtio capability validation

Move capability validation of virtio options from command line
generation to post-parse device validation where it belongs.

Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotests: more fine-granular tests for virtio-options
Bjoern Walk [Thu, 23 Apr 2020 13:15:07 +0000 (15:15 +0200)]
tests: more fine-granular tests for virtio-options

Add separate tests for individual options and devices for virtio-options
to have the ability to do more fine-granular testing of various
combinations.

Also, add negative tests for unavailable capabilities.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agotests: use latest caps for virtio-options test
Bjoern Walk [Thu, 23 Apr 2020 13:15:06 +0000 (15:15 +0200)]
tests: use latest caps for virtio-options test

Convert the virtio-options test in qemuxml2argv and qemuxml2xml to use
the latest available QEMU capabilities.

Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Bjoern Walk <bwalk@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
5 years agonews: Update for the recent added pSeries features
Daniel Henrique Barboza [Mon, 27 Apr 2020 12:14:32 +0000 (09:14 -0300)]
news: Update for the recent added pSeries features

Update news.xml to inform about the availability of CFPC, SBBC and
IBS features.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Implement the IBS pSeries feature
Daniel Henrique Barboza [Mon, 27 Apr 2020 12:14:31 +0000 (09:14 -0300)]
qemu: Implement the IBS pSeries feature

This patch adds the implementation of the IBS pSeries feature,
using the QEMU_CAPS_MACHINE_PSERIES_CAP_IBS capability added
in the previous patch.

IBS can have the following values: "broken", "workaround",
"fixed-ibs", "fixed-ccd" and "fixed-na".

This is the XML format for the cap:

<features>
  <ibs value='fixed-ibs'/>
</features>

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Add capability for IBS pSeries feature
Daniel Henrique Barboza [Mon, 27 Apr 2020 12:14:30 +0000 (09:14 -0300)]
qemu: Add capability for IBS pSeries feature

IBS (Indirect Branch Speculation) is the last capability added
in QEMU 2.12 related to Spectre mitigation for Power. It was
added in commit 4be8d4e7d935.

This patch introduces it as QEMU_CAPS_MACHINE_PSERIES_CAP_IBS.
Like CFPC and SBBC, users might want to tune in IBS based on
their HW and guest OS requirements, and it's better to do it
so in a proper Libvirt feature than to put QEMU arguments
in the middle of the domain XML.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Implement the SBBC pSeries feature
Daniel Henrique Barboza [Mon, 27 Apr 2020 12:14:29 +0000 (09:14 -0300)]
qemu: Implement the SBBC pSeries feature

This patch adds the implementation of the SBBC pSeries feature,
using the QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC capability added
in the previous patch.

Like the previously added CFPC feature, SBBC can have the values
"broken", "workaround" or "fixed". Extra code is required to handle
it since it's not a regular tristate capability.

This is the XML format for the cap:

<features>
  <sbbc value='workaround'/>
</features>

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Add capability for SBBC pSeries feature
Daniel Henrique Barboza [Mon, 27 Apr 2020 12:14:28 +0000 (09:14 -0300)]
qemu: Add capability for SBBC pSeries feature

SBBC (Speculation Barrier Bounds Checking) is another capability
related to Spectre mitigation efforts in Power processors. It
was implemented in QEMU 2.12 by commit 09114fd81799.

This patch introduces it as QEMU_CAPS_MACHINE_PSERIES_CAP_SBBC to
be implemented in the next patch. Like the case with the now
implemented CFPC, exposing this feature in the XML allows for
a cleaner way for users to tune the SBBC accordingly, given
that not all hypervisor and guest setups supports this
Spectre mitigation.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Implement the CFPC pSeries feature
Daniel Henrique Barboza [Mon, 27 Apr 2020 12:14:27 +0000 (09:14 -0300)]
qemu: Implement the CFPC pSeries feature

This patch adds the implementation of the CFPC pSeries feature,
using the QEMU_CAPS_MACHINE_PSERIES_CAP_CFPC capability added
in the previous patch.

CPFC can have the values "broken", "workaround" or "fixed". Extra
code is required to handle it since it's not a regular tristate
capability.

This is the XML format for the cap:

<features>
  <cfpc value='workaround'/>
</features>

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu: Add capability for CFPC pSeries feature
Daniel Henrique Barboza [Mon, 27 Apr 2020 12:14:26 +0000 (09:14 -0300)]
qemu: Add capability for CFPC pSeries feature

CFPC (Cache Flush on Privilege Change) is one of the capabilities
added to QEMU to mitigate Spectre vulnerabilities in Power chips.
It was implemented in QEMU 2.12 by commit 6898aed77f46.

This capability is still used today due to differences in how
the host setup (hardware and firmware/kernel) can handle this
mitigation. Its default value also varies with the pseries machine
version of the time. There's also certain OSes, like AIX, that
might not support the default value of the pseries machine the
guest uses.

Exposing this in the Libvirt XML as a feature will allow users to tune
CFPC values in a cleaner way, instead of hacking parameters in
<qemu:commandline> elements.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoutil: qcow2GetExtensions: Remove support for 'data file' extension
Peter Krempa [Fri, 24 Apr 2020 09:17:55 +0000 (11:17 +0200)]
util: qcow2GetExtensions: Remove support for 'data file' extension

The implementation was never finished in libvirt. Remove it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: Remove 'externalDataStoreRaw' field from virStorageSource
Peter Krempa [Fri, 24 Apr 2020 09:16:20 +0000 (11:16 +0200)]
util: Remove 'externalDataStoreRaw' field from virStorageSource

It's not used for anything so we don't need to extract it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoutil: Remove 'externalDataStore' field from virStorageSource
Peter Krempa [Fri, 24 Apr 2020 09:12:27 +0000 (11:12 +0200)]
util: Remove 'externalDataStore' field from virStorageSource

It's not used for anything so we don't need to extract it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agosecurity: Remove labelling of 'externalDataStore'
Peter Krempa [Fri, 24 Apr 2020 09:08:04 +0000 (11:08 +0200)]
security: Remove labelling of 'externalDataStore'

The feature was never completed and is not really being pursued. Remove
the storage driver integration.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agonetwork: Remove memory leak caused by wrong initialization
Julio Faracco [Sat, 25 Apr 2020 16:35:37 +0000 (13:35 -0300)]
network: Remove memory leak caused by wrong initialization

This commit fix a wrong variable initialization. There is a variable
called `new_lease` which is being initialized with the content of
parameter `lease`. To avoid memory leak, the proper way is initialize
with NULL first. This wrong statement was added by commit 97a0aa24.
There are some other improvements also.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemumonitortestutils: Enforce consumption of all items in test monitor
Peter Krempa [Thu, 23 Apr 2020 14:57:31 +0000 (16:57 +0200)]
qemumonitortestutils: Enforce consumption of all items in test monitor

To prevent unexpected situations where a change in code would stop
looking at some of the tested commands go unnoticed add a mechanism to
force consumption of all test items.

Since there are a few tests which would be hard to fix add also a
mechanism to opt-out of the check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemumonitortestutils: Store a string identifying test monitor entry
Peter Krempa [Thu, 23 Apr 2020 14:52:12 +0000 (16:52 +0200)]
qemumonitortestutils: Store a string identifying test monitor entry

For each test monitor entry store an optional string which will allow to
identify it. This will be used later when checking that all registered
monitor commands were used.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemuhotplugtest: Remove 'drive_del' expectation from failed cases
Peter Krempa [Thu, 23 Apr 2020 14:38:30 +0000 (16:38 +0200)]
qemuhotplugtest: Remove 'drive_del' expectation from failed cases

On failure 'drive_del' is not issued.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemucapabilitiesdata: riscv: Remove call to 'query-machines'
Peter Krempa [Thu, 23 Apr 2020 14:23:00 +0000 (16:23 +0200)]
qemucapabilitiesdata: riscv: Remove call to 'query-machines'

The riscv capabilities code doesn't use the data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemumonitortestutils: Make test monitor failures more prominent
Peter Krempa [Thu, 23 Apr 2020 09:57:14 +0000 (11:57 +0200)]
qemumonitortestutils: Make test monitor failures more prominent

Until now we've tried to report errors from the test monitor code by
passing them back as failures from the qemu we simulate. This doesn't
work well in cases when the monitor logic does not detect failures or
has fallback code. Additionally there isn't much use for continuing the
test execution after first failure as in most cases the test data will
be misaligned and all other calls will fail as well.

To make the errors more obvious this patch moves away from reporting
them via the simulated monitor to reporting them to stderr and
exit()ing afterwards. While this might be less convenient
when developing tests it actually makes failures in the test suite
really obvious and doesn't require any opt-in from the tests themselves.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemuhotplugtest: cpu: x86-modern-individual: Remove invalid test case
Peter Krempa [Thu, 23 Apr 2020 12:31:12 +0000 (14:31 +0200)]
qemuhotplugtest: cpu: x86-modern-individual: Remove invalid test case

One of the test cases attempted to use test data meant for modern qemu
without asserting the 'modern' flag. Since that changes the commands
used to query state it won't work with data meant for the modern case.

Remove the invalid test case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemuhotplugtest: detach: Add expected 'object-del' to disk-scsi-multipath case
Peter Krempa [Thu, 23 Apr 2020 10:03:21 +0000 (12:03 +0200)]
qemuhotplugtest: detach: Add expected 'object-del' to disk-scsi-multipath case

The test verifies unplug of a disk with the persistent reservations
helper. The 'object-del' used to remove the helper was not mentioned in
the list of expected commands.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotests: monitor: Rename qemuMonitorReportError to qemuMonitorTestAddErrorResponse
Peter Krempa [Thu, 23 Apr 2020 09:50:59 +0000 (11:50 +0200)]
tests: monitor: Rename qemuMonitorReportError to qemuMonitorTestAddErrorResponse

It's a method of the test monitor and it adds a response to the monitor
output. The original qemuMonitorTestAddErrorResponse method is renamed
to qemuMonitorTestAddErrorResponseInternal

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirStorageSourceParseNBDColonString: Rewrite to match what qemu does
Peter Krempa [Fri, 24 Apr 2020 11:59:21 +0000 (13:59 +0200)]
virStorageSourceParseNBDColonString: Rewrite to match what qemu does

Our implementation wasn't quite able to parse everything that qemu does.
This patch rewrites the parser to a code that semantically resembles the
combination of 'nbd_parse_filename' and 'inet_parse' methods in qemu to
be able to parse the strings in an equivalent manner.

The only thing that libvirt doesn't do is to check the lengths of
various components in the nbd string in places where qemu uses constant
size buffers.

The test cases validate that some of the corner cases involving colons
are parsed properly.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agotravis: explicitly include gnutls to ensure it is updated
Daniel P. Berrangé [Fri, 24 Apr 2020 12:17:42 +0000 (13:17 +0100)]
travis: explicitly include gnutls to ensure it is updated

Travis includes gnutls in the default package set, but it is
an outdated version linkng to an incompatible libffi version.
The 'update: true' stanza causes the brew toolchain to be
updated but not the installed formula. It is possible to
run 'brew upgrade' to update installed formula, but this is
very slow adding more than 5 minutes to the build time.
Listing the gnutls package explicitly causes it to be updated
without extending the build time.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agoschema: backup: Make 'exportname' and 'exportbitmap' independent
Peter Krempa [Fri, 24 Apr 2020 08:37:54 +0000 (10:37 +0200)]
schema: backup: Make 'exportname' and 'exportbitmap' independent

Both are optional but don't have to be specified together. Fix the
schema.

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

Suggested-by: Yi Sun <yisun@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
5 years agodocs: Document reserved PCI addresses for QEMU
Michal Privoznik [Tue, 21 Apr 2020 14:56:58 +0000 (16:56 +0200)]
docs: Document reserved PCI addresses for QEMU

From time to time we are asked which PCI addresses are reserved
in QEMU. Let's document them in one place, it's easier than
reconstructing the list from the code each time.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
5 years agodocs: Add version info for 'backingStoreInput' in domaincaps
Sebastian Mitterle [Wed, 15 Apr 2020 11:34:06 +0000 (11:34 +0000)]
docs: Add version info for 'backingStoreInput' in domaincaps

Add 'since 5.10' as commonly used in formatdomain to avoid
misunderstandings if element is not present (Is it not supported
because of my version or because of my environment?)

Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agokbase: improve disk image chains documentation
Sebastian Mitterle [Wed, 15 Apr 2020 11:34:05 +0000 (11:34 +0000)]
kbase: improve disk image chains documentation

1. Use 'setup' consistently as noun, 'set up' as verb
2. Use path variables like '$IMAGE_PATH' consistently
   like in Troubleshooting to improve readability
3. Remove ':' from field names
4. Change phrasing in sentences I stumbled upon several
   times to improve readability.
5. Minor grammar/vocab fixes.

Signed-off-by: Sebastian Mitterle <smitterl@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agonews: Include new DHCP network <lease/> feature
Julio Faracco [Thu, 23 Apr 2020 23:56:51 +0000 (20:56 -0300)]
news: Include new DHCP network <lease/> feature

This commit includes an entry for new network DHCP lease time
information inside news.xml.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonews: qemu: support async IO mode 'io_uring'
Han Han [Tue, 21 Apr 2020 12:19:38 +0000 (20:19 +0800)]
news: qemu: support async IO mode 'io_uring'

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agotests: Tests for io mode io_uring
Han Han [Tue, 21 Apr 2020 12:19:37 +0000 (20:19 +0800)]
tests: Tests for io mode io_uring

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agodocs: Docs and rng schemas for io_uring
Han Han [Tue, 21 Apr 2020 12:19:36 +0000 (20:19 +0800)]
docs: Docs and rng schemas for io_uring

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: Implement the aio mode io_uring
Han Han [Tue, 21 Apr 2020 12:19:35 +0000 (20:19 +0800)]
qemu: Implement the aio mode io_uring

This aio mode was added since Linux 5.1[1], QEMU 5.0.0[2], which will
deliever faster and more efficient I/O operations for the file,
host_device, host_cdrom backends.

Reference:
[1]: https://lwn.net/Articles/810414/
[2]: https://lists.gnu.org/archive/html/qemu-devel/2020-01/msg07686.html

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu_capabilities: Introduce QEMU_CAPS_AIO_IO_URING
Han Han [Tue, 21 Apr 2020 12:19:34 +0000 (20:19 +0800)]
qemu_capabilities: Introduce QEMU_CAPS_AIO_IO_URING

Add io_uring value to capability replies.

The capability QEMU_CAPS_AIO_IO_URING will be used for io_uring aio mode,
introduced from QEMU 5.0, linux 5.1.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu: Move interlocking of blockjobs and checkpoints after liveness check
Peter Krempa [Fri, 17 Apr 2020 08:58:08 +0000 (10:58 +0200)]
qemu: Move interlocking of blockjobs and checkpoints after liveness check

qemuDomainSupportsCheckpointsBlockjobs checks if the
QEMU_CAPS_INCREMENTAL_BACKUP capability is supported to do the
interlocking. Capabilities are not present when the VM isn't running
though which would create false errors.

Move the checks after the liveness check in block job implementations.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Pavel Mores <pmores@redhat.com>
5 years agobackup: Store error message for failed backups
Peter Krempa [Thu, 16 Apr 2020 09:23:07 +0000 (11:23 +0200)]
backup: Store error message for failed backups

If a backup job fails midway it's hard to figure out what happened as
it's running asynchronous. Use the VIR_DOMAIN_JOB_ERRMSG job statistics
field to pass through the error from the first failed backup-blockjob
so that both the consumer of the virDomainGetJobStats and the
corresponding event can see the error.

event 'job-completed' for domain backup-test:
operation: 9
time_elapsed: 46
disk_total: 104857600
disk_processed: 10158080
disk_remaining: 94699520
success: 0
errmsg: No space left on device

virsh domjobinfo backup-test --completed --anystats
Job type:         Failed
Operation:        Backup
Time elapsed:     46           ms
File processed:   9.688 MiB
File remaining:   90.312 MiB
File total:       100.000 MiB
Error message:    No space left on device

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemu: domain: Add 'errmsg' field to qemuDomainJobInfo
Peter Krempa [Thu, 16 Apr 2020 09:21:51 +0000 (11:21 +0200)]
qemu: domain: Add 'errmsg' field to qemuDomainJobInfo

The field can be used by jobs to add an optional error message to a
completed (failed) job.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoAPI: Add VIR_DOMAIN_JOB_ERRMSG domain job statistics field
Peter Krempa [Wed, 15 Apr 2020 10:27:53 +0000 (12:27 +0200)]
API: Add VIR_DOMAIN_JOB_ERRMSG domain job statistics field

In some cases it's useful to report the error which caused the domain
job to fail. Add an optional field for holding the error message so that
it can be later retrieved from statistics of a completed job.

Add the field name macro and code for extracting it in virsh.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemu: Add free and copy function for qemuDomainJobInfo and use it
Peter Krempa [Thu, 26 Mar 2020 16:55:00 +0000 (17:55 +0100)]
qemu: Add free and copy function for qemuDomainJobInfo and use it

In order to add a string to qemuDomainJobInfo we must ensure that it's
freed and copied properly. Add helpers to copy and free the structure
and adjust the code to use them properly for the new semantics.

Additionally also allocation is changed to g_new0 as it includes the
type and thus it's very easy to grep for all the allocations of a given
type.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoremote: remoteDispatchDomainGetJobStats: Encode typed parameter strings
Peter Krempa [Thu, 16 Apr 2020 09:14:00 +0000 (11:14 +0200)]
remote: remoteDispatchDomainGetJobStats: Encode typed parameter strings

String typed parameter values were introduced in v0.9.7-30-g40624d32fb.
virDomainGetJobStats was introduced in v1.0.2-239-g4dd00f4238 so all
clients already support typed parameter stings at that time thus we can
enable it unconditionally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
5 years agoqemuhotplugtest: detach: Remove commands which are not issued
Peter Krempa [Thu, 23 Apr 2020 08:36:59 +0000 (10:36 +0200)]
qemuhotplugtest: detach: Remove commands which are not issued

The 'human-monitor-command' equates to the 'drive-del' command issued by
the hotplug code on successful detach of a device. This means that it's
not issued for failed attempts and thus should not be added to the
expected list. Unfortunately our test monitor doesn't ensure that all
expected commands were consumed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agomock: qemuDomainGetUnplugTimeout: Decrease timeout
Peter Krempa [Thu, 23 Apr 2020 08:33:58 +0000 (10:33 +0200)]
mock: qemuDomainGetUnplugTimeout: Decrease timeout

We always queue the DEVICE_DELETED events before successful return from
the command so that tests are reliable. This means we can decrease the
unplug timeout as it's guaranteed to be executed in correct order.

According to my testing it shaves off ~450ms of test run:

real 0m0.721s

vs.

real 0m0.259s

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agomock:qemuDomainGetUnplugTimeout: Remove unused attribute for '@vm'
Peter Krempa [Thu, 23 Apr 2020 08:32:22 +0000 (10:32 +0200)]
mock:qemuDomainGetUnplugTimeout: Remove unused attribute for '@vm'

'@vm' is used to use a different timeout for ppc64 guests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemuDomainGetUnplugTimeout: Add G_GNUC_NO_INLINE
Peter Krempa [Thu, 23 Apr 2020 08:30:13 +0000 (10:30 +0200)]
qemuDomainGetUnplugTimeout: Add G_GNUC_NO_INLINE

The function is mocked in qemuhotplugmock.so. Recent clang versions
decided to inline it so the mock stopped working resulting in
qemuhotplugtest wasting 15 seconds waiting for timeouts.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemucapstest: Refresh data for qemu 5.0 on x86_64
Peter Krempa [Wed, 22 Apr 2020 10:39:10 +0000 (12:39 +0200)]
qemucapstest: Refresh data for qemu 5.0 on x86_64

Bump to v5.0.0-rc3-8-g3119154db0 and make sure that 'liburing' is picked
up by qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuDomainSaveImageOpen: Refactor handling of errors
Peter Krempa [Wed, 22 Apr 2020 14:52:24 +0000 (16:52 +0200)]
qemuDomainSaveImageOpen: Refactor handling of errors

Return error codes directly and fix weird reporting of errors via
temporary variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuDomainSaveImageOpen: Use 'g_new0' instead of VIR_ALLOC(_N)
Peter Krempa [Wed, 22 Apr 2020 14:22:58 +0000 (16:22 +0200)]
qemuDomainSaveImageOpen: Use 'g_new0' instead of VIR_ALLOC(_N)

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuDomainSaveImageOpen: Automatically close 'fd' if unneeded
Peter Krempa [Wed, 22 Apr 2020 14:19:21 +0000 (16:19 +0200)]
qemuDomainSaveImageOpen: Automatically close 'fd' if unneeded

Use VIR_AUTOCLOSE to declare it and remove all internal closing of the
filedescriptor. This will allow getting rid of 'error' completely.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemuDomainSaveImageOpen: Use g_autoptr for 'def'
Peter Krempa [Wed, 22 Apr 2020 14:16:19 +0000 (16:16 +0200)]
qemuDomainSaveImageOpen: Use g_autoptr for 'def'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agovirQEMUSaveData: Register autoclear function and use it in qemuDomainSaveImageOpen
Peter Krempa [Wed, 22 Apr 2020 14:12:39 +0000 (16:12 +0200)]
virQEMUSaveData: Register autoclear function and use it in qemuDomainSaveImageOpen

In an attempt to simplify qemuDomainSaveImageOpen we need to add
automatic pointer clearing for virQEMUSaveData.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoqemu: fix domain start with corrupted save file
Peter Krempa [Wed, 22 Apr 2020 14:03:37 +0000 (16:03 +0200)]
qemu: fix domain start with corrupted save file

Commit 21ad56e932 introduced a regression where a VM with a corrupted
save image file would fail to start on the first attempt. This was
caused by returning a wrong return code as 'fd' was abused to also hold
the return code.

Since it's easy to miss this nuance, introduce a 'ret' variable for the
return code and return it' value in the error section.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Mores <pmores@redhat.com>
5 years agoutil: remove virRun
Ján Tomko [Wed, 22 Apr 2020 14:20:10 +0000 (16:20 +0200)]
util: remove virRun

Everything is using virCommand now.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoutil: remove references to virRun/virExec
Ján Tomko [Wed, 22 Apr 2020 14:10:17 +0000 (16:10 +0200)]
util: remove references to virRun/virExec

virCommand is now used everywhere.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Suggested-by: Sebastian Mitterle <smitterl@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoRemove all usage of virRun
Ján Tomko [Wed, 22 Apr 2020 14:25:24 +0000 (16:25 +0200)]
Remove all usage of virRun

Catch the individual usage not removed in previous commits.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovmware: use virCommand instead of virRun
Ján Tomko [Tue, 21 Apr 2020 17:17:59 +0000 (19:17 +0200)]
vmware: use virCommand instead of virRun

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoopenvz: switch from virRun to virCommand
Ján Tomko [Wed, 22 Apr 2020 14:25:19 +0000 (16:25 +0200)]
openvz: switch from virRun to virCommand

Construct the command in multiple steps instead of using a sentinel
in the args array.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agonetworkxml2xmltest: Complete renaming of @actual
Michal Privoznik [Thu, 23 Apr 2020 10:28:43 +0000 (12:28 +0200)]
networkxml2xmltest: Complete renaming of @actual

In 97a0aa2467 the @actual variable was renamed to @confactual.
However, the commit missed non-Linux case resulting in a broken
build.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotests: Add tests for <lease/> to cover dnsmasq settings
Julio Faracco [Wed, 22 Apr 2020 20:05:58 +0000 (17:05 -0300)]
tests: Add tests for <lease/> to cover dnsmasq settings

New tests are required to cover some new XML syntax entry for
<lease/> option. This includes schema testing and other features
like unit attribute and lease value. This commit includes hostsfile
checks adding new files for each test case that is manipulating <host/>
tag.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: Add <lease/> option for <dhcp/> settings
Julio Faracco [Wed, 22 Apr 2020 20:05:57 +0000 (17:05 -0300)]
conf: Add <lease/> option for <dhcp/> settings

If an user is trying to configure a dhcp neetwork settings, it is not
possible to change the leasetime of a range or a host entry. This is
available using dnsmasq extra options, but they are associated with
dhcp-range or dhcp-hosts fields. This patch implements a leasetime for
range and hosts tags. They can be defined under that settings:

    <dhcp>
      <range ...>
        <lease/>
      </range>
      <host ...>
        <lease/>
      </host>
    </dhcp>

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

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agodocs: drvqemu: trivial fix for qemu commands passthrough
Chen Hanxiao [Wed, 22 Apr 2020 16:02:20 +0000 (12:02 -0400)]
docs: drvqemu: trivial fix for qemu commands passthrough

element <qemu:commandline> should be the child of <domain>

Signed-off-by: Chen Hanxiao <chen_han_xiao@126.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
5 years agonews: Document new Xen hypervisor features
Jim Fehlig [Tue, 21 Apr 2020 22:05:40 +0000 (16:05 -0600)]
news: Document new Xen hypervisor features

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
5 years agoudevHandleOneDevice: Remove old instance of device on "move"
Michal Privoznik [Mon, 20 Apr 2020 14:12:03 +0000 (16:12 +0200)]
udevHandleOneDevice: Remove old instance of device on "move"

When a device is "move"-d (this basically means it was renamed),
we add the new device onto our list but keep the old there too.
Fortunately, udev sets this DEVPATH_OLD property which points to
the old device path. We can use it to remove the old instance.

To test this try renaming an interface, for instance:

  # ip link set tunl0 name tunl1
  # ip link set tunl1 name tunl0

One problem with udev is that it sends old ifname in INTERFACE
property, which creates a problem for us, the property is where
we get the ifname from and use it then to query all kind of info
about the interface. Well, if it is non-existent then we can't
query anything. This happens if ifname rename is suppressed
(net.ifnames=0 on kernel cmd line for instance). Fortunately, we
can use "kernel" source for udev events which has always the
fresh info.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 years agonode_device_udev: Split udevRemoveOneDevice() into two
Michal Privoznik [Mon, 20 Apr 2020 13:59:19 +0000 (15:59 +0200)]
node_device_udev: Split udevRemoveOneDevice() into two

Move internals of udevRemoveOneDevice() into a separate function
which accepts sysfs path as an argument and actually removes the
device from the internal list. It will be reused later.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
5 years agoudevRemoveOneDevice: Unlock node device obj upon return
Michal Privoznik [Mon, 20 Apr 2020 13:40:01 +0000 (15:40 +0200)]
udevRemoveOneDevice: Unlock node device obj upon return

When removing a node device object from the internal list the
udevRemoveOneDevice() function does plain unref over the object.
This is not sufficient. If there is another thread that's waiting
for the object lock it will wait forever.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
5 years agoconf: split out virDomainFeaturesDefParse
Ján Tomko [Tue, 21 Apr 2020 16:35:59 +0000 (18:35 +0200)]
conf: split out virDomainFeaturesDefParse

The virDomainDefParseXML function has grown so large it broke the build:
../../src/conf/domain_conf.c:20362:1: error: stack frame size of 4168 bytes
in function 'virDomainDefParseXML' [-Werror,-Wframe-larger-than=]

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
5 years agoqemu-cgroup: remove unnecessary include
Marc-André Lureau [Wed, 8 Apr 2020 17:23:51 +0000 (19:23 +0200)]
qemu-cgroup: remove unnecessary include

The file doesn't use virSystemd functions directly.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu-dbus: register DBus bus to the VM cgroup
Marc-André Lureau [Wed, 8 Apr 2020 17:23:50 +0000 (19:23 +0200)]
qemu-dbus: register DBus bus to the VM cgroup

External devices are started before cgroup is created. Add the DBus
daemon to the VM cgroup with the rest of the external devices.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu-dbus: remove unused variable
Marc-André Lureau [Wed, 8 Apr 2020 17:23:49 +0000 (19:23 +0200)]
qemu-dbus: remove unused variable

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoqemu-dbus: prevent double start of the bus daemon
Marc-André Lureau [Wed, 8 Apr 2020 17:23:48 +0000 (19:23 +0200)]
qemu-dbus: prevent double start of the bus daemon

Allow calling qemuDBusStart() multiple times (as may be done by
qemu-slirp already).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoslirp: add helper to VM cgroup
Marc-André Lureau [Wed, 8 Apr 2020 17:23:47 +0000 (19:23 +0200)]
slirp: add helper to VM cgroup

The slirp helper process should be associated with the VM cgroup, like
other helpers.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoslirp: leave the dbus daemon running on error
Marc-André Lureau [Wed, 8 Apr 2020 17:23:46 +0000 (19:23 +0200)]
slirp: leave the dbus daemon running on error

Don't stop the DBus daemon if a slirp helper failed to start, as it
may be shared with other helpers.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agovirsh: Fix return code for dump and migrate
Andrea Bolognani [Tue, 21 Apr 2020 17:06:16 +0000 (19:06 +0200)]
virsh: Fix return code for dump and migrate

When the job monitoring logic was refactored, these two commands
were not converted properly and the result is that a successful
dump or migration (char '0') would be reported as a failed one
(int 48) instead.

Fixes: dc0771cfa2e78ffecd7c8234538ee548748d7bef
Reported-by: Brian Rak <brak@gameservers.com>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
5 years agodocs: Remove stray parenthesis
Jim Fehlig [Tue, 21 Apr 2020 22:09:24 +0000 (16:09 -0600)]
docs: Remove stray parenthesis

Commit fadbaa2375 introduced a stray parenthesis in formatdomain.html.in.
Remove it.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
5 years agoCONTRIBUTING: Include information on build dependencies
Andrea Bolognani [Mon, 20 Apr 2020 10:49:09 +0000 (12:49 +0200)]
CONTRIBUTING: Include information on build dependencies

libvirt depends on a ton of packages, so trying to install them
all by using the classic approach of repeatedly running configure
and reacting to each failure by installing the corresponding
missing package will inevitably lead to frustration.

Luckily there's an easy solution to get most dependencies
installed in one fell swoop, and we just need to document it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
5 years agotests: check conversion of passthrough hypervisor feature
Jim Fehlig [Fri, 17 Apr 2020 20:19:16 +0000 (14:19 -0600)]
tests: check conversion of passthrough hypervisor feature

Add a new test to check the 'mode' attribute of the passthrough element
and augment an existing, related test to check enablement of the
passthrough element only.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoxenconfig: Add support for 'passthrough' hypervisor feature
Jim Fehlig [Thu, 16 Apr 2020 14:31:48 +0000 (08:31 -0600)]
xenconfig: Add support for 'passthrough' hypervisor feature

Add support for xl.cfg(5) 'passthrough' option in the domXML-to-xenconfig
configuration converter.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agolibxl: refactor cpu and hypervisor feature parser/formatter
Jim Fehlig [Thu, 16 Apr 2020 03:48:42 +0000 (21:48 -0600)]
libxl: refactor cpu and hypervisor feature parser/formatter

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agolibxl: make use of passthrough hypervisor feature
Jim Fehlig [Wed, 15 Apr 2020 23:18:25 +0000 (17:18 -0600)]
libxl: make use of passthrough hypervisor feature

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agoconf: add xen hypervisor feature 'passthrough'
Jim Fehlig [Wed, 15 Apr 2020 22:34:54 +0000 (16:34 -0600)]
conf: add xen hypervisor feature 'passthrough'

'passthrough' is Xen-Specific guest configuration option new to Xen 4.13
that enables IOMMU mappings for a guest and hence whether it supports PCI
passthrough. The default is disabled. See the xl.cfg(5) man page and
xen.git commit babde47a3fe for more details.

The default state of disabled prevents hotlugging PCI devices. However,
if the guest configuration contains a PCI passthrough device at time of
creation, libxl will automatically enable 'passthrough' and subsequent
hotplugging of PCI devices will also be possible. It is not possible to
unconditionally enable 'passthrough' since it would introduce a migration
incompatibility due to guest ABI change. Instead, introduce another Xen
hypervisor feature that can be used to enable guest PCI passthrough

  <features>
    <xen>
      <passthrough state='on'/>
    </xen>
  </features>

To allow finer control over how IOMMU maps to guest P2M table, the
passthrough element also supports a 'mode' attribute with values
restricted to snyc_pt and share_pt, similar to xl.cfg(5) 'passthrough'
setting .

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
5 years agotests: check e820_host option handling
Marek Marczykowski-Górecki [Tue, 14 Apr 2020 02:37:07 +0000 (04:37 +0200)]
tests: check e820_host option handling

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agoxenconfig: parse e820_host option
Marek Marczykowski-Górecki [Tue, 14 Apr 2020 02:37:06 +0000 (04:37 +0200)]
xenconfig: parse e820_host option

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agolibxl: make use of e820_host feature
Marek Marczykowski-Górecki [Tue, 14 Apr 2020 02:37:05 +0000 (04:37 +0200)]
libxl: make use of e820_host feature

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
5 years agoconf: add xen specific feature: e820_host
Marek Marczykowski-Górecki [Tue, 14 Apr 2020 02:37:04 +0000 (04:37 +0200)]
conf: add xen specific feature: e820_host

e820_host is a Xen-specific option, only available for PV domains, that
provides the domain a virtual e820 memory map based on the host one. It
is enabled with a new Xen hypervisor feature, e.g.

  <features>
    <xen>
      <e820_host state='on'/>
    </xen>
  </features>

e820_host is required when using PCI passthrough and is generally
considered safe for any PV kernel. e820_host is silently ignored if set
in HVM domain configuration. See xl.cfg(5) man page in the Xen
documentation for more details.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>