[PATCH 00/67] docs: Fix and clean up anchor links

First 50 patches remove the use of raw HTML passthrough in formatdomain.rst, which is the only outstanding place which still does. Most of the work was done by a ad-hoc bash script, but manual tweaks were needed. Since this series also contains a test script which validates linking I'm not going to publish the conversion script. The rest of the series then cleans up pre-existing broken links and adds the aforementioned checker script. One more change is to prevent the use of external references in RST to refer to the same file. All usage was converted to local references and a syntax check was added. One slight drawback of the checker script is that it works on generated HTML files and thus the error message contains the output file name and not the source RST document. Output after the fixes can be browsed at: https://gitlab.com/pipo.sk/libvirt/-/jobs/2528184702/artifacts/browse/websit... Peter Krempa (67): docs: formatdomain: Remove 'elements' anchor docs: formatdomain: Remove 'elementsMetadata' anchor docs: formatdomain: Remove 'elementsOS' anchor docs: formatdomain: Remove 'elementsOSBIOS' anchor docs: formatdomain: Remove 'elementsOSContainer' anchor docs: formatdomain: Remove 'elementsSysinfo' anchor docs: formatdomain: Remove 'elementsCPUAllocation' anchor docs: formatdomain: Remove 'elementsIOThreadsAllocation' anchor docs: formatdomain: Remove 'elementsCPUTuning' anchor docs: formatdomain: Remove 'elementsMemoryAllocation' anchor docs: formatdomain: Remove 'elementsMemoryBacking' anchor docs: formatdomain: Remove 'elementsMemoryTuning' anchor docs: formatdomain: Remove 'elementsNUMATuning' anchor docs: formatdomain: Remove 'elementsBlockTuning' anchor docs: formatdomain: Remove 'elementsCPU' anchor docs: formatdomain: Remove 'hmat' anchor docs: formatdomain: Remove 'elementsEvents' anchor docs: formatdomain: Remove 'elementsFeatures' anchor docs: formatdomain: Remove 'elementsDevices' anchor docs: formatdomain: Remove 'elementsDisks' anchor docs: formatdomain: Remove 'elementsAddress' anchor docs: formatdomain: Remove 'elementsVirtio' anchor docs: formatdomain: Remove 'elementsVirtioTransitional' anchor docs: formatdomain: Remove 'elementsControllers' anchor docs: formatdomain: Remove 'elementsHostDev' anchor docs: formatdomain: Remove 'elementsNICS' anchor docs: formatdomain: Remove 'elementsNICSDirect' anchor docs: formatdomain: Remove 'elementsNICSTargetOverride' anchor docs: formatdomain: Remove 'elementQoS' anchor docs: formatdomain: Remove 'elementVlanTag' anchor docs: formatdomain: Remove 'elementPort' anchor docs: formatdomain: Remove 'mtu' anchor docs: formatdomain: Remove 'coalesce' anchor docs: formatdomain: Remove 'elementVhostuser' anchor docs: formatdomain: Remove 'elementsGraphics' anchor docs: formatdomain: Remove 'elementsVideo' anchor docs: formatdomain: Remove 'elementsConsole' anchor docs: formatdomain: Remove 'elementCharSerial' anchor docs: formatdomain: Remove 'elementCharSerialAndConsole' anchor docs: formatdomain: Remove 'elementsCharHostInterface' anchor docs: formatdomain: Remove 'elementsCharHost' anchor docs: formatdomain: Remove 'elementsAudio' anchor docs: formatdomain: Remove 'elementsTpm' anchor docs: formatdomain: Remove 'elementsMemory' anchor docs: formatdomain: Remove 'elementsIommu' anchor docs: formatdomain: Remove 'vsock' anchor docs: formatdomain: Remove 'seclabel' anchor docs: formatdomain: Remove 'keywrap' anchor docs: formatdomain: Remove 'launchSecurity' anchor docs: formatdomain: Remove the 'anchor' role docs: formatdomain: Use local reference directly docs: uri: Fix link to libvirtd configuration section syntax-check: Add check prohibiting remote reference to local file docs: page.xsl: Fix link to 'mailing-lists' section docs: domainstatecapture: Fix broken links docs: rpc: Fix broken headings docs: formatcaps: Fix anchors of links into formatdomain.rst scripts: hvsupport: Remove link into the 'html' directory docs: Fix link to 'tlscerts' article docs: Remove extra leading slash in 'api' and 'formatdomaincaps' pages docs: Fix links in kbase/internals docs: kbase/kvm-realtime: Fix few links docs: kbase/tlscerts: Fix links docs: remote: Fix anchor names in links to uri.html uri: Fix link to qemu KVM example config docs: formatstorageencryption: Use correct anchor into formatsecret page docs: Add HTML reference checker build-aux/syntax-check.mk | 7 + docs/api.rst | 2 +- docs/docs.rst | 2 +- docs/drvlxc.rst | 2 +- docs/formatbackup.rst | 6 +- docs/formatcaps.rst | 10 +- docs/formatcheckpoint.rst | 2 +- docs/formatdomain.rst | 360 ++++++++++++----------------- docs/formatdomaincaps.rst | 20 +- docs/formatnetwork.rst | 8 +- docs/formatnetworkport.rst | 4 +- docs/formatnode.rst | 2 +- docs/formatsecret.rst | 12 +- docs/formatsnapshot.rst | 8 +- docs/formatstorageencryption.rst | 2 +- docs/kbase/domainstatecapture.rst | 12 +- docs/kbase/internals/eventloop.rst | 2 +- docs/kbase/internals/migration.rst | 2 +- docs/kbase/internals/rpc.rst | 16 +- docs/kbase/kvm-realtime.rst | 10 +- docs/kbase/launch_security_sev.rst | 2 +- docs/kbase/locking-sanlock.rst | 2 +- docs/kbase/memorydevices.rst | 2 +- docs/kbase/s390_protected_virt.rst | 2 +- docs/kbase/tlscerts.rst | 8 +- docs/manpages/virsh.rst | 8 +- docs/meson.build | 11 + docs/page.xsl | 2 +- docs/remote.rst | 4 +- docs/storage.rst | 6 +- docs/uri.rst | 4 +- scripts/check-html-references.py | 153 ++++++++++++ scripts/hvsupport.py | 2 +- scripts/meson.build | 1 + 34 files changed, 402 insertions(+), 294 deletions(-) create mode 100755 scripts/check-html-references.py -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - docs/formatdomaincaps.rst | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 089a99b4b5..a0e8d69b87 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -13,7 +13,6 @@ variations on the format based on the kind of domains run and the options used to launch them. For hypervisor specific details consult the `driver docs <drivers.html>`__ -:anchor:`<a id="elements"/>` Element and attribute overview ============================== diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 4de96ea83a..55209e53c2 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -68,7 +68,7 @@ The root element that emulator capability XML document starts with has name ``path`` The full path to the emulator binary. ``domain`` - Describes the `virtualization type <formatdomain.html#elements>`__ (or so + Describes the `virtualization type <formatdomain.html#element-and-attribute-overview>`__ (or so called domain type). ``machine`` The domain's `machine type <formatdomain.html#elementsOSBIOS>`__. Since not -- 2.35.3

Reworded the local link so that it retains the sense. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index a0e8d69b87..a8d3e559c9 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -24,7 +24,6 @@ domain. The allowed values are driver specific, but include "xen", "kvm", and "lxc". The second attribute is ``id`` which is a unique integer identifier for the running guest machine. Inactive machines have no id value. -:anchor:`<a id="elementsMetadata"/>` General metadata ---------------- @@ -500,8 +499,8 @@ layout of sub-elements, with supported values of: Serial number ``uuid`` Universal Unique ID number. If this entry is provided alongside a - top-level `uuid <#elementsMetadata>`__ element, then the two values - must match. + top-level ``uuid`` element (see `General metadata`_), then the two + values must match. ``sku`` SKU number to identify a particular configuration. ``family`` -- 2.35.3

Reworded the paragraph around the local link. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index a8d3e559c9..381d17370e 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -90,7 +90,6 @@ General metadata application needs structure, they should have sub-elements to their namespace element). :since:`Since 0.9.10` -:anchor:`<a id="elementsOS"/>` Operating system booting ------------------------ @@ -465,8 +464,8 @@ layout of sub-elements, with supported values of: ``smbios`` Sub-elements call out specific SMBIOS values, which will affect the guest if - used in conjunction with the ``smbios`` sub-element of the - `os <#elementsOS>`__ element. Each sub-element of ``sysinfo`` names a SMBIOS + used in conjunction with the ``smbios`` sub-element of the ``os`` element + (see `Operating system booting`_). Each sub-element of ``sysinfo`` names a SMBIOS block, and within those elements can be a list of ``entry`` elements that describe a field within the block. The following blocks and entries are recognized: -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 21 ++++++++++----------- docs/formatdomaincaps.rst | 6 +++--- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 381d17370e..3936a31155 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -97,7 +97,6 @@ Operating system booting There are a number of different ways to boot virtual machines each with their own pros and cons. -:anchor:`<a id="elementsOSBIOS"/>` BIOS bootloader ~~~~~~~~~~~~~~~ @@ -332,11 +331,11 @@ and full virtualized guests. ... ``type`` - This element has the same semantics as described earlier in the `BIOS boot - section <#elementsOSBIOS>`__ + This element has the same semantics as described earlier in the + `BIOS bootloader`_ section. ``loader`` - This element has the same semantics as described earlier in the `BIOS boot - section <#elementsOSBIOS>`__ + This element has the same semantics as described earlier in the + `BIOS bootloader`_ section. ``kernel`` The contents of this element specify the fully-qualified path to the kernel image in the host OS. @@ -3197,7 +3196,7 @@ paravirtualized driver is specified via the ``disk`` element. attribute is an 8 character string which can be queried by guests on S390 via sclp or diag 308. Linux guests on S390 can use ``loadparm`` to select a boot entry. :since:`Since 3.5.0` The per-device ``boot`` elements cannot be used - together with general boot elements in `BIOS bootloader <#elementsOSBIOS>`__ + together with general boot elements in `BIOS bootloader`_ section. :since:`Since 0.8.8` ``encryption`` Starting with :since:`libvirt 3.9.0` the ``encryption`` element is preferred @@ -4240,8 +4239,8 @@ or: ``boot`` Specifies that the device is bootable. The ``order`` attribute determines the order in which devices will be tried during boot sequence. The per-device - ``boot`` elements cannot be used together with general boot elements in `BIOS - bootloader <#elementsOSBIOS>`__ section. :since:`Since 0.8.8` for PCI + ``boot`` elements cannot be used together with general boot elements in + `BIOS bootloader`_ section. :since:`Since 0.8.8` for PCI devices, :since:`Since 1.0.1` for USB devices. ``rom`` The ``rom`` element is used to change how a PCI device's ROM is presented to @@ -4384,8 +4383,8 @@ after 0.9.5 (KVM only)` : ``boot`` Specifies that the device is bootable. The ``order`` attribute determines the order in which devices will be tried during boot sequence. The per-device - ``boot`` elements cannot be used together with general boot elements in `BIOS - bootloader <#elementsOSBIOS>`__ section. ( :since:`Since 1.0.1` ) + ``boot`` elements cannot be used together with general boot elements in + `BIOS bootloader`_ section. ( :since:`Since 1.0.1` ) ``redirfilter`` The\ ``redirfilter``\ element is used for creating the filter rule to filter out certain devices from redirection. It uses sub-element ``<usbdev>`` to @@ -5415,7 +5414,7 @@ Specifying boot order For hypervisors which support this, you can set a specific NIC to be used for network boot. The ``order`` attribute determines the order in which devices will be tried during boot sequence. The per-device ``boot`` elements cannot be used -together with general boot elements in `BIOS bootloader <#elementsOSBIOS>`__ +together with general boot elements in `BIOS bootloader`_ section. :since:`Since 0.8.8` Interface ROM BIOS configuration diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 55209e53c2..41a0b78959 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -71,11 +71,11 @@ The root element that emulator capability XML document starts with has name Describes the `virtualization type <formatdomain.html#element-and-attribute-overview>`__ (or so called domain type). ``machine`` - The domain's `machine type <formatdomain.html#elementsOSBIOS>`__. Since not + The domain's `machine type <formatdomain.html#bios-bootloader>`__. Since not every hypervisor has a sense of machine types this element might be omitted in such drivers. ``arch`` - The domain's `architecture <formatdomain.html#elementsOSBIOS>`__. + The domain's `architecture <formatdomain.html#bios-bootloader>`__. CPU Allocation ~~~~~~~~~~~~~~ @@ -98,7 +98,7 @@ BIOS bootloader ~~~~~~~~~~~~~~~ Sometimes users might want to tweak some BIOS knobs or use UEFI. For cases like -that, `os <formatdomain.html#elementsOSBIOS>`__ element exposes what values can +that, `os <formatdomain.html#bios-bootloader>`__ element exposes what values can be passed to its children. :: -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/drvlxc.rst | 2 +- docs/formatdomain.rst | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/drvlxc.rst b/docs/drvlxc.rst index 24501cae11..8a346907fb 100644 --- a/docs/drvlxc.rst +++ b/docs/drvlxc.rst @@ -37,7 +37,7 @@ In order to separate processes inside a container from those in the primary namespaces are compiled in. Libvirt currently requires the 'mount', 'ipc', 'pid', and 'uts' namespaces to be available. If separate network interfaces are desired, then the 'net' namespace is required. If the guest configuration -declares a `UID or GID mapping <formatdomain.html#elementsOSContainer>`__, the +declares a `UID or GID mapping <formatdomain.html#container-boot>`__, the 'user' namespace will be enabled to apply these. **A suitably configured UID/GID mapping is a pre-requisite to making containers secure, in the absence of sVirt confinement.** diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 3936a31155..1346c1ce01 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -355,7 +355,6 @@ and full virtualized guests. ``type`` attribute contains the ACPI table type (currently only ``slic`` is supported) :since:`Since 1.3.5 (QEMU)` :since:`Since 5.9.0 (Xen)` -:anchor:`<a id="elementsOSContainer"/>` Container boot ~~~~~~~~~~~~~~ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 1346c1ce01..f0bc9f6995 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -53,7 +53,7 @@ General metadata the virtual machine. The format must be RFC 4122 compliant, eg ``3e3fce45-4f53-4fa7-bb32-11f34168b82b``. If omitted when defining/creating a new machine, a random UUID is generated. It is also possible to provide the - UUID via a `sysinfo <#elementsSysinfo>`__ specification. :since:`Since 0.0.1, + UUID via a `SMBIOS System Information`_ specification. :since:`Since 0.0.1, sysinfo since 0.8.7` ``genid`` :since:`Since 4.4.0` , the ``genid`` element can be used to add a Virtual @@ -251,7 +251,7 @@ harddisk, cdrom, network) determining where to obtain/find the boot image. UUID, from the host's SMBIOS values; the `virConnectGetSysinfo <html/libvirt-libvirt-host.html#virConnectGetSysinfo>`__ call can be used to see what values are copied), or "sysinfo" (use the values - in the `sysinfo <#elementsSysinfo>`__ element). If not specified, the + in the `SMBIOS System Information`_ element). If not specified, the hypervisor default is used. :since:`Since 0.8.7` Up till here the BIOS/UEFI configuration knobs are generic enough to be @@ -407,7 +407,6 @@ If you want to enable user namespace, set the ``idmap`` element. The ``uid`` and <gid start='0' target='1000' count='10'/> </idmap> -:anchor:`<a id="elementsSysinfo"/>` SMBIOS System Information ------------------------- -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - docs/kbase/kvm-realtime.rst | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index f0bc9f6995..564ebbfd69 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -576,7 +576,6 @@ layout of sub-elements, with supported values of: the value (to set the blob value directly), or ``file`` attribute (to set the blob value from the file). -:anchor:`<a id="elementsCPUAllocation"/>` CPU Allocation -------------- diff --git a/docs/kbase/kvm-realtime.rst b/docs/kbase/kvm-realtime.rst index 476e581a2a..f523858143 100644 --- a/docs/kbase/kvm-realtime.rst +++ b/docs/kbase/kvm-realtime.rst @@ -128,7 +128,7 @@ host core that is in the `isolcpus` reserved set. The QEMU emulator threads need to be pinned to host CPUs that are not in the `isolcpus` reserved set. The vCPUs need to be given a real time CPU scheduler policy. -When configuring the `guest CPU count <../formatdomain.html#elementsCPUAllocation>`_, +When configuring the `guest CPU count <../formatdomain.html#cpu-allocation>`_, do not include any CPU affinity at this stage: :: -- 2.35.3

Reworded documentation around local links. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 18 ++++++++---------- docs/formatdomaincaps.rst | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 564ebbfd69..835dff3596 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -653,7 +653,6 @@ CPU Allocation same core need to be enabled as well. All non-hotpluggable CPUs present at boot need to be grouped after vCPU 0. :since:`Since 2.2.0 (QEMU only)` -:anchor:`<a id="elementsIOThreadsAllocation"/>` IOThreads Allocation -------------------- @@ -775,9 +774,8 @@ CPU Tuning of element ``vcpu`` is not specified, the IOThreads are pinned to all the physical CPUs by default. There are two required attributes, the attribute ``iothread`` specifies the IOThread ID and the attribute ``cpuset`` - specifying which physical CPUs to pin to. See the ``iothreadids`` - `description <#elementsIOThreadsAllocation>`__ for valid ``iothread`` values. - :since:`Since 1.2.9` + specifying which physical CPUs to pin to. See the `IOThreads Allocation`_ + section documenting valid values of ``iothread``. :since:`Since 1.2.9` ``shares`` The optional ``shares`` element specifies the proportional weighted share for the domain. If this is omitted, it defaults to the OS provided defaults. NB, @@ -851,8 +849,8 @@ CPU Tuning vCPUs/IOThreads this setting applies to, leaving them out sets the default. The element ``emulatorsched`` does not have that attribute. Valid ``vcpus`` values start at 0 through one less than the number of vCPU's defined for the - domain. Valid ``iothreads`` values are described in the ``iothreadids`` - `description <#elementsIOThreadsAllocation>`__. If no ``iothreadids`` are + domain. Valid ``iothreads`` values are described in the `IOThreads Allocation`_ + section. If no ``iothreadids`` are defined, then libvirt numbers IOThreads from 1 to the number of ``iothreads`` available for the domain. For real-time schedulers (``fifo``, ``rr``), priority must be specified as well (and is ignored for non-real-time ones). @@ -3131,8 +3129,8 @@ paravirtualized driver is specified via the ``disk`` element. intensive operation, but can save file space and/or time on slow media. :since:`Since 2.0.0` - The optional ``iothread`` attribute assigns the disk to an IOThread as - defined by the range for the domain - `iothreads <#elementsIOThreadsAllocation>`__ value. Multiple disks may be + defined by the range for the domain ``iothreads`` value. (See + `IOThreads Allocation`_). Multiple disks may be assigned to the same IOThread and are numbered from 1 to the domain iothreads value. Available for a disk device ``target`` configured to use "virtio" ``bus`` and "pci" or "ccw" ``address`` types. :since:`Since 1.2.8 @@ -3754,8 +3752,8 @@ An optional sub-element ``driver`` can specify the driver specific options: Supported for controller type ``scsi`` using model ``virtio-scsi`` for ``address`` types ``pci`` and ``ccw`` :since:`since 1.3.5 (QEMU 2.4)` . The optional ``iothread`` attribute assigns the controller to an IOThread as - defined by the range for the domain - `iothreads <#elementsIOThreadsAllocation>`__ value. Each SCSI ``disk`` + defined by the range for the domain ``iothreads`` (See `IOThreads Allocation`_). + Each SCSI ``disk`` assigned to use the specified ``controller`` will utilize the same IOThread. If a specific IOThread is desired for a specific SCSI ``disk``, then multiple controllers must be defined each having a specific ``iothread`` value. The diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 41a0b78959..9ca7cdcc7c 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -232,7 +232,7 @@ I/O Threads ~~~~~~~~~~~ The ``iothread`` elements indicates whether or not `I/O -threads <formatdomain.html#elementsIOThreadsAllocation>`__ are supported. +threads <formatdomain.html#iothreads-allocation>`__ are supported. :: -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - docs/kbase/kvm-realtime.rst | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 835dff3596..27e1e496e9 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -699,7 +699,6 @@ host/guest with many LUNs. :since:`Since 1.2.8 (QEMU only)` ``iothreads`` defined for the domain, then the ``iothreads`` value will be adjusted accordingly. :since:`Since 1.2.15` -:anchor:`<a id="elementsCPUTuning"/>` CPU Tuning ---------- diff --git a/docs/kbase/kvm-realtime.rst b/docs/kbase/kvm-realtime.rst index f523858143..288295b4c7 100644 --- a/docs/kbase/kvm-realtime.rst +++ b/docs/kbase/kvm-realtime.rst @@ -137,7 +137,7 @@ do not include any CPU affinity at this stage: The guest CPUs now need to be placed individually. In this case, they will all be put within the same host socket, such that they can be exposed as core -siblings. This is achieved using the `CPU tuning config <../formatdomain.html#elementsCPUTuning>`_: +siblings. This is achieved using the `CPU tuning config <../formatdomain.html#cpu-tuning>`_: :: -- 2.35.3

Reworded documentation around local links. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 27e1e496e9..8e18151796 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -885,8 +885,7 @@ CPU Tuning but the ``unit`` attribute can be used to scale the value. ``unit`` (optional) If specified it is the unit such as KiB, MiB, GiB, or TiB (described in - the ``memory`` element for `Memory - Allocation <#elementsMemoryAllocation>`__) in which ``size`` is + the ``memory`` element for `Memory Allocation`_) in which ``size`` is specified, defaults to bytes. ``monitor`` :since:`Since 4.10.0` @@ -921,7 +920,6 @@ CPU Tuning The memory bandwidth to allocate from this node. The value by default is in percentage. -:anchor:`<a id="elementsMemoryAllocation"/>` Memory Allocation ----------------- @@ -1565,8 +1563,8 @@ maximum virtual CPUs number declared in ``vcpus``, to make the domain consistent across qemu and libvirt versions. ``memory`` specifies the node memory in kibibytes (i.e. blocks of 1024 bytes). :since:`Since 6.6.0` the ``cpus`` attribute is optional and if omitted a CPU-less NUMA node is created. -:since:`Since 1.2.11` one can use an additional -`unit <#elementsMemoryAllocation>`__ attribute to define units in which +:since:`Since 1.2.11` one can use an additional ``unit`` attribute +(See `Memory Allocation`_) to define units in which ``memory`` is specified. :since:`Since 1.2.7` all cells should have ``id`` attribute in case referring to some cell is necessary in the code, otherwise the cells are assigned ``id``\ s in the increasing order starting from 0. Mixing @@ -2034,7 +2032,7 @@ are: as 48 MiB of unavailable RAM might be too much for small guests (e.g. with 512 MiB of RAM). - See `Memory Allocation <#elementsMemoryAllocation>`__ for more details about + See `Memory Allocation`_ for more details about the ``unit`` attribute. :since:`Since 4.5.0` (QEMU only) ``ioapic`` @@ -7981,8 +7979,8 @@ Example: usage of the memory devices ``label`` For NVDIMM type devices one can use ``label`` and its subelement ``size`` to configure the size of namespaces label storage within the NVDIMM - module. The ``size`` element has usual meaning described - `here <#elementsMemoryAllocation>`__. ``label`` is mandatory for pSeries + module. The ``size`` element has usual meaning described in the + `Memory Allocation`_ section. ``label`` is mandatory for pSeries guests and optional for all other architectures. For QEMU domains the following restrictions apply: -- 2.35.3

Reworded documentation around one of the local links. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 16 +++++++--------- docs/kbase/kvm-realtime.rst | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 8e18151796..fbebff8650 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -970,7 +970,6 @@ Memory Allocation fly. If this is omitted, it defaults to the same value as the ``memory`` element. The ``unit`` attribute behaves the same as for ``memory``. -:anchor:`<a id="elementsMemoryBacking"/>` Memory Backing -------------- @@ -1083,7 +1082,7 @@ Memory Tuning killed by the kernel if the guess is too low, and determining the memory needed for a process to run is an `undecidable problem <https://en.wikipedia.org/wiki/Undecidable_problem>`__; that said, if - you already set ``locked`` in `memory backing <#elementsMemoryBacking>`__ + you already set ``locked`` in `Memory Backing`_ because your workload demands it, you'll have to take into account the specifics of your deployment and figure out a value for ``hard_limit`` that is large enough to support the memory requirements of your guest, but small @@ -1573,8 +1572,8 @@ in unwanted behaviour. :since:`Since 1.2.9` the optional attribute ``memAccess`` can control whether the memory is to be mapped as "shared" or "private". This is valid only for hugepages-backed memory and nvdimm modules. Each ``cell`` element can have an optional ``discard`` attribute which fine tunes the discard feature -for given numa node as described under `Memory -Backing <#elementsMemoryBacking>`__. Accepted values are ``yes`` and ``no``. +for given numa node as described under `Memory Backing`_. +Accepted values are ``yes`` and ``no``. :since:`Since 4.4.0` This guest NUMA specification is currently available only for QEMU/KVM and Xen. @@ -2715,7 +2714,7 @@ paravirtualized driver is specified via the ``disk`` element. ``vhostuser`` Enables the hypervisor to connect to another process using vhost-user protocol. Requires shared memory configured for the VM, for more details - see ``access`` mode for `memoryBacking <#elementsMemoryBacking>`__ element. + see ``access`` mode for ``memoryBacking`` element (See `Memory Backing`_). The ``source`` element has following mandatory attributes: @@ -7907,7 +7906,7 @@ Example: usage of the memory devices ``access`` An optional attribute ``access`` ( :since:`since 3.2.0` ) that provides capability to fine tune mapping of the memory on per module basis. Values are - the same as `Memory Backing <#elementsMemoryBacking>`__: ``shared`` and + the same as `Memory Backing`_: ``shared`` and ``private``. For ``nvdimm`` model, if using real NVDIMM DAX device as backend, ``shared`` is required. For ``virtio-pmem`` model ``shared`` is required. @@ -7915,9 +7914,8 @@ Example: usage of the memory devices ``discard`` An optional attribute ``discard`` ( :since:`since 4.4.0` ) that provides capability to fine tune discard of data on per module basis. Accepted values - are ``yes`` and ``no``. The feature is described here: `Memory - Backing <#elementsMemoryBacking>`__. This attribute is allowed only for - ``model='dimm'``. + are ``yes`` and ``no``. The feature is described here: `Memory Backing`_. + This attribute is allowed only for ``model='dimm'``. ``uuid`` For pSeries guests, an uuid can be set to identify the nvdimm module. If diff --git a/docs/kbase/kvm-realtime.rst b/docs/kbase/kvm-realtime.rst index 288295b4c7..9b38aff0fd 100644 --- a/docs/kbase/kvm-realtime.rst +++ b/docs/kbase/kvm-realtime.rst @@ -178,7 +178,7 @@ Memory configuration The host memory used for guest RAM needs to be allocated from huge pages on the second NUMA node, and all other memory allocation needs to be locked into RAM with memory page sharing disabled. -This is achieved by using the `memory backing config <formatdomain.html#elementsMemoryBacking>`_: +This is achieved by using the `memory backing config <formatdomain.html#memory-backing>`_: :: -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index fbebff8650..5cf31d9e06 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1025,7 +1025,7 @@ influence how virtual memory pages are backed by host pages. amounts of locked memory could cause a denial-of-service attack on the host. Because of this, using this option is discouraged unless your workload demands it; even then, it's highly recommended to set a ``hard_limit`` (see - `memory tuning <#elementsMemoryTuning>`__) on memory allocation suitable for + `Memory Tuning`_) on memory allocation suitable for the specific environment at the same time to mitigate the risks described above. :since:`Since 1.0.6` ``source`` @@ -1046,7 +1046,6 @@ influence how virtual memory pages are backed by host pages. this is just an optimization and is not guaranteed to work in all cases (e.g. when hypervisor crashes). :since:`Since 4.4.0` (QEMU/KVM only) -:anchor:`<a id="elementsMemoryTuning"/>` Memory Tuning ------------- -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 5cf31d9e06..6637ab409b 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1008,7 +1008,7 @@ influence how virtual memory pages are backed by host pages. ``nodeset`` attribute may come handy as it ties given guest's NUMA nodes to certain hugepage sizes. From the example snippet, one gigabyte hugepages are used for every NUMA node except node number four. For the correct syntax see - `this <#elementsNUMATuning>`__. + `NUMA Node Tuning`_. ``nosharepages`` Instructs hypervisor to disable shared pages (memory merge, KSM) for this domain. :since:`Since 1.0.6` @@ -1100,7 +1100,6 @@ Memory Tuning of 1024 bytes). This element is only supported by VMware ESX and OpenVZ drivers. -:anchor:`<a id="elementsNUMATuning"/>` NUMA Node Tuning ---------------- -- 2.35.3

Reworded documentation around the local link. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 6637ab409b..45f94e5fa2 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1149,7 +1149,6 @@ NUMA Node Tuning element. This setting is not compatible with automatic placement. :since:`QEMU Since 1.2.7` -:anchor:`<a id="elementsBlockTuning"/>` Block I/O Tuning ---------------- @@ -2970,7 +2969,7 @@ paravirtualized driver is specified via the ``disk`` element. ``iotune`` The optional ``iotune`` element provides the ability to provide additional per-device I/O tuning, with values that can vary for each device (contrast - this to the `<blkiotune> <#elementsBlockTuning>`__ element, which applies + this to the ``blkiotune`` element (See `Block I/O Tuning`_), which applies globally to the domain). Currently, the only tuning available is Block I/O throttling for qemu. This element has optional sub-elements; any sub-element not specified or given with a value of 0 implies no limit. :since:`Since -- 2.35.3

Reworded documentation around the local link. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 5 ++--- docs/formatdomaincaps.rst | 2 +- docs/kbase/kvm-realtime.rst | 2 +- docs/manpages/virsh.rst | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 45f94e5fa2..e8431f972f 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -948,8 +948,8 @@ Memory Allocation or "TiB" for tebibytes (2\ :sup:`40` or 1,099,511,627,776 bytes). However, the value will be rounded up to the nearest kibibyte by libvirt, and may be further rounded to the granularity supported by the hypervisor. Some - hypervisors also enforce a minimum, such as 4000KiB. In case - `NUMA <#elementsCPU>`__ is configured for the guest the ``memory`` element + hypervisors also enforce a minimum, such as 4000KiB. In case NUMA is + configured for the guest (See `CPU model and topology`_) the ``memory`` element can be omitted. In the case of crash, optional attribute ``dumpCore`` can be used to control whether the guest memory should be included in the generated coredump or not (values "on", "off"). ``unit`` :since:`since 0.9.11` , @@ -1252,7 +1252,6 @@ Using this feature requires Fibre Channel capable HW, kernel compiled with option ``CONFIG_BLK_CGROUP_FC_APPID`` and ``nvme_fc`` kernel module loaded. :since:`Since 7.7.0` -:anchor:`<a id="elementsCPU"/>` CPU model and topology ---------------------- diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 9ca7cdcc7c..d8fcf65450 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -165,7 +165,7 @@ CPU configuration ~~~~~~~~~~~~~~~~~ The ``cpu`` element exposes options usable for configuring `guest -CPUs <formatdomain.html#elementsCPU>`__. +CPUs <formatdomain.html#cpu-model-and-topology>`__. :: diff --git a/docs/kbase/kvm-realtime.rst b/docs/kbase/kvm-realtime.rst index 9b38aff0fd..f0a1bb7c95 100644 --- a/docs/kbase/kvm-realtime.rst +++ b/docs/kbase/kvm-realtime.rst @@ -150,7 +150,7 @@ siblings. This is achieved using the `CPU tuning config <../formatdomain.html#cp <vcpusched vcpus='0-4' scheduler='fifo' priority='1'/> </cputune> -The `guest CPU model <formatdomain.html#elementsCPU>`_ now needs to be +The `guest CPU model <formatdomain.html#cpu-model-and-topology>`_ now needs to be configured to pass through the host model unchanged, with topology matching the placement: diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index e73e590754..5cb948bb91 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -895,7 +895,7 @@ domain capabilities XML (printed by ``domcapabilities`` command). In addition to the <cpu> element itself, this command accepts full domain XML, capabilities XML, or domain capabilities XML containing the CPU definition. For more information on guest CPU definition see: -`https://libvirt.org/formatdomain.html#elementsCPU <https://libvirt.org/formatdomain.html#elementsCPU>`__. If *--error* is +`https://libvirt.org/formatdomain.html#elementsCPU <https://libvirt.org/formatdomain.html#cpu-model-and-topology>`__. If *--error* is specified, the command will return an error when the given CPU is incompatible with host CPU and a message providing more details about the incompatibility will be printed out. If *--validate* is specified, validates @@ -943,7 +943,7 @@ host CPU model found in the domain capabilities XML (printed by the ``domcapabilities`` command). In addition to the <cpu> element itself, this command accepts full domain XML, capabilities XML, or domain capabilities XML containing the CPU definition. For more information on guest CPU definition -see: `https://libvirt.org/formatdomain.html#elementsCPU <https://libvirt.org/formatdomain.html#elementsCPU>`__. +see: `https://libvirt.org/formatdomain.html#elementsCPU <https://libvirt.org/formatdomain.html#cpu-model-and-topology>`__. The *virttype* option specifies the virtualization type (usable in the 'type' attribute of the <domain> top level element from the domain XML). *emulator* -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index e8431f972f..2851f28251 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1630,7 +1630,6 @@ QEMU. If no ``distances`` are given to describe the SLIT data between different cells, it will default to a scheme using 10 for local and 20 for remote distances. -:anchor:`<a id="hmat"/>` ACPI Heterogeneous Memory Attribute Table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - docs/kbase/locking-sanlock.rst | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 2851f28251..acff214cc8 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1705,7 +1705,6 @@ To describe latency from one NUMA node to a cache of another NUMA node the For instance, ``target='0' cache='1'`` refers to the first level cache of NUMA node 0. -:anchor:`<a id="elementsEvents"/>` Events configuration -------------------- diff --git a/docs/kbase/locking-sanlock.rst b/docs/kbase/locking-sanlock.rst index 24895b42f4..0b645582f4 100644 --- a/docs/kbase/locking-sanlock.rst +++ b/docs/kbase/locking-sanlock.rst @@ -173,7 +173,7 @@ Domain configuration In case sanlock loses access to disk locks for some reason, it will kill all domains that lost their locks. This default behavior may be changed -using `on_lockfailure element <../formatdomain.html#elementsEvents>`__ in +using `on_lockfailure element <../formatdomain.html#events-configuration>`__ in domain XML. When this element is present, sanlock will call ``sanlock_helper`` (provided by libvirt) with the specified action. This helper binary will connect to libvirtd and thus it may need to -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 3 +-- docs/formatdomaincaps.rst | 2 +- docs/kbase/kvm-realtime.rst | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index acff214cc8..0247132d2b 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1809,7 +1809,6 @@ advertisements to the guest OS. (NB: Only qemu driver support) the guest OS itself can choose to circumvent the unavailability of the sleep states (e.g. S4 by turning off completely). -:anchor:`<a id="elementsFeatures"/>` Hypervisor features ------------------- @@ -8047,7 +8046,7 @@ Example: ``eim`` The ``eim`` attribute (with possible values ``on`` and ``off``) can be used to configure Extended Interrupt Mode. A q35 domain with split I/O - APIC (as described in `hypervisor features <#elementsFeatures>`__), and + APIC (as described in `Hypervisor features`_), and both interrupt remapping and EIM turned on for the IOMMU, will be able to use more than 255 vCPUs. :since:`Since 3.4.0` (QEMU/KVM only) diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index d8fcf65450..7aead08d69 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -527,7 +527,7 @@ each of the elements or attributes. For example, the ``gic`` element has an attribute ``version`` which can support the values ``2`` or ``3``. For information about the purpose of each feature, see the `relevant -section <formatdomain.html#elementsFeatures>`__ in the domain XML documentation. +section <formatdomain.html#hypervisor-features>`__ in the domain XML documentation. GIC capabilities ^^^^^^^^^^^^^^^^ diff --git a/docs/kbase/kvm-realtime.rst b/docs/kbase/kvm-realtime.rst index f0a1bb7c95..890155560c 100644 --- a/docs/kbase/kvm-realtime.rst +++ b/docs/kbase/kvm-realtime.rst @@ -162,7 +162,7 @@ placement: </cpu> The performance monitoring unit virtualization needs to be disabled -via the `hypervisor features <../formatdomain.html#elementsFeatures>`_: +via the `hypervisor features <../formatdomain.html#hypervisor-features>`_: :: -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - docs/manpages/virsh.rst | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 0247132d2b..4f85366c9d 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2291,7 +2291,6 @@ event name Description ``emulation_faults`` the count of emulation faults, that is when the kernel traps on unimplemented instrucions and emulates them for user space, by applications running on the platform ``perf.emulation_faults`` =========================== ======================================================================================================================================================================================= ================================ -:anchor:`<a id="elementsDevices"/>` Devices ------- diff --git a/docs/manpages/virsh.rst b/docs/manpages/virsh.rst index 5cb948bb91..965b89c99d 100644 --- a/docs/manpages/virsh.rst +++ b/docs/manpages/virsh.rst @@ -4645,7 +4645,7 @@ attach-device Attach a device to the domain, using a device definition in an XML file using a device definition element such as <disk> or <interface> as the top-level element. See the documentation at -`https://libvirt.org/formatdomain.html#elementsDevices <https://libvirt.org/formatdomain.html#elementsDevices>`__ to learn about +`https://libvirt.org/formatdomain.html#elementsDevices <https://libvirt.org/formatdomain.html#devices>`__ to learn about libvirt XML format for a device. If *--config* is specified the command alters the persistent guest configuration with the device attach taking effect the next time libvirt starts the domain. @@ -5006,7 +5006,7 @@ Update the characteristics of a device associated with *domain*, based on the device definition in an XML *file*. The *--force* option can be used to force device update, e.g., to eject a CD-ROM even if it is locked/mounted in the domain. See the documentation at -`https://libvirt.org/formatdomain.html#elementsDevices <https://libvirt.org/formatdomain.html#elementsDevices>`__ to learn about +`https://libvirt.org/formatdomain.html#elementsDevices <https://libvirt.org/formatdomain.html#devices>`__ to learn about libvirt XML format for a device. If *--live* is specified, affect a running domain. -- 2.35.3

Two paragraphs containing local links were reformulated and rewrapped. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatbackup.rst | 6 +++--- docs/formatcheckpoint.rst | 2 +- docs/formatdomain.rst | 21 +++++++++++---------- docs/formatsecret.rst | 10 +++++----- docs/formatsnapshot.rst | 6 +++--- docs/storage.rst | 6 +++--- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/docs/formatbackup.rst b/docs/formatbackup.rst index c378ad9d9a..02847fd5d4 100644 --- a/docs/formatbackup.rst +++ b/docs/formatbackup.rst @@ -37,7 +37,7 @@ were supplied). The following child elements and attributes are supported: ``server`` Present only for a pull mode backup. Contains the same attributes as the - ```protocol`` element of a disk <formatdomain.html#elementsDisks>`__ attached + ```protocol`` element of a disk <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ attached via NBD in the domain (such as transport, socket, name, port, or tls), necessary to set up an NBD server that exposes the content of each disk at the time the backup is started. @@ -61,7 +61,7 @@ were supplied). The following child elements and attributes are supported: ``name`` A mandatory attribute which must match the ``<target dev='name'/>`` of - one of the `disk devices <formatdomain.html#elementsDisks>`__ specified + one of the `disk devices <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ specified for the domain at the time of the checkpoint. ``backup`` @@ -122,7 +122,7 @@ were supplied). The following child elements and attributes are supported: file is not deleted after the backup but the contents of the file don't make sense outside of the backup. The same applies for the block device which must be formatted appropriately. Similarly to the domain - ```disk`` <formatdomain.html#elementsDisks>`__ definition ``scratch`` + ```disk`` <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ definition ``scratch`` and ``target`` can contain ``seclabel`` and/or ``encryption`` subelements to configure the corresponding properties. diff --git a/docs/formatcheckpoint.rst b/docs/formatcheckpoint.rst index ff3f1e8c00..496de4e1ff 100644 --- a/docs/formatcheckpoint.rst +++ b/docs/formatcheckpoint.rst @@ -69,7 +69,7 @@ The top-level ``domaincheckpoint`` element may contain the following elements: ``name`` A mandatory attribute which must match either the ``<target dev='name'/>`` or an unambiguous ``<source file='name'/>`` of - one of the `disk devices <formatdomain.html#elementsDisks>`__ specified + one of the `disk devices <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ specified for the domain at the time of the checkpoint. ``checkpoint`` diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 4f85366c9d..d1134c523f 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -239,7 +239,7 @@ harddisk, cdrom, network) determining where to obtain/find the boot image. (the sorted list is vda, vdb, hda, hdc). Similar domain with hdc, vda, vdb, and hda disks will boot from hda (sorted disks are: hda, hdc, vda, vdb). It can be tricky to configure in the desired way, which is why per-device boot - elements (see `disks <#elementsDisks>`__, `network + elements (see `Hard drives, floppy disks, CDROMs`_, `network interfaces <#elementsNICS>`__, and `USB and PCI devices <#elementsHostDev>`__ sections below) were introduced and they are the preferred way providing full control over booting order. The ``boot`` element and per-device boot elements @@ -1186,12 +1186,13 @@ Block I/O Tuning ``device`` The domain may have multiple ``device`` elements that further tune the weights for each host block device in use by the domain. Note that multiple - `guest disks <#elementsDisks>`__ can share a single host block device, if - they are backed by files within the same host file system, which is why this - tuning parameter is at the global domain level rather than associated with - each guest disk device (contrast this to the `<iotune> <#elementsDisks>`__ - element which can apply to an individual ``<disk>``). Each ``device`` element - has two mandatory sub-elements, ``path`` describing the absolute path of the + disks (See `Hard drives, floppy disks, CDROMs`_) can share a single host + block device, if they are backed by files within the same host file system, + which is why this tuning parameter is at the global domain level rather than + associated with each guest disk device (contrast this to the <iotune> + element of a disk definition (See `Hard drives, floppy disks, CDROMs`_) + which can applies to an individual disk). Each ``device`` element has + two mandatory sub-elements, ``path`` describing the absolute path of the device, and ``weight`` giving the relative weight of that device, in the range [100, 1000]. After kernel 2.6.39, the value could be in the range [10, 1000]. :since:`Since 0.9.8` @@ -2331,7 +2332,6 @@ following characters: ``[a-zA-Z0-9_-]``. :since:`Since 3.9.0` ... </devices> -:anchor:`<a id="elementsDisks"/>` Hard drives, floppy disks, CDROMs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -4118,7 +4118,7 @@ or: "unfiltered", where the default is "filtered". The optional ``rawio`` ( :since:`since 1.2.9` ) attribute indicates whether the lun needs the rawio capability. Valid settings are "yes" or "no". See the rawio description - within the `disk <#elementsDisks>`__ section. If a disk lun in the domain + within the `Hard drives, floppy disks, CDROMs`_ section. If a disk lun in the domain already has the rawio capability, then this setting not required. ``scsi_host`` :since:`since 2.5.0` For SCSI devices, user is responsible to make sure @@ -4197,7 +4197,8 @@ or: :since:`Since 1.2.8` , the ``source`` element of a SCSI device may contain the ``protocol`` attribute. When the attribute is set to "iscsi", the host - device XML follows the network `disk <#elementsDisks>`__ device using the + device XML follows the network disk device + (See `Hard drives, floppy disks, CDROMs`_) using the same ``name`` attribute and optionally using the ``auth`` element to provide the authentication credentials to the iSCSI server. diff --git a/docs/formatsecret.rst b/docs/formatsecret.rst index 03c2836843..0327430078 100644 --- a/docs/formatsecret.rst +++ b/docs/formatsecret.rst @@ -65,7 +65,7 @@ using ``virsh secret-set-value``. The volume type secret can be supplied either in volume XML during creation of a `storage volume <formatstorage.html#storage-volume-xml>`__ in order to provide the passphrase to encrypt the volume or in domain XML -`disk device <formatdomain.html#elementsDisks>`__ in order to provide the +`disk device <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ in order to provide the passphrase to decrypt the volume, :since:`since 2.1.0` . An example follows: :: @@ -101,7 +101,7 @@ This secret is associated with a Ceph RBD (rados block device). The ``<usage type='ceph'>`` element must contain a single ``name`` element that specifies a usage name for the secret. The Ceph secret can then be used by UUID or by this usage name via the ``<auth>`` element of a `disk -device <formatdomain.html#elementsDisks>`__ or a `storage pool +device <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ or a `storage pool (rbd) <formatstorage.html>`__. :since:`Since 0.9.7` . The following is an example of the steps to be taken. First create a ceph-secret.xml file: @@ -132,7 +132,7 @@ See `Setting secret values in virsh`_ on how to set the value of the secret using ``virsh secret-set-value``. The ceph secret can then be used by UUID or by the usage name via the ``<auth>`` -element in a domain's `<disk> <formatdomain.html#elementsDisks>`__ element as +element in a domain's `<disk> <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ element as follows: :: @@ -157,7 +157,7 @@ This secret is associated with an iSCSI target for CHAP authentication. The ``<usage type='iscsi'>`` element must contain a single ``target`` element that specifies a usage name for the secret. The iSCSI secret can then be used by UUID or by this usage name via the ``<auth>`` element of a `disk -device <formatdomain.html#elementsDisks>`__ or a `storage pool +device <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ or a `storage pool (iscsi) <formatstorage.html>`__. :since:`Since 1.0.4` . The following is an example of the XML that may be used to generate a secret for iSCSI CHAP authentication. Assume the following sample entry in an iSCSI authentication @@ -207,7 +207,7 @@ See `Setting secret values in virsh`_ on how to set the value of the secret using ``virsh secret-set-value``. The iSCSI secret can then be used by UUID or by the usage name via the -``<auth>`` element in a domain's `<disk> <formatdomain.html#elementsDisks>`__ +``<auth>`` element in a domain's `<disk> <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ element as follows: :: diff --git a/docs/formatsnapshot.rst b/docs/formatsnapshot.rst index dd742a3063..07aa03c0a7 100644 --- a/docs/formatsnapshot.rst +++ b/docs/formatsnapshot.rst @@ -115,11 +115,11 @@ The top-level ``domainsnapshot`` element may contain the following elements: This sub-element describes the snapshot properties of a specific disk. The attribute ``name`` is mandatory, and must match either the ``<target dev='name'/>`` (recommended) or an unambiguous ``<source file='name'/>`` - of one of the `disk devices <formatdomain.html#elementsDisks>`__ + of one of the `disk devices <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ specified for the domain at the time of the snapshot. The attribute ``snapshot`` is optional, and the possible values are the same as the ``snapshot`` attribute for `disk devices - <formatdomain.html#elementsDisks>`__ (``no``, ``internal``, or + <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ (``no``, ``internal``, or ``external``). Some hypervisors like ESX require that if specified, the snapshot mode must not override any snapshot mode attached to the corresponding domain disk, while others like qemu allow this field to @@ -140,7 +140,7 @@ The top-level ``domainsnapshot`` element may contain the following elements: overwrite the default ``file`` type. The ``type`` attribute along with the format of the ``source`` sub-element is identical to the ``source`` element used in domain disk definitions. See the `disk devices - <formatdomain.html#elementsDisks>`__ section documentation for further + <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ section documentation for further information. Libvirt currently supports the ``type`` element in the qemu driver and supported values are ``file``, ``block`` and ``network`` :since:`(since 1.2.2)`. diff --git a/docs/storage.rst b/docs/storage.rst index b860648628..9d5b193e31 100644 --- a/docs/storage.rst +++ b/docs/storage.rst @@ -557,7 +557,7 @@ Example RBD disk attachment RBD images can be attached to QEMU guests when QEMU is built with RBD support. Information about attaching a RBD image to a guest can be found at `format -domain <formatdomain.html#elementsDisks>`__ page. +domain <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ page. Valid RBD pool format types ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -618,7 +618,7 @@ Example Sheepdog disk attachment Sheepdog images can be attached to QEMU guests. Information about attaching a Sheepdog image to a guest can be found at the `format -domain <formatdomain.html#elementsDisks>`__ page. +domain <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ page. Valid Sheepdog pool format types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -698,7 +698,7 @@ Example Gluster disk attachment Files within a gluster volume can be attached to QEMU guests. Information about attaching a Gluster image to a guest can be found at the `format -domain <formatdomain.html#elementsDisks>`__ page. +domain <formatdomain.html#hard-drives-floppy-disks-cdroms>`__ page. Valid Gluster pool format types ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 2.35.3

All local links were reformulated to make sense with local references. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d1134c523f..9d3960e7ad 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3473,7 +3473,6 @@ A directory on the host that can be accessed directly from the guest. permitted to exceed its soft limits for a grace period of time. Afterwards the hard limit is enforced. :since:`Since 0.9.13` -:anchor:`<a id="elementsAddress"/>` Device Addresses ~~~~~~~~~~~~~~~~ @@ -3715,7 +3714,7 @@ Note: The PowerPC64 "spapr-vio" addresses do not have an associated controller. For controllers that are themselves devices on a PCI or USB bus, an optional sub-element ``<address>`` can specify the exact relationship of the controller -to its master bus, with semantics `given above <#elementsAddress>`__. +to its master bus, with semantics described in the `Device Addresses`_ section. An optional sub-element ``driver`` can specify the driver specific options: @@ -4255,7 +4254,7 @@ or: the address type used must conform to the ``model`` attribute of element ``hostdev``, e.g. any address type other than PCI for ``vfio-pci`` device API or any address type other than CCW for ``vfio-ccw`` device API will result in - an error. `See above <#elementsAddress>`__ for more details on the address + an error. See the `Device Addresses`_ section for more details on the address element. ``driver`` PCI devices can have an optional ``driver`` subelement that specifies which @@ -4445,10 +4444,9 @@ behaves like a physical USB CCID (Chip/Smart Card Interface Device) card. of the character device is the hypervisor itself, rather than a device visible in the guest). -Each mode supports an optional sub-element ``<address>``, which fine-tunes the -correlation between the smartcard and a ccid bus controller, `documented -above <#elementsAddress>`__. For now, qemu only supports at most one smartcard, -with an address of bus=0 slot=0. +Each mode supports an optional sub-element ``<address>`` (See `Device Addresses`_), +which fine-tunes the correlation between the smartcard and a ccid bus controller. +For now, qemu only supports at most one smartcard, with an address of bus=0 slot=0. :anchor:`<a id="elementsNICS"/>` @@ -4484,7 +4482,7 @@ the host. Each ``<interface>`` element has an optional ``<address>`` sub-element that can tie the interface to a particular pci slot, with attribute ``type='pci'`` as -`documented above <#elementsAddress>`__. +documented in the `Device Addresses`_ section. :since:`Since 6.6.0` , one can force libvirt to keep the provided MAC address when it's in the reserved VMware range by adding a ``type="static"`` attribute @@ -5808,7 +5806,7 @@ to provide a graphics tablet for absolute cursor movement. :since:`since 1.3.0` ) "virtio". The ``input`` element has an optional sub-element ``<address>`` which can tie -the device to a particular PCI slot, `documented above <#elementsAddress>`__. +the device to a particular PCI slot, documented in the `Device Addresses`_ section. On S390, ``address`` can be used to provide a CCW address for an input device ( :since:`since 4.2.0` ). For types ``passthrough`` and ``evdev``, the mandatory sub-element ``source`` must have an ``evdev`` (for ``passthrough``) or ``dev`` @@ -5848,9 +5846,9 @@ ports available to connect devices to a host system. The ``hub`` element has one mandatory attribute, the ``type`` whose value can only be 'usb'. -The ``hub`` element has an optional sub-element ``<address>`` with -``type='usb'``\ which can tie the device to a particular controller, `documented -above <#elementsAddress>`__. +The ``hub`` element has an optional sub-element ``<address>`` +(See `Device Addresses`_) ``type='usb'`` which can tie the device to a +particular controller. :anchor:`<a id="elementsGraphics"/>` @@ -6419,7 +6417,7 @@ If any of the attributes is not specified by the user, libvirt will choose a value suitable for most users. Most target types support configuring the guest-visible device address as -`documented above <#elementsAddress>`__; more specifically, acceptable address +documented in the `Device Addresses`_ section; more specifically, acceptable address types are ``isa`` (for ``isa-serial``), ``usb`` (for ``usb-serial``), ``pci`` (for ``pci-serial``) and ``spapr-vio`` (for ``spapr-vio-serial``). The ``system-serial`` and ``sclp-serial`` target types don't support specifying an @@ -6598,7 +6596,7 @@ types have different ``target`` attributes. /dev/virtio-ports/$name (for more info, please see https://fedoraproject.org/wiki/Features/VirtioSerial). The optional element ``address`` can tie the channel to a particular ``type='virtio-serial'`` - controller, `documented above <#elementsAddress>`__. With qemu, if ``name`` + controller, as documented in the `Device Addresses`_ section. With qemu, if ``name`` is "org.qemu.guest_agent.0", then libvirt can interact with a guest agent installed in the guest, for actions such as guest shutdown or file system quiescing. :since:`Since 0.7.7, guest agent interaction since 0.9.10` @@ -6985,7 +6983,7 @@ Valid values are: ... Each ``sound`` element has an optional sub-element ``<address>`` which can tie -the device to a particular PCI slot, `documented above <#elementsAddress>`__. +the device to a particular PCI slot. See `Device Addresses`_. A sound device could be optionally mapped to the specific host audio backend using the ``<audio>`` sub-element: -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 9d3960e7ad..91517b069f 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3127,7 +3127,7 @@ paravirtualized driver is specified via the ``disk`` element. virtio-blk. ( :since:`Since 3.9.0` ) - The optional ``queue_size`` attribute specifies the size of each virt queue for virtio-blk. ( :since:`Since 7.8.0` ) - - For virtio disks, `Virtio-specific options <#elementsVirtio>`__ can also + - For virtio disks, `Virtio-related options`_ can also be set. ( :since:`Since 3.5.0` ) - The optional ``metadata_cache`` subelement controls aspects related to the format specific caching of storage image metadata. Note that this setting @@ -3431,7 +3431,7 @@ A directory on the host that can be accessed directly from the guest. "loop", with a format of "raw" or "nbd" with any format. QEMU supports a type of "path" or "handle", but no formats. Virtuozzo driver supports a type of "ploop" with a format of "ploop". - - For virtio-backed devices, `Virtio-specific options <#elementsVirtio>`__ + - For virtio-backed devices, `Virtio-related options`_ can also be set. ( :since:`Since 3.5.0` ) - For ``virtiofs``, the ``queue`` attribute can be used to specify the queue size (i.e. how many requests can the queue fit). ( :since:`Since 6.2.0` ) @@ -3565,7 +3565,6 @@ control where on the bus the device will be placed: will have access to it. ``<address type='unassigned'/>`` is an invalid address type for all other device types. :since:`Since 6.0.0` -:anchor:`<a id="elementsVirtio"/>` Virtio-related options ~~~~~~~~~~~~~~~~~~~~~~ @@ -3746,7 +3745,7 @@ An optional sub-element ``driver`` can specify the driver specific options: controllers must be defined each having a specific ``iothread`` value. The ``iothread`` value must be within the range 1 to the domain iothreads value. virtio options - For virtio controllers, `Virtio-specific options <#elementsVirtio>`__ can + For virtio controllers, `Virtio-related options`_ can also be set. ( :since:`Since 3.5.0` ) USB companion controllers have an optional sub-element ``<master>`` to specify @@ -5293,7 +5292,7 @@ following attributes are available for the ``"virtio"`` NIC driver: you know what you are doing. Proper RSS configuration depends from vcpu, tap, and vhost settings.** virtio options - For virtio interfaces, `Virtio-specific options <#elementsVirtio>`__ can also + For virtio interfaces, `Virtio-related options`_ can also be set. ( :since:`Since 3.5.0` ) Offloading options for the host and guest can be configured using the following @@ -5825,8 +5824,7 @@ change the grab key combination. <#elementsVirtioTransitional>`__ for more details. The subelement ``driver`` can be used to tune the virtio options of the device: -`Virtio-specific options <#elementsVirtio>`__ can also be set. ( :since:`Since -3.5.0` ) +`Virtio-related options`_ can also be set. ( :since:`Since 3.5.0` ) Hub devices ~~~~~~~~~~~ @@ -6247,8 +6245,7 @@ A video device. the default QEMU backend. "vhostuser" will use a separate vhost-user process backend (for ``virtio`` device). virtio options - `Virtio-specific options <#elementsVirtio>`__ can also be set ( - :since:`Since 3.5.0` ) + `Virtio-related options`_ can also be set (:since:`Since 3.5.0`) VGA configuration Control how the video devices exposed to the guest using the ``vgaconf`` attribute which takes the value "io", "on" or "off". At present, it's only @@ -7476,8 +7473,8 @@ Example: manually added device with static PCI slot 2 requested years) might be ignored. :since:`Since 1.1.1, requires QEMU 1.5` ``driver`` - For model ``virtio`` memballoon, `Virtio-specific - options <#elementsVirtio>`__ can also be set. ( :since:`Since 3.5.0` ) + For model ``virtio`` memballoon, `Virtio-related options`_ can also be set. + ( :since:`Since 3.5.0` ) Random number generator device ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -7551,8 +7548,7 @@ Example: usage of the RNG device: The subelement ``driver`` can be used to tune the device: virtio options - `Virtio-specific options <#elementsVirtio>`__ can also be set. ( - :since:`Since 3.5.0` ) + `Virtio-related options`_ can also be set. ( :since:`Since 3.5.0` ) :anchor:`<a id="elementsTpm"/>` @@ -8071,7 +8067,7 @@ attribute ``address`` of the ``cid`` element specifies the CID assigned to the guest. If the attribute ``auto`` is set to ``yes``, libvirt will assign a free CID automatically on domain startup. :since:`Since 4.4.0` The optional ``driver`` element allows to specify virtio options, see -`Virtio-specific options <#elementsVirtio>`__ for more details. :since:`Since 7.1.0` +`Virtio-related options`_ for more details. :since:`Since 7.1.0` :: -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 91517b069f..13d6e35ca8 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2571,9 +2571,8 @@ paravirtualized driver is specified via the ``disk`` element. Indicates the emulated device model of the disk. Typically this is indicated solely by the ``bus`` property but for ``bus`` "virtio" the model can be specified further with "virtio-transitional", - "virtio-non-transitional", or "virtio". See `Virtio transitional - devices <#elementsVirtioTransitional>`__ for more details. :since:`Since - 5.2.0` + "virtio-non-transitional", or "virtio". See `Virtio transitional devices`_ + for more details. :since:`Since 5.2.0` ``rawio`` Indicates whether the disk needs rawio capability. Valid settings are "yes" or "no" (default is "no"). If any one disk in a domain has @@ -3385,8 +3384,8 @@ A directory on the host that can be accessed directly from the guest. :since:`Since 5.2.0` , the filesystem element has an optional attribute ``model`` with supported values "virtio-transitional", - "virtio-non-transitional", or "virtio". See `Virtio transitional - devices <#elementsVirtioTransitional>`__ for more details. + "virtio-non-transitional", or "virtio". See `Virtio transitional devices`_ + for more details. The filesystem element has optional attributes ``fmode`` and ``dmode``. These two attributes control the creation mode for files and directories @@ -3593,7 +3592,6 @@ granularity. The default is determined by QEMU. :since:`Since 7.9.0 (QEMU 2.8)` Note: In general you should leave this option alone, unless you are very certain you know what you are doing. -:anchor:`<a id="elementsVirtioTransitional"/>` Virtio transitional devices ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -3679,15 +3677,13 @@ specific features, such as: ``ports`` and ``vectors``, which control how many devices can be connected through the controller. :since:`Since 5.2.0` , it supports an optional attribute ``model`` which can be 'virtio', 'virtio-transitional', or - 'virtio-non-transitional'. See `Virtio transitional - devices <#elementsVirtioTransitional>`__ for more details. + 'virtio-non-transitional'. See `Virtio transitional devices`_ for more details. ``scsi`` A ``scsi`` controller has an optional attribute ``model``, which is one of 'auto', 'buslogic', 'ibmvscsi', 'lsilogic', 'lsisas1068', 'lsisas1078', 'virtio-scsi', 'vmpvscsi', 'virtio-transitional', 'virtio-non-transitional', 'ncr53c90' (as builtin implicit controller only), 'am53c974', 'dc390'. - See `Virtio transitional devices <#elementsVirtioTransitional>`__ for more - details. + See `Virtio transitional devices`_ for more details. ``usb`` A ``usb`` controller has an optional attribute ``model``, which is one of "piix3-uhci", "piix4-uhci", "ehci", "ich9-ehci1", "ich9-uhci1", "ich9-uhci2", @@ -4123,8 +4119,8 @@ or: the device is not used by host. This ``type`` passes all LUNs presented by a single HBA to the guest. :since:`Since 5.2.0,` the ``model`` attribute can be specified further with "virtio-transitional", - "virtio-non-transitional", or "virtio". See `Virtio transitional - devices <#elementsVirtioTransitional>`__ for more details. + "virtio-non-transitional", or "virtio". `Virtio transitional devices`_ + for more details. ``mdev`` For mediated devices ( :since:`Since 3.2.0` ) the ``model`` attribute specifies the device API which determines how the host's vfio driver will @@ -5163,8 +5159,7 @@ supported models with these commands: Typical values for QEMU and KVM include: ne2k_isa i82551 i82557b i82559er ne2k_pci pcnet rtl8139 e1000 virtio. :since:`Since 5.2.0` , ``virtio-transitional`` and ``virtio-non-transitional`` values are supported. -See `Virtio transitional devices <#elementsVirtioTransitional>`__ for more -details. +See `Virtio transitional devices`_ for more details. Setting NIC driver-specific options ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -5820,8 +5815,7 @@ change the grab key combination. ``input`` type ``evdev`` is currently supported only on linux devices. (KVM only) :since:`Since 5.2.0` , the ``input`` element accepts a ``model`` attribute which has the values 'virtio', 'virtio-transitional' and -'virtio-non-transitional'. See `Virtio transitional devices -<#elementsVirtioTransitional>`__ for more details. +'virtio-non-transitional'. See `Virtio transitional devices`_ for more details. The subelement ``driver`` can be used to tune the virtio options of the device: `Virtio-related options`_ can also be set. ( :since:`Since 3.5.0` ) @@ -7443,8 +7437,7 @@ Example: manually added device with static PCI slot 2 requested - 'virtio-non-transitional' :since:`Since 5.2.0` - 'xen' - default with Xen - See `Virtio transitional devices <#elementsVirtioTransitional>`__ for more - details. + See `Virtio transitional devices`_ for more details. ``autodeflate`` The optional ``autodeflate`` attribute allows to enable/disable (values @@ -7510,8 +7503,7 @@ Example: usage of the RNG device: - 'virtio-transitional' :since:`Since 5.2.0` - 'virtio-non-transitional' :since:`Since 5.2.0` - See `Virtio transitional devices <#elementsVirtioTransitional>`__ for more - details. + See `Virtio transitional devices`_ for more details. ``rate`` The optional ``rate`` element allows limiting the rate at which entropy can @@ -8061,11 +8053,10 @@ Vsock A vsock host/guest interface. The ``model`` attribute defaults to ``virtio``. :since:`Since 5.2.0` ``model`` can also be 'virtio-transitional' and -'virtio-non-transitional', see `Virtio transitional -devices <#elementsVirtioTransitional>`__ for more details. The optional -attribute ``address`` of the ``cid`` element specifies the CID assigned to the -guest. If the attribute ``auto`` is set to ``yes``, libvirt will assign a free -CID automatically on domain startup. :since:`Since 4.4.0` +'virtio-non-transitional', see `Virtio transitional devices`_ for more details. +The optional attribute ``address`` of the ``cid`` element specifies the CID +assigned to the guest. If the attribute ``auto`` is set to ``yes``, libvirt will +assign a free CID automatically on domain startup. :since:`Since 4.4.0` The optional ``driver`` element allows to specify virtio options, see `Virtio-related options`_ for more details. :since:`Since 7.1.0` -- 2.35.3

Local references were reworded. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 13d6e35ca8..403a03edfb 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3234,7 +3234,7 @@ paravirtualized driver is specified via the ``disk`` element. ``address`` If present, the ``address`` element ties the disk to a given slot of a controller (the actual ``<controller>`` device can often be inferred by - libvirt, although it can be `explicitly specified <#elementsControllers>`__). + libvirt, although it can be be explicitly specified. See `Controllers`_). The ``type`` attribute is mandatory, and is typically "pci" or "drive". For a "pci" controller, additional attributes for ``bus``, ``slot``, and ``function`` must be present, as well as optional ``domain`` and @@ -3633,7 +3633,6 @@ posting <https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg00923.html>`__ and the `virtio-1.0 spec <https://docs.oasis-open.org/virtio/virtio/v1.0/virtio-v1.0.html>`__. -:anchor:`<a id="elementsControllers"/>` Controllers ~~~~~~~~~~~ @@ -6311,8 +6310,7 @@ same values described above. :since:`Since 1.3.3` . ... Each character device element has an optional sub-element ``<address>`` which -can tie the device to a particular `controller <#elementsControllers>`__ or PCI -slot. +can tie the device to a particular controller (See `Controllers`_) or PCI slot. For character device with type ``unix`` or ``tcp`` the ``source`` has an optional element ``reconnect`` which configures reconnect timeout if the -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 3 +-- docs/formatnode.rst | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 403a03edfb..65197d6e3d 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -240,7 +240,7 @@ harddisk, cdrom, network) determining where to obtain/find the boot image. and hda disks will boot from hda (sorted disks are: hda, hdc, vda, vdb). It can be tricky to configure in the desired way, which is why per-device boot elements (see `Hard drives, floppy disks, CDROMs`_, `network - interfaces <#elementsNICS>`__, and `USB and PCI devices <#elementsHostDev>`__ + interfaces <#elementsNICS>`__, and `Host device assignment`_ sections below) were introduced and they are the preferred way providing full control over booting order. The ``boot`` element and per-device boot elements are mutually exclusive. :since:`Since 0.1.3, per-device boot since 0.8.8` @@ -3975,7 +3975,6 @@ acquired. The offset specifies where the lease is stored within the file. If the lock manager does not require an offset, just pass 0. -:anchor:`<a id="elementsHostDev"/>` Host device assignment ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/docs/formatnode.rst b/docs/formatnode.rst index ec3d529fff..5903cac7fe 100644 --- a/docs/formatnode.rst +++ b/docs/formatnode.rst @@ -12,7 +12,7 @@ Node Device XML There are several libvirt functions, all with the prefix ``virNodeDevice``, which deal with management of host devices that can be handed to guests via passthrough as <hostdev> elements in `the domain -XML <formatdomain.html#elementsHostDev>`__. These devices are represented as a +XML <formatdomain.html#host-device-assignment>`__. These devices are represented as a hierarchy, where a device on a bus has a parent of the bus controller device; the root of the hierarchy is the node named "computer". -- 2.35.3

The one local link addition prompted rewrapping of the whole paragraph. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 11 +++++------ docs/formatnetwork.rst | 4 ++-- docs/formatnetworkport.rst | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 65197d6e3d..3618b1212a 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -239,11 +239,11 @@ harddisk, cdrom, network) determining where to obtain/find the boot image. (the sorted list is vda, vdb, hda, hdc). Similar domain with hdc, vda, vdb, and hda disks will boot from hda (sorted disks are: hda, hdc, vda, vdb). It can be tricky to configure in the desired way, which is why per-device boot - elements (see `Hard drives, floppy disks, CDROMs`_, `network - interfaces <#elementsNICS>`__, and `Host device assignment`_ - sections below) were introduced and they are the preferred way providing full - control over booting order. The ``boot`` element and per-device boot elements - are mutually exclusive. :since:`Since 0.1.3, per-device boot since 0.8.8` + elements (see `Hard drives, floppy disks, CDROMs`_, `Network interfaces`_, + and `Host device assignment`_ sections below) were introduced and they are + the preferred way providing full control over booting order. + The ``boot`` element and per-device boot elements are mutually exclusive. + :since:`Since 0.1.3, per-device boot since 0.8.8` ``smbios`` How to populate SMBIOS information visible in the guest. The ``mode`` attribute must be specified, and is either "emulate" (let the hypervisor @@ -4441,7 +4441,6 @@ Each mode supports an optional sub-element ``<address>`` (See `Device Addresses` which fine-tunes the correlation between the smartcard and a ccid bus controller. For now, qemu only supports at most one smartcard, with an address of bus=0 slot=0. -:anchor:`<a id="elementsNICS"/>` Network interfaces ~~~~~~~~~~~~~~~~~~ diff --git a/docs/formatnetwork.rst b/docs/formatnetwork.rst index d6550f6df9..d956178e56 100644 --- a/docs/formatnetwork.rst +++ b/docs/formatnetwork.rst @@ -61,7 +61,7 @@ The first elements provide basic metadata about the virtual network. The optional parameter ``trustGuestRxFilters`` can be used to set that attribute of the same name for each domain interface connected to this network ( :since:`since 1.2.10` ). See the `Network - interfaces <formatdomain.html#elementsNICS>`__ section of the domain XML + interfaces <formatdomain.html#network-interfaces>`__ section of the domain XML documentation for more details. Note that an explicit setting of this attribute in a portgroup or the individual domain interface will override the setting in the network. @@ -616,7 +616,7 @@ starting. portgroups also support the optional parameter ``trustGuestRxFilters`` which can be used to set that attribute of the same name for each domain interface using this portgroup ( :since:`since 1.2.10` ). See the `Network -interfaces <formatdomain.html#elementsNICS>`__ section of the domain XML +interfaces <formatdomain.html#network-interfaces>`__ section of the domain XML documentation for more details. Note that an explicit setting of this attribute in the portgroup overrides the network-wide setting, and an explicit setting in the individual domain interface will override the setting in the portgroup. diff --git a/docs/formatnetworkport.rst b/docs/formatnetworkport.rst index 6f1a24a52c..394c65c2b7 100644 --- a/docs/formatnetworkport.rst +++ b/docs/formatnetworkport.rst @@ -98,7 +98,7 @@ The following elements are common to one or more of the plug types listed later ``virtualport`` The ``virtualport`` element describes metadata that needs to be provided to the underlying network subsystem. It is described in the domain XML - `interface documentation <formatdomain.html#elementsNICS>`__. + `interface documentation <formatdomain.html#network-interfaces>`__. Plugs ~~~~~ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - docs/formatnetwork.rst | 4 ++-- docs/formatnetworkport.rst | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 3618b1212a..bbf26edeba 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -4725,7 +4725,6 @@ integration is required. </devices> ... -:anchor:`<a id="elementsNICSDirect"/>` Direct attachment to physical interface ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/docs/formatnetwork.rst b/docs/formatnetwork.rst index d956178e56..044c239985 100644 --- a/docs/formatnetwork.rst +++ b/docs/formatnetwork.rst @@ -253,7 +253,7 @@ to the physical LAN (if at all). interfaces to be used for a "direct" connection via macvtap using macvtap's "bridge" mode (if the forward element has one or more ``<interface>`` subelements, :since:`Since 0.9.4` ) (see `Direct - attachment to physical interface <formatdomain.html#elementsNICSDirect>`__ + attachment to physical interface <formatdomain.html#direct-attachment-to-physical-interface>`__ for descriptions of the various macvtap modes). libvirt doesn't attempt to manage the bridge interface at all, thus the ``<bridge>`` element's ``stp`` and ``delay`` attributes are not allowed; no iptables rules, IP @@ -599,7 +599,7 @@ as the 'default' portgroup for the network), and each portgroup has a name, as well as various attributes and subelements associated with it. The currently supported subelements are ``<bandwidth>`` (described in `Quality of service`_) and ``<virtualport>`` (documented -`here <formatdomain.html#elementsNICSDirect>`__). If a domain interface +`here <formatdomain.html#direct-attachment-to-physical-interface>`__). If a domain interface definition specifies a portgroup (by adding a ``portgroup`` attribute to the ``<source>`` subelement), that portgroup's info will be merged into the interface's configuration. If no portgroup is given in the interface definition, diff --git a/docs/formatnetworkport.rst b/docs/formatnetworkport.rst index 394c65c2b7..40a4f0e85b 100644 --- a/docs/formatnetworkport.rst +++ b/docs/formatnetworkport.rst @@ -151,7 +151,7 @@ interface. The ``dev`` attribute provides the name of the physical network interface to which the port will be connected. The ``mode`` attribute describes how the connection will be setup and takes the same values described in the `domain -XML <formatdomain.html#elementsNICSDirect>`__. +XML <formatdomain.html#direct-attachment-to-physical-interface>`__. Host PCI ^^^^^^^^ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index bbf26edeba..d9d262d959 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -4513,8 +4513,7 @@ can be determined by examining the virtual network config with 'default' setup out of the box which does NAT'ing to the default route and has an IP range of ``192.168.122.0/255.255.255.0``. Each guest will have an associated tun device created with a name of vnetN, which can also be overridden -with the <target> element (see `overriding the target -element <#elementsNICSTargetOverride>`__). +with the <target> element (see `Overriding the target element`_). When the source of an interface is a network, a ``portgroup`` can be specified along with the name of the network; one network may have multiple portgroups @@ -4580,8 +4579,8 @@ static wired networking configs.** Provides a bridge from the VM directly to the LAN. This assumes there is a bridge device on the host which has one or more of the hosts physical NICs attached. The guest VM will have an associated tun device created with a name of -vnetN, which can also be overridden with the <target> element (see `overriding -the target element <#elementsNICSTargetOverride>`__). The tun device will be +vnetN, which can also be overridden with the <target> element (see +`Overriding the target element`_). The tun device will be attached to the bridge. The IP range / network configuration is whatever is used on the LAN. This provides the guest VM full incoming & outgoing net access just like a physical machine. @@ -5331,7 +5330,6 @@ bridge interfaces. This does not work in session mode. :since:`Since 1.2.9` For tap devices there is also ``sndbuf`` element which can adjust the size of send buffer in the host. :since:`Since 0.8.8` -:anchor:`<a id="elementsNICSTargetOverride"/>` Overriding the target element ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d9d262d959..5264d5fbf3 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5436,7 +5436,6 @@ domains (so data will not go through host system). Use with type 'ethernet' to create plain network link, or with type 'bridge' to connect to a bridge inside the backend domain. :since:`Since 1.2.13 (Xen only)` -:anchor:`<a id="elementQoS"/>` Quality of service ^^^^^^^^^^^^^^^^^^ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 5264d5fbf3..10503edab6 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5460,7 +5460,6 @@ outgoing traffic can be shaped independently. The ``bandwidth`` element and its child elements are described in the `QoS <formatnetwork.html#quality-of-service>`__ section of the Network XML. -:anchor:`<a id="elementVlanTag"/>` Setting VLAN tag (on supported network types only) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 10503edab6..00d05adfb8 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5515,7 +5515,6 @@ done with the optional ``nativeMode`` attribute on the ``<tag>`` subelement: be the "native" VLAN for this interface, and the ``nativeMode`` attribute determines whether or not traffic for that VLAN will be tagged. -:anchor:`<a id="elementPort"/>` Isolating guests's network traffic from each other ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 00d05adfb8..584cea36af 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5564,7 +5564,6 @@ specified as the value, the interface behaves as if it had the network cable disconnected. Default behavior if this element is unspecified is to have the link state ``up``. :since:`Since 0.9.5` -:anchor:`<a id="mtu"/>` MTU configuration ^^^^^^^^^^^^^^^^^ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 584cea36af..f7d29e7403 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5584,7 +5584,6 @@ This element provides means of setting MTU of the virtual network link. Currently there is just one attribute ``size`` which accepts a non-negative integer which specifies the MTU size for the interface. :since:`Since 3.1.0` -:anchor:`<a id="coalesce"/>` Coalesce settings ^^^^^^^^^^^^^^^^^ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index f7d29e7403..4f09df9d48 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5236,8 +5236,8 @@ following attributes are available for the ``"virtio"`` NIC driver: ``queues`` The optional ``queues`` attribute controls the number of queues to be used for either `Multiqueue - virtio-net <https://www.linux-kvm.org/page/Multiqueue>`__ or - `vhost-user <#elementVhostuser>`__ network interfaces. Use of multiple packet + virtio-net <https://www.linux-kvm.org/page/Multiqueue>`__ or vhost-user (See + `vhost-user interface`_) network interfaces. Use of multiple packet processing queues requires the interface having the ``<model type='virtio'/>`` element. Each queue will potentially be handled by a different processor, resulting in much higher throughput. @@ -5679,7 +5679,6 @@ side of the network device. These are configured as subelements of the similarly named elements used to configure the guest side of the interface (described above). -:anchor:`<a id="elementVhostuser"/>` vhost-user interface ^^^^^^^^^^^^^^^^^^^^ -- 2.35.3

Local references needed rewording. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 4f09df9d48..73151c35f0 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -4133,8 +4133,8 @@ or: NVIDIA vGPU or Intel GVT-g) as an alternative to emulated `video devices <#elementsVideo>`__. This attribute is limited to ``model='vfio-pci'`` only. Supported values are either ``on`` or ``off`` - (default is 'off'). It is required to use a `graphical - framebuffer <#elementsGraphics>`__ in order to use this attribute, + (default is 'off'). It is required to use a graphical framebuffer (See + `Graphical framebuffers`_) in order to use this attribute, currently only supported with VNC, Spice and egl-headless graphics devices. :since:`Since version 5.10.0` , there is an optional ``ramfb`` attribute for devices with ``model='vfio-pci'``. Supported values are @@ -4350,7 +4350,7 @@ after 0.9.5 (KVM only)` : ``type`` is required, matching one of the supported `serial device <#elementsConsole>`__ types, to describe the host side of the tunnel; ``type='tcp'`` or ``type='spicevmc'`` (which uses the usbredir channel of a - `SPICE graphics device <#elementsGraphics>`__) are typical. The redirdev + SPICE graphics device (See `Graphical framebuffers`_)) are typical. The redirdev element has an optional sub-element ``<address>`` which can tie the device to a particular controller. Further sub-elements, such as ``<source>``, may be required according to the given type, although a ``<target>`` sub-element is @@ -4431,7 +4431,7 @@ behaves like a physical USB CCID (Chip/Smart Card Interface Device) card. ``type`` is required, matching one of the supported `serial device <#elementsConsole>`__ types, to describe the host side of the tunnel; ``type='tcp'`` or ``type='spicevmc'`` (which uses the smartcard channel of a - `SPICE graphics device <#elementsGraphics>`__) are typical. Further + SPICE graphics device (See `Graphical framebuffers`_)) are typical. Further sub-elements, such as ``<source>``, may be required according to the given type, although a ``<target>`` sub-element is not required (since the consumer of the character device is the hypervisor itself, rather than a device @@ -5830,7 +5830,6 @@ The ``hub`` element has an optional sub-element ``<address>`` (See `Device Addresses`_) ``type='usb'`` which can tie the device to a particular controller. -:anchor:`<a id="elementsGraphics"/>` Graphical framebuffers ~~~~~~~~~~~~~~~~~~~~~~ @@ -6596,7 +6595,7 @@ types have different ``target`` attributes. the necessary probing mechanism. :since:`Since 2.3.0` ``spicevmc`` Paravirtualized SPICE channel. The domain must also have a SPICE server as a - `graphics device <#elementsGraphics>`__, at which point the host piggy-backs + graphics device (See `Graphical framebuffers`_), at which point the host piggy-backs messages across the ``main`` channel. The ``target`` element must be present, with attribute ``type='virtio'``; an optional attribute ``name`` controls how the guest will have access to the channel, and defaults to @@ -6618,7 +6617,7 @@ types have different ``target`` attributes. disabled by default, and can be enabled by setting the ``copypaste`` property to ``yes``. This allows the guest's clipboard to be synchronized with the qemu clipboard manager. This can enable copy and paste between a - guest and a client when using a VNC `graphics device <#elementsGraphics>`__ + guest and a client when using a VNC graphics device (See `Graphical framebuffers`_) (when using a VNC client that supports the copy/paste feature) or other graphics types that support the qemu clipboard manager. @@ -6879,7 +6878,7 @@ The character device is accessible through spice connection under a channel name specified in the ``channel`` attribute. :since:`Since 1.2.2` Note: depending on the hypervisor, spiceports might (or might not) be enabled on -domains with or without `spice graphics <#elementsGraphics>`__. +domains with or without spice graphics (See `Graphical framebuffers`_). :: -- 2.35.3

The surrounding paragraph around the only fixed use was rewrapped. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 73151c35f0..b3d254520e 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -4130,12 +4130,11 @@ or: create mediated devices on the host. :since:`Since 4.6.0 (QEMU 2.12)` an optional ``display`` attribute may be used to enable or disable support for an accelerated remote desktop backed by a mediated device (such as - NVIDIA vGPU or Intel GVT-g) as an alternative to emulated `video - devices <#elementsVideo>`__. This attribute is limited to - ``model='vfio-pci'`` only. Supported values are either ``on`` or ``off`` - (default is 'off'). It is required to use a graphical framebuffer (See - `Graphical framebuffers`_) in order to use this attribute, - currently only supported with VNC, Spice and egl-headless graphics + NVIDIA vGPU or Intel GVT-g) as an alternative to emulated `Video devices`_. + This attribute is limited to ``model='vfio-pci'`` only. Supported values + are either ``on`` or ``off`` (default is 'off'). It is required to use a + graphical framebuffer (See `Graphical framebuffers`_) in order to use this + attribute, currently only supported with VNC, Spice and egl-headless graphics devices. :since:`Since version 5.10.0` , there is an optional ``ramfb`` attribute for devices with ``model='vfio-pci'``. Supported values are either ``on`` or ``off`` (default is 'off'). When enabled, this attribute @@ -6125,7 +6124,6 @@ Only ``vnc``, ``spice`` and ``rdp`` supports ``<listen>`` element. :since:`Since the two APIs to pass a FD to QEMU in order to connect to this graphics device. Supported by graphics type ``vnc`` and ``spice``. -:anchor:`<a id="elementsVideo"/>` Video devices ~~~~~~~~~~~~~ -- 2.35.3

Some rewording and rewraping was needed to accomodate the new local references. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index b3d254520e..5f15c14093 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -4346,15 +4346,18 @@ after 0.9.5 (KVM only)` : ``redirdev`` The ``redirdev`` element is the main container for describing redirected devices. ``bus`` must be "usb" for a USB device. An additional attribute - ``type`` is required, matching one of the supported `serial - device <#elementsConsole>`__ types, to describe the host side of the tunnel; - ``type='tcp'`` or ``type='spicevmc'`` (which uses the usbredir channel of a - SPICE graphics device (See `Graphical framebuffers`_)) are typical. The redirdev - element has an optional sub-element ``<address>`` which can tie the device to - a particular controller. Further sub-elements, such as ``<source>``, may be - required according to the given type, although a ``<target>`` sub-element is - not required (since the consumer of the character device is the hypervisor - itself, rather than a device visible in the guest). + ``type`` is required, matching one of the supported serial device types + (See `Consoles, serial, parallel & channel devices`_), to describe the host + side of the tunnel; ``type='tcp'`` or ``type='spicevmc'`` (which uses the + usbredir channel of a SPICE graphics device (See `Graphical framebuffers`_)) + are typical. + + The redirdev element has an optional sub-element ``<address>`` which can tie + the device to a particular controller. Further sub-elements, such as + ``<source>``, may be required according to the given type, although a + ``<target>`` sub-element is not required (since the consumer of the + character device is the hypervisor itself, rather than a device visible in + the guest). ``boot`` Specifies that the device is bootable. The ``order`` attribute determines the order in which devices will be tried during boot sequence. The per-device @@ -4427,8 +4430,9 @@ behaves like a physical USB CCID (Chip/Smart Card Interface Device) card. possible to tunnel all requests through a secondary character device to a third-party provider (which may in turn be talking to a smartcard or using three certificate files). In this mode of operation, an additional attribute - ``type`` is required, matching one of the supported `serial - device <#elementsConsole>`__ types, to describe the host side of the tunnel; + ``type`` is required, matching one of the supported serial device types + (See `Consoles, serial, parallel & channel devices`_), + to describe the host side of the tunnel; ``type='tcp'`` or ``type='spicevmc'`` (which uses the smartcard channel of a SPICE graphics device (See `Graphical framebuffers`_)) are typical. Further sub-elements, such as ``<source>``, may be required according to the given @@ -6230,7 +6234,6 @@ A video device. attribute which takes the value "io", "on" or "off". At present, it's only applicable to the bhyve's "gop" video model type ( :since:`Since 3.5.0` ) -:anchor:`<a id="elementsConsole"/>` Consoles, serial, parallel & channel devices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 5f15c14093..3b9c18f6b4 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -274,8 +274,8 @@ them in production. ``bios`` This element has attribute ``useserial`` with possible values ``yes`` or ``no``. It enables or disables Serial Graphics Adapter which allows users to - see BIOS messages on a serial port. Therefore, one needs to have `serial - port <#elementCharSerial>`__ defined. :since:`Since 0.9.4` . :since:`Since + see BIOS messages on a serial port. Therefore, one needs to have `Serial port`_ + defined. :since:`Since 0.9.4` . :since:`Since 0.10.2 (QEMU only)` there is another attribute, ``rebootTimeout`` that controls whether and after how long the guest should start booting again in case the boot fails (according to BIOS). The value is in milliseconds with @@ -6330,7 +6330,6 @@ Parallel port ``target`` can have a ``port`` attribute, which specifies the port number. Ports are numbered starting from 0. There are usually 0, 1 or 2 parallel ports. -:anchor:`<a id="elementCharSerial"/>` Serial port ''''''''''' @@ -6437,7 +6436,7 @@ the ``console`` element might represent the same device as an existing ``serial`` element or a separate device. A ``target`` subelement is supported and works the same way as with the -``serial`` element (`see above <#elementCharSerial>`__ for details). Valid +``serial`` element (See `Serial port`_ for details). Valid values for the ``type`` attribute are: ``serial`` (described below); ``virtio`` (usable whenever VirtIO support is available); ``xen``, ``lxc`` and ``openvz`` (available when the corresponding hypervisor is in use). ``sclp`` and ``sclplm`` -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 3b9c18f6b4..1e279ad72e 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6400,8 +6400,8 @@ types are ``isa`` (for ``isa-serial``), ``usb`` (for ``usb-serial``), ``pci`` ``system-serial`` and ``sclp-serial`` target types don't support specifying an address. -For the relationship between serial ports and consoles, `see -below <#elementCharSerialAndConsole>`__. +For the relationship between serial ports and consoles, refer to the +`Relationship between serial ports and consoles`_ section. Console ''''''' @@ -6454,10 +6454,8 @@ Virtio consoles are usually accessible as ``/dev/hvc[0-7]`` from inside the guest; for more information, see https://fedoraproject.org/wiki/Features/VirtioSerial. :since:`Since 0.8.3` -For the relationship between serial ports and consoles, `see -below <#elementCharSerialAndConsole>`__. - -:anchor:`<a id="elementCharSerialAndConsole"/>` +For the relationship between serial ports and consoles, refer to the +`Relationship between serial ports and consoles`_ section. Relationship between serial ports and consoles '''''''''''''''''''''''''''''''''''''''''''''' -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 1e279ad72e..d8004d4ad0 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6624,7 +6624,6 @@ types have different ``target`` attributes. default will be used (client mode). :since:`Since 8.4.0` -:anchor:`<a id="elementsCharHostInterface"/>` Host interface ^^^^^^^^^^^^^^ @@ -7512,8 +7511,8 @@ Example: usage of the RNG device: ``egd`` This backend connects to a source using the EGD protocol. The source is - specified as a character device. Refer to `character device host - interface <#elementsCharHostInterface>`__ for more information. + specified as a character device. Refer to the `Host interface`_ for more + information. ``builtin`` This backend uses qemu builtin random generator, which uses -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d8004d4ad0..d63543db0b 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6716,7 +6716,6 @@ NB special case if <console type='pty'>, then the TTY path is also duplicated as an attribute tty='/dev/pts/3' on the top level <console> tag. This provides compat with existing syntax for <console> tags. -:anchor:`<a id="elementsCharHost"/>` Host device proxy ''''''''''''''''' -- 2.35.3

Local references were reworded to match. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d63543db0b..a6e54246b8 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -5920,7 +5920,7 @@ interaction with the admin. <audio id='1'> </graphics> - Where ``1`` is an id of the `audio device <#elementsAudio>`__. If no + Where ``1`` is an id of the audio device (See`Audio backends`_). If no ID is specified, then the default audio backend will be used. :since:`Since 7.2.0, qemu`. @@ -6077,7 +6077,7 @@ interaction with the admin. <audio id='1'> </graphics> - Where ``1`` is an id of the `audio device <#elementsAudio>`__. + Where ``1`` is an id of the audio device (See `Audio backends`_). Graphics device uses a ``<listen>`` to set up where the device should listen for clients. It has a mandatory attribute ``type`` which specifies the listen type. @@ -6971,11 +6971,10 @@ backend using the ``<audio>`` sub-element: </devices> ... -Where ``1`` is an id of the `audio device <#elementsAudio>`__. If no +Where ``1`` is an id of the audio device (See `Audio backends`_). If no ID is specified, then the default audio backend will be used. :since:`Since 6.7.0, bhyve; Since 7.2.0, qemu`. -:anchor:`<a id="elementsAudio"/>` Audio backends ~~~~~~~~~~~~~~ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - docs/formatsecret.rst | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index a6e54246b8..efe20e9654 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -7523,7 +7523,6 @@ Example: usage of the RNG device: virtio options `Virtio-related options`_ can also be set. ( :since:`Since 3.5.0` ) -:anchor:`<a id="elementsTpm"/>` TPM device ~~~~~~~~~~ diff --git a/docs/formatsecret.rst b/docs/formatsecret.rst index 0327430078..d0c37ff165 100644 --- a/docs/formatsecret.rst +++ b/docs/formatsecret.rst @@ -268,7 +268,7 @@ This secret is associated with a virtualized TPM (vTPM) and serves as a passphrase for deriving a key from for encrypting the state of the vTPM. The ``<usage type='vtpm'>`` element must contain a single ``name`` element that specifies a usage name for the secret. The vTPM secret can then be used by UUID -via the ``<encryption>`` element of a `tpm <formatdomain.html#elementsTpm>`__ +via the ``<encryption>`` element of a `tpm <formatdomain.html#tpm-device>`__ when using an emulator. :since:`Since 5.6.0` . The following is an example of the steps to be taken. First create a vtpm-secret.xml file: -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - docs/kbase/memorydevices.rst | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index efe20e9654..2dec27b0b1 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -7769,7 +7769,6 @@ machines and the host. :since:`Since 1.2.10, QEMU and KVM only` the number of interrupt vectors. The ``ioeventd`` attribute enables/disables (values "on"/"off", respectively) ioeventfd. -:anchor:`<a id="elementsMemory"/>` Memory devices ~~~~~~~~~~~~~~ diff --git a/docs/kbase/memorydevices.rst b/docs/kbase/memorydevices.rst index 7f58a4247b..505b3b3828 100644 --- a/docs/kbase/memorydevices.rst +++ b/docs/kbase/memorydevices.rst @@ -79,7 +79,7 @@ Furthermore, DIMMs can have ``<source/>`` element which configures backend for devices. For NVDIMMs the element is mandatory and reflects where the content is saved. -See `memory devices documentation <../formatdomain.html#elementsMemory>`_. +See `memory devices documentation <../formatdomain.html#memory-devices>`_. ``virtio-mem`` model ==================== -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 2dec27b0b1..cd3dcca1cb 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -3572,7 +3572,7 @@ QEMU's virtio devices have some attributes related to the virtio transport under the ``driver`` element: The ``iommu`` attribute enables the use of emulated IOMMU by the device. The attribute ``ats`` controls the Address Translation Service support for PCIe devices. This is needed to make use of IOTLB support -(see `IOMMU device <#elementsIommu>`__). Possible values are ``on`` or ``off``. +(see `IOMMU devices`_). Possible values are ``on`` or ``off``. :since:`Since 3.5.0` The attribute ``packed`` controls if QEMU should try to use packed virtqueues. @@ -7969,7 +7969,6 @@ Example: usage of the memory devices element is formatted into live XML and never parsed, i.e. it is output-only element. -:anchor:`<a id="elementsIommu"/>` IOMMU devices ~~~~~~~~~~~~~ -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index cd3dcca1cb..8e0f254236 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -8024,7 +8024,6 @@ Example: mapping larger iova addresses in the guest. :since:`Since 6.5.0` (QEMU/KVM only) -:anchor:`<a id="vsock"/>` Vsock ~~~~~ -- 2.35.3

One local reference required rewording of a whole paragraph to make sense. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 10 +++++----- docs/formatsnapshot.rst | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 8e0f254236..cffdab6eb7 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -2720,10 +2720,11 @@ paravirtualized driver is specified via the ``disk`` element. incremental backups and snapshots are not supported for this disk type. With "file", "block", and "volume", one or more optional sub-elements - ``seclabel``, `described below <#seclabel>`__ (and :since:`since 0.9.9` ), - can be used to override the domain security labeling policy for just that - source file. (NB, for "volume" type disk, ``seclabel`` is only valid when the + ``seclabel`` (See `Security label`_) can be used to override the domain + security labeling policy for just that source file. + (NB, for "volume" type disk, ``seclabel`` is only valid when the specified storage volume is of 'file' or 'block' type). + :since:`since 0.9.9` The ``source`` element may also have the ``index`` attribute with same semantics the ``index`` attribute of ``backingStore``. @@ -6280,7 +6281,7 @@ top-level element. The host interface is configured by the ``source`` element. The ``source`` element may contain an optional ``seclabel`` to override the way that labelling is done on the socket path. If this element is not present, the -`security label is inherited from the per-domain setting <#seclabel>`__. +`Security label`_ is inherited from the per-domain setting. If the interface ``type`` presented to the host is "file", then the ``source`` element may contain an optional attribute ``append`` that specifies whether or @@ -8047,7 +8048,6 @@ The optional ``driver`` element allows to specify virtio options, see </devices> ... -:anchor:`<a id="seclabel"/>` Security label -------------- diff --git a/docs/formatsnapshot.rst b/docs/formatsnapshot.rst index 07aa03c0a7..085c712053 100644 --- a/docs/formatsnapshot.rst +++ b/docs/formatsnapshot.rst @@ -159,7 +159,7 @@ The top-level ``domainsnapshot`` element may contain the following elements: The ``source`` element also may contain the ``seclabel`` element (described in the `domain XML documentation - <formatdomain.html#seclabel>`__) which can be used to override the + <formatdomain.html#security-label>`__) which can be used to override the domain security labeling policy for ``source``. ``driver`` -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index cffdab6eb7..97c23f6aa6 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -8142,7 +8142,6 @@ an output-only element ``labelskip`` will be present for active domains on disks where labeling was skipped due to the image being on a file system that lacks security labeling. -:anchor:`<a id="keywrap"/>` Key Wrap -------- -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 1 - docs/formatdomaincaps.rst | 4 ++-- docs/kbase/launch_security_sev.rst | 2 +- docs/kbase/s390_protected_virt.rst | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 97c23f6aa6..4868d3c397 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -8177,7 +8177,6 @@ At least one ``cipher`` element must be nested within the ``keywrap`` element. Note: DEA/TDEA is synonymous with DES/TDES. -:anchor:`<a id="launchSecurity"/>` Launch Security --------------- diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 7aead08d69..1ff45da6f0 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -568,7 +568,7 @@ s390-pv capability Reports whether the hypervisor supports the Protected Virtualization. In order to use Protected Virtualization with libvirt have a look at the `launchSecurity -element in the domain XML <formatdomain.html#launchSecurity>`__. For more +element in the domain XML <formatdomain.html#launch-security>`__. For more details on the Protected Virtualization feature please see `Protected Virtualization on s390 <kbase/s390_protected_virt.html>`__. @@ -583,7 +583,7 @@ transparently encrypted with a key unique to that VM. For more details on the SEV feature, please follow resources in the AMD developer's document store. In order to use SEV with libvirt have a look at `SEV -in domain XML <formatdomain.html#launchSecurity>`__ +in domain XML <formatdomain.html#launch-security>`__ ``cbitpos`` When memory encryption is enabled, one of the physical address bits (aka the diff --git a/docs/kbase/launch_security_sev.rst b/docs/kbase/launch_security_sev.rst index 06d1f2dad0..3ebb01ad80 100644 --- a/docs/kbase/launch_security_sev.rst +++ b/docs/kbase/launch_security_sev.rst @@ -154,7 +154,7 @@ VM Configuration ================ SEV is enabled in the XML by specifying the -`<launchSecurity> <https://libvirt.org/formatdomain.html#launchSecurity>`__ +`<launchSecurity> <https://libvirt.org/formatdomain.html#launch-security>`__ element. However, specifying ``launchSecurity`` isn't enough to boot an SEV VM. Further configuration requirements are discussed below. diff --git a/docs/kbase/s390_protected_virt.rst b/docs/kbase/s390_protected_virt.rst index 4cbdeea7ed..a8c627931b 100644 --- a/docs/kbase/s390_protected_virt.rst +++ b/docs/kbase/s390_protected_virt.rst @@ -128,7 +128,7 @@ As the virtio data structures of secure guests are not accessible by the host, it is necessary to use shared memory ('bounce buffers'). Since libvirt 7.6.0 the -`<launchSecurity> <https://libvirt.org/formatdomain.html#launchSecurity>`__ +`<launchSecurity> <https://libvirt.org/formatdomain.html#launch-security>`__ element with type ``s390-pv`` should be used on protected virtualization guests. Without ``launchSecurity`` you must enable all virtio devices to use shared buffers by configuring them with platform_iommu enabled. -- 2.35.3

The role was used to pass through raw HTML to define custom anchor names. Since all of the document was now converted to use the anchors generated from headers we can remove it. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index 4868d3c397..d27a295329 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -1,6 +1,4 @@ .. role:: since -.. role:: anchor(raw) - :format: html ================= Domain XML format -- 2.35.3

Once we are already using the new anchor format we can create the link via a local reference. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatdomain.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index d27a295329..1c446da9ca 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -6171,9 +6171,8 @@ A video device. above), since such behaviour is inconvenient in cases where GPU mediated devices are meant to be the only rendering device within a guest. If this is your use case specify a ``none`` type ``video`` device in the XML to stop - the default behaviour. Refer to `Host device assignment - <#host-device-assignment>`__ to see how to add a mediated device into a - guest. + the default behaviour. Refer to `Host device assignment`_ to see how to add + a mediated device into a guest. You can provide the amount of video memory in kibibytes (blocks of 1024 bytes) using ``vram``. This is supported only for guest type of "vz", "qemu", -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/uri.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/uri.rst b/docs/uri.rst index 3ca3fb12c3..bfc9542260 100644 --- a/docs/uri.rst +++ b/docs/uri.rst @@ -291,7 +291,7 @@ Supported extra parameters: If set to a non-zero value, this disables client checks of the server's certificate. Note that to disable server checks of the client's certificate or IP address you must `change the libvirtd configuration - <#Remote_libvirtd_configuration>`__ + <remote.html#libvirtd-configuration-file>`__ **Example:** ``no_verify=1`` -- 2.35.3

Within a file we should use the internal reference syntax. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- build-aux/syntax-check.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index e8f9a91cee..649eb91acb 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1087,6 +1087,13 @@ sc_prohibit_backup_files: { echo 'found version controlled backup file' 1>&2; \ exit 1; } || : +# prohibit remote references to local file in RST files +sc_avoid_remote_reference_to_local_file: + @prohibit='<#' \ + in_vc_files='\.rst$$' \ + halt='use local reference within a file' \ + $(_sc_search_regexp) + # This Perl code is slightly obfuscated. Not only is each "$" doubled # because it's in a Makefile, but the $$c's are comments; we cannot # use "#" due to the way the script ends up concatenated onto one line. -- 2.35.3

Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/page.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/page.xsl b/docs/page.xsl index 0a0b017482..1414d90b89 100644 --- a/docs/page.xsl +++ b/docs/page.xsl @@ -172,7 +172,7 @@ <div id="contact"> <h3>Contact</h3> <ul> - <li><a href="{$href_base}contact.html#mailng-lists">email</a></li> + <li><a href="{$href_base}contact.html#mailing-lists">email</a></li> <li><a href="{$href_base}contact.html#irc">irc</a></li> </ul> </div> -- 2.35.3

Some links didn't exit the 'kbase/' directory and 'virDomainBackupEnd' API never existed. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/domainstatecapture.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/kbase/domainstatecapture.rst b/docs/kbase/domainstatecapture.rst index cefc381d2e..204e74c18f 100644 --- a/docs/kbase/domainstatecapture.rst +++ b/docs/kbase/domainstatecapture.rst @@ -176,12 +176,12 @@ capture have these properties: contents are not also saved. Since creating an external snapshot changes which disk image resource is in use by the guest, this API can be coupled with - `virDomainBlockCommit() <html/libvirt-libvirt-domain.html#virDomainBlockCommit>`__ + `virDomainBlockCommit() <../html/libvirt-libvirt-domain.html#virDomainBlockCommit>`__ to restore things back to the guest using its original disk image, where a third-party tool can read the backing file prior to the live - commit. See also the `XML details <formatsnapshot.html>`__ used with + commit. See also the `XML details <../formatsnapshot.html>`__ used with this command. -`virDomainFSFreeze <html/libvirt-libvirt-domain.html#virDomainFSFreeze>`__, `virDomainFSThaw <html/libvirt-libvirt-domain.html#virDomainFSThaw>`__ +`virDomainFSFreeze <../html/libvirt-libvirt-domain.html#virDomainFSFreeze>`__, `virDomainFSThaw <../html/libvirt-libvirt-domain.html#virDomainFSThaw>`__ This pair of APIs does not directly capture guest state, but can be used to coordinate with a trusted live guest that state capture is about to happen, and therefore guest I/O should be quiesced so that @@ -191,7 +191,7 @@ capture have these properties: to these functions. Also, note that freezing guest I/O is only possible with trusted guests running a guest agent, and that some guests place maximum time limits on how long I/O can be frozen. -`virDomainCheckpointCreateXML <html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointCreateXML>`__ +`virDomainCheckpointCreateXML <../html/libvirt-libvirt-domain-checkpoint.html#virDomainCheckpointCreateXML>`__ This API does not actually capture guest state, rather it makes it possible to track which portions of guest disks have changed between a checkpoint and the current live execution of the guest. However, @@ -201,9 +201,9 @@ capture have these properties: at the creation of an external snapshot with ``virDomainSnapshotCreateXML2()``, since a second incremental backup is most useful when using the checkpoint created during the first. - See also the `XML details <formatcheckpoint.html>`__ used with this + See also the `XML details <../formatcheckpoint.html>`__ used with this command. -`virDomainBackupBegin <html/libvirt-libvirt-domain.html#virDomainBackupBegin>`__, `virDomainBackupEnd <html/libvirt-libvirt-domain.html#virDomainBackupEnd>`__ +`virDomainBackupBegin <../html/libvirt-libvirt-domain.html#virDomainBackupBegin>`__ This API wraps approaches for capturing the state of disks of a running guest, but does not track accompanying guest memory state. The capture is consistent to the start of the operation, where the -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
Some links didn't exit the 'kbase/' directory and 'virDomainBackupEnd' API never existed.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/domainstatecapture.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Remove what seems like links from some headings. This error predates the conversion to RST where an '<a href' was used instead of '<a id' in the source document. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/internals/rpc.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/kbase/internals/rpc.rst b/docs/kbase/internals/rpc.rst index 02bc880044..d38db1410d 100644 --- a/docs/kbase/internals/rpc.rst +++ b/docs/kbase/internals/rpc.rst @@ -27,8 +27,8 @@ outstanding method. The protocol was loosely inspired by the design of SunRPC. The definition of the RPC protocol is in the file ``src/rpc/virnetprotocol.x`` in the libvirt source tree. -`Packet framing <protocolframing>`__ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Packet framing +~~~~~~~~~~~~~~ On the wire, there is no explicit packet framing marker. Instead each packet is preceded by an unsigned 32-bit integer giving the total length of the packet in @@ -45,8 +45,8 @@ the framing looks like this: |~ Len ~|~ Data ~|~ Len ~|~ Data ~|~ Len ~|~ Data ~|~ -`Packet data <protocoldata>`__ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Packet data +~~~~~~~~~~~ The data in each packet is split into two parts, a short fixed length header, followed by a variable length payload. So a packet from the illustration above @@ -61,8 +61,8 @@ is more correctly shown as |~ Len ~|~ Header ~|~ Payload .... ~| -`Packet header <protocolheader>`__ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Packet header +~~~~~~~~~~~~~ The header contains 6 fields, encoded as signed/unsigned 32-bit integers. @@ -119,8 +119,8 @@ The header contains 6 fields, encoded as signed/unsigned 32-bit integers. #. continue: for streams this indicates that further data packets will be following -`Packet payload <protocolpayload>`__ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Packet payload +~~~~~~~~~~~~~~ The payload of a packet will vary depending on the ``type`` and ``status`` fields from the header. -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
Remove what seems like links from some headings. This error predates the conversion to RST where an '<a href' was used instead of '<a id' in the source document.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/internals/rpc.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The links were broken on the initial conversion of formatdomain.html to RST which didn't faithfully forward port some of the manually added anchors. Fix it by pointing to the closest possible heading. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatcaps.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/formatcaps.rst b/docs/formatcaps.rst index abd36692e4..9d7932a6a8 100644 --- a/docs/formatcaps.rst +++ b/docs/formatcaps.rst @@ -84,20 +84,20 @@ The ``<guest/>`` element will typically wrap up the following elements: Size of CPU word in bits, for example 64. ``emulator`` Emulator (device model) path, for use in - `emulator <formatdomain.html#elementEmulator>`__ element of domain XML. + `emulator <formatdomain.html#devices>`__ element of domain XML. ``loader`` - Loader path, for use in `loader <formatdomain.html#elementLoader>`__ + Loader path, for use in `loader <formatdomain.html#bios-bootloader>`__ element of domain XML. ``machine`` Machine type, for use in - `machine <formatdomain.html#attributeOSTypeMachine>`__ attribute of + `machine <formatdomain.html#operating-system-booting>`__ attribute of os/type element in domain XML. For example Xen supports ``xenfv`` for HVM, ``xenpv`` for PV, or ``xenpvh`` for PVH. ``domain`` The ``type`` attribute of this element specifies the type of hypervisor required to run the domain. Use in - `type <formatdomain.html#attributeDomainType>`__ attribute of the domain - root element. + `type <formatdomain.html#element-and-attribute-overview>`__ attribute of + the domain root element. ``features`` This optional element encases possible features that can be used with a guest of described type. Possible subelements are: -- 2.35.3

Linking to a list of files is not helpful. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- scripts/hvsupport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/hvsupport.py b/scripts/hvsupport.py index 50ba25c78f..89fd0d1d94 100755 --- a/scripts/hvsupport.py +++ b/scripts/hvsupport.py @@ -426,7 +426,7 @@ print('''<?xml version="1.0" encoding="UTF-8"?> <ul id="toc"></ul> <p> -This page documents which <a href="html/">libvirt calls</a> work on +This page documents which libvirt calls work on which libvirt drivers / hypervisors, and which version the API appeared in. If a hypervisor driver later dropped support for the API, the version when it was removed is also mentioned (highlighted in -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
Linking to a list of files is not helpful.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- scripts/hvsupport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The link was not fixed when the page was moved into 'kbase/' Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/docs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs.rst b/docs/docs.rst index 0a698913be..9fd8b7c37e 100644 --- a/docs/docs.rst +++ b/docs/docs.rst @@ -26,7 +26,7 @@ Deployment / operation `Remote access <remote.html>`__ Enable remote access over TCP -`TLS certs <tlscerts.html>`__ +`TLS certs <kbase/tlscerts.html>`__ Generate and deploy x509 certificates for TLS `Authentication <auth.html>`__ -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
The link was not fixed when the page was moved into 'kbase/'
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/docs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

While the links work they'd trip up the link validator script which will be added later. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/api.rst | 2 +- docs/formatdomaincaps.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 08e5a0eed9..cdba642967 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -27,7 +27,7 @@ wise thing to do in most cases. See the `connection URI <uri.html>`__ page for a full descriptions of the values allowed. OnDevice the application obtains a -`virConnectPtr </html/libvirt-libvirt-host.html#virConnectPtr>`__ +`virConnectPtr <html/libvirt-libvirt-host.html#virConnectPtr>`__ connection to the hypervisor it can then use it to manage the hypervisor's available domains and related virtualization resources, such as storage and networking. All those are exposed as first class diff --git a/docs/formatdomaincaps.rst b/docs/formatdomaincaps.rst index 1ff45da6f0..933469b2a2 100644 --- a/docs/formatdomaincaps.rst +++ b/docs/formatdomaincaps.rst @@ -18,7 +18,7 @@ more recent to support VFIO, while legacy KVM is achievable just fine with older qemus. The main difference between -`virConnectGetCapabilities </html/libvirt-libvirt-host.html#virConnectGetCapabilities>`__ +`virConnectGetCapabilities <html/libvirt-libvirt-host.html#virConnectGetCapabilities>`__ and the emulator capabilities API is, the former one aims more on the host capabilities (e.g. NUMA topology, security models in effect, etc.) while the latter one specializes on the hypervisor capabilities. -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
While the links work they'd trip up the link validator script which will be added later.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/api.rst | 2 +- docs/formatdomaincaps.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The links were broken when the documentation was moved into the 'internals' subdirectory. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/internals/eventloop.rst | 2 +- docs/kbase/internals/migration.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/kbase/internals/eventloop.rst b/docs/kbase/internals/eventloop.rst index f25e97ab14..856cabc85f 100644 --- a/docs/kbase/internals/eventloop.rst +++ b/docs/kbase/internals/eventloop.rst @@ -47,7 +47,7 @@ To work with event loop from our code we have plenty of APIs. - ``virEventRemoveTimeout``: Unregisters a timer. For more information on these APIs continue reading -`here <../html/libvirt-libvirt-event.html>`__. +`here <../../html/libvirt-libvirt-event.html>`__. Worker pool ----------- diff --git a/docs/kbase/internals/migration.rst b/docs/kbase/internals/migration.rst index f7b4b5a10e..ad9d9426b2 100644 --- a/docs/kbase/internals/migration.rst +++ b/docs/kbase/internals/migration.rst @@ -7,7 +7,7 @@ Libvirt migration internals Migration is a multi-step operation with at least two distinct actors, the source and the destination libvirtd daemons, and a lot of failure points. This document describes the basic migration workflow in the -code level, as a way to complement `the base migration docs <../migration.html>`_ +code level, as a way to complement `the base migration docs <../../migration.html>`_ and help developers to get up to speed quicker with the code. In this document, unless stated otherwise, these conventions are followed: -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
The links were broken when the documentation was moved into the 'internals' subdirectory.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/internals/eventloop.rst | 2 +- docs/kbase/internals/migration.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Certain links were missing the '../' prefix to reach files in the parent directory from the time the page was introduced. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/kvm-realtime.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/kbase/kvm-realtime.rst b/docs/kbase/kvm-realtime.rst index 890155560c..87ab314bcb 100644 --- a/docs/kbase/kvm-realtime.rst +++ b/docs/kbase/kvm-realtime.rst @@ -150,7 +150,7 @@ siblings. This is achieved using the `CPU tuning config <../formatdomain.html#cp <vcpusched vcpus='0-4' scheduler='fifo' priority='1'/> </cputune> -The `guest CPU model <formatdomain.html#cpu-model-and-topology>`_ now needs to be +The `guest CPU model <../formatdomain.html#cpu-model-and-topology>`_ now needs to be configured to pass through the host model unchanged, with topology matching the placement: @@ -178,7 +178,7 @@ Memory configuration The host memory used for guest RAM needs to be allocated from huge pages on the second NUMA node, and all other memory allocation needs to be locked into RAM with memory page sharing disabled. -This is achieved by using the `memory backing config <formatdomain.html#memory-backing>`_: +This is achieved by using the `memory backing config <../formatdomain.html#memory-backing>`_: :: -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
Certain links were missing the '../' prefix to reach files in the parent directory from the time the page was introduced.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/kvm-realtime.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Most of the links were broken by moving the article into kbase, but in this case we need to also fix the anchor names. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/tlscerts.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/kbase/tlscerts.rst b/docs/kbase/tlscerts.rst index 962253e853..e4aa5bb3c9 100644 --- a/docs/kbase/tlscerts.rst +++ b/docs/kbase/tlscerts.rst @@ -84,12 +84,12 @@ clients. There are two distinct checks involved: - The client should know that it is connecting to the right server. Checking done by client by matching the certificate that the server sends to the server's hostname. May be disabled by adding ``?no_verify=1`` to the `remote - URI <uri.html#Remote_URI_parameters>`__. + URI <../uri.html#tls-transport>`__. - The server should know that only permitted clients are connecting. This can be done based on client's IP address, or on client's IP address and client's certificate. Checking done by the server. May be enabled and disabled in the - `libvirtd.conf file <remote.html#libvirtd-configuration-file>`__. + `libvirtd.conf file <../remote.html#libvirtd-configuration-file>`__. For full certificate checking you will need to have certificates issued by a recognised `Certificate Authority @@ -99,7 +99,7 @@ CA, you can set up your own CA and tell your server(s) and clients to trust certificates issues by your own CA. Follow the instructions in the next section. Be aware that the `default configuration for -libvirtd <remote.html#libvirtd-configuration-file>`__ allows any client to +libvirtd <../remote.html#libvirtd-configuration-file>`__ allows any client to connect provided they have a valid certificate issued by the CA for their own IP address. You may want to change this to make it less (or more) permissive, depending on your needs. @@ -180,7 +180,7 @@ for validation may be discontinued entirely, so it is strongly recommended to include the SAN fields. In the example below, clients will be connecting to the server using a -`URI <uri.html#URI_remote>`__ of ``qemu://compute1.libvirt.org/system``, so the +`URI <../uri.html#remote-uris>`__ of ``qemu://compute1.libvirt.org/system``, so the CN must be "``compute1.libvirt.org``". Make a private key for the server: -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
Most of the links were broken by moving the article into kbase, but in this case we need to also fix the anchor names.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/kbase/tlscerts.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

When uri.html was converted to RST the 'URI remote' anchor was not fixed in remote.rst. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/remote.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/remote.rst b/docs/remote.rst index bcc394e083..ab11405d56 100644 --- a/docs/remote.rst +++ b/docs/remote.rst @@ -24,7 +24,7 @@ access the system-wide QEMU daemon, then to access the system-wide QEMU daemon on a remote machine called ``compute1.libvirt.org`` you would use ``qemu://compute1.libvirt.org/system``. -The `section on remote URIs <uri.html#URI_remote>`__ describes in more detail +The `section on remote URIs <uri.html#remote-uris>`__ describes in more detail these remote URIs. From an API point of view, apart from the change in URI, the API should behave @@ -82,7 +82,7 @@ Remote libvirt supports a range of transports: remote side. The choice of transport is determined by the `URI -scheme <uri.html#URI_remote>`__, with ``tls`` as the default if no explicit +scheme <uri.html#remote-uris>`__, with ``tls`` as the default if no explicit transport is requested. libvirtd configuration file -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
When uri.html was converted to RST the 'URI remote' anchor was not fixed in remote.rst.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/remote.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

Link into the examples of the qemu driver. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/uri.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/uri.rst b/docs/uri.rst index bfc9542260..1d2c68f5b8 100644 --- a/docs/uri.rst +++ b/docs/uri.rst @@ -121,7 +121,7 @@ So to connect to the daemon, one of two different URIs is used: domain socket(s) that it listens on in the various different modes). KVM URIs are identical. You select between qemu, qemu accelerated and KVM guests -in the `guest XML as described here <format.html#KVM1>`__. +in the `guest XML as described here <drvqemu.html#example-domain-xml-config>`__. test:///... Test URIs ~~~~~~~~~~~~~~~~~~~~~ -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
Link into the examples of the qemu driver.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/uri.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

The link was most likely broken when 'formatsecret' was converted to RST. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatstorageencryption.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/formatstorageencryption.rst b/docs/formatstorageencryption.rst index 11bea53cb8..2c19473d6b 100644 --- a/docs/formatstorageencryption.rst +++ b/docs/formatstorageencryption.rst @@ -107,7 +107,7 @@ to a qemu VM using the qemu VM driver. A single Examples -------- -Assuming a `luks volume type secret <formatsecret.html#VolumeUsageType>`__ is +Assuming a `luks volume type secret <formatsecret.html#usage-type-volume>`__ is already defined, a simple example specifying use of the ``luks`` format for either volume creation without a specific cipher being defined or as part of a domain volume definition: -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
The link was most likely broken when 'formatsecret' was converted to RST.
Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/formatstorageencryption.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano

In many cases we move around or rename internal anchors which may break links leading to the content. docutils handle the case of links inside a document, but we are lacking the same form of checking between documents. Introduce a script which cross-checks all the anchors and links in HTML output files and prints problems and use it as a test case for the 'docs' directory. Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/meson.build | 11 +++ scripts/check-html-references.py | 153 +++++++++++++++++++++++++++++++ scripts/meson.build | 1 + 3 files changed, 165 insertions(+) create mode 100755 scripts/check-html-references.py diff --git a/docs/meson.build b/docs/meson.build index d71f6006dd..cb70ef6084 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -350,3 +350,14 @@ run_target( ], depends: install_web_deps, ) + +test( + 'check-html-references', + python3_prog, + args: [ + check_html_references_prog.path(), + '--prefix', + meson.build_root() / 'docs' + ], + env: runutf8, +) diff --git a/scripts/check-html-references.py b/scripts/check-html-references.py new file mode 100755 index 0000000000..95a61a6bb4 --- /dev/null +++ b/scripts/check-html-references.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python3 +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library. If not, see +# <http://www.gnu.org/licenses/>. +# +# Check that external references between documentation HTML files are not broken. + +import sys +import os +import argparse +import re +import xml.etree.ElementTree as ET + +ns = {'html': 'http://www.w3.org/1999/xhtml'} +externallinks = [] + + +def get_file_list(prefix): + filelist = [] + + for root, dir, files in os.walk(prefix): + prefixbase = os.path.dirname(prefix) + + if root.startswith(prefixbase): + relroot = root[len(prefixbase):] + else: + relroot = root + + for file in files: + if not re.search('\\.html$', file): + continue + + # the 404 page doesn't play well + if '404.html' in file: + continue + + fullfilename = os.path.join(root, file) + relfilename = os.path.join(relroot, file) + filelist.append((fullfilename, relfilename)) + + return filelist + + +# loads an XHTML and extracts all anchors, local and remote links for the one file +def process_file(filetuple): + filename, relfilename = filetuple + tree = ET.parse(filename) + root = tree.getroot() + + anchors = [relfilename] + targets = [] + + for elem in root.findall('.//html:a', ns): + target = elem.get('href') + an = elem.get('id') + + if an: + anchors.append(relfilename + '#' + an) + + if target: + if re.search('://', target): + externallinks.append(target) + elif target[0] != '#' and 'mailto:' not in target: + dirname = os.path.dirname(relfilename) + targetname = os.path.normpath(os.path.join(dirname, target)) + + targets.append((targetname, filename, target)) + + # older docutils generate "<div class='section'" + for elem in root.findall('.//html:div/[@class=\'section\']', ns): + an = elem.get('id') + + if an: + anchors.append(relfilename + '#' + an) + + # modern docutils generate a <section element + for elem in root.findall('.//html:section', ns): + an = elem.get('id') + + if an: + anchors.append(relfilename + '#' + an) + + return (anchors, targets) + + +def process_all(filelist): + anchors = [] + targets = [] + + for filetuple in filelist: + anchor, target = process_file(filetuple) + + targets = targets + target + anchors = anchors + anchor + + return (targets, anchors) + + +def check_targets(targets, anchors): + errors = [] + for target, targetfrom, targetorig in targets: + if target not in anchors: + errors.append((targetfrom, targetorig)) + + if errors: + errors.sort() + + print('broken link targets:') + + for file, target in errors: + print(file + " broken link: " + target) + + return True + + return False + + +parser = argparse.ArgumentParser(description='HTML reference checker') +parser.add_argument('--prefix', default='.', + help='build tree prefix') +parser.add_argument('--external', action="store_true", + help='print external references instead') + +args = parser.parse_args() + +files = get_file_list(args.prefix) + +targets, anchors = process_all(files) + +if args.external: + prev = None + externallinks.sort() + for ext in externallinks: + if ext != prev: + print(ext) + + prev = ext +else: + if check_targets(targets, anchors): + sys.exit(1) + + sys.exit(0) diff --git a/scripts/meson.build b/scripts/meson.build index 421e3d2acd..05b71184f1 100644 --- a/scripts/meson.build +++ b/scripts/meson.build @@ -6,6 +6,7 @@ scripts = [ 'check-driverimpls.py', 'check-drivername.py', 'check-file-access.py', + 'check-html-references.py', 'check-remote-protocol.py', 'check-symfile.py', 'check-symsorting.py', -- 2.35.3

On a Tuesday in 2022, Peter Krempa wrote:
First 50 patches remove the use of raw HTML passthrough in formatdomain.rst, which is the only outstanding place which still does.
Is cleaning those up worth breaking links from external sites which use the old anchors? I thought that was the only reason we left them there. Jano
Most of the work was done by a ad-hoc bash script, but manual tweaks were needed. Since this series also contains a test script which validates linking I'm not going to publish the conversion script.
The rest of the series then cleans up pre-existing broken links and adds the aforementioned checker script.
One more change is to prevent the use of external references in RST to refer to the same file. All usage was converted to local references and a syntax check was added.
One slight drawback of the checker script is that it works on generated HTML files and thus the error message contains the output file name and not the source RST document.

On Tue, May 31, 2022 at 17:26:34 +0200, Ján Tomko wrote:
On a Tuesday in 2022, Peter Krempa wrote:
First 50 patches remove the use of raw HTML passthrough in formatdomain.rst, which is the only outstanding place which still does.
Is cleaning those up worth breaking links from external sites which use the old anchors? I thought that was the only reason we left them there.
Well, the main reason they were added originally was because it also prevented us from having to convert all other documents we have locally and allowed a mostly automated conversion. For all other documents which didn't have so many internal cross-links we already converted the links to the new names when doing the conversion to RST The external links case was certainly one of the selling points at that time, but IMO the value of it decreased over the last almost 2 years since the document was converted as all new links obtained from the document are of the new format. My stance (obviously since I posted the patches) is that since it's inevitable that the links will break at some point and we had a good enough intermediate period so we should just get over it and use what's generated.

On a Tuesday in 2022, Peter Krempa wrote:
On Tue, May 31, 2022 at 17:26:34 +0200, Ján Tomko wrote:
On a Tuesday in 2022, Peter Krempa wrote:
First 50 patches remove the use of raw HTML passthrough in formatdomain.rst, which is the only outstanding place which still does.
Is cleaning those up worth breaking links from external sites which use the old anchors? I thought that was the only reason we left them there.
Well, the main reason they were added originally was because it also prevented us from having to convert all other documents we have locally and allowed a mostly automated conversion.
For all other documents which didn't have so many internal cross-links we already converted the links to the new names when doing the conversion to RST
The external links case was certainly one of the selling points at that time, but IMO the value of it decreased over the last almost 2 years since the document was converted as all new links obtained from the document are of the new format.
My stance (obviously since I posted the patches) is that since it's inevitable that the links will break at some point and we had a good enough intermediate period so we should just get over it and use what's generated.
Series: Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Peter Krempa