Commit Graph

4052 Commits

Author SHA1 Message Date
Tim Wiederhake
0519787f88 docs: domain: Clarify on the dangers of migrating with hyperv-passthrough enabled
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-15 11:53:08 +01:00
Tim Wiederhake
fdec0cbf43 Fix some typos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-15 11:52:54 +01:00
Daniel P. Berrangé
34cb8f6fcd conf: extend domain capabilities for max SEV guest count
There are limits on the number of SEV/SEV-ES guests that can
be run on machines, which may be influenced by firmware
settings. This is important to expose to users.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
719bb0bf23 tools: add 'nodesevinfo' virsh command
While some SEV info is reported in the domain capabilities,
for reasons of size, this excludes the certificates. The
nodesevinfo command provides the full set of information.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Daniel P. Berrangé
ac79e9ff5c tools: add 'domlaunchsecinfo' virsh command
This command reports the launch security parameters for
a guest, allowing an external tool to perform a launch
attestation.

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-14 16:04:17 +00:00
Tim Wiederhake
8b6766bd77 docs: domain: Add documentation for hyperv passthrough mode
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:46 +01:00
Tim Wiederhake
ec0616cac3 schema: hyperv: Add mode "passthrough"
This mode will enable all enlightenments known to the hypervisor. See
https://bugzilla.redhat.com/show_bug.cgi?id=1851249

Example:

  <features>
    <hyperv mode='passthrough'/>
    ...
  </features>

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
da9f798445 docs: domain: Add documentation for "hyperv"'s new "mode" attribute
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
33d9d3806c schema: Add optional "mode" attribute to hyperv
Allow for an optional attribute "mode", set to the string "custom".

Later patches will introduce different modes. Omitting this attribute
will default to "custom" for backwards compatibility.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Tim Wiederhake
fa0789cc0c schema: Wrap hyperv element in choice and group
This does not change the schema, but will make upcoming changes
easier.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-14 16:50:45 +01:00
Ján Tomko
7624796ac8 docs: use g_auto in virCommand example
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-14 16:41:36 +01:00
Hyman Huang(黄勇)
5d18d740d8 qemu: support dirty ring feature
Dirty ring feature was introduced in qemu-6.1.0, this patch
add the corresponding feature named 'dirty-ring', which enable
dirty ring feature when starting VM.

To enable the feature, the following XML needs to be added to
the guest's domain description:

<features>
   <kvm>
     <dirty-ring state='on' size='xxx'>
   </kvm>
</features>

If property "state=on", property "size" must be specified, which
should be power of 2 and range in [1024, 65526].

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-12-14 13:17:41 +01:00
Michal Privoznik
16159d5152 qemu: Validate TCG feature is enabled only for TCG domains
After previous commit it's possible for domains to fine tune TCG
features (well, just one - tb-cache). Check that domain has TCG
enabled, otherwise the feature makes no sense.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-12-13 17:07:39 +01:00
Michal Privoznik
f106788069 conf: Introduce TCG domain features
It may come handy to be able to tweak TCG options, in this
specific case the size of translation block cache size (tb-size).
Since we can expect more knobs to tweak let's put them under
common element, like this:

  <domain>
    <features>
      <tcg>
        <tb-cache unit='MiB'>128</tb-cache>
      </tcg>
    </features>
  </domain>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Tested-by: Kashyap Chamarthy <kchamart@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-12-13 17:01:02 +01:00
Ján Tomko
4a6b246d39 Revert "virt-ssh-helper: Add manual page"
This was pushed by mistake with incorrect claim of my R-b.

This reverts commit dadcd35260.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-12-10 23:08:31 +01:00
Andrea Bolognani
9402db25f8 virt-pki-query-dn: Add manual page
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-10 18:40:10 +01:00
Andrea Bolognani
823fcba905 virt-qemu-run: Improve manual page
Specifically:

  * use the correct notation and markup for commands, options
    and arguments;
  * rename arguments meta-variables to be more descriptive;
  * sort options so that the most common ones come first;
  * use consistent vertical spacing;
  * fix a typo.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-10 18:39:56 +01:00
Andrea Bolognani
dadcd35260 virt-ssh-helper: Add manual page
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-10 18:39:31 +01:00
Andrea Bolognani
8a637cc766 docs: Update more links to point to the new Go modules
A couple of links were still pointing to the obsolete Go
packages instead of the current module-aware ones.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2021-12-09 12:16:17 +01:00
Peter Krempa
0f170de28a docs: migration: Add a paragraph about non-shared storage migration
Outline some of the basics and the caveats of the non-shared migration
code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-07 09:00:39 +01:00
Peter Krempa
8841302e3d docs: Convert 'migration' doc to RST
After conversion the table doesn't have to custom colors, but otherwise
seems to hold well.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-07 09:00:39 +01:00
Peter Krempa
51d1c08fe9 virDomainMigrate: Introduce VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES flag
Non-shared storage migration of guests which are disk I/O intensive and
have fast local storage may actually never converge if the guest happens
to dirty the disk faster than it can be copied.

This patch introduces a new flag
'VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES' which will instruct
hypervisors to synchronize local I/O writes with the writes to remote
storage used for migration so that the guest can't overwhelm the
migration. This comes at a cost of decreased local I/O performance for
guests which behave well on average.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-07 09:00:39 +01:00
Peter Krempa
d43513e383 man: virsh: Separate paragraphs describing distinct flags
Separate the paragraphs where the topic changes to simplify further
additions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-07 09:00:39 +01:00
Peter Krempa
b54c313c33 virDomainBlockCopy: Introduce VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES flag
In cases when the destination storage is slower than the normal VM
storage and the VM does intensive I/O to the disk a block copy job may
never converge.

Switching it to synchronous mode will ensure that all writes done by the
guest are propagated to the destination at the cost of slowing down I/O
of the guest to the synchronous speed.

This patch adds the new API flag and implements virsh support.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-12-07 09:00:39 +01:00
Daniel P. Berrangé
fd0aa7879f conf: add TPM devices to domain capabilities
This adds reporting of available TPM models and backends to the domain
capabilities schema

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-12-01 12:14:03 +00:00
Pavel Hrdina
2fe7622d19 virsh: man: update snapshot-revert description
We've changed the behavior of this API that from now on it will always
restart the VM process and we are no longer able to revert to snapshots
created by libvirt older then 0.9.5.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-11-23 16:03:19 +01:00
Andrea Bolognani
324de132bc docs: Use new URLs for Go modules in downloads page
We've been using the new repositories for a few months now,
but the downloads page still points to the obsolete Go packages.

Fixes: 1832c0a02b
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-11-17 17:45:55 +01:00
Martin Kletzander
5d972ad910 Add suggestions for virt-pki-query-dn usage
To make it easier for users to figure out how the DN should be formatted.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-12 12:37:29 +01:00
Martin Kletzander
555c24a55d docs: Simplify explanation of tls_allowed_dn_list wildcards
This removes a dead link, the need for users to understand a glib function and a
improper reference to fnmatch (as we only expand asterisks to any string).

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2021-11-11 18:31:29 +01:00
Or Ozeri
dfa5713bc2 docs: add minor clarifications for librbd encryption
This should make the documentation less confusing mainly for
Ceph people.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-09 14:42:23 +01:00
zhanglei
c6d009620a virsh: add interface information to guestinfo command
The new parameter group returns information about network interfaces

Signed-off-by: zhanglei <zhanglei@smartx.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2021-11-05 13:38:40 +01:00
Stefan Berger
a5bbe1a8b6 qemu: tpm: Extend TPM domain XML with PCR banks to activate
Extend the TPM backend XML with a node 'active_pcr_banks' that allows a
user to specify the PCR banks to activate before starting a VM. Valid
choices for PCR banks are sha1, sha256, sha384 and sha512. When the XML
node is provided, the set of active PCR banks is 'enforced' by running
swtpm_setup before every start of the VM. The activation requires that
swtpm_setup v0.7 or later is installed and may not have any effect
otherwise.

<tpm model='tpm-tis'>
  <backend type='emulator' version='2.0'>
    <active_pcr_banks>
      <sha256/>
      <sha384/>
    </active_pcr_banks>
  </backend>
</tpm>

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

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-05 09:22:50 +01:00
Jonathon Jongsma
8970094afd docs: fix documentation for nodedev-start
Presumably the result of a copy/paste mistake, the the argument for the
`nodedev-start` command was described as a 'network' rather than a
'device'.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
2021-11-03 14:07:32 -05:00
zhenwei pi
b2757b697e qemu: support kvm-pv-ipi off
QEMU version 3.1 introduced PV_SEND_IPI CPUID feature bit under
commit 7f710c32bb8 (target-i386: adds PV_SEND_IPI CPUID feature bit).

This patch adds a new KVM feature 'pv-ipi' to disable this feature
(enabled by default). Newer CPU platform (Ex, AMD Zen2) supports
hardware accelation for IPI in guest, to use this feature to get
better performance in some scenarios. Detailed about the discussion:
  https://lkml.org/lkml/2021/10/20/423

To disable kvm-pv-ipi and have libvirt add "-cpu host,kvm-pv-ipi=off"
to the QEMU command line, the following XML code needs to be added to the
guest's domain description:

  <features>
    <kvm>
      <pv-ipi state='off'/>
    </kvm>
  </features>

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-11-01 15:44:26 +01:00
Han Han
a08082c7fc docs: Make the version requirement more clear for rbd encryption
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-10-29 14:51:12 +02:00
Han Han
c0946737d5 docs: Fix a typo of page_per_vq
The page_per_vq is added since v7.9.0 not v7.8.0.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-10-29 14:51:05 +02:00
Laine Stump
dba9893831 Revert "conf: introduce support for acpi-bridge-hotplug feature"
This reverts commit 7300ccc9b3.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
2021-10-25 23:18:41 -04:00
Daniel P. Berrangé
460eda9b05 docs: fix docs output path with meson 0.60.0
The meson 0.60.0 release introduced a bug with the '/' operator when
using an empty path component. '/foo' / ''  will now result in '/foo'
not '/foo/'

  https://github.com/mesonbuild/meson/issues/9450

This breaks libvirt because xsltproc requires the trailing '/' on the
output directory path. Fortunately the explicit 'join_paths' function
is not affected by the regression

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2021-10-25 19:36:15 +01:00
Or Ozeri
060f344c80 conf: add luks2 encryption format
This commit extends libvirt XML configuration to support luks2 encryption format.
This means that <encryption format="luks2" engine="librbd"> becomes valid.
Currently librbd is the only engine that supports this new format.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-25 14:06:15 +02:00
Or Ozeri
59090adf63 qemu: add librbd encryption engine
rbd encryption is new in qemu 6.1.0.
This commit adds a new encryption engine property which
allows the user to use this new encryption engine.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-25 14:06:15 +02:00
Or Ozeri
ab1d46d612 conf: add encryption engine property
This commit extends libvirt XML configuration to support a custom encryption engine.
This means that <encryption format="luks" engine="qemu">  becomes valid.
The only engine for now is qemu. However, a new engine (librbd) will be added in an upcoming commit.
If no engine is specified, qemu will be used (assuming qemu driver is used).

Signed-off-by: Or Ozeri <oro@il.ibm.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2021-10-25 14:06:15 +02:00
Dmitrii Shcherbakov
fab3513bf0 Add PCI VPD Capability Documentation
Describes the format of the newly added VPD capability and gives and
example for a real-world device.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
2021-10-21 17:34:04 +01:00
Dmitrii Shcherbakov
3954378d06 Add PCI VPD Capability Support
* XML serialization and deserialization of PCI VPD;
* PCI VPD capability flags added and used in relevant places;
* XML to XML tests for the added capability.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dmitrii Shcherbakov <dmitrii.shcherbakov@canonical.com>
2021-10-21 17:34:04 +01:00
Peter Krempa
289aa4bc5b virsh: Add QMP command wrapping for 'qemu-monitor-command'
Issuing simple QMP commands is pain as they need to be wrapped by the
JSON wrapper:

 { "execute": "COMMAND" }

and optionally also:

 { "execute": "COMMAND", "arguments":...}

For simple commands without arguments we can add syntax sugar to virsh
which allows simple usage of QMP and additionally prepares also for
passing through of the 'arguments' section:

 virsh qemu-monitor-command $VM query-status

is equivalent to

 virsh qemu-monitor-command $VM '{"execute":"query-status"}'

and

 virsh qemu-monitor-command $VM query-named-block-nodes '{"flat":true}'
 or
 virsh qemu-monitor-command $VM query-named-block-nodes '"flat":true'

is equivalent to

 virsh qemu-monitor-command $VM '{"execute":"query-named-block-nodes", "arguments":{"flat":true}}'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-10-18 16:04:17 +02:00
Han Han
388cdd11f3 conf: Add page_per_vq for driver element
Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Gavi Teitz <gavi@nvidia.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-10-15 09:40:55 +02:00
Julio Faracco
946664db75 gitdm: Add other email into Red Hat company list
Some people from Red Hat does not use 'redhat.com' domain emails.
They use personal or other domains.

Signed-off-by: Julio Faracco <jcfaracco@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2021-10-12 16:46:45 +02:00
Ani Sinha
7300ccc9b3 conf: introduce support for acpi-bridge-hotplug feature
This change introduces a new libvirt sub-element <pci> under
<features> that can be used to configure all pci related features.
Currently the only sub-sub element supported by this sub-element is
'acpi-bridge-hotplug' as shown below:

<features>
  <pci>
    <acpi-bridge-hotplug state='on|off'/>
  </pci>
</features>

The above option is only available for the QEMU driver, for x86 guests
only. It is a global option, affecting all PCI bridge controllers on
the guest.

The 'acpi-bridge-hotplug' option enables or disables ACPI hotplug
support for cold-plugged pci bridges. Examples of bridges include the
PCI-PCI bridge (pci-bridge controller) for pc (i440fx) machinetypes,
or PCIe-PCI bridges and pcie-root-port controllers for q35
machinetypes.

For pc machinetypes in x86, this option has been available in QEMU
since version 2.1. Please see the following changes in qemu repo:

9e047b982452c6 ("piix4: add acpi pci hotplug support")
133a2da488062e ("pc: acpi: generate AML only for PCI0 devices if PCI
               bridge hotplug is disabled")

For q35 machinetypes, this was introduced in QEMU 6.1 with the
following changes in qemu repo:

(a) c0e427d6eb5fef ("hw/acpi/ich9: Enable ACPI PCI hot-plug")
(b) 17858a16950860 ("hw/acpi/ich9: Set ACPI PCI hot-plug as default on
                   Q35")

The reasons for enabling ACPI based hotplug for PCIe (q35) based
machines (as opposed to native hotplug) are outlined in (b). There are
use cases where users would still want to use native
hotplug. Therefore, this config option enables users to choose either
ACPI based hotplug or native hotplug for bridges (for example for pcie
root port controller in q35 machines).

Qemu capability validation checks have also been added along with
related unit tests to exercise the new conf option.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-10 13:13:45 -04:00
Ani Sinha
8eadf82fb5 conf: introduce option to enable/disable pci hotplug on pci-root controller
This change introduces libvirt xml support to enable/disable hotplug on the
pci-root controller. It adds a 'target' subelement for the pci-root controller
with a 'hotplug' property. This property can be used to enable or disable
hotplug for the pci-root controller. For example, in order to disable hotplug
on the pci-root controller, one has to use set '<target hotplug='off'>' as
shown below:

<controller type='pci' model='pci-root'>
  <target hotplug='off'/>
</controller>

'<target hotplug='on'>' option would enable hotplug for pci-root controller.
This is also the default value. This option is only available for pc machine
types and is applicable for qemu/kvm accelerator only.This feature was
introduced from qemu version 5.2 with the following change in qemu repository:

3d7e78aa7777f ("Introduce a new flag for i440fx to disable PCI hotplug on the root bus")

The above qemu commit describes some reasons why users might to disable hotplug
on PCI root buses.

Related unit tests to exercise the new conf option has also been added.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2021-10-01 14:19:44 -04:00
Michal Privoznik
9c1e5a5158 kbase: Document virtio-mem
This commit adds new memorydevices.rst page which should serve
all models of memory devices. Yet, I'm documenting virtio-mem
quirks only.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-01 11:05:12 +02:00
Michal Privoznik
f72e4edf50 virsh: Introduce update-memory-device command
New 'update-memory-device' command is introduced which aims on
making it user friendly to change <memory/> device. So far I just
need to change <requested/> so I'm introducing --requested-size
only; but the idea is that this is extensible for other cases
too. For instance, want to change <myElement/>? A new
--my-element argument can be easily introduced.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2021-10-01 11:05:05 +02:00