Commit Graph

4615 Commits

Author SHA1 Message Date
Pavel Hrdina
b5becaea31 capabilities: report full external snapshot support
Now that deleting and reverting external snapshots is implemented we can
report that in capabilities so management applications can use that
information and start using external snapshots.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-10-09 15:06:59 +02:00
Han Han
c1d8eb579f docs: Fix typos
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2023-10-09 06:59:29 +02:00
Andrea Bolognani
ffff04725c docs: Go bindings release at the same time as the C library
The actual versioning policy[1] is a bit more nuanced, and in
particular there are scenarios in which the monthly release
is intentionally skipped, but overall it's not inaccurate to
claim that the release cadence of the Go bindings follows the
one of the C library.

[1] https://gitlab.com/libvirt/libvirt-go-module/-/blob/master/VERSIONING.rst

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-09-28 11:13:14 +02:00
Ján Tomko
9783b2b3e5 docs: formatdomain: clarify support of some filesystem options
Not all are supported by all hypervisors.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2023-09-25 14:24:20 +02:00
Michal Privoznik
e45240d37f test_driver: Implement virConnectGetDomainCapabilities()
Our test driver lacks implementation for
virConnectGetDomainCapabilities(). Provide one, though a trivial
one. Mostly so that something else than VIR_ERR_NO_SUPPORT error
is returned.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-09-21 08:45:31 +02:00
Jonathon Jongsma
1195403c43 schema: add ssh-agent configuration for ssh disks
Add the ability to specify a path to a ssh-agent socket in order to use
the ssh-agent to authenticate to remote ssh disks. Example
configuration:

    <disk type='network'>
        </source protocol='ssh' ...>
            <identity username='myusername' agentsock='/path/to/socket'/>
            ...
        </source>
        ...
    </disk>

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-09-19 14:28:50 -05:00
Jonathon Jongsma
1e2fa6d524 schema: add keyfile configuration for ssh disks
Authenticating via key file to an ssh server is often preferable to
logging in via password. In order to support this functionality add a
new <identity> xml element for ssh disks that allows the user to specify
a keyfile and username. Example configuration:

    <disk type='network'>
      <source protocol='ssh' ...>
        <identity keyfile='/path/to/id_rsa' username='myusername'/>
        ...
      </source>
    ...
    </disk>

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-09-19 14:28:50 -05:00
Jonathon Jongsma
e234fd5110 schema: add configuration for host verification of ssh disks
In order to make ssh disks usable, we need to be able to validate a
remote host. To do this, add a <knownHosts> xml element for ssh disks to
allow the user to specify a location for a file that contains known host
keys. Implementation to follow.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-09-19 14:28:50 -05:00
Jonathon Jongsma
cf88b13090 schema: add password configuration for ssh disk
Right now, ssh network disks are not usable. There is some basic support
in libvirt that is meant to support disk chains that have backing disks
located at ssh urls, but there is no real way for a user to configure a
ssh-based disk.  This commit allows users to configure an ssh disk with
password authentication. Implementation will follow.

<disk type='network'>
  <source  protocol='ssh' ...>
    <auth username='myusername'>
      <secret type='iscsi' usage='secretname'/>
    </auth>
</disk>

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-09-19 14:28:50 -05:00
Jonathon Jongsma
1df106cc20 conf: add ability to configure a vdpa block disk device
vDPA block devices can be configured as follows:

    <disk type='vhostvdpa'>
      <source dev='/dev/vhost-vdpa-0'/>
    </disk>

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-09-12 11:06:41 -05:00
Peter Krempa
ca40725a21 manpage: virsh: Note that 'virsh undefine --remove-all-storage' doesn't remove backing images
Removing a backing image could break other image chains as it's
theoretically possible to share backing chains.

As --storage/--remove-all-storage is fully implemented in virsh as a
helper option, which enumerates and deletes VM's volumes. We do not plan
to make it any more complicated.

Document that backing chains are not removed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-09-11 13:15:01 +02:00
Peter Krempa
0152aa5673 docs: compiling: Add a note about use of CFLAGS for optimization
Meson doesn't interpret what's set in CFLAGS, but rather simply appeds
it to the command line. Thus any logic which is based on the
optimization level will not work.

Note the caveat in the docs and instruct users to use
``--optimization=N`` instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-09-04 13:32:28 +02:00
Michal Privoznik
ad8c4d9d6d bhyve: Feed hook scripts with domain XML
Domain related hook scripts are all fed with domain XML on their
stdin, except for bhyve. Fix this.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/528
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-09-04 11:03:33 +02:00
Michal Privoznik
4e73f50b1e docs: Document bhyve hook scripts
We have bhyve hook scripts since v6.1.0-rc1~42 but never mention
them in hooks.rst. Fill the blanks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-09-04 11:03:33 +02:00
Michal Privoznik
4dffe53c5c docs: Document that libxl hooks are also given full domain XML
Our hooks.rst document existence of libxl hook scripts, but
mentions only qemu and lxc as receivers of full domain XML. But
since their introduction in v2.2.0-rc1~201 they are also given
full domain XML. Fix our wording.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-09-04 11:03:33 +02:00
Martin Kletzander
a4935d01cf docs, passt: Clarify some niche passt usage
Change example logfile path and clarify how complicated all things passt
are.  I chose not to create the non-existing directory because it could
open a whole new can of worms.

Also explain missing `dev` attribute of `<portForward/>`

Resolves: https://issues.redhat.com/browse/RHEL-1833

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-09-04 10:54:31 +02:00
Pavel Hrdina
0873d63b09 Revert "capabilities: report full external snapshot support"
Reverting external snapshot for running VM doesn't work correctly so we
should not report this capability until it is fixed.

This reverts commit de71573bfe.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-09-01 12:09:04 +02:00
Laine Stump
bbfcf18f50 docs: update description of virsh nodedev-detach --driver option
--driver can now be used to specify a specific driver to bind to the
device being detached from the host driver (e.g. vfio-pci-igbvf), not
just the *type* of driver (e.g. "vfio" or "xen", which are unnecessary
anyway, since they are implicit in which hypervisor driver is in use)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-08-25 15:24:58 -04:00
Kristina Hanicova
96d8ee2cff conf: add support for discard_granularity
This introduces the ability to set the discard granularity option
for a disk.  It defines the smallest amount of data that can be
discarded in a single operation (useful for managing and
optimizing storage).

However, most hypervisors automatically set the proper discard
granularity and users usually do not need to change the default
setting.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-08-25 15:05:13 +02:00
Peter Krempa
c3934b2b6b docs: Improve documentation of <disk type='dir'>
Note the implications and caveats of <disk type='dir'>.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/519
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-08-25 14:43:22 +02:00
K Shiva Kiran
93d1989a3d virsh exposure of Network Metadata APIs
Adds two new commands and a new option:
- 'net-desc' to show/modify network title and description.
- 'net-metadata' to show/modify network metadata.
- Option '--title' for 'net-list' to print corresponding
  network titles in an additional column.
- Documentation for all the above.
- XML Fallback function `virshNetworkGetXMLFromNet` for title and
  description for compatibility with hosts running older versions
  of libvirtd.

Signed-off-by: K Shiva Kiran <shiva_kr@riseup.net>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-08-25 12:36:37 +02:00
K Shiva Kiran
742c87d453 Add <title> and <description> for Network Objects
This patch adds new elements <title> and <description> to the Network XML.
- The <title> attribute holds a short title defined by the user and
  cannot contain newlines.
- The <description> attribute holds any documentation that the user
  wants to store.
- Schema definitions of <title> and <description> have been moved from
  domaincommon.rng to basictypes.rng for use by network and future objects.
- Added Network XML parser logic for the above.

Signed-off-by: K Shiva Kiran <shiva_kr@riseup.net>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-08-25 12:36:37 +02:00
Pavel Hrdina
de71573bfe capabilities: report full external snapshot support
Now that deleting and reverting external snapshots is implemented we can
report that in capabilities so management applications can use that
information and start using external snapshots.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-08-24 19:08:20 +02:00
Pavel Hrdina
ec642b1efe capabilities: reword disksnapshot feature to mention creating snapshots
Libvirt supports creating snapshots for a long time but the wording of
the feature may imply that libvirt supports external snapshots in
general but that is not true as users were not able to use APIs to
delete or revert external snapshots.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2023-08-24 19:08:09 +02:00
Erik Skultety
4e381c3e1d docs: index: Add a quick link to Submitting patches
We still get MRs in Gitlab from individual contributors on a regular
basis which in some ways just makes maintainer's or reviewer's life
just a bit more complicated. This ultimately means our guidelines are
probably not visible enough on the main page
(or some people wouldn't read them anyway). While this patch can't make
the problem go away, it can at least attempt to mitigate it by creating
a quick link to the 'hacking' page, skipping a lot of TL;DR contents
in contributing.rst which we link from the main page.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2023-08-11 14:57:51 +02:00
Han Han
0cec8abdba docs: formatdomain: Mention the QEMU requirement for discard_no_unref
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2023-07-26 10:08:26 +02:00
Han Han
8cb0c11f29 docs: Mention vhostuser for queues and queue_size
These two attributes are supported for vhost-user-blk as well.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-25 10:24:59 +02:00
Michal Privoznik
7ba20863a7 meson: Annotate each test() with 'suite'
A test case can be part of a test suite (just like we already
have 'syntax-check'). This then allows developers to run only a
subset of tests. For instance - when using valgrind test setup
(`meson test -C _build/ --setup valgrind`) it makes zero sense to
run syntax-check tests or other script based tests (e.g.
check-augeas-*, check-remote_protocol, etc.). What does makes
sense is to run compiled binaries.

Strictly speaking, reaching that goal is as trivial as annotating
only those compiled tests (declared in tests/meson.build) and
running them selectively:

  meson test -C _build/ --setup valgrind --suite $TAG

But it may be also desirable to run test scripts separately.

Therefore, introduce two new tags: 'bin' for compiled tests, and
'script' for script based tests and annotate each test()
accordingly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-20 10:58:01 +02:00
Boris Fiuczynski
aece25f665 conf: domcaps: Add 'async-teardown' domain capability
Add async-teardown to the features list in domain capabilities allowing
high level management to introspect the availability of the asynchronous
teardown feature.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-18 08:49:32 +02:00
Jonathon Jongsma
2d7542a8a5 docs: expand clangd instructions
Add some additional information about running clangd for LSP when clang
is not your normal compiler.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-By: Tim Small <tim@seoss.co.uk>
2023-07-17 10:43:29 -05:00
Tim Small
36b247b908 docs: Reword ninja invocation note to clarify build directory
Minor rewording to clarify purpose of the -C flag in the ninja
invocation, whilst retaining previous meaning.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:34 +02:00
Tim Small
ef7228f5ca docs: Fix deprecated use of implicit meson "setup" command
Use the explicit meson "setup" command instead of the deprecated
implicit invocation. The implied setup usage generates a warning with
meson version 1.0.1:

WARNING: Running the setup command as `meson [options]` instead of
`meson setup [options]` is ambiguous and deprecated.

Additionally the implicit command is likely to be confusing to those
unfamiliar with Meson - the `build` argument in `meson build` resembles
an action rather than an arbitrary path.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:29 +02:00
Tim Small
4d50cd23c9 docs: Point to mailing list archives from submitting-patches
Suggest that new contributors should review past patch submissions for
typical style, feedback etc. prior to submitting. Link to archives.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:27 +02:00
Tim Small
7160215146 docs: Advise running CI tests prior to submission
In the preparing patches section, note that it is possible to run CI
tests via gitlab prior to submitting patches.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:24 +02:00
Tim Small
941fc36f11 docs: Reword "Preparing Patches" to clarify
Clarify that patches should apply cleanly to the master branch. Give
guidance for typical bug fix process for existing releases.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:22 +02:00
Tim Small
3da8d8b5b1 docs: Add config instructions for clangd with libvirt
In build environments which use gcc as the default compiler, use of the
clangd LSP server (for enhanced code editing and navigation etc.) with
libvirt requires some additional configuration.  Detail this and link
from `hacking.rst`.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:19 +02:00
Tim Small
401a6171a3 docs: Point to compiling guide from code contribution guide
The "hacking" doc details where to find the code, but not how to compile
it - link to the instructions contained in `compiling.rst`.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:17 +02:00
Tim Small
7218970862 docs: Link main "contributing" from programming-specific guide
There are two guides to contributing: `hacking.rst` is focused on code
contributions, and `contributing.rst` is more general. Clarify scope of
`hacking.rst` and link to the general guide in its references.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:14 +02:00
Tim Small
225f6de45f docs: Missing "full-stop"/"period" on some bullet items
Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:10 +02:00
Tim Small
cccf129c2d docs: Link to main docs directory from Quick Links
Whilst the "docs" documentation map is linked in the navigation bar,
users may scroll down and lose sight of this, so also place at the
bottom of the "Quick Links" section.

Signed-off-by: Tim Small <tim@seoss.co.uk>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-14 15:19:07 +02:00
Boris Fiuczynski
3bf02acdc5 qemu: allow use of async teardown in domain
Asynchronous teardown can be specified if the QEMU binary supports it by
adding in the domain XML

  <features>
    ...
    <async-teardown enabled='yes|no'/>
    ...
  </features>

By default this new feature is disabled.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-10 13:28:17 +02:00
Han Han
1ed695bcff qemu: Support removable for scsi disk
Allow //disk/target@removable for scsi disk devices, since QEMU has support
the removable attribute for scsi-hd device from v0.14.0[1].

[1]: 419e691f8e: scsi-disk: Allow overriding SCSI INQUIRY removable bit

Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-07-09 07:39:57 +02:00
Michal Privoznik
ceb4dc8e17 docs: Move passt log file in our example XML
In our passt example XML we use /var/log/passt.log as path to the
log file. This is not optimal, because in case of unprivileged
daemon, neither libvirt nor passt has enough permissions to
create the file. Let's move the file under /tmp.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-06-26 15:52:54 +02:00
Jean-Louis Dupond
b855f8ea1e Add discard_no_unref option for qcow2 images
Qemu 8.1.0 will add discard_no_unref option for qcow2 images.
When this option is enabled (default=false), then it will no longer
unreference clusters when guest does a discard, but it will just free
the blocks (useful for incremental backups for example) and pass the
discard to the lower layer.

This was implemented to avoid fragmentation within the qcow2 image.

Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2023-06-26 13:06:00 +02:00
Jiri Denemark
be1b7d5b18 qemu: Report physical address size in domain capabilities
We already report the hosts physical address size in host capabilities,
but computing a baseline CPU definition is done from domain
capabilities.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-06-16 12:44:54 +02:00
Oleg Vasilev
794c583f46 docs: fix changed API calls
Signed-off-by: Oleg Vasilev <oleg.vasilev@virtuozzo.com>
2023-06-05 13:34:31 +00:00
Peter Krempa
2380242928 docs: Use '--exit-status=' option for 'rst2html5'
Ensure that also 'non-halting' messages stop the build process.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2023-06-02 09:39:10 +02:00
Peter Krempa
9f49f60aca docs: go: Add 'go-import' metadata via rST
The '.. meta::' rST directive allows adding header metadata. Move the
specific metadata from page.xsl into the individual files and pass them
through into the header from page.xsl.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2023-06-02 09:39:10 +02:00
Peter Krempa
54c1f31fda docs: page.xsl: Drop passhrough of <script> elements into header
No generated headers have inline javascript.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2023-06-02 09:39:10 +02:00
Peter Krempa
464450772f docs: newapi: Remove unused 'docomponents' template
Never used since introduction in b38893c3ea

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2023-06-02 09:39:10 +02:00