1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-09-21 09:44:54 +03:00

Compare commits

..

840 Commits

Author SHA1 Message Date
Jiri Denemark
f8b6c7e59a Release of libvirt-8.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-08-01 09:25:44 +02:00
Jiri Denemark
8cb19a9b9a qemu_migration_params: Avoid deadlock in qemuMigrationParamsReset
In my recent comnmit v8.5.0-188-gc47f1abb81 I accidentally moved
qemuMigrationParamsResetTLS after qemuDomainObjEnterMonitorAsync not
noticing qemuMigrationParamsResetTLS will try to enter the monitor
again. The second call will time out and return with a domain object
locked. But we're still in monitor section and the object should be
unlocked which means qemuDomainObjExitMonitor will deadlock trying to
lock it again.

Fixes: c47f1abb81
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-29 09:34:53 +02:00
Laine Stump
640d185f01 qemu: don't call qemuMigrationSrcIsAllowedHostdev() from qemuMigrationDstPrepareFresh()
This call to qemuMigrationSrcIsAllowedHostdev() (which does a
hardcoded fail of the migration if there is any PCI or mdev hostdev
device in the domain) while doing the destination side of migration
prep was found once the call to that same function was removed from
the source side migration prep (commit 25883cd5).

According to jdenemar, for the V2 migration protocol, prep of the
destination is the first step, so this *was* the proper place to do
the check, but for V3 migration this is in a way redundant (since we
will have already done the check on the source side (updated by
25883cd5 to query QEMU rather than do a hardcoded fail)).

Of course it's possible that the source could support migration of a
particular VFIO device, but the destination doesn't. But the current
check on the destination side is worthless even in that case, since it
is just *always* failing rather than querying QEMU; and QEMU can't be
queried at the point where the destination check is happening, since
it isn't yet running.

Anyway QEMU should complain when it's started if it's going to fail,
so removing this check should just move the failure to happen a bit
later. So the best solution to this problem is to simply remove the
hardcoded check/fail from qemuMigrationDstPrepareFresh() and rely on
QEMU to fail if it needs to.

Fixes: 25883cd5f0
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-28 08:16:29 -04:00
Yuri Chornoivan
859392cf14 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10480 of 10480 strings)

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

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2022-07-28 13:05:07 +02:00
김인수
bc520c215f Translated using Weblate (Korean)
Currently translated at 100.0% (10480 of 10480 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-07-28 13:05:07 +02:00
Jiri Denemark
bb9badb916 qemu: Restore original memory locking limit on reconnect
Commit v8.4.0-287-gd4d3bb8130 tried to make sure the original
pre-migration memory locking limit is restored at the end of migration,
but it missed the case when libvirt daemon is restarted during
migration which needs to be aborted on reconnect.

And if this was not enough, I forgot to actually save the status XML
after setting the field in priv (in the commit mentioned above and also
in v8.4.0-291-gd375993ab3).

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-28 13:04:45 +02:00
Jiri Denemark
9c3d398df1 qemu: Properly release job in qemuDomainSaveInternal
The function would fail to release the job in case
qemuMigrationSrcIsAllowed failed.

Fixes v8.5.0-157-g69e0e33873

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-07-27 16:22:29 +02:00
Daniel P. Berrangé
ef53798ab6 qemu: support use of stateless EFI firmware
When the <loader stateless='yes'/> attribute is set, the QEMU driver
needs to do three things

 - Avoid looking for an NVRAM template
 - Avoid auto-populating an <nvram/> path
 - Find firmware descriptors with mode=stateless instead of mode=split

Note, the first thing happens automatically when we solve the second
thing.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-26 15:41:44 +01:00
Daniel P. Berrangé
578ac25c6a conf: support stateless UEFI firmware
Normally when an UEFI firmware is marked as read-only, an associated
NVRAM file will be created. Some builds of UEFI firmware, however, wish
to remain stateless and so will be read-only, but never have any NVRAM
file. To represent this concept a 'stateless' tristate bool attribute
is introduced on the <loader/> element.

There are rather a large number of permutations to consider.

With default firmware selection

  *  <os/>

     => Historic default, no change

  *  <os>
       <loader stateless='yes'/>
     </os>

     => Explicit version of historic default, no change

  *  <os>
       <loader stateless='no'/>
     </os>

      => Invalid, bios is always stateless

With manual legacy BIOS selection

  *  <os>
       <loader>/path/to/seabios</loader>
       ...
     </os>

     => Historic default, no change

  *  <os>
       <loader stateless='yes'>/path/to/seabios</loader>
       ...
     </os>

     => Explicit version of historic default, no change

  *  <os>
       <loader stateless='no'>/path/to/seabios</loader>
       ...
     </os>

      => Invalid, bios is always stateless

With manual UEFI selection

  *  <os>
       <loader type='pflash'>/path/to/edk2</loader>
       ...
     </os>

     => Historic default, no change

  *  <os>
       <loader type='pflash' stateless='yes'>/path/to/edk2</loader>
       ...
     </os>

     => Skip auto-filling NVRAM / template

  *  <os>
       <loader type='pflash' stateless='no'>/path/to/edk2</loader>
       ...
     </os>

     => Explicit version of historic default, no change

With automatic firmware selection

  *  <os firmware='bios'/>

     => Historic default, no change

  *  <os firmware='bios'>
       <loader stateless='yes'/>
     </os>

     => Explicit version of historic default, no change

  *  <os firmware='bios'>
       <loader stateless='no'/>
     </os>

      => Invalid, bios is always stateless

  *  <os firmware='uefi'/>

     => Historic default, no change

  *  <os firmware='uefi'>
       <loader stateless='yes'/>
     </os>

     => Skip auto-filling NVRAM / template

  *  <os firmware='uefi'>
       <loader stateless='no'/>
     </os>

     => Explicit version of historic default, no change

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-26 15:41:44 +01:00
Peter Krempa
429c15259c docs: Add article about handling upstream issues
Outline how upstream issues are triaged and explain what the states of
the issue means.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-07-26 16:35:57 +02:00
Peter Krempa
80e50315b4 docs: patches: Add a note about reviews and contacting developers
Add a note outling best practices around review and responding to it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-07-26 16:35:57 +02:00
Weblate
06a9dcb35d Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2022-07-26 11:13:19 +02:00
Jiri Denemark
5522105f59 po: Refresh potfile for v8.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-26 10:51:40 +02:00
Jiri Denemark
c47f1abb81 qemu_migration_params: Refactor qemuMigrationParamsReset
Because qemuMigrationParamsReset used to call qemuMigrationParamsApply
for resetting migration capabilities and parameters, it did not work
well since commit v5.1.0-83-ga1dec315c9 which only allowed capabilities
to be set from an async job. However, when reconnecting to running
domains after daemon restart we do not have an async job. Thus the
capabilities were not properly reset in case the daemon was restarted
during an ongoing migration. We need to avoid calling
qemuMigrationParamsApply to make sure both parameters and capabilities
can be reset by a normal job.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-26 10:09:01 +02:00
Jiri Denemark
c0824fd038 qemu_migration_params: Refactor qemuMigrationParamsApply
qemuMigrationParamsApply restricts when capabilities can be set, but
this is not useful in all cases. Let's create new helpers for setting
migration capabilities and parameters which can be reused in more places
without the restriction.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-26 10:09:00 +02:00
Jiri Denemark
c723894135 qemu_migration: Store original migration params in status XML
We keep original values of migration parameters so that we can restore
them at the end of migration to make sure later migration does not use
some random values. However, this does not really work when libvirt
daemon is restarted on the source host because we failed to explicitly
save the status XML after getting the migration parameters from QEMU.
Actually it might work if the status XML is written later for some other
reason such as domain state change, but that's not how it should work.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-26 10:09:00 +02:00
Michal Privoznik
32b9d4390e coding-style: Allow some use of ternary operators
While we all understand that excessive use of ternary operator
may worsen code readability (e.g. nested, multi-line expression),
there are few cases where using it actually improves code
readability. For instance, when a function takes a long list of
arguments out of which one depends on a boolean expression, or
when formatting "yes"/"no" or "on"/"off" values based on a
boolean variable (although one can argue that the latter is a
subset of the former). Just consider alternatives to:

  virBufferAsprintf(buf, "<elem>%s</elem>\n", boolVar ? "yes" : "no");

In fact, this pattern occurs plenty in our code. Exempt it from
our "no ternary operators" rule.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-26 08:48:48 +02:00
Peter Krempa
30a067d94c qemu: monitor: Split up enum strings definitions
The VIR_ENUM_IMPL macros directly above them list one string per line.
Use the same also for qemuMonitorMigrationStatus and
qemuMonitorVMStatus.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-25 16:47:05 +02:00
Peter Krempa
ef0fef79e7 qemuMigrationSrcIOFunc: Avoid unnecessary string construction
Use full strings for better greppability.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-25 16:47:02 +02:00
Peter Krempa
ec272cd94e qemu: migration: Overwrite 'dname' only when NULL
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-25 16:22:36 +02:00
Peter Krempa
b9fab14b81 qemuMigrationDstPersist: Avoid multi-line ternary operator in function call
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-25 16:22:36 +02:00
Peter Krempa
a74fceb7d5 qemuMigrationDstFinishFresh: Avoid multi-line ternary operator in function call
Rewrite the code using a temporary variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-25 16:22:36 +02:00
Richard W.M. Jones
45912ac399 rpc: Pass OPENSSL_CONF through to ssh invocations
It's no longer possible for libvirt to connect over the ssh transport
from RHEL 9 to RHEL 5.  This is because SHA1 signatures have been
effectively banned in RHEL 9 at the openssl level.  They are required
to check the RHEL 5 host key.  Note this is a separate issue from
openssh requiring additional configuration in order to connect to
older servers.

Connecting from a RHEL 9 client to RHEL 5 server:

$ cat ~/.ssh/config
Host 192.168.0.91
  KexAlgorithms            +diffie-hellman-group14-sha1
  MACs                     +hmac-sha1
  HostKeyAlgorithms        +ssh-rsa
  PubkeyAcceptedKeyTypes   +ssh-rsa
  PubkeyAcceptedAlgorithms +ssh-rsa

$ virsh -c 'qemu+ssh://root@192.168.0.91/system' list
error: failed to connect to the hypervisor
error: Cannot recv data: ssh_dispatch_run_fatal: Connection to 192.168.0.91 port 22: error in libcrypto: Connection reset by peer

"error in libcrypto: Connection reset by peer" is the characteristic
error of openssl having been modified to disable SHA1 by default.
(You will not see this on non-RHEL-derived distros.)

You could enable the legacy crypto policy which downgrades security on
the entire host, but a more fine-grained way to do this is to create
an alternate openssl configuration file that enables the "forbidden"
signatures.  However this requires passing the OPENSSL_CONF
environment variable through to ssh to specify the alternate
configuration.  Libvirt filters out this environment variable, but
this commit allows it through.  With this commit:

$ cat /var/tmp/openssl.cnf
.include /etc/ssl/openssl.cnf
[openssl_init]
alg_section = evp_properties
[evp_properties]
rh-allow-sha1-signatures = yes

$ OPENSSL_CONF=/var/tmp/openssl.cnf ./run virsh -c 'qemu+ssh://root@192.168.0.91/system' list
root@192.168.0.91's password:
 Id   Name   State
--------------------

Essentially my argument here is that OPENSSL_CONF is sufficiently
similar in nature to KRB5CCNAME, SSH* and XAUTHORITY that we should
permit it to be passed through.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2062360
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-25 15:54:00 +02:00
Peter Krempa
8e2a043c32 cmdQemuMonitorCommandQMPWrap: Reset ignored errors from JSON parsing
'cmdQemuMonitorCommandQMPWrap' is checking whether the user provided
string is not valid JSON to avoid wrapping it. In cases where it's not
JSON we ignore the error and add the wrapper.

If the caller then reports a different non-libvirt error the error from
the JSON parsing would be printed as well. Reset errors we ignore:

 # virsh qemu-monitor-command cd --pass-fds a asdf
 error: Unable to parse FD number 'a'
 error: internal error: cannot parse json asdf: lexical error: invalid char in json text.
                                        asdf
                      (right here) ------^

In the above case 'asdf' is not valid JSON, but the code did wrap it
into '{"execute":"asdf"}', the only problem is the argument for
--pass-fds.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-25 12:25:02 +02:00
Peter Krempa
619d825a18 ci: Move builds from alpine-314 to alpine-315
'lcitool' dropped alpine-314

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-07-25 10:50:08 +02:00
Peter Krempa
f81d26f3b6 tests: qemucapabilities: Update test data for the qemu-7.1 cycle on x86_64
Update to v7.0.0-2780-g5288bee45f

Notable changes:
 - set-vcpu-dirty-limit/cancel-vcpu-dirty-limit/query-vcpu-dirty-limit command added
 - snapshot-save/snapshot-load command added
 - dirty-sync-missed-zero-copy migration statistic added
 - postcopy-preempt migration feature added
 - the 'copy-before-write' block driver gained:
    - 'cbw-timeout' property
    - 'on-cbw-error' property with values:
        - 'break-guest-write'
        - 'break-snapshot'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-07-25 10:50:03 +02:00
Michal Privoznik
e90d48ae6e virsh: Require --xpath for *dumpxml
Historically, the dumpxml command reject any unknown arguments,
for instance:

    virsh dumpxml fedora xxx

However, after v8.5.0-rc1~31 the second argument ('xxx') is
treated as an XPath, but it's not that clearly visible.
Therefore, require the --xpath switch, like this:

    virsh dumpxml fedora --xpath xxx

Yes, this breaks already released virsh, but I think we can argue
that the pool of users of this particular function is very small.
We also document the argument being mandatory:

   dumpxml [--inactive] [--security-info] [--update-cpu] [--migratable]
           [--xpath EXPRESSION] [--wrap] domain

The sooner we do this change, the better.

The same applies for other *dumpxml functions (net-dumpxml,
pool-dumpxml, vol-dumpxl to name a few).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2103524
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-07-25 09:50:21 +02:00
Temuri Doghonadze
8874d585d2 Translated using Weblate (Georgian)
Currently translated at 1.6% (178 of 10472 strings)

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

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
2022-07-25 08:19:01 +02:00
Göran Uddeborg
4bbe088331 Translated using Weblate (Swedish)
Currently translated at 39.8% (4181 of 10491 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-07-25 08:19:00 +02:00
Andrea Bolognani
5105409614 qemu: Add IOMMU device alias to command line
Note that we can only do this for intel-iommu and virtio-iommu,
which are configured using -device; smmuv3 is configured using
a machine type property, so there's no room on the command line
for an alias in that case.

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

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-22 17:38:09 +02:00
Andrea Bolognani
0ee76b1dfa qemu: Assign default alias to IOMMU devices
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-22 17:38:08 +02:00
Andrea Bolognani
f6d8952a00 schema: Allow IOMMU devices to have aliases
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-22 17:37:56 +02:00
Michal Privoznik
a1dd3576b5 qemu_hotplug: Create chardev files before attempting to relabel them
When hotplugging a chardev, Libvirt opens corresponding
file/binds to a socket/does whatever necessary to obtain an FD
that is later passed to QEMU. However, due to wrong placement of
the function that does all of this
(qemuProcessPrepareHostBackendChardevHotplug()) it may happen
that a file is set seclabel on, only to be unlink()-ed and
created again (the former is done by
qemuSecuritySetChardevLabel(), the latter by aforementioned
function). The unlink()-ing is done for UNIX sockets with
mode='bind' and happens inside qemuOpenChrChardevUNIXSocket().
However, these steps can be swapped simply.

Fixes: ad81aa8ad0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2022-07-22 15:14:44 +02:00
Michal Privoznik
14f42129fc qemu_hotplug: Close FDs in QEMU on failed chardev hotplug
When hotplugging a chardev, Libvirt opens corresponding
file/binds to a socket/does whatever necessary to obtain an FD
that is later passed to QEMU. However, if something fails after
the FDs were transferred to QEMU and before chardev is actually
added via monitor, these FDs are never closed in QEMU. This is
rather suboptimal.

Fixes: 15bdced9b3
Fixes: ad81aa8ad0
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2022-07-22 15:14:44 +02:00
Kristina Hanicova
7437f35642 domain_conf: rewrite if else functions to switch
Pattern of using switch instead of a long if else construction is
used everywhere, so I used it here as well to make the code more
consistent (and remove that else after return). I also included
all the values from the enum.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:57:13 +02:00
Kristina Hanicova
d90c92adb6 domain_conf: remove else after return / goto
The else branches are redundant because the execution will never
reach them if the conditions in the previous 'if' branches are
true.

I think this looks cleaner and is more readable, because having
'else' branch indicates that no return / break / goto is in the
previous branch and the function can reach it.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:57:11 +02:00
Kristina Hanicova
ff35ce0b5b domain_conf: rewrite variable setting
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:57:09 +02:00
Kristina Hanicova
bad1206ce9 domain_conf: rewrite conditions in virDomainObjWaitUntil()
This patch rewrites conditions to make the code easier to read and less
nested.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:57:07 +02:00
Kristina Hanicova
0f729b6ce0 domain_conf: use early return in virDomainObjAssignDef()
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:57:05 +02:00
Kristina Hanicova
af8a241816 domain_conf: extend switch in virDomainChrDefFree()
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:57:03 +02:00
Kristina Hanicova
e496588960 domain_conf: remove breaks after return in virDomainChrSourceDefIsEqual()
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:57:01 +02:00
Kristina Hanicova
f08d9efc4d domain_capabilities: reformat virDomainCapsCPUCustomFormat()
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:56:59 +02:00
Kristina Hanicova
27d4ba02ee domain_capabilities: reformat virDomainCapsFeatureSEVFormat()
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:56:57 +02:00
Kristina Hanicova
54412f01b2 domain_capabilities: use early return in virDomainCapsFeatureSEVFormat()
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-22 12:56:55 +02:00
Martin Kletzander
69e0e33873 qemu_migration: Acquire correct job in qemuMigrationSrcIsAllowed
Commit 6262752460 added the acquiring of a job, but it is not always
VIR_ASYNC_JOB_MIGRATION_OUT, so the code fails when doing save or anything else.
Correct the async job by passing it from the caller as another parameter.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-22 12:47:32 +02:00
Peter Krempa
1122b16276 virclosecallbacks: Remove unused virCloseCallbacksGetConn
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-22 11:11:42 +02:00
Peter Krempa
8eeb284499 virLXCProcessReboot: Remove the need to re-register autodestroy callback
Add a new flag VIR_LXC_PROCESS_CLEANUP_AUTODESTROY to
virLXCProcessCleanupFlags for skipping removal of the autodestroy
callback so that fake reboot of the container doesn't need to fetch the
connection and re-register it.

Since virLXCProcessReboot is defined before virLXCProcessCleanupFlags,
this patch also moves the flag enum typedef to the beginning of the
file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-22 11:11:42 +02:00
Peter Krempa
6d155a5a8e virLXCProcessAutostartDomain: Refactor control flow and variable use
Use automatic unlocking of the 'vm' object, so that we can return early
when no autostart is needed and avoid passing of the 'driver' object
which is already present in 'vm's' private data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-22 11:11:42 +02:00
Peter Krempa
5cd1656463 virLXCProcessAutostartAll: Remove unused 'conn'
The connection object is not needed when autostarting containers so we
can remove the machinery for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-22 11:11:42 +02:00
Peter Krempa
5b15917730 virLXCProcessReboot: Simplify cleanup
Remove the pointless 'cleanup' section and 'ret' variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-22 11:11:42 +02:00
Peter Krempa
ed0507b58a virLXCProcessStart: Pass in virConnect object only when registering autodestroy
The function doesn't really need the connect object for anything besides
registering the autodestroy callback for it. If we merge it certain
callers can be simplified.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-22 11:11:42 +02:00
Peter Krempa
e44a5f43cb virLXCProcessStop: Add 'cleanupFlags' parameter
Add possibility for the caller to set the flags for the call to
'virLXCProcessCleanup'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-22 11:11:42 +02:00
Laine Stump
25883cd5f0 qemu: skip hardcoded hostdev migration check if QEMU can do it for us
libvirt currently will block migration for any vfio-assigned device
unless it is a network device that is associated with a virtio-net
failover device (ie. if the hostdev object has a teaming->type ==
VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT).

In the future there will be other vfio devices that can be migrated,
so we don't want to rely on this hardcoded block. QEMU 6.0+ will
anyway inform us of any devices that will block migration (as a part
of qemuDomainGetMigrationBlockers()), so we only need to do the
hardcoded check in the case of old QEMU that can't provide that
information.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-21 11:12:46 -04:00
Laine Stump
2dd5587f1d qemu: don't try to query QEMU about migration blockers during offline migration
The new code that queries QEMU about migration blockers was put at the
top of qemuMigrationSrcIsAllowed(), but that function can also be
called in the case of offline migration (ie when the domain is
inactive / QEMU isn't running). This check should have been put inside
the "if (!(flags & VIR_MIGRATE_OFFLINE))" conditional, so let's move
it there.

Fixes: 156e99f686
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-21 11:12:44 -04:00
Jiri Denemark
6262752460 qemu_migration: Use EnterMonitorAsync in qemuDomainGetMigrationBlockers
The code is run with an async job and thus needs to make sure a nested
job is acquired before entering the monitor.

While touching the code in qemuMigrationSrcIsAllowed I also fixed the
grammar which was accidentally broken by v8.5.0-140-g2103807e33.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-21 17:02:13 +02:00
Kristina Hanicova
356669955a CH: use virDomainObjInitJob()
This patch removes and replaces virCHDomainObjInitJob() with
general virDomainObjInitJob().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-21 15:02:51 +02:00
Kristina Hanicova
f78e59c197 LXC: use virDomainObjInitJob()
This patch removes and replaces virLXCDomainObjInitJob() with
general virDomainObjInitJob().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-21 15:02:49 +02:00
Kristina Hanicova
6c1dec40a2 libxl: use virDomainObjInitJob()
This patch removes and replaces libxlDomainObjInitJob() with
general virDomainObjInitJob().

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-21 15:02:47 +02:00
Kristina Hanicova
260a091982 qemu & hypervisor: move qemuDomainObjInitJob() into hypervisor
This patch moves qemuDomainObjInitJob() as virDomainObjInitJob()
into hypervisor in order to be used by other drivers as well.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-21 15:02:44 +02:00
Michal Privoznik
f87dc1c49e qemu_cgroup: Introduce qemuCgroupAllowDevicesPaths()
We have qemuCgroupAllowDevicePath() which sets up devices
controller for just one path. And if we have more paths we have
to call it in a loop. So far, we have just one such place, but
soon we'll have another one (for SGX memory). Separate the loop
into its own function so that it can be reused.

And while at it, move setting the default set of devices as the
first thing, right after all devices are disallowed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-21 14:49:42 +02:00
Michal Privoznik
086bbbad09 qemu_cgroup: Avoid ternary operator when setting @deviceACL
Inside of the qemuSetupDevicesCgroup() there's @deviceACL
variable, which points to a string list of devices that are
allowed in devices controller by default. This list can either
come from qemu.conf (cfg->cgroupDeviceACL) or from a builtin
@defaultDeviceACL. However, a multiline ternary operator is used
when setting the variable which is against our coding style.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-21 14:45:50 +02:00
Eugenio Pérez
2103807e33 qemu: remove hardcoded migration fail for vDPA devices if we can ask QEMU
vDPA devices will be migratable soon, so we shouldn't unconditionally
block migration of any domain with a vDPA device. Instead, we should
rely on QEMU to make the decision when that info is available from the
query-migrate QMP command (QEMU versions too old to have that info in
the results of query-migrate don't support migration of vDPA devices,
so in that case we will continue to unconditionally block migration).

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2022-07-21 00:58:06 -04:00
Eugenio Pérez
156e99f686 qemu: query QEMU for migration blockers before our own harcoded checks
Since QEMU 6.0, if QEMU knows that a migration would fail,
'query-migrate' will return an array of error strings describing the
migration blockers.  This can be used to check whether there are any
devices/conditions blocking migration.

This patch adds a call to this query at the top of
qemuMigrationSrcIsAllowed().

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2022-07-21 00:58:06 -04:00
Eugenio Pérez
7e52c4839f qemu: new function to retrieve migration blocker reasons from QEMU
Since QEMU 6.0, if migration is blocked for some reason,
'query-migrate' will return an array of error strings describing the
migration blockers.  This can be used to check whether there are any
devices, or other conditions, that would cause migration to fail.

This patch adds a function that sends this query via a QMP command and
returns the resulting array of reasons. qemuMigrationSrcIsAllowed()
will be able to use the new function to ask QEMU for migration
blockers, instead of the hardcoded guesses that libvirt currently has.

Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2022-07-21 00:58:06 -04:00
Jonathon Jongsma
1e9d84d9f9 qemu: introduce capability QEMU_CAPS_MIGRATION_BLOCKED_REASONS
since qemu 6.0, if migration is blocked for some reason, 'query-migrate'
will return an array of error strings describing the migration blockers.
This can be used to check whether there are any devices blocking
migration, etc.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2022-07-21 00:58:06 -04:00
Jan Kuparinen
ccfdc6b029 Translated using Weblate (Finnish)
Currently translated at 22.8% (2388 of 10472 strings)

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

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2022-07-20 16:57:05 +02:00
김인수
187c9b7363 Translated using Weblate (Korean)
Currently translated at 100.0% (10472 of 10472 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-07-20 16:57:05 +02:00
minglei.liu
3078799fef qemu: support CDROM hotplug cdrom with USB/SCSI bus
QEMU supports hotplug of a cdrom device with USB or SCSI bus. Just
unblock these devices in qemuDomainAttachDeviceDiskLiveInternal() and
qemuDomainDetachPrepDisk().

Fixes: https://gitlab.com/libvirt/libvirt/-/issues/261

Signed-off-by: minglei.liu <minglei.liu@smartx.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 16:53:51 +02:00
Han Han
7b28561c85 schemas: Update ref acpi for devices
According to a9fe9569ab, the <acpi index='NNN'/> is only for PCI
devices. Remove the ref acpi from devices channel, smartcard, tpm,
redirdev, panic, hub because none of them has PCI address. And add the
ref acpi to iommu device.

Fixes: a9fe9569ab
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 14:59:26 +02:00
Kristina Hanicova
3945327839 domain_conf: rewrite if else condition
This patch prevents nesting of if conditions and makes the code
cleaner.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 14:54:30 +02:00
Kristina Hanicova
dc0ae3a50f CH: use virDomainJobObj
This patch replaces struct virCHDomainJobObj with generalized
virDomainJobObj.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 14:43:23 +02:00
Kristina Hanicova
c228910d26 libxl: use virDomainJobObj
This patch replaces struct libxlDomainJobObj with generalized
virDomainJobObj.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 14:43:22 +02:00
Kristina Hanicova
fb2fdba2f0 LXC: use virDomainJobObj
This patch replaces struct virLXCDomainJobObj with generalized
virDomainJobObj.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 14:43:20 +02:00
Kristina Hanicova
e8046532a7 hypervisor: domain_job: rename members in virDomainObjPrivateJobCallbacks
This patch alters members of virDomainObjPrivateJobCallbacks to
make the code more consistent.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 14:43:19 +02:00
Kristina Hanicova
badb7972fd qemu & hypervisor: move job object into hypervisor
This patch moves qemuDomainJobObj into hypervisor/ as generalized
virDomainJobObj along with generalized private job callbacks as
virDomainObjPrivateJobCallbacks.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 14:43:14 +02:00
Kristina Hanicova
2e480f0c64 hypervisor: domain_job: add and edit description
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 14:35:19 +02:00
Kristina Hanicova
34c9782d28 qemu: domainjob: remove async variable from qemuDomainObjBeginJobInternal()
This patch removes variable 'async', which is used only once, and
replaces it with direct comparison with an enum member.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-20 14:34:15 +02:00
Jonathon Jongsma
f52dbac93f conf: add missing break on a switch case
This was not causing any problems because all cases below were empty,
but in order to avoid future misbehavior, add a break to this case.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-19 10:59:08 -05:00
Michal Privoznik
a9d1c08b71 domain_conf: Switch to virBufferAddLit for literal strings
There's no need to use virBufferAddStr() for literal strings
without any newline character as it's more expensive than
virBufferAddLit().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-19 14:24:28 +02:00
Michal Privoznik
4e39625095 qemu_capabilities: Indent <cpudata/> properly
When formatting qemuCaps XML, the <cpudata/> element is
misaligned. This is because it contains multiple lines and
virBufferAsprintf() does not expect that. Switch to
virBufferAddStr() which does.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-19 14:24:20 +02:00
Michal Privoznik
9e8601c464 lib: Use G_NO_INLINE instead of G_GNUC_NO_INLINE
The G_GNUC_NO_INLINE macro will eventually be marked as
deprecated [1] and we are recommended to use G_NO_INLINE instead.
Do the switch now, rather than waiting for compile time warning
to occur.

1: 15cd0f0461
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-07-18 17:23:15 +02:00
Michal Privoznik
b9e3ab53e5 glibcompat: Provide implementation for G_GNUC_NO_INLINE
Currently, we require glib-2.56.0 at minimum (because of RHEL-8)
but we use G_GNUC_NO_INLINE which was introduced in 2.58.0. While
we provide an implementation for older versions, where the macro
does not exists, it's a bit more tricky than that. Since we
define GLIB_VERSION_MAX_ALLOWED we would get a compile time error
when trying to use something too new, except for G_GNUC_NO_INLINE
which was intentionally not marked as
GLIB_AVAILABLE_MACRO_IN_2_58. But this is about to change with
glib-2.73.2 (which contains commit [1]).

At the same time, we can't just bump glib and thus we have to
provide an alternative implementation without the version
annotation.

1: a6f8fe071e
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-07-18 17:23:15 +02:00
Tim Wiederhake
57d263d6a3 docs: Fix typos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-18 11:10:55 +02:00
Jonathon Jongsma
62ca300530 util: remove virObjectUnref() adapters
These wrapper functions were used to adapt the virObjectUnref() function
signature for different callbacks. But in commit 0d184072, the
virObjectUnref() function was changed to return a void instead of a
bool, so these adapters are no longer necessary.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-07-15 16:44:39 -05:00
Peter Krempa
d531b9c724 qemu: monitor: Remove unused migration property getters/setters
The getters/setters for individual properties of migration
speed/downtime/cache size are unused once we switched to setting them
purely via migration parameters. Remove the unused helpers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-15 15:57:10 +02:00
Peter Krempa
e2b86ffa19 qemu: capabilities: Retire QEMU_CAPS_MIGRATION_PARAM_XBZRLE_CACHE_SIZE
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-15 15:57:10 +02:00
Peter Krempa
06e0ba3da7 qemu: Always assume support for QEMU_CAPS_MIGRATION_PARAM_XBZRLE_CACHE_SIZE
The 'xbzrle-cache-size' parameter was added in qemu-2.11 thus all
supported qemu versions now use the new code path.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-15 15:57:10 +02:00
Peter Krempa
af2d983567 qemu: capabilties: Retire QEMU_CAPS_MIGRATION_PARAM_DOWNTIME
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-15 15:57:10 +02:00
Peter Krempa
70d141fea5 qemu: driver: Always assume support for QEMU_CAPS_MIGRATION_PARAM_DOWNTIME
The 'downtime-limit' field of 'migrate-set-parameters' was introduced in
qemu-2.8, thus all qemu versions supported by libvirt use the new code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-15 15:57:10 +02:00
Peter Krempa
ce761753d3 qemu: capabilities: Retire QEMU_CAPS_MIGRATION_PARAM_BANDWIDTH
The parameter is supported since qemu-2.8.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-15 15:57:10 +02:00
Peter Krempa
6810cc45f7 qemu: Always assume support for QEMU_CAPS_MIGRATION_PARAM_BANDWIDTH
The 'max-bandwidth' field was added as argument of
'migrate-set-parameters' in qemu-2.8, thus all qemu version supported by
libvirt already use the new code path.

This patch assumes the presence and removes the legacy code paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-15 15:57:09 +02:00
Erik Skultety
c341989fa1 docs: ci: Add a brief section on how to run the CI workload locally
This is just a glue to the testing article introduced in previous
commits.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-15 08:26:38 +02:00
Erik Skultety
659ac70281 docs: ci: Add a section on how to add a new platform to libvirt CI
Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-15 08:26:34 +02:00
Erik Skultety
294b5a9821 docs: ci: Add info about the two major types of jobs our CI runs
Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-15 08:26:29 +02:00
Erik Skultety
4df9845bb9 docs: Change the CI headline from "CI Testing" to "CI"
It's not just strategy the master CI article talks (or will talk in the
future) about.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-15 08:26:25 +02:00
Erik Skultety
77ab90f0a2 docs: Drop the testsuites article
The article was replaced with a new one in previous commit, so we don't
need this one anymore.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-15 08:26:25 +02:00
Erik Skultety
200ab55980 docs: Replace testsuites article with the new 'testing' article
The new article provides more in-depth information on testing options
in libvirt.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-15 08:26:25 +02:00
Erik Skultety
5d9e41ee77 docs: Provide an article on testing
Currently we don't have much information on how testing is done in
libvirt and the little we have is scattered among multiple files. This
patch creates a common landing page containing all important bits about
testing in libvirt, providing links to respective sections which
deserve their own articles.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-15 08:26:13 +02:00
Erik Skultety
1dc037ec17 docs: Provide an article on how to add a custom runner to the project
Since running our functional test suite in GitLab cannot make use of
the shared resources it makes sense to document the process of adding
own HW to run the custom libvirt executor that powers the integration
suite. This article will likely make even more sense in the future with
GitLab severely cutting down on shared CI resources.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-14 17:31:21 +02:00
Erik Skultety
0be5de986a docs: Provide more information about the TCK test suite
Most importantly, how to get it, how install dependencies and how
to run it.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-14 17:31:21 +02:00
Erik Skultety
983cf8c03b docs: Move the CI dashboard to its own RST module
The dashboard itself simply takes away focus from everything else that
makes sense to have in the CI article, so move it to it's own article
and link it from the main CI article.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-14 17:31:21 +02:00
Göran Uddeborg
f02a579b61 Translated using Weblate (Swedish)
Currently translated at 39.4% (4141 of 10491 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-07-13 17:16:42 +02:00
Piotr Drąg
68a3acbbea Translated using Weblate (Polish)
Currently translated at 22.2% (2328 of 10472 strings)

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

Co-authored-by: Piotr Drąg <piotrdrag@gmail.com>
Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2022-07-13 17:16:42 +02:00
Michal Privoznik
265d49896d qemu: Generate cmd line for guestReset
QEMU offers two attributes for handling reset requests of an USB
host device: guest-reset and guest-resets-all. When combined they
act as follows:

1) guest-reset=false
   The guest is not allowed to reset the physical USB device.

2) guest-reset=true,guest-resets-all=false
   The guest is allowed to reset the device when it is not yet
   initialized (aka no USB bus address assigned). Usually this results
   in one guest reset being allowed. This is the default behavior.

3) guest-reset=true,guest-resets-all=true
   The guest is allowed to reset the device as it pleases.

Now, there's a clear 1:1 mapping with our representation of
guestReset, so generating cmd line is trivial.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 16:01:14 +02:00
Michal Privoznik
10a353c92c qemu_validate: Validate that QEMU's capable of guestReset
Now that we have a capability, validate that the QEMU we are
talking to has everything we need for guestReset.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 16:01:11 +02:00
Michal Privoznik
0738d339a3 qemu_capabilities: Track usb-host.guest-resets-all capability
We will need two attributes of usb-host device to set:
guest-reset and guest-resets-all. The former was introduced in
QEMU v4.0.0-rc0~56^2 and the other in v4.2.0-rc1~9^2. Hence,
track the latter only as it's only starting from that commit when
QEMU has both attributes.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 16:00:59 +02:00
Michal Privoznik
85ea114016 conf: Introduce @guestReset to hostdev's <source/>
Some USB devices have a buggy firmware that either crashes on
device reset, or make the device unusable in some other way.
Fortunately, QEMU offers a way to skip device reset either
completely, or if device is not initialized yet. Expose this
ability to users under:

    <hostdev mode='subsystem' type='usb'>
      <source guestReset='off'/>
    </hostdev>

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 16:00:50 +02:00
Michal Privoznik
dcfbfffd6a tests: Fix qemu replies wrt usb-host properties
My commit of v6.9.0-rc1~457 was a bit too harsh. While it served
its purpose (adding usb-host.hostdevice capability) it has a side
effect: because I copied reply from qemu-5.1.0 to older .replies
files one might now think that say qemu-3.1.0 supports both
.guest-reset and .guest-resets-all properties. But in fact it
doesn't. There are three problematic properties:

1) guest-reset, introduced in v4.0.0-rc0~56^2
2) guest-resets-all introduced in v4.2.0-rc1~9^2
3) suppress-remote-wake introduced in v5.0.0-rc0~148^2~4

Remove these properties from versions that could not have had
them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 16:00:41 +02:00
Michal Privoznik
94ae42fd25 tests: Update hostdev-usb-* hostdev-pci-* xml2xml and xml2argv tests
Currently, we have bunch of PCI/USB tests cases for
qemuxml2argvtest and qemuxml2xmltest but all of them run without
any capabilities. This makes is needlessly complicated when
trying to extend them. Switch to DO_TEST_CAPS_LATEST().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 15:42:08 +02:00
Daniel P. Berrangé
c748000cd1 docs: replace ARRAY_CARDINALITY with G_N_ELEMENTS
Fix docs illustrating call with an obsolete macro.

Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-13 12:18:06 +01:00
Daniel P. Berrangé
497d8555c4 docs: add info about factors affecting CPU compatibility
While libvirt solves most of the problem of ensuring compatibility, when
there is incompatibility it can be hard for users to track down the
cause. Everything knows to check the physical CPU model, but there are a
surprisingly large number of other factors influencing compatibility.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-13 11:04:29 +01:00
Michal Privoznik
3ff558c1c1 virsh: Implement --config for iothreadset
Our man page already documents that iothreadset has --config
argument. Well, it doesn't really. Normally, I'd just fix the man
page, but with recent work on the API it's possible to tweak
values for inactive XML too. Therefore, implement the --config
argument for the command.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 11:55:06 +02:00
Michal Privoznik
3096965ce7 qemuDomainSetIOThreadParams: Accept VIR_DOMAIN_AFFECT_CONFIG flag
It was always possible to modify the inactive XML, because
VIR_DOMAIN_AFFECT_CURRENT (= 0) is accepted implicitly. But now
that the logic when changing both config and live XMLs is more
robust we can accept VIR_DOMAIN_AFFECT_CONFIG flag too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 11:55:06 +02:00
Michal Privoznik
6db9c95a45 qemu: Make IOThread changing more robust
There are three APIs that allow changing IOThreads:

  virDomainAddIOThread()
  virDomainDelIOThread()
  virDomainSetIOThreadParams()

In case of QEMU driver these are handled by
qemuDomainChgIOThread() which attempts to be versatile enough to
work on both inactive and live domain definitions at the same
time. However, it's a bit clumsy - when a change to live
definition succeeds but fails in inactive definition then there's
no rollback. And somewhat rightfully so - changes to live
definition are in general harder to roll back. Therefore, do what
we do elsewhere (qemuDomainAttachDeviceLiveAndConfig(),
qemuDomainDetachDeviceAliasLiveAndConfig(), ...):

  1) do the change to inactive XML first,
  2) in fact, do the change to a copy of inactive XML,
  3) swap inactive XML and its copy only after everything
     succeeded.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 11:55:06 +02:00
Michal Privoznik
5aa2495854 domain_conf: Format iothread IDs more often
When formatting IOThreads (in virDomainDefIOThreadsFormat()), we
may only output the number of IOThreads, or the full list of IOThreads too:

  <iothreads>4</iothreads>
  <iothreadids>
    <iothread id='1' thread_pool_max='10'/>
    <iothread id='2' thread_pool_min='2' thread_pool_max='10'/>
    <iothread id='3'/>
    <iothread id='4'/>
  </iothreadids>

Now, the deciding factor here is whether those individual
IOThreads were so called 'autofill-ed' or user provided. Well, we
need to take another factor in: if an IOThread has pool size
limit set, then we ought to format the full list.

But how can we get into a situation when a thread is autofilled
(i.e. not provided by user in the XML) and yet it has pool size
limit set? virDomainSetIOThreadParams() is the answer.

Sure, we could also unset the autofill flag whenever a pool size
limit is being set. But this approach allows us to not format
anything if the limits are reset (we don't lose the autofill
information).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 11:55:06 +02:00
Michal Privoznik
24fa7004e4 domain_conf: Format <defaultiothread/> more often
The <defaultiothread/> element is formatted inside
virDomainDefaultIOThreadDefFormat() which is called only from
virDomainDefIOThreadsFormat() (so that IOThread related stuff is
formatted calling one function). However, when there are no
<iothreadids/> defined (or only autoallocated ones are present),
then the outer formatting function exits early never calling the
<defaultiothread/> formatter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 11:55:06 +02:00
Michal Privoznik
430ab88ab1 qemu: Report supported TPM version in domcaps
Now that we have everything prepared, we can start detecting
supported TPM versions and setting corresponding values in
backendModel struct.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/340
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2103119
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-07-13 11:55:06 +02:00
Michal Privoznik
1277a9c884 domcaps: Introduce TPM backendVersion
We accept TPM version in the domain XML. However, supported
version depends on the host (swtpm_setup binary) and thus it may
be tricky for users (or mgmt applications) chose a version.
Introduce machinery for reporting supported version in domain
capabilities.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-07-13 11:55:06 +02:00
Michal Privoznik
7b37763278 virtpm: Introduce TPM-1.2 and TPM-2.0 capabilieis
These new capabilities will be used only to track whether
swtpm_setup is capable of TPM-1.2 and/or TPM-2.0.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-07-13 11:55:06 +02:00
Michal Privoznik
6a00c565c4 docs: Document TPM portion of domcaps
Surprisingly, we don't document TPM part of domain capabilities.
Fortunately, the information exposed is pretty much self
explanatory, but we should document it regardless.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-07-13 11:55:06 +02:00
Peter Krempa
b8e94066f0 remote: conf: Mention that 'virtproxyd' doesn't require the '--listen' flag
'virtproxyd' doesn't have the '--listen' parameter and it's enough just
to enable the corresponding option in the config.

The config file is generic for all the daemons and we just omit/adjust
some sections. Adding a separate mechanism to omit the note about the
'--listen' parameter would be overkill so mention explicitly that it's
required only for libvirtd and not virtproxyd.

The section is omitted for other daemons.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2094641
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-07-13 09:28:04 +02:00
Peter Krempa
f99808ff25 qemuxml2*test: Add 'startupPolicy' fields to aio-io_uring case
Extend the test for io_uring to also test startup policy.

Since the actual logic for dropping disks is in the host preparation
phase, thus skipped for tests we can use any file path.

Add a case also for 'file' backing to have all cases covered.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-13 09:27:06 +02:00
Peter Krempa
b7e05cf966 docs: formatstorage: Format XML namespace definition as code block
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2022-07-12 11:33:37 +02:00
Michal Privoznik
d33c2a9e2f vircpi: Add PCIe 5.0 and 6.0 link speeds
The PCIe 5.0 and PCIe 6.0 standards define new link speeds:
32GT/s and 64GT/s, respectively. Update our internal enum to
include these new speeds. Otherwise we format incorrect XML:

  <pci-express>
    <link validity='cap' port='0' speed='(null)' width='16'/>
    <link validity='sta' speed='16' width='16'/>
  </pci-express>

Like all "good" specifications, these are also locked behind a
login portal. But we can look at pciutils' source code: [1] and
[2].

1: https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git/commit/ls-caps.c?id=caca31a0eea41c7b051705704c1158fddc02fbd2
2: https://git.kernel.org/pub/scm/utils/pciutils/pciutils.git/commit/ls-caps.c?id=5bdf63b6b1bc35b59c4b3f47f7ca83ca1868155b

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2105231
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-12 09:07:45 +02:00
Peter Krempa
7cd8f51b97 ci: Regenerate files with new lcitool
Apart from other changes this fixes failures with builds on FreeBSD.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-07-11 15:53:54 +02:00
Peter Krempa
9adeafac81 qemucapabilitiestest: Fake proper version for 'caps_4.2.0.aarch64' case
The capabilities for that version were not updated from the development
version and thus would fail our upcoming minimum version change. Fake
the data to report 4.2.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
7a3f48247e qemucapabilitiestest: Fake proper version for 'caps_4.2.0.ppc64' case
The capabilities for that version were not updated from the development
version and thus would fail our upcoming minimum version change. Fake
the data to report 4.2.0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
8eb8096556 qemu: Remove qemu-4.0 version of 'cpu-translation' test case
The cpu commandline is identical with the '-latest' version so there's
no need for a separate case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
ed150afb4e qemuxml2argvtest: Move real-caps versions of cpu-host tests out of the block setting fake host cpu
Make it obvious that the fake cpu does not apply to the test cases based
on real capabilities.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
061224892c qemuxml2argvtest: Make 'qemu-ns' test case more stable
The test was showing that the 'blockdev' capability is properly added
although we didn't detect it yet. Unfortunately this test can't be
carried over once we bump minimum qemu version to qemu-4.2.

Make the test case future-proof by removing the qemu-4.0.0 version which
would become pointless and use only already deprecated capability flags
so that the test output does not change.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
5177143117 qemuxml2argvtest: Convert 'net-user' case to _LATEST
The tested net device has the same syntax with latest qemu so there's no
need to have a version-locked test for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
dc231a1d38 qemuxml2argvtest: Remove qemu-4.0 versions of cpu feature test cases
The cpu feature formatting doesn't change between the versions thus we
can just keep the '-latest' versions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
5579ff564b qemuxml2argvtest: Convert 'cpu-eoi-(disabled|enabled)' cases to VIR_TEST_CAPS_LATEST
The tested feature doesn't change across versions so we can use the
modern testing infrastructure.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
92f1f61e5b qemuxml2argvtest: Drop 'qemu-4.1' versions of hyperv tests
The version-locked version of the test data is identical to the 'latest'
version so we can remove them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
dcd30a3bf3 qemuxml2(argv|xml)test: Drop qemu-3.1 version of 'cpu-Icelake-Server-pconfig'
Prior to qemu-3.2 we'd have to disable the 'pconfig' feature explicitly
which is no longer needed with new qemu. Remove the version locked to
qemu-3.1 as the 'latest' case sufficiently handles what we want to test.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:28 +02:00
Peter Krempa
48e049dca3 test: domaincaps: Remove old test data
Remove the test data for qemu-2.11, qemu-2.12 and qemu-3.0 which are no
longer supported.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-11 12:48:27 +02:00
Michal Privoznik
3547875f3a qemu_monitor_json: Implement logic for setting iothread.thread-pool-{min,max}
When virDomainSetIOThreadParams() API is called, well its QEMU
impl: qemuDomainSetIOThreadParams() then typed params are parsed
by qemuDomainIOThreadParseParams() into this
qemuMonitorIOThreadInfo struct. In the struct we have a <int,
bool> pair for every IOThread attribute we can tune through
monitor. The struct is then passed to
qemuMonitorJSONSetIOThread() which looks at the bool and if set
then the corresponding attribute is set to given value. Each
attribute is thus changed in a separate call. While this works
for attributes independent of each other ("poll-max-ns",
"poll-grow", "poll-shrink"), it does not always work for the
other attributes ("thread-pool-min" and "thread-pool-max").

The limitation here is that the lower boundary (minimum) has to
be lower (or equal to) the upper boundary (maximum) at all times.

This means, that in some cases we might need to set attributes in
reversed order to meet the constraint.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/339
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-07 17:39:19 +02:00
Göran Uddeborg
49a32cd8cb Translated using Weblate (Swedish)
Currently translated at 39.0% (4101 of 10491 strings)

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

Translated using Weblate (Swedish)

Currently translated at 38.7% (4062 of 10491 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-07-07 14:38:52 +02:00
Peter Krempa
c37ebda93a kbase: debuglogs: Add a note about auto-shutdown of daemons
When using runtime setting of logging with 'virt-admin' it can be
confusing that the settings are discarded when the shutdown timeout of a
daemon is reached.

Add a note about this behaviour along with a suggestion to use
virt-admin to disable the behaviour if needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-07 14:35:30 +02:00
Peter Krempa
fe69f5074a virt-admin: Introduce 'daemon-timeout'
Add a simple command to drive the new 'virAdmConnectSetDaemonTimeout'
API.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-07 14:35:30 +02:00
Peter Krempa
8b2bf0f1d7 admin: Introduce virAdmConnectSetDaemonTimeout
Use of the admin APIs to modify logging temporarily has a rather serious
deficiency when the daemon whose config is being changed is using
auto-shutdown (default with socket-activated deployments) as the
configuration is discarded if there is no client or VM/other object
blocking auto shutdown.

This API allows users to disable/postpone shutdown timeout so that the
configuration doesn't change under their hands.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-07 14:35:30 +02:00
Peter Krempa
12a76fb81e scripts: apibuild: Improve error when API is missing from symbol file
Improve:

 KeyError: 'virAdmConnectSetDaemonTimeout'

to

 Exception: Missing symbol file entry for 'virAdmConnectSetDaemonTimeout'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-07 14:35:30 +02:00
Peter Krempa
c53e0c9535 virNetDaemonAutoShutdown: Allow live update of shutdown timeout
Modify the code so that calling 'virNetDaemonAutoShutdown' will update
the auto shutdown timeout also for running daemons.

This involves changing the logic when to do the update of the timer so
that it can be called from both when the daemon is not yet runnign and
when doing a live update.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-07 14:35:30 +02:00
Peter Krempa
fbc18725f2 virnetdaemon: Extract autoShutdownTimer operations from virNetDaemonRun
Introduce 'virNetDaemonShutdownTimerRegister' and
'virNetDaemonShutdownTimerUpdate' to aggregate the code to deal with the
auto-shutdown timer.

The code is also placed so that it can be called from
'virNetDaemonAutoShutdown' which involved the move of
'virNetDaemonAutoShutdownTimer'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-07 14:35:30 +02:00
Michal Privoznik
cc161c26d0 domain_postparse: Move error messages onto single line
Our coding style suggests 80 chars per line with error messages
being exception (for easier git-grep). Apply this exception onto
the newly created domain_postparse.c file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-07 14:32:26 +02:00
Michal Privoznik
d9916c3519 conf: Separate domain post parse code into domain_postparse.c
The domain post parse functions currently live in domain_conf.c
which thus grows always larger. Mimic what we've done for the
validation code and move the post parse code into a separate
file: domain_postparse.c.

I've started by moving every function with PostParse in its name
into the new file and then compile hunting for helper functions
only to move them as well.

In the end, I've moved virDomainDefPostParse symbol in
libvirt_private.syms into a new section. And while
virDomainDeviceDefPostParseOne() is made 'public' in
domain_postparse.h too, I'm not exporting it because it has no
caller outside src/conf/ and it's unlikely it ever will.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-07 14:32:21 +02:00
Michal Privoznik
531b62950f domain_conf: Unexport virDomainDefPostParseDeviceIteratorData
The virDomainDefPostParseDeviceIteratorData struct is exported in
domain_conf.h because it's used in both domain_conf.c and
domain_validate.c. However, the latter usage is not warranted,
it's just a shortcut so that we don't have to introduce a similar
struct just for domain_validate.c. Well, do the extra step and
introduce a separate structure for domain_validate.c. This allows
us to move post parse code later on.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-07 14:32:11 +02:00
Han Han
89c16bf9dd virt-xml-validate: Fix incorrect wildcards for XML roots
To match the XML roots domainCapabilities and storagepoolCapabilities,
the wildcards should be *domainCap* and *storagepoolCap*.

Fixes: 7b0e2e4a55
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-07 12:21:16 +02:00
Han Han
19c8da1d4c schemas: rng: Make secret optional in storage vol
For a qcow2 storage volume with luks encryption created by qemu-img, its
dumped storage vol XML has no secret element in encryption:
<volume type='file'>
    ...
    <encryption format='luks'>
    </encryption>
    ...
</volume>

That will cause a failure in rng validation. Fix that validation failure.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-07 12:18:17 +02:00
Han Han
2ee82b3dfb docs: Fix syntax error in defaultiothread example
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-07 12:14:02 +02:00
Michal Privoznik
35609616a2 domain_validate: Properly terminate switch() in virDomainIOMMUDefValidate()
In my previous commit I've introduced virDomainIOMMUDefValidate()
function with a switch() statement. However, two cases in it,
though empty, were not terminated with a break statement which
made compiler complain.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-04 15:45:27 +02:00
Michal Privoznik
43e9d322be domain_validate: Disallow non-virtio IOMMU with an <address/>
Per v8.3.0-rc1~199 it's only a virtio IOMMU that can have
<address/>. The rest (Intel and SMMUv3) are system devices and
thus have no address associated with them. However, this
assumption is never checked for.

Fixes: b0eb1e193f
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-04 13:21:16 +02:00
Michal Privoznik
92678703ce docs: Document <address/> for IOMMU device
The commit v8.3.0-rc1~199 introduced <address/> to <iommu/>
device. And while it updated the RNG it forgot to update the
docs. Fix that.

Fixes: b0eb1e193f
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-04 13:21:16 +02:00
Michal Privoznik
4a9c86ee2f qemu_domain_address: Drop needless virDomainIOMMUModel typecast
There are two places where the @model member of
_virDomainIOMMUDef struct is typecasted to virDomainIOMMUModel
which is completely unnecessary because the struct already
defines the member of that type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-04 13:21:16 +02:00
Sergey A
49de22e2dc Translated using Weblate (Russian)
Currently translated at 91.3% (9567 of 10472 strings)

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

Co-authored-by: Sergey A <sw@atrus.ru>
Signed-off-by: Sergey A. <sw@atrus.ru>
2022-07-04 10:09:03 +02:00
Tim Wiederhake
58e6bb8be8 Fix spelling
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
2022-07-04 10:07:47 +02:00
김인수
3b33548dd3 Translated using Weblate (Korean)
Currently translated at 100.0% (10472 of 10472 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-07-02 03:18:53 +02:00
Ján Tomko
17f8e36e22 conf: fix error message for wrong thread_pool_size
Fix the copy-and-paste error by referring to the correct variable.

Fixes: 0df2e7df80
https://bugzilla.redhat.com/show_bug.cgi?id=2103132

Signed-off-by: Ján Tomko <jtomko@redhat.com>
2022-07-01 17:10:25 +02:00
Peter Krempa
ebe0e34b64 storagepoolxml2argvtest: Fix output data for 'pool-netfs-protocol-ver'
The storage pool tests have host-specific versions which I neglected to
update in commit c44930d932 thus breaking
the test-suite on non-linux OSes.

Fixes: c44930d932
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2022-07-01 16:53:08 +02:00
Peter Krempa
c44930d932 storage: pool: Allow more intricate nfs protocol versions
Treat the 'protocolVer' field as a string so that e.g. '4.1' can be
used. Forbid only ',' in the string as it's a separator of arguments for
mount options.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-01 16:15:23 +02:00
Andrea Bolognani
5333cf9d2f NEWS: Document improvements to firmware autoselection
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:44 +02:00
Andrea Bolognani
7d285059f4 docs: Add kbase page for Secure Boot
Provide simple recipes for the most common high-level tasks.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:43 +02:00
Andrea Bolognani
981879d026 qemu_firmware: enrolled-keys requires secure-boot
No sane firmware build will fail this check, but just to be on
the safe side let's check anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:40 +02:00
Andrea Bolognani
262672dbbf qemu_firmware: Enable loader.secure when requires-smm
Currently, a firmware configuration such as

  <os firmware='efi'>
    <firmware>
      <feature enabled='yes' name='enrolled-keys'/>
    </firmware>
  </os>

will correctly pick a firmware that implements the Secure Boot
feature and initialize the NVRAM file so that it contains the
keys necessary to enforce the signing requirements. However, the
lack of a

  <loader secure='yes'/>

element makes it possible for pflash writes to happen outside
of SMM mode. This means that the authenticated UEFI variables
where the keys are stored could potentially be overwritten by
malicious code running in the guest, thus making it possible to
circumvent Secure Boot.

To prevent that from happening, automatically turn on the
loader.secure feature whenever a firmware that implements Secure
Boot is chosen by the firmware autoselection logic. This is
identical to the way we already automatically enable SMM in such
a scenario.

Note that, while this is technically a guest-visible change, it
will not affect migration of existings VMs and will not prevent
legitimate guest code from running.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:39 +02:00
Andrea Bolognani
73c5ae55c7 conf: Reject features when using manual firmware selection
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:37 +02:00
Andrea Bolognani
c4b8124e45 conf: Always parse firmware features
Regardless of whether firmware autoselection is in use, we
still want to parse the list of requested features. Doing this
will allow us to produce better error messages.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:35 +02:00
Andrea Bolognani
de2a338dce conf: Validate firmware configuration more thoroughly
Generally speaking, when firmware autoselection is in use we
don't want any information to be provided manually. There are
two exceptions:

  * we still want the path to the NVRAM file to be customizable;

  * using <loader secure='yes'/> was how you would ask for a
    firmware that implements the Secure Boot feature in the
    original approach to firmware autoselection, so we want to
    keep that working.

Anything else should result in a descriptive error.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/327
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:34 +02:00
Andrea Bolognani
f5dcd8b979 conf: Refactor virDomainDefOSValidate()
This makes it explicit that there are two possible scenarios
(whether or not firmware autoselection is in use) and will make
upcoming changes cleaner to implement.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:32 +02:00
Andrea Bolognani
421d4f1fa8 conf: Always parse all firmware information
Currently we're simply ignoring some elements and attributes,
such as the loader path, when firmware autoselection is enabled
because we know we're not going to use them.

This makes sense, but has the unfortunate consequence of
confusing users who experience part of their configuration
simply going away for no apparent reason.

A more user-friendly approach is to produce meaningful error
messages in those scenarios. As a first step towards that goal,
stop conditionally parsing information.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:31 +02:00
Andrea Bolognani
161b31f958 conf: Reject enrolled-keys=yes with secure-boot=no
This combination doesn't make sense and so the firmware
autoselection logic will not be able to find a suitable firmware,
but it's more user-friendly to report a detailed error upfront.

Note that this check would ideally happen in the validate phase,
but if we moved it there we would no longer be able to
automatically enable secure-boot when enrolled-keys=yes. Since
the combination never resulted in a working configuration, the
chances of this causing real-world VMs to disappear are
extremely low.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:30 +02:00
Andrea Bolognani
c98910d011 conf: Add return value to virDomainDefPostParseOs()
There are currently no failure scenarios for the function, but
we're about to add one.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:29 +02:00
Andrea Bolognani
6cacfc751e conf: Enable secure-boot when enrolled-keys is enabled
The latter doesn't make sense without the former, so make that
visible in the XML.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:27 +02:00
Andrea Bolognani
9c7499ce54 conf: Always parse NVRAM path if present
Currently, the lack of a <loader> element results in the <nvram>
element being completely ignored, but this is unnecessarily
limiting: even when firmware autoselection is in use, it should
be possible for the user to specify a custom path for the NVRAM
file.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:26 +02:00
Andrea Bolognani
bdd9ce0fda conf: Use nodes in virDomainLoaderDefParseXMLNvram()
This makes the function more consistent with
virDomainLoaderDefParseXML() by preferring the virXMLProp
class of functions to XPath access.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:25 +02:00
Andrea Bolognani
f0e68d28e1 conf: Rename virDomainLoaderDefParseXML() argument
We're going to start passing multiple nodes to the function in
a moment, so we need a more specific name.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:23 +02:00
Andrea Bolognani
28c689dc61 conf: Handle NVRAM in virDomainLoaderDefParseXML()
All the data in the <nvram> element ends up in the same struct
as that coming from the <loader> element, so it makes sense to
have a single entry point for parsing an XML document into a
virDomainLoaderDef instance.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:22 +02:00
Andrea Bolognani
5943e4ade6 conf: Move nvramTemplate parsing
It belongs to virDomainLoaderDefParseXMLNvram(), where the other
parts of the <nvram> element are handled.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:21 +02:00
Andrea Bolognani
cec35f4a52 conf: Move setting type for NVRAM source
When the 'type' attribute is present we'd end up overwriting
this value via virDomainStorageSourceParse(). Moving this
assignment makes the current code clearer and will also help
with upcoming changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:19 +02:00
Andrea Bolognani
040ebb9d1b conf: Rename virDomainLoaderDefParseXMLNvram()
The previous name was identical, modulo the case, to the
completely unrelated virDomainNVRAMDefParseXML().

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:18 +02:00
Andrea Bolognani
628c018344 conf: Move virDomainLoaderDefParseXML()
Pure code movement, needed to prepare for upcoming changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:17 +02:00
Andrea Bolognani
1afc026c73 tests: Add more firmware tests
Note that some of these new tests are displaying incorrect or
suboptimal behavior. When we address those in upcoming patches,
this will be highlighted by changes in the test data.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:16 +02:00
Andrea Bolognani
29bbd927f8 tests: Don't use loader.secure=no with firmware autoselection
This currently has not effect whatsoever, so it's just cluttering
the input files.

We're going to add specific handling for this scenario, as well
as a test case covering it, in an upcoming commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:14 +02:00
Andrea Bolognani
2ce1dcc6b5 tests: Don't set NVRAM path manually
This does the opposite of

  commit 392292cd99
  Author: Daniel P. Berrangé <berrange@redhat.com>
  Date:   Wed Feb 23 12:45:51 2022 +0000

    tests: don't use auto-generated NVRAM path in tests

in order to minimize input files.

We're going to add a test case specifically covering the use of
custom NVRAM paths with firmware autoselection in an upcoming
commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:13 +02:00
Andrea Bolognani
53cdfd7994 tests: Use minimal hardware for firmware tests
When testing firmware selection, we don't really care about any
of the hardware assigned to the VM, and in fact it's better to
keep it as minimal as possible to make sure that the focus
remains on the firmware bits.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:12 +02:00
Andrea Bolognani
f29a8bcef1 tests: Rename and reorganize firmware tests
Group all tests related to firmware selection together and give
them consistent names that leave room for further tests to be
added in an upcoming commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:10 +02:00
Andrea Bolognani
acb8733924 tests: Drop bios-nvram-os-interleave test
This was introduced in

  commit 5882064084
  Author: Martin Kletzander <mkletzan@redhat.com>
  Date:   Wed Feb 25 15:45:26 2015 +0100

    tests: Add test for os interleaving

to ensure a recent change in the schema was behaving correctly.

Seven years later, it no longer seems very useful to keep it
around.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:09 +02:00
Andrea Bolognani
031f379573 tests: Use firmware autoselection on aarch64
This simplifies the test data without negatively impacting test
coverage.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:10:05 +02:00
Andrea Bolognani
c76e595131 tests: Remove firmware bits from unrelated tests
The pci-bridge-many-disks test case is not related to firmware
handling at all, so we can trim it without losing any coverage.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 15:09:50 +02:00
David Michael
9f13f54a63 security_selinux.c: Relabel existing mode="bind" UNIX sockets
This supports sockets created by libvirt and passed by FD using the
same method as in security_dac.c.

Signed-off-by: David Michael <david@bigbadwolfsecurity.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 14:51:19 +02:00
Michal Privoznik
09010f7e76 virnettlscontext: Don't set DH parameters ourselves
According to [1]:

  Prior to GnuTLS 3.6.0 for the ephemeral or anonymous
  Diffie-Hellman (DH) TLS ciphersuites the application was
  required to generate or provide DH parameters. That is no
  longer necessary as GnuTLS utilizes DH parameters and
  negotiation from [RFC7919].

This allows us to:

  a) drop the code that's setting DH params,
  b) drop @dhParams member from _virNetTLSContext struct. and
  c) drop gnutls_dh_params_generate2() mock.

1: https://www.gnutls.org/manual/html_node/Parameter-generation.html

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-01 13:04:59 +02:00
Michal Privoznik
4d7e848418 meson: Require gnutls-3.6.0 or newer
Released almost 5 years ago, gnutls-3.6.0 brings some important
features (which are utilized in next commit). Hence, require that
version at least.

Per repology, currently shipped versions are:

                 RHEL-8: 3.6.16
                 RHEL-9: 3.7.3
              Debian 11: 3.7.1
              Debian 12: 3.7.6
     openSUSE Leap 15.3: 3.6.7
       Ubuntu LTS 20.04: 3.6.13
       Ubuntu LTS 22.04: 3.7.3
             FreeBSD 12: 3.7.6
              Fedora 34: 3.7.4
              Fedora 35: 3.7.6

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-07-01 13:04:58 +02:00
Michal Privoznik
91e96ab71a virnetdevbandwidthtest: Test QoS for OVS
Ever since v7.6.0-rc1~235 we can use ovs-vsctl to set QoS instead
of tc. However, we don't have a test that's verifying generated
cmd line for ovs-vsctl.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-01 13:04:18 +02:00
Michal Privoznik
5f6aa07303 virnetdevbandwidthtest: Reformat TC cmd line
Our coding style expects a long line to be broken into shorter
lines which are then aligned on the first character, for
instance:

  "some string that's broken "
  "into multiple lines"

However, one can argue that there are few cases where shifting
the alignment makes the code more readable. And this is the case
of expected cmd line for DO_TEST_SET() where a long cmd line can
be aligned on the arguments rather than the binary:

  TC " filter ..."
     " police ..."

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-01 13:04:18 +02:00
Michal Privoznik
5c5ca1970f virnetdevbandwidthtest: Drop unused testMinimalStruct
The last usage of the testMinimalStruct struct was removed in
v1.2.2-rc1~206 which forgot to remove the struct as well. Remove
it now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-01 13:04:17 +02:00
Michal Privoznik
b7ab6a6bd6 virnetdevbandwidthtest: Drop unnecessary brackets
Some cases that call DO_TEST_SET() macro wrap each argument in
curved brackets. This is unnecessary, drop the brackets.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-07-01 13:04:17 +02:00
Jiri Denemark
766abdc291 qemu_migration: Apply max-postcopy-bandwidth on post-copy resume
When resuming post-copy migration users may want to limit the bandwidth
used by the migration and use a value that is different from the one
specified when the migration was originally started.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/333

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 11:28:34 +02:00
Jiri Denemark
8c335b5530 qemu_migration: Pass migParams to qemuMigrationSrcResume
So the we can apply selected migration parameters even when resuming
post-copy migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 11:28:34 +02:00
Jiri Denemark
184749691f qemu_migration_params: Replace qemuMigrationParamTypes array
We will need to annotate individual parameters a bit more than just
noting their type. Let's introduce qemuMigrationParamInfo replacing
simple qemuMigrationParamTypes with an array of structs.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 11:28:34 +02:00
Jiri Denemark
0eae541257 qemu: Pass migration flags to qemuMigrationParamsApply
The flags will later be used to determine which parameters should
actually be applied.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 11:28:34 +02:00
Jiri Denemark
f9dcc01a0f qemu_migration: Avoid mem.hard_limit > 0 check
My original commit v8.4.0-288-gf01fc4d119 accidentally forgot to fix
both instances of the same problem. While it fixed the destination side
of migration, the source one remained broken.

However, that commit was also wrong in saying the issue could have
caused unlimited memory locking to be allowed for QEMU when RDMA
migration was used. It could not, because the code would refuse to even
think about starting RDMA migration if hard_limit was not set. But
avoiding the "mem.hard_limit > 0" check is useful anyway.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-07-01 11:28:34 +02:00
Jiri Denemark
10008f5810 Post-release version bump to 8.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-01 11:27:31 +02:00
Jiri Denemark
a9cc9f6612 Release of libvirt-8.5.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-01 11:19:54 +02:00
Michal Privoznik
f3f877cfa6 qemu_hotplug: Don't skip cleanup in qemuDomainAttachNetDevice()
Introduced in v8.4.0-rc1~183 but the first real problem
introduced in v8.4.0-rc1~170, there's a
qemuBuildInterfaceConnect() call inside of
qemuDomainAttachNetDevice(). If the former fails, then the
function is immediately returned from instead of jumping onto the
cleanup label. This is crucial, because at this point the domain
definition contains 'borrowed' net definition, which is then
freed, since an error was met. The domain definition is then left
with a dangling pointer which leads to all sorts of different
crashes.

Fixes: 29d022b1eb
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2102009
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-07-01 10:45:26 +02:00
Michal Privoznik
0ba3870406 API: Remove internal impl detail from VIR_DOMAIN_IOTHREAD_THREAD_POOL_{MIN,MAX} description
When introducing VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and
VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX typed parameters, I've made a
shortcut. Since at the monitor level these two are set in two
separate calls and minimum has to be always smaller than maximum
(or equal to it), it may happen that one of the values we want to
set violates this restriction. So I've put a little note in the
public API description warning users about this.

However, the proper solution is to have a logic that checks the
current values and based on that set either minimum or maximum
value first. But until we get there, remove that note from the
public API before it gets released.

Related: https://gitlab.com/libvirt/libvirt/-/issues/339
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-30 09:54:40 +02:00
Peter Krempa
7989edd742 NEWS: Mention 3 user-visible regressions fixed in this release
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-30 09:49:19 +02:00
김인수
55daf23446 Translated using Weblate (Korean)
Currently translated at 99.5% (10424 of 10472 strings)

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

Translated using Weblate (Korean)

Currently translated at 99.5% (10424 of 10472 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-06-30 02:21:26 +02:00
Weblate
93f4ad2996 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2022-06-30 02:21:24 +02:00
Göran Uddeborg
f8e7b4fed2 Translated using Weblate (Swedish)
Currently translated at 37.5% (3942 of 10491 strings)

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

Translated using Weblate (Swedish)

Currently translated at 37.4% (3920 of 10472 strings)

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

Translated using Weblate (Swedish)

Currently translated at 37.3% (3901 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-06-30 02:21:21 +02:00
Peter Krempa
170eccd03c qemucapabilitiestest: Update capabilities for the 7.1 release cycle on x86_64
Update to v7.0.0-2187-g2a8835cb45

Notable changes:
    - VFU_CLIENT_HANGUP event added
    - query-stats and query-stats-schemas commands added
    - 'vduse-blk' block export export
    - 'loongarch64' arch added
    - added new qom types:
        - cxl-downstream
        - cxl-upstream
        - qio-channel-block
        - qio-channel-null
    - added smi-irq[0], smm-enabled, unnamed-gpio-out[0] properties for PIIX4_PM

    - removed:
        - piix3-ide-xen

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-29 15:37:40 +02:00
Liu Yiding
0dd1fdae2e conf: virDomainMemoryDefValidate: Improve error message
An explicit limit would be more user friendly. Add the limit to error message.

Before this commit:
```
error: requested size must be smaller than or equal to @size
```

Now:
```
error: requested size must be smaller than or equal to @size (8388608KiB)
```

Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-28 12:33:38 +02:00
Michal Privoznik
088e92e0cc NEWS: Document my contributions for the upcoming release
There are couple of features/improvements/bugfixes I contributed
into the upcoming release. Include those worth mentioning in the
NEWS.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-27 15:00:00 +02:00
Jiri Denemark
e324569691 po: Refresh potfile for v8.5.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-06-27 08:56:55 +02:00
Göran Uddeborg
148b39c657 Translated using Weblate (Swedish)
Currently translated at 37.0% (3861 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-06-25 10:18:52 +02:00
Jonathon Jongsma
790f3b214b schema: Be more flexible for diskSourceNetworkProtocolPropsCommon
Add <interleave> to allow the subproperties to be specified in any
order.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-24 09:04:06 -05:00
Jonathon Jongsma
4260a642d3 docs: clarify 'readahead' and 'timeout' for disks
Document the format of the 'readahead' and 'timeout' XML elements more
accurately.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-24 09:03:54 -05:00
Jiri Denemark
d375993ab3 qemu_migration: Implement VIR_MIGRATE_ZEROCOPY flag
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/306

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-23 16:45:39 +02:00
Jiri Denemark
efa3baeae7 virsh: Add support for VIR_MIGRATE_ZEROCOPY flag
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-23 16:45:39 +02:00
Jiri Denemark
8744beecb3 Add VIR_MIGRATE_ZEROCOPY flag
The flag can be used to enable zero-copy mechanism for migrating memory
pages.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-23 16:45:39 +02:00
Jiri Denemark
f01fc4d119 qemu_migration: Don't set unlimited memlock limit for RDMA
Our documentation says RDMA migration requires hard_limit to be set so
that we know how big memory locking limit should be set for the domain
during migration. But since commit v1.2.13-71-gcf521fc8ba (which changed
the default hard_limit value from 0 to
VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) we were actually setting memlock
limit to unlimited if hard_limit was not set.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-23 16:45:39 +02:00
Jiri Denemark
d4d3bb8130 qemu_migration: Restore original memory locking limit
For RDMA migration we update memory locking limit, but never set it back
once migration finishes (on the destination host) or aborts (on the
source host).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-23 16:45:39 +02:00
Jiri Denemark
22ee8cbf09 qemu_migration: Use qemuDomainSetMaxMemLock
This helper will not try to set the limit if it is already big enough,
which may be useful when libvirt daemon is running in a containerized
environment and is not allowed to change memory locking limit.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-23 16:45:39 +02:00
Jiri Denemark
dff51c7f57 qemu: Add qemuDomainSetMaxMemLock helper
qemuDomainAdjustMaxMemLock combined computing the desired limit with
applying it. This patch separates the code to apply a memory locking
limit to a new qemuDomainSetMaxMemLock helper for better reusability.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-23 16:45:39 +02:00
Ján Tomko
a55abe6c51 storagefile: set size field of ploop to 8
For all file formats, the length of the size field is assumed
and hardcoded to be 8 bytes.

Fix the length for the ploop format - since we specify the offset,
we read 8 bytes of the length, not 0.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-22 15:29:44 +02:00
Ján Tomko
74077a651b conf: virDomainDefParseMemory: remove pointless assignment
Evaluate the XPath as a boolean, instead of trying to get a node
out of it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-22 15:29:44 +02:00
Ján Tomko
be4047d051 docs: update links to listman
The mailman for mailing lists hosted by Red Hat seems to have moved
to listman.redhat.com. While the old links still seem to work,
point our docs to the new location to avoid the redirect.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-22 15:29:44 +02:00
Ján Tomko
cf1a7df577 libxl: remove cleanup label from libxlDomainMigrationSrcPerform
Use VIR_AUTOCLOSE for the remaining file descriptor that uses
manual cleanup and remove the label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-22 12:28:29 +02:00
Ján Tomko
7b5dd948b8 qemu: remove cleanup label from qemuMigrationSrcGraphicsRelocate
Remove the label and use 'rc' instead of 'ret'.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-22 12:28:29 +02:00
Ján Tomko
c1ac66afdb vmx: use g_autofree in virVMXParseSerial
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-22 12:28:29 +02:00
Ján Tomko
6afc449106 vz: refactor prlsdkGetSerialInfo
Use g_autofree for the two strings still using manual cleanup
and remove the pointless cleanup label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-22 12:28:29 +02:00
Ján Tomko
28337e9485 tests: remove pointless label in testURIParse
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-22 12:28:29 +02:00
Ján Tomko
8d9bd178e2 Use g_auto for virURI almost everywhere
Convert all the cases where we can unconditionally free
the virURI at the end of scope.

In libxlDomainMigrationDstPrepare, uri is only filled
if uri_in was present, so moving the virURIFree out of
the condition is safe.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-22 12:28:29 +02:00
Göran Uddeborg
84543b2878 Translated using Weblate (Swedish)
Currently translated at 36.4% (3801 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-06-22 11:18:51 +02:00
Rohit Kumar
5d6abb5222 NEWS: Add support for network backed NVRAM
Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-22 10:40:48 +02:00
Ján Tomko
b8a2d96758 src: QemuMonitorCommandWithFiles: report error when fd passing is unsupported
The result of the <= 0 comparison was assigned to 'rc', rendering the
if (rc == 0) condition dead code.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-21 15:49:11 +02:00
Cole Robinson
25072c0304 libxl: Fix domain startup failure error reporting
When domain startup fails, domain cleanup calls
libxlNetworkUnwindDevices, which calls virGetConnectNetwork, which
is a top level API entry point, which resets the initial saved error,
leading to clients seeing:

  error: An error occurred, but the cause is unknown

This preserves the error around the entire teardown process, similar
to what is done in the qemu driver.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-21 09:01:03 -04:00
Cole Robinson
5f0765f90f qemu: validate: use domcaps for tpm validation
Replace tpm->type and tpm->model qemuCaps validation with the
similar logic in domcaps.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-21 08:23:18 -04:00
Cole Robinson
8b09303f24 tests: mock swtpm initialization for all qemu tests
Don't restrict this to domcaps testing only, we will soon
need it for qemu command line validation

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-21 08:23:18 -04:00
Cole Robinson
b233bf89dc qemu: command: Use correct tpm device for all non-x86
The qemu `tpm-tis` device is an ISA device, so only really applicable
to x86 archs. For all non-x86 archs we should use `tpm-tis-device`

This fixes tpm-tis usage on armv7l and riscv

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-21 08:23:18 -04:00
Cole Robinson
5aec476e2e qemu: validate: Drop tpm-tis arch validation
Checking against qemu capabilities should be enough here

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/329

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-21 08:23:18 -04:00
Sergey A
d428c7f5a7 Translated using Weblate (Russian)
Currently translated at 91.8% (9582 of 10431 strings)

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

Co-authored-by: Sergey A <sw@atrus.ru>
Signed-off-by: Sergey A. <sw@atrus.ru>
2022-06-20 14:15:51 +02:00
Göran Uddeborg
7ce80287d1 Translated using Weblate (Swedish)
Currently translated at 36.0% (3761 of 10431 strings)

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

Translated using Weblate (Swedish)

Currently translated at 35.6% (3721 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-06-20 14:15:51 +02:00
Daniel P. Berrangé
dae16374dd nwfilter: spawn thread for reloading on firewalld trigger
When firewalld is restarted or has its rules reloaded, we trigger a
reload of the nwfilter driver. This is done directly in the main
event loop thread which is a bad idea.

In a previous commit we fixed a actual deadlock problem with the
virStateReload API, when triggered from SIGHUP:

commit 33c6eb9689
Author: Jim Fehlig <jfehlig@suse.com>
Date:   Thu Mar 8 15:04:48 2018 -0700

    libvirtd: fix potential deadlock when reloading

The same deadlock problem previously existed with the firewalld reload
trigger, however, today it is not quite so series. The QEMU driver uses
a private event thread for each VM, so the particular deadlock would
not occur. None the less during the time the filters are reloading all
use of the event loop is blocked, which prevents APIs being serviced.

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-20 13:15:21 +01:00
Daniel P. Berrangé
8603b3d76c tools: add '--xpath EXPRESSION --wrap' args to all dumpxml commands
While you can chain the virsh output up to a later 'xmllint' or 'xpath'
command, integrating it into virsh avoids needs for installing extra
binaries which we've often found to be missing on production installs
of libvirt. It also gives better response if the initial virsh command
hits an error, as you don't get an aborted pipeline.

    $ virsh pool-dumpxml --xpath //permissions default
    <permissions>
      <mode>0711</mode>
      <owner>1000</owner>
      <group>1000</group>
      <label>unconfined_u:object_r:svirt_home_t:s0</label>
    </permissions>

If multiple nodes match, they are emitted individually:

    $ virsh dumpxml --xpath '//devices/*/address[@type="pci"]' --wrap demo
    <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
    <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
    ...snip...
    <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
    <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>

but if intending to post-process the output further, the results
can be wrapped in a parent node

    $ virsh dumpxml --xpath '//devices/*/address[@type="pci"]' --wrap demo
    <nodes>
      <address type="pci" domain="0x0000" bus="0x05" slot="0x00" function="0x0"/>
      <address type="pci" domain="0x0000" bus="0x03" slot="0x00" function="0x0"/>
      ...snip...
      <address type="pci" domain="0x0000" bus="0x00" slot="0x02" function="0x0" multifunction="on"/>
      <address type="pci" domain="0x0000" bus="0x07" slot="0x00" function="0x0"/>
    </nodes>

Fixes https://gitlab.com/libvirt/libvirt/-/issues/244
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-20 10:40:45 +01:00
Daniel P. Berrangé
8615c19b5d tools: add helper method for printing an XML document
The trivial case of fully printing an XML document is boring, but
this helper does more by allowing an XPath expression to be given.
It will then print just the subset of nodes which match the
expression. It either print each match as a standalone XML doc
or can put them into one new XML doc wrapped woith <nodes>...</nodes>

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-20 10:40:34 +01:00
Cole Robinson
812edc95a3 conf: cpu: Add <signature family=X model=X stepping=X/>
Internally we already collect x86 host family + model + stepping
numeric values. This exposed them in capabilities CPU output.
Example:

$ sudo virsh capabilities | grep -A1 -B1 signature
      <microcode version='240'/>
      <signature family='6' model='94' stepping='3'/>
      <counter name='tsc' frequency='3408010000' scaling='no'/>

Users need to know these values to calculate an expected.
SEV-ES/SEV-SNP launch measurement.

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-16 12:12:45 -04:00
Andrea Bolognani
03771f5f04 qemu: Fix alignment in qemuFirmwareMappingFlashFormat()
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-06-16 15:27:16 +02:00
Andrea Bolognani
8c75efd4ef qemu: Simplify handling of virTristateBool values
We explicitly check whether the value is YES or NO, which makes
it unnecessary to make sure it's not ABSENT beforehand.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 15:27:16 +02:00
Andrea Bolognani
58805f3ace conf: Fix virDomainDefOSValidate()
Even when the os.loader element is absent, we still have to
validate that the user is not attempting to use firmware
autoselection with a driver that doesn't implement the feature.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 15:27:16 +02:00
Andrea Bolognani
69464f4280 vmx: Declare support for firmware autoselection
The feature was implemented in commits b4e34d1083 and
9bb6e4e739 but the corresponding feature flag was not set in
the driver, so other parts of of libvirt wouldn't be able to
know about it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 15:27:16 +02:00
Ján Tomko
2753eba20c qemu: virtiofs: format --thread-pool-size
https://bugzilla.redhat.com/show_bug.cgi?id=2079582

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-16 14:58:25 +02:00
Ján Tomko
0df2e7df80 conf: virtiofs: add thread_pool element
Add an element to configure the thread pool size:

...
<binary>
  <thread_pool size='16'/>
</binary>
...

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-16 14:58:25 +02:00
Yalan Zhang
261f106100 docs: formatdomain: update hostdev interface section a bit
Update the default "driver" value for hostdev interface since
the default is not "KVM" anymore (refer to "Host device
asssignment" part and by test results). And update the mac
address in one xml example.

Signed-off-by: Yalan Zhang <yalzhang@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 07:18:56 +02:00
Peng Liang
3d5245e3eb lxc: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:58 +02:00
Peng Liang
48e8c36b05 tests: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:58 +02:00
Peng Liang
1ce16ae098 tools: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:58 +02:00
Peng Liang
b3bb252a3b test_driver: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:58 +02:00
Peng Liang
0e791283e0 vmx: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:58 +02:00
Peng Liang
5bfb23850e vmware: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:58 +02:00
Peng Liang
3ef307cb9b vbox: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:57 +02:00
Peng Liang
55a996c90b util: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:57 +02:00
Peng Liang
abb90d278d storage: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:57 +02:00
Peng Liang
38ab1982fa rpc: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:57 +02:00
Peng Liang
68dae91767 remote: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:57 +02:00
Peng Liang
bc16c1bcf6 qemu: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:57 +02:00
Peng Liang
fa8bf49f89 openvz: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:57 +02:00
Peng Liang
3c97380138 node_device: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:57 +02:00
Peng Liang
b19cb3dff0 network: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:57 +02:00
Peng Liang
4c8a354fd5 logging: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
58391e6dea locking: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
3620f40702 libxl: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
bd09115d4c hypvervisor: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
07d8142814 hyperv: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
623efbcb11 esx: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
e9b5f6bed0 cpu: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
000e722d67 conf: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
7f7ec6df27 ch: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
6661df8f0b admin: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:56 +02:00
Peng Liang
3be884e280 access: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-16 06:43:55 +02:00
Göran Uddeborg
eb120a79da Translated using Weblate (Swedish)
Currently translated at 35.2% (3681 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-06-15 17:18:53 +02:00
Sergey A
fb1c2215ed Translated using Weblate (Russian)
Currently translated at 91.8% (9582 of 10431 strings)

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

Co-authored-by: Sergey A <sw@atrus.ru>
Signed-off-by: Sergey A. <sw@atrus.ru>
2022-06-15 17:18:52 +02:00
Peter Krempa
ed8984306e virDomainDiskTranslateSourcePool: Fix check of 'startupPolicy' definition
The check was historically done only for _TYPE_VOLUME disks, but
refactors to allow _TYPE_VOLUME disks in the backing chain caused a
regression where we'd reject startupPolicy also for _TYPE_BLOCK disks
which historically worked well.

Fix it by using the 'virDomainDiskDefValidateStartupPolicy' helper and
use it only when the top level image is a _TYPE_VOLUME as in other cases
it was already validated. This also allows _TYPE_BLOCK volumes to use
startup policy.

Fixes: 37f01262ee
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2095758
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-14 16:38:11 +02:00
Peter Krempa
b90d0f0a1e virDomainDiskDefValidateStartupPolicy: Validate disk type better
Our startup policy checkers work only for local paths, so disk sources
such as NVMe, or vhost-user can't be used with startup policy.

Unfortunately the validation did not catch these cases. Fix it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-14 16:38:11 +02:00
Peter Krempa
3603a18bce domain_validate: Split out validation of disk startup policy
Move the code into 'virDomainDiskDefValidateStartupPolicy' which will be
later reused in the qemu driver.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-14 16:38:11 +02:00
Peter Krempa
9a480737c8 virDomainDiskDefValidate: Improve error messages for 'startupPolicy' checks
Remove linebreak and mention the attribute name. Also prepare the error
messages for future by substituting the type of offending access.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-14 16:38:11 +02:00
Peter Krempa
6900538254 virDomainHugepagesFormat: Use virXMLFormatElementEmpty
Refactor the function to use modern XML formatting machinery.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 15:53:11 +02:00
Rohit Kumar
d762abfe3f Add unit tests for new specification of nvram.
This patch adds unit tests for remote NVRAM.

Examples:

<nvram type='network'>
  <source protocol='iscsi' name='iqn.2013-07.com.example:iscsi-nopool/0'>
    <host name='example.com' port='6000'/>
    <auth username='myname'>
      <secret type='iscsi' usage='mycluster_myname'/>
    </auth>
  </source>
</nvram>

and

<nvram type='network'>
  <source protocol='nbd' name='bar'>
    <host name='example.org' port='6000'/>
  </source>
</nvram>

and

<nvram type='file'>
  <source file='/var/lib/libvirt/nvram/guest_VARS.fd'/>
</nvram>

Signed-off-by: Prerna Saxena <prerna.saxena@nutanix.com>
Signed-off-by: Florian Schmidt <flosch@nutanix.com>
Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 15:53:11 +02:00
Rohit Kumar
468a0a6027 conf: Add support to parse/format <source> for NVRAM
This patch introduces the logic to format and parse remote NVRAM.

Update NVRAM element schema, and docs for supporting network backed
NVRAM. NVRAM backed over network would give the flexibility to start
the VM on any host without having to worry about where to get the latest
nvram image.

<nvram type='network'>
  <source protocol='iscsi' name='iqn.2013-07.com.example:iscsi-nopool/0'>
    <host name='example.com' port='6000'/>
  </source>
</nvram>

or

<nvram type='file'>
  <source file='/var/lib/libvirt/nvram/guest_VARS.fd'/>
</nvram>

In the qemu driver we will support the new definition only with qemu's
supporting -blockdev.

Signed-off-by: Prerna Saxena <prerna.saxena@nutanix.com>
Signed-off-by: Florian Schmidt <flosch@nutanix.com>
Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 15:53:11 +02:00
Peter Krempa
1cc5777874 conf: Extract formatting of NVRAM out of virDomainLoaderDefFormat
Introduce virDomainLoaderDefFormatNvram and extract the code to it so
that it's self-contained in upcoming patches adding more complex logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 15:53:11 +02:00
Peter Krempa
9d8abe0480 qemuFirmwareFillDomain: Don't fill in firmware for network backed nvram
Prepare for network backed nvram by refusing the reset of nvram on boot
and don't check whether it exists. We will not support filling it from a
template.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 15:53:11 +02:00
Rohit Kumar
bca731d0f5 qemu: validate: Reject virStorageSource features we don't want to support with nvram
Signed-off-by: Prerna Saxena <prerna.saxena@nutanix.com>
Signed-off-by: Florian Schmidt <flosch@nutanix.com>
Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 15:53:11 +02:00
Peter Krempa
c3c586baa1 qemuDomainInitializePflashStorageSource: Properly and fully initialize nvram source
Setup all fields for use with -blockdev.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 15:53:11 +02:00
Peter Krempa
9945c24259 qemuProcessReconnect: Don't re-instantiate pflash storage source
We don't really use it besides when starting up the VM so when
reconnecting this step is totally pointless.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 15:53:11 +02:00
Peter Krempa
baf224f1f9 qemu: Properly setup the NVRAM virStorageSource
Use the designated helpers for virStorageSource instead using the
file-based ones with a check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 15:53:11 +02:00
Peter Krempa
5709b31f35 qemu: Use 'def->os.loader->nvram' directly instead of 'priv->pflash1'
Since we now have a full virStorageSource for storing the nvram path we
don't need the extra dance of transferring the data into the 'pflash1'
variable which was an intermediary solution to use -blockdev.

For now we keep it functionally identical to the previous impl.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 14:39:55 +02:00
Rohit Kumar
911c3cb2f0 conf: Convert def->os.loader->nvram a virStorageSource
Currently, libvirt allows only local filepaths to specify the location
of the 'nvram' image. Changing it to virStorageSource type will allow
supporting remote storage for nvram.

Signed-off-by: Prerna Saxena <prerna.saxena@nutanix.com>
Signed-off-by: Florian Schmidt <flosch@nutanix.com>
Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 14:39:55 +02:00
Peter Krempa
c3cf2a2b60 qemuBuildPflashBlockdevCommandLine: Take virDomainObj instead of private data
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 14:39:55 +02:00
Peter Krempa
f23b0ac13e qemuDomainPrepareStorageSourceBlockdev: Add a variant for custom nodename
Extract the internals of qemuDomainPrepareStorageSourceBlockdev into
qemuDomainPrepareStorageSourceBlockdevNodename so that we can reuse it
when instantiating the virStorageSource for pflash backing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2022-06-14 14:39:55 +02:00
Peter Krempa
637f29bfac po/LINGUAS: Fix sorting
Fixes breakage of 'sc_linguas_sorting'.

Fixes: c886a40cfc
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2022-06-14 14:36:13 +02:00
김인수
17ac5af4ce Translated using Weblate (Korean)
Currently translated at 100.0% (10431 of 10431 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-06-13 20:46:11 +02:00
Temuri Doghonadze
c886a40cfc Added translation using Weblate (Georgian)
Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
2022-06-13 20:46:11 +02:00
Göran Uddeborg
fc0f2309b1 Translated using Weblate (Swedish)
Currently translated at 35.0% (3661 of 10431 strings)

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

Translated using Weblate (Swedish)

Currently translated at 34.9% (3641 of 10431 strings)

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

Translated using Weblate (Swedish)

Currently translated at 34.7% (3621 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-06-13 20:46:11 +02:00
Mark Mielke
31b5ad06e3 Fix incorrect uses of g_clear_pointer() introduced in 8.1.0
This is a partial revert of 87a43a907f

The change to use g_clear_pointer() in more places was accidentally
applied to cases involving vir_g_source_unref().

In some cases, the ordering of g_source_destroy() and
vir_g_source_unref() was reversed, which resulted in the source being
marked as destroyed, after it is already unreferenced. This
use-after-free case might work in many cases, but with versions of
glib older than 2.64.0 it may defer unref to run within the main
thread to avoid a race condition, which creates a large distance
between the g_source_unref() and g_source_destroy().

In some cases, the call to vir_g_source_unref() was replaced with a
second call to g_source_destroy(), leading to a memory leak or worse.

In our experience, the symptoms were that use of libvirt-python became
slower over time, with OpenStack nova-compute initially taking around
one second to periodically query the host PCI devices, and within an
hour it was taking over a minute to complete the same operation, until
it is was eventually running this query back-to-back, resulting in the
nova-compute process consuming 100% of one CPU thread, losing its
RabbitMQ connection frequently, and showing up as down to the control
plane.

Signed-off-by: Mark Mielke <mark.mielke@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2022-06-13 20:42:47 +02:00
Peter Krempa
f5c5b16d5d kbase: launch_security_sev: Break up overly long line
Standard text is aligned to 80 colums in all .rst files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2022-06-13 16:09:32 +02:00
Michal Privoznik
67e4fed61c qemuBuildInterfaceConnect: Initialize @tapfd array
When creating a TAP interface we can end up with multiple FDs,
each representing one queue. However, these FDs must be
relabelled as they are then passed to QEMU. In case of
qemuBuildInterfaceConnect() we allocate the array for the FDs and
then let function corresponding to the <interface/> type to fill
the array with FDs. When any of the functions meets an error,
it's also responsible for closing previously opened FDs. However,
the functions take a shortcut: iterate through each member of the
array and close it (if it's non-negative). This assumes that the
array is initialized to negative values, which use to be the case
before rewrite in v8.4.0-rc1~170 but after it it's no longer the
case. Subsequently, "random" FDs are closed (okay, not that
random since the array is allocated via g_new0(), but hey - FD 0
is still valid FD and might be valuable, actually).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2075383#c18
Fixes: 7a38d3946b
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-13 16:06:54 +02:00
Michal Privoznik
74ba5b5401 virNetDevSaveNetConfig: Pass mode to virFileWriteStr()
For some types of SRIOV interfaces we create a temporary file
where the state of the interface is saved before we start
modifying it. The file is used then to restore the original
configuration when the interface is no longer associated with any
guest. For writing the file virFileWriteStr() is used. However,
it's given wrong argument: the last argument is supposed to be
mode to create the file with but virNetDevSaveNetConfig() passes
open(2) flags (O_CREAT|O_TRUNC|O_WRONLY). We need the file to be
writable and readable by root only (0600). Therefore, pass that
mode instead of gibberish.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-13 16:06:44 +02:00
Cole Robinson
d823f27597 docs: kbase/launch_security_sev: QEMU 6.0+ sets iommu=on for us
Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-13 09:12:35 -04:00
Cole Robinson
aabace2aa5 spec: Fix indentation
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-13 09:09:35 -04:00
Cole Robinson
b7eca90cd4 spec: Xen arches have changed on Fedora 36+
Latest fedora 36+ xen builds have dropped i686 and armv7hl builds.

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2022-06-13 08:11:31 -04:00
Jiri Denemark
a7d2272e59 util: Fix error reporting in virProcessSetMaxMemLock
Commit v7.1.0-136-g6a6d6bb520 refactored virProcessSetMaxMemLock by
moving its part into a new virProcessSetLimit, but lost "return -1" on
error.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-06-10 18:38:25 +02:00
Michal Privoznik
425d3b12a4 qemu: Generate command line for <defaultiothread/> pool size
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2059511
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 14:01:08 +02:00
Michal Privoznik
94b71589f1 qemu_validate: Check if QEMU's capable of setting <defaultiothread/> pool size
Since the main-loop and iothread classes are derived from the
same class (EventLoopBaseClass) we don't need new capability and
can use QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX directly to check
whether QEMU's capable of setting defaultiothread pool size.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 14:01:06 +02:00
Michal Privoznik
3e4bebb9d1 conf: Introduce <defaultiothread/>
As of v7.0.0-877-g70ac26b9e5 QEMU exposes its default event loop
for devices with no IOThread assigned as an QMP object. In the
very next commit (v7.0.0-878-g71ad4713cc) it was extended for
thread-pool-min and thread-pool-max attributes. Expose them under
new <defaultiothread/> element.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 14:01:03 +02:00
Michal Privoznik
7162cee68a virsh: Wire up new virDomainSetIOThreadParams parameters
Since virsh implements a wrapper over virDomainSetIOThreadParams()
(command iothreadset) let's wire up new typed parameters there too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 14:00:59 +02:00
Michal Privoznik
f078db9dab qemu: Wire up new virDomainSetIOThreadParams parameters
Introduced in previous commit, QEMU driver needs to be taught how
to set VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and
VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX parameters on given IOThread.
Fortunately, this is fairly trivial to do and since these two
parameters are exposed in domain XML too the update of inactive
XML can be wired up too.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 14:00:44 +02:00
Michal Privoznik
1e8c3525f3 include: Introduce typed params for virDomainSetIOThreadParams wrt pool size
Our public API offers virDomainSetIOThreadParams() function which
allows users to set various aspects of IOThreads. Introduce two
new typed parameters: VIR_DOMAIN_IOTHREAD_THREAD_POOL_MIN and
VIR_DOMAIN_IOTHREAD_THREAD_POOL_MAX which will allow users to
modify the thread-pool-min and thread-pool-max attributes of an
iothread.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 14:00:35 +02:00
Michal Privoznik
86c10f81e5 qemu: Generate command line for IOThread pool size
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 14:00:13 +02:00
Michal Privoznik
2bfb8159bb qemu_validate: Check if QEMU's capable of setting iothread pool size
Now that we have a capability that reflects whether QEMU is
capable of setting iothread pool size, let's introduce a
validator check to make sure users are not trying to use this
feature with QEMU that doesn't support it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 14:00:11 +02:00
Michal Privoznik
38a67a9a9e qemu: Introduce QEMU_CAPS_IOTHREAD_THREAD_POOL_MAX
This capability reflects whether QEMU allows setting
thread-pool-min and thread-pool-max attributes on iothread
object. Since both attributes were introduced in the same commit
(v7.0.0-878-g71ad4713cc) and can't exist independently of each
other we can stick with one capability covering both of them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 14:00:08 +02:00
Michal Privoznik
568503edf1 conf: Introduce thread_pool_min and thread_pool_max attributes to IOThread
At least in case of QEMU an IOThread is actually a pool of
threads (see iothread_set_aio_context_params() in QEMU's code
base). As such, it can have minimal and maximal number of worker
threads. Allow setting them in domain XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 13:59:46 +02:00
Michal Privoznik
f899276737 conf: Introduce allocator for virDomainIOThreadIDDef
So far, iothread configuration structure (virDomainIOThreadIDDef)
is allocated by plain g_new0(). This is perfectly okay because
all members of the struct default to value 0 anyway. But soon
this is going to change. Therefore, replace those g_new0() with a
function so that the default value can be set consistently in one
place.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 13:53:52 +02:00
Michal Privoznik
c4c57cef33 conf: Move iothread formatter into a separate function
Formatting iothreads is currently open coded inside of
virDomainDefFormatInternalSetRootName(). While this works, it
makes the function needlessly long, especially if the formatting
code will expand in near future. Therefore, move it into a
separate function. At the same time, make
virDomainDefIothreadShouldFormat() accept const domain definition
so that the new function can also accept const domain definition.
Formatters shouldn't need to change definition.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 13:53:52 +02:00
Michal Privoznik
13a8c0aa61 virDomainIOThreadIDDefArrayInit: Decrease scope of @iothrid
In virDomainIOThreadIDDefArrayInit() the variable @iothrid is
used only inside a loop but is declared for whole function. Bring
the variable into the loop so that it's obvious that the variable
is not used elsewhere.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 13:53:52 +02:00
Michal Privoznik
d10b6b4c89 virDomainDefParseIOThreads: Use g_autoptr() for @iothrid
Using g_autoptr() for @iothrid variable inside
virDomainDefParseIOThreads() allows us to drop explicit call to
virDomainIOThreadIDDefFree() in one case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 13:53:52 +02:00
Michal Privoznik
95c95f1b75 virml: Introduce VIR_XML_PROP_NONNEGATIVE flag
For easier attribute parsing we have virXMLProp*() family of
functions. These accept flags through which a caller can pose
some conditions onto the attribute value, for instance:
VIR_XML_PROP_NONZERO when the attribute may not be zero, etc.

What we are missing is VIR_XML_PROP_NONNEGATIVE when the
attribute value may be non-negative. Obviously, this flag makes
sense only for some members of the virXMLProp*() family.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-10 13:53:52 +02:00
Andrea Bolognani
ae2dabe5ed ci: Move upstream QEMU integration test to Fedora 36
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-06-09 14:41:44 +02:00
Andrea Bolognani
4a4b7f2854 ci: Add Fedora 36 to integration tests
This requires publishing the RPMs as artifacts from the regular
build job.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-06-09 14:41:40 +02:00
Erik Skultety
d1e3247675 ci: integration: Set 'safe.directory' when installing QEMU from git
Since a fix for CVE-2022-24765 was released every git command is now
checked against the context repo in which it's supposed to run
resulting in a fatal error if the repo is owned by other user than the
one running the git command.
This means that in order to be able to do 'sudo make install', we have
to set the 'safe.directory' for the root user. This is because QEMU
runs 'git submodule update' automatically on 'make install'.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-06-09 13:38:17 +02:00
Erik Skultety
3b943f0c43 ci: integration: SELinux relabel the QEMU we installed from git
Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-06-09 13:38:13 +02:00
Michal Privoznik
2177de7b6e virsh: Check whether enough arguments was passed to iothreadset
Virsh has iothreadset command which allows setting various
attributes of IOThreads. However, when the command is called
without any arguments (besides domain and IOThread IDs), then
@params stays NULL and is passed to virDomainSetIOThreadParams()
which produces rather user unfriendly error message:

  error: params in virDomainSetIOThreadParams must not be NULL

Introduce a check and produce better error message.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
2022-06-08 15:37:35 +02:00
Jiri Denemark
4582267782 qemu: Improve error messages using qemuMigrationJobName
They were constructed from two separate strings using "%s: %s", which
is ugly and does not work well with translations.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-06-08 11:00:43 +02:00
Jiri Denemark
87257c76b9 qemu: Fix VSERPORT_CHANGE event in post-copy migration
When a domain has a guest agent channel enabled and the agent is running
in the guest, we will get VSERPORT_CHANGE event on a destination host as
soon as we start vCPUs there. This is not an issue for normal migration,
but post-copy migration will remain running after we started vCPUs on
the destination. If it runs for more than 30s, the VSERPORT_CHANGE event
handler will fail to get a job and log the following error message:

    Timed out during operation: cannot acquire state change lock (held
    by monitor=remoteDispatchDomainMigrateFinish3Params)

and of course we will think the guest agent is not connected and thus
all APIs talking to it will fail. Until the agent or libvirt daemon is
restarted.

Luckily we only need to update the channel state (to mark it as
connected) and connect to the agent neither of which conflicts with
migration. Thus we can safely enable processing this event during
migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:21 +02:00
Jiri Denemark
b01426a238 Introduce VIR_JOB_MIGRATION_SAFE job type
This is a special job for operations that need to modify domain state
during an active migration. The modification must not affect any state
that could conflict with the migration code. This is useful mainly for
event handlers that need to be processed during migration and which
could otherwise time out on acquiring a normal MODIFY job.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:21 +02:00
Jiri Denemark
5915f93ed0 NEWS: Add support for post-copy recovery
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:21 +02:00
Jiri Denemark
ce34977c1f virsh: Add --postcopy option for domjobabort command
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:21 +02:00
Jiri Denemark
01d65a1520 qemu: Implement VIR_DOMAIN_ABORT_JOB_POSTCOPY flag
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:21 +02:00
Jiri Denemark
479d8e9f09 Add VIR_DOMAIN_ABORT_JOB_POSTCOPY flag for virDomainAbortJobFlags
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:21 +02:00
Jiri Denemark
fb50e56569 qemu: Implement virDomainAbortJobFlags
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:21 +02:00
Jiri Denemark
57762f8527 Add virDomainAbortJobFlags public API
The original virDomainAbortJob did not support flags.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:21 +02:00
Jiri Denemark
cf3842ef08 qemu: Enable support for VIR_MIGRATE_POSTCOPY_RESUME
Since all parts of post-copy recovery have been implemented now, it's
time to enable the corresponding flag.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
9189301fe5 qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for peer-to-peer migration
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
56348173fa qemu: Call qemuDomainCleanupAdd from qemuMigrationJobContinue
Every single call to qemuMigrationJobContinue needs to register a
cleanup callback in case the migrating domain dies between phases or
when migration is paused due to a failure in postcopy mode.

Let's integrate registering the callback in qemuMigrationJobContinue to
make sure the current thread does not release a migration job without
setting a cleanup callback.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
21469f6076 qemu: Register qemuProcessCleanupMigrationJob after Begin phase
The callback will properly cleanup non-p2p migration job in case the
migrating domain dies between Begin and Perform while the client which
controls the migration is not cooperating (normally the API for the next
migration phase would handle this).

The same situation can happen even after Prepare and Perform phases, but
they both already register a suitable callback, so no fix is needed
there.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
776311df23 qemu: Create completed jobData in qemuMigrationSrcComplete
Normally the structure is created once the source reports completed
migration, but with post-copy migration we can get here even after
libvirt daemon was restarted. It doesn't make sense to preserve the
structure in our status XML as we're going to rewrite almost all of it
while refreshing the stats anyway. So we just create the structure here
if it doesn't exist to make sure we can properly report statistics of a
completed migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
c1d40d2c40 qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Finish phase
Everything was already done in the normal Finish phase and vCPUs are
running. We just need to wait for all remaining data to be transferred.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
55e49b1b72 qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Prepare phase
The QEMU process is already running, all we need to do is to call
migrate-recover QMP command. Except for some checks and cookie handling,
of course.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
c04c93ea57 qemu: Start a migration phase in qemuMigrationAnyConnectionClosed
Non-postcopy case talks to QEMU monitor and thus needs to create a
nested job. Since qemuMigrationAnyConnectionClosed is called in case
there's no thread processing a migration API, we need to make the
current thread a temporary owner of the migration job to avoid "This
thread doesn't seem to be the async job owner: 0". This is done by
starting a migration phase.

While no monitor interaction happens in postcopy case and just setting
the phase (to indicate a broken postcopy migration) would be enough,
being consistent and setting the owner does not hurt anything.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
4f22d2f883 qemu: Handle incoming migration in qemuMigrationAnyConnectionClosed
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
5eec0b4b2d qemu: Refactor qemuMigrationAnyConnectionClosed
To prepare the code for handling incoming migration too.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
14aae98212 qemu: Rename qemuMigrationSrcCleanup
The function is now called qemuMigrationAnyConnectionClosed to make it
clear it is supposed to handle broken connection during migration. It
will soon be used on both sides of migration so the "Src" part was changed
to "Any" to avoid renaming the function twice in a row.

The original *Cleanup name could easily be confused with cleanup
callbacks called when a domain is destroyed.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
8c4da941c0 qemu: Add support for migrate-recover QMP command
This command tells QEMU to start listening for an incoming post-copy
recovery connection. Just like migrate-incoming is used for starting
fresh migration on the destination host.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
8e0d86fb6a qemu: Use autoptr for mig in qemuMigrationDstPrepareFresh
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
62181e8af6 qemu: Refactor qemuMigrationDstPrepareFresh
Offline migration jumps over a big part of qemuMigrationDstPrepareFresh.
Let's move that part into a new qemuMigrationDstPrepareActive function
to make the code easier to follow.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
c7727296f8 qemu: Introduce qemuMigrationDstPrepareFresh
Moves most of the code from qemuMigrationDstPrepareAny to a new
qemuMigrationDstPrepareFresh so that qemuMigrationDstPrepareAny can be
shared with post-copy resume.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
491c9eff6c qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Confirm phase
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
f2a19b4cd0 qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Perform phase
It just calls migrate QMP command with resume=true without having to
worry about migration capabilities or parameters, storage migration,
etc. since everything has already been done in the normal Perform phase.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
07a2a6e511 qemu: Add support for 'resume' parameter of migrate QMP command
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
691ce4ea8f qemu: Separate starting migration from qemuMigrationSrcRun
qemuMigrationSrcRun does a lot of thing before and after telling QEMU to
start the migration. Let's make the core reusable by moving it to a new
qemuMigrationSrcStart function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
d1b6bce02c qemu: Refactor qemuMigrationSrcPerformPhase
To make the code flow a bit more sensible.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
37a67122dd qemu: Implement VIR_MIGRATE_POSTCOPY_RESUME for Begin phase
Mostly we just need to check whether the domain is in a failed post-copy
migration that can be resumed.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
a5e603c808 qemu: Don't set VIR_MIGRATE_PAUSED for post-copy resume
For historical reasons we automatically enabled VIR_MIGRATE_PAUSED flag
when a migration was started for a paused domain. However, when resuming
failed post-copy migration the domain on the source host will always be
paused (as it is already running on the destination host). We must avoid
enabling VIR_MIGRATE_PAUSED in this case.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
6280246971 virsh: Add --postcopy-resume option for migrate command
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
f55aedc845 Introduce VIR_MIGRATE_POSTCOPY_RESUME flag
This flag can be used to restart post-copy migration once it failed
because of a broken connection.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
b3110bb8e4 qemu: Use QEMU_MIGRATION_PHASE_POSTCOPY_FAILED
This phase marks a migration protocol as broken in a post-copy phase.
Libvirt is no longer actively watching the migration in this phase as
the migration API that started the migration failed.

This may either happen when post-copy migration really fails (QEMU
enters postcopy-paused migration state) or when the migration still
progresses between both QEMU processes, but libvirt lost control of it
because the connection between libvirt daemons (in p2p migration) or a
daemon and client (non-p2p migration) was closed. For example, when one
of the daemons was restarted.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
f1da6e9076 qemu: Do not set job owner in qemuMigrationJobSetPhase
Both qemuMigrationJobSetPhase and qemuMigrationJobStartPhase were doing
the same thing, which made little sense. Let's follow the difference
between qemuDomainObjSetJobPhase and qemuDomainObjStartJobPhase and
change job owner only in qemuMigrationJobStartPhase.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
2b163ca301 qemu: Refactor qemuDomainObjSetJobPhase
We will want to update migration phase without affecting job ownership.
Either in the thread that already owns the job or from an event handler
which only changes the phase (of a job no-one owns) without assuming it.

Let's move the ownership change to a new qemuDomainObjStartJobPhase
helper and let qemuDomainObjSetJobPhase set the phase without touching
ownership.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
69d9f54c66 qemu: Make qemuMigrationCheckPhase failure fatal
The check can reveal a serious bug in our migration code and we should
not silently ignore it.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
a5dc9bf96b qemu: Separate protocol checks from qemuMigrationJobSetPhase
Into a new qemuMigrationCheckPhase helper, which can be reused in other
places.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
6efd671a11 qemu: Add new migration phases for post-copy recovery
When recovering from a failed post-copy migration, we need to go through
all migration phases again, but don't need to repeat all the steps in
each phase. Let's create a new set of migration phases dedicated to
post-copy recovery so that we can easily distinguish between normal and
recovery code.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
ab3fd13932 qemu: Introduce qemuMigrationSrcBeginXML helper
Turn the final part of Begin phase formatting a domain XML for migration
into a reusable helper.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
3c1f37848d qemu: Check flags incompatible with offline migration earlier
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
2b137aba20 qemu: Improve post-copy migration handling on reconnect
When libvirt daemon is restarted during an active post-copy migration,
we do not always mark the migration as broken. In this phase libvirt is
not really needed for migration to finish successfully. In fact the
migration could have even finished while libvirt was not running or it
may still be happily running.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
c556d02551 qemu: Ignore missing memory statistics in query-migrate
We want to use query-migrate QMP command to check the current migration
state when reconnecting to active domains, but the reply we get to this
command may not contain any statistics at all if called on the
destination host.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
6908f857f8 qemu: Finish completed unattended migration
So far migration could only be completed while a migration API was
running and waiting for the migration to finish. In case such API could
not be called (the connection that initiated the migration is broken)
the migration would just be aborted or left in a "don't know what to do"
state. But this will change soon and we will be able to successfully
complete such migration once we get the corresponding event from QEMU.
This is specific to post-copy migration when vCPUs are already running
on the destination and we're only waiting for all memory pages to be
transferred. Such post-copy migration (which no-one is actively
watching) is called unattended migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
cc9f385a1d qemu: Pass qemuDomainJobObj to qemuMigrationDstComplete
When reconnecting to an active domain we need to use a different job
structure than the one referenced from the VM object.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
dbfcbe0896 qemu: Make sure migrationPort is released even in callbacks
Normally migrationPort is released in the Finish phase, but we need to
make sure it is properly released also in case qemuMigrationDstFinish is
not called at all. Currently the only callback which is called in this
situation qemuMigrationDstPrepareCleanup which already releases
migrationPort. This patch adds similar handling to additional callbacks
which will be used in the future.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
cff2e25043 qemu: Make final part of migration Confirm phase reusable
By separating it into a dedicated qemuMigrationSrcComplete function
which can be later called in other places.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
4c4e6913f4 qemu: Handle migration job in qemuMigrationDstFinish
The function which started a migration phase should also finish it by
calling qemuMigrationJobFinish/qemuMigrationJobContinue so that the code
is easier to follow.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
923ce7ed00 qemu: Introduce qemuMigrationDstFinishActive
Refactors qemuMigrationDstFinish by moving some parts to a dedicated
function for easier introduction of postcopy resume code without
duplicating common parts of the Finish phase. The goal is to have the
following call graph:

    - qemuMigrationDstFinish
        - qemuMigrationDstFinishOffline
        - qemuMigrationDstFinishActive
            - qemuMigrationDstFinishFresh
            - qemuMigrationDstFinishResume

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
229456b140 qemu: Separate cookie parsing for qemuMigrationDstFinishOffline
To keep all cookie handling (parsing and formatting) in the same
function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
71951e9869 qemu: Introduce qemuMigrationDstFinishOffline
Refactors qemuMigrationDstFinish by moving some parts to a dedicated
function for easier introduction of postcopy resume code without
duplicating common parts of the Finish phase. The goal is to have the
following call graph:

    - qemuMigrationDstFinish
        - qemuMigrationDstFinishOffline
        - qemuMigrationDstFinishActive
            - qemuMigrationDstFinishFresh
            - qemuMigrationDstFinishResume

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
8ede853a9f qemu: Introduce qemuMigrationDstFinishFresh
Refactors qemuMigrationDstFinish by moving some parts to a dedicated
function for easier introduction of postcopy resume code without
duplicating common parts of the Finish phase. The goal is to have the
following call graph:

    - qemuMigrationDstFinish
        - qemuMigrationDstFinishOffline
        - qemuMigrationDstFinishActive
            - qemuMigrationDstFinishFresh
            - qemuMigrationDstFinishResume

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
3865596cf9 qemu: Preserve error in qemuMigrationDstFinish
We want to prevent our error path that can potentially kill the domain
on the destination host from overwriting an error reported earlier, but
we were only doing so in one specific path when starting vCPUs fails.
Let's do it in all paths.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
ea08483e7d qemu: Drop obsolete comment in qemuMigrationDstFinish
The comment about QEMU < 0.10.6 has been irrelevant for years.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
c41edf420b qemu: Make final part of migration Finish phase reusable
By separating it into a dedicated qemuMigrationDstComplete function
which can be later called in other places.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
c542432357 qemu: Generate migration cookie in Finish phase earlier
The final part of Finish phase will be refactored into a dedicated
function and we don't want to generate the cookie there.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
6bb40ef6b1 qemu: Rename "endjob" label in qemuMigrationDstFinish
Let's call it "error" so that it's clear the label is only used in
failure path.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
5eb956e284 qemu: Separate success and failure path in qemuMigrationDstFinish
Most of the code in "endjob" label is executed only on failure. Let's
duplicate the rest so that the label can be used only in error path
making the success path easier to follow and refactor.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
4cd9b5cdb8 qemu: Move success-only code out of endjob in qemuMigrationDstFinish
Code executed only when dom != NULL can be moved before "endjob" label,
to the only place where dom is set.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
b85eed31a5 qemu: Create domain object at the end of qemuMigrationDstFinish
We don't need the object until we get to the "endjob" label.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
73b81fc55f qemu: Add support for postcopy-recover QEMU migration state
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
5dd2d11ec0 qemu: Handle 'postcopy-paused' migration state
When connection breaks during post-copy migration, QEMU enters
'postcopy-paused' state. We need to handle this state and make the
situation visible to upper layers.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
458fa0e2bf qemu: Use switch in qemuProcessHandleMigrationStatus
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
425886ea99 qemu: Fetch paused migration stats
Even though a migration is paused, we still want to see the amount of
data transferred so far and that the migration is indeed not progressing
any further.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
918c14ee06 qemu: Don't wait for migration job when migration is running
Migration is a job which takes some time and if it succeeds, there's
nothing to call another migration on. If a migration fails, it might
make sense to rerun it with different arguments, but this would only be
done once the first migration fails rather than while it is still
running.

If this was not enough, the migration job now stays active even if
post-copy migration fails and anyone possibly retrying the migration
would be waiting for the job timeout just to get a suboptimal error
message.

So let's special case getting a migration job when another one is
already active.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
96db9dcfe9 qemu: Drop forward declarations in migration code
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
7c36e5004c qemu: Restore async job start timestamp on reconnect
Jobs that are supposed to remain active even when libvirt daemon
restarts were reported as started at the time the daemon was restarted.
This is not very helpful, we should restore the original timestamp.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
013d3091e0 qemu: Restore failed migration job on reconnect
Since we keep the migration job active when post-copy migration fails,
we need to restore it when reconnecting to running domains.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
c2f6a6a726 qemu: Abort failed post-copy when we haven't called Finish yet
When migration fails after it already switched to post-copy phase on the
source, but early enough that we haven't called Finish on the
destination yet, we know the vCPUs were not started on the destination
and the source host still has a complete state of the domain. Thus we
can just ignore the fact post-copy phase started and normally abort the
migration and resume vCPUs on the source.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
88a59fbbf3 qemu: Keep migration job active after failed post-copy
When post-copy migration fails, we can't just abort the migration and
resume the domain on the source host as it is already running on the
destination host and no host has a complete state of the domain memory.
Instead of the current approach of just marking the domain on both ends
as paused/running with a post-copy failed sub state, we will keep the
migration job active (even though the migration API will return failure)
so that the state is more visible and we can better control what APIs
can be called on the domains and even allow for resuming the migration.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
6637880b3c qemu: Add qemuDomainObjRestoreAsyncJob
The code for setting up a previously active backup job in
qemuProcessRecoverJob is generalized into a dedicated function so that
it can be later reused in other places.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
d6d1c4980d qemu: Rename qemuDomainObjRestoreJob as qemuDomainObjPreserveJob
It is used for saving job out of domain object. Just like
virErrorPreserveLast is used for errors. Let's make the naming
consistent as Restore would suggest different semantics.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
7c1840fa37 qemu: Introduce qemuProcessCleanupMigrationJob
The function can be used as a callback for qemuDomainCleanupAdd to
automatically clean up a migration job when a domain is destroyed.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
83ccd3a3d1 conf: Introduce virDomainObjIsPostcopy helper
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
efe95fb878 conf: Introduce virDomainObjIsFailedPostcopy helper
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
6ca0ff90ac qemu: Make qemuDomainCleanupAdd return void
The function never returns anything but zero.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
3abe9c496c qemu: Explicitly emit events on post-copy failure
The events would normally be triggered only if we're changing domain
state. But most of the time the domain is already in the right state and
we're just changing its substate from {PAUSED,RUNNING}_POSTCOPY to
*_POSTCOPY_FAILED. Let's emit lifecycle events explicitly when post-copy
migration fails to make the failure visible without polling.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
13b43c22b7 qemu: Keep domain running on dst on failed post-copy migration
There's no need to artificially pause a domain when post-copy fails
from our point of view unless QEMU connection is broken too as migration
may still be progressing well.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
aab9d64d4d Introduce VIR_DOMAIN_RUNNING_POSTCOPY_FAILED
This new "post-copy failed" reason for the running state will be used on
the destination host when post-copy migration fails while the domain is
already running there.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-06-07 17:40:20 +02:00
Jiri Denemark
8cd5edfdfe qemumonitorjsontest: Test more migration capabilities
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:19 +02:00
Jiri Denemark
8d00f3e801 qemu: Add debug messages to job recovery code
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-06-07 17:40:19 +02:00
Göran Uddeborg
fe67380b20 Translated using Weblate (Swedish)
Currently translated at 34.5% (3601 of 10431 strings)

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

Translated using Weblate (Swedish)

Currently translated at 34.1% (3561 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-06-07 16:50:32 +02:00
Peng Liang
b2297edc05 storage_file: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-07 16:16:48 +02:00
Peng Liang
32b11c49e6 security: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-07 16:07:00 +02:00
Peng Liang
c701575d8b secret: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-07 16:07:00 +02:00
Peng Liang
c666bb7929 nwfilter: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-07 16:04:21 +02:00
Peng Liang
72593eac93 interface: Remove unused includes
Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-07 16:04:21 +02:00
Ján Tomko
4539530034 docs: contact: recommend the TLS port for IRC
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-06-07 15:22:32 +02:00
Peter Krempa
0e3f42b834 qemucapabilitiestest: Update latest caps to 'v7.0.0-1512-gca127b3fc2'
Notable changes:

 - Icelake-Client cpu model family removed:
     "Icelake-Client-noTSX-x86_64-cpu"
     "Icelake-Client-v1-x86_64-cpu"
     "Icelake-Client-v2-x86_64-cpu"
     "Icelake-Client-v3-x86_64-cpu"
     "Icelake-Client-x86_64-cpu"

 - 'zero-copy-send' migration feature added

 - display 'sdl' qapified

 - 'arch-lbr' cpu feature added

 - new HyperV enlightenments:
     'hv-tlbflush-ext'
     'hv-tlbflush-direct'
     'hv-emsr-bitmap'
     'hv-xmm-input'

 - 'none-machine' has two new properties:
     - "boot" described as "Boot configuration"
     - "memory" described as "Memory size configuration"

 - 'igd-passthrough-isa-bridge' is now Xen-only

 - CXL: Compute eXpress Link related devices:
      "CXL"
      "cxl-rp",
      "cxl-type3",
      "pxb-cxl",
      "pxb-cxl-bus",
      "pxb-cxl-host",

 - 'dma-translation' feature of 'intel-iommu'

 - 'vmcb-clean' cpu feature now migratable:
     - possibly due to host kernel upgrade
     - changes commandline generated for the 'cpu-host-model' case of
       qemuxml2argvtest

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-07 13:00:56 +02:00
Peter Krempa
95bd137216 qemu: Fix crash in qemuBuildDeviceCommandlineHandleOverrides
'STREQ' is used to compare the override alias with the device alias.
While the parser ensures that the override alias is non-NULL, the device
alias may be NULL and STREQ doesn't handle that.

Fixes: 38ab5c9ead
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/321
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-06 10:41:38 +02:00
Peter Krempa
8d3a807a4a qemu: fd: Fix monitor usage of qemuFDPassDirectGetPath
We need to use the 'name' variable and just overwrite it with the FD
number when FDs are passed on the monitor. Otherwise we will read NULL
path if the FD is accessed before being passed on the monitor. The idea
of this helper is to simplify the monitor code so it would be
counterproductive to have other behaviour.

Fixes the following symptom:

 $ virsh attach-interface cd network default --model virtio
 error: Failed to attach interface
 error: internal error: unable to execute QEMU command 'netdev_add': File descriptor named '(null)' has not been found

Fixes: bca9047906
Resolves: https://gitlab.com/libvirt/libvirt/-/issues/318
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2092856
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-06 09:42:58 +02:00
Peter Krempa
a939d4d869 util: json: Add modifier for adding non-negative long values to JSON objects
Similarly to the 'k' modifier for integers introduce 'K' for long
integers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-06-03 10:09:04 +02:00
Göran Uddeborg
b0f473f49e Translated using Weblate (Swedish)
Currently translated at 33.3% (3481 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-06-02 22:18:44 +02:00
Michal Privoznik
8d2567bccf qemu: Restore label to temp file in qemuDomainScreenshot()
Obtaining a screenshot via virDomainScreenshot() works like this:
  1) we create a temp file, label it, then
  2) tell QEMU to store the screenshot into it, and
  3) finally, open the file for transfer via virStream

Since the file is just temporary and even explicitly unlinked at
the end, no seclabel restoration is done. This makes perfect
sense for security models which attach a label to file itself
(DAC, SELinux) because the label is gone with the file. However,
for models where a list of files and allowed actions is kept on a
side (AppArmor) this approach means we just append files into the
profile and never remove them. In turn, the file grows and policy
update takes longer with each entry.

Restore the seclabel for AppArmor's sake.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-06-02 17:03:43 +02:00
Michal Privoznik
215b2466cd virStorageSourceGetActualType: Change type of retval
The virStorageSourceGetActualType() function returns either
virStorageSource->type (which is of type virStorageType), or
virStorageSourcePoolDef->type, which really stores a value of the
same enum. Thus, the latter struct can be changed so that the
virStorageSourceGetActualType() function can return correct type
instead of generic int.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2022-06-01 14:54:59 +02:00
Michal Privoznik
2307f06cb2 Drop needless typecast to virStorageType enum
There are three places (two in domain_conf.c and one in
qemu_migration.c) where a virStorageSource->type is typecasted to
virStorageType (for the purpose of catching missing enum member
in a switch() statement at compile time). This is needless,
because as of v8.2.0-rc1~120 the struct member is of proper type.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2022-06-01 14:54:59 +02:00
Peter Krempa
0c4bdd835c schemas: Allow 'manual' snapshot mode in domain definition
Commit a1465e661e added the 'manual' disk snapshot mode documentation
but didn't allow it in the schema as default snapshot mode for a disk.

Add the needed value into the schema.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
3299e00298 docs: domain: Remove extraneous quotes
Certain documentation bits tried to put a reference of a value into
quotes, but that's not needed for both the pure view of the rST source
and the rendered output.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
24049c06d9 virNetMessageEncodePayloadEmpty: Replace by virNetMessageEncodePayloadRaw(msg, NULL, 0)
Replace the two outstanding invocations and remove the function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
9a86592c4e virNetMessageEncodePayloadRaw: Tolerate empty 'data'
'virNetMessageEncodePayloadRaw' is not supposed to be called with 'NULL'
data, but the code path from 'virNetClientStreamSendPacket' does so.

Now 'virNetMessageEncodePayloadEmpty' is intended for such case, but
since it's just a sub-set of steps from 'virNetMessageEncodePayloadRaw'
it's more straightforward to add NULL-tolerance to 'virNetMessageEncodePayloadRaw'
and subsequently remove 'virNetMessageEncodePayloadEmpty'.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/308
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
00509d2d6a glibcompat: Provide proper override for 'g_hash_table_steal_extended'
We've emulated the function in virHashSteal, with a note pointing to use
the proper version. Move the code to glibcomapt.c and make it such that
builds using newer glib already use the new function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
37356e1dc8 gitlab: issue_template: Remove labelling commands
The commands only work for users who are members of the project and thus
can set flags themselves.

For non-members they are ignored, so there's isn't much value in having
it here.

Additionally in my recent upstream issue triage I've changed some of the
labels so they were not accurate anyways.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
8452124669 docs: Add HTML reference checker
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
dcff02d797 docs: formatstorageencryption: Use correct anchor into formatsecret page
The link was most likely broken when 'formatsecret' was converted to
RST.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
602c14fdf5 uri: Fix link to qemu KVM example config
Link into the examples of the qemu driver.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
ccc5df2e4c docs: remote: Fix anchor names in links to uri.html
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
5aa78876e0 docs: kbase/tlscerts: Fix links
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
ce2426baff docs: kbase/kvm-realtime: Fix few links
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
34aa8abda7 docs: Fix links in kbase/internals
The links were broken when the documentation was moved into the
'internals' subdirectory.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
d19c8e7a57 docs: Remove extra leading slash in 'api' and 'formatdomaincaps' pages
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
610407dad3 docs: Fix link to 'tlscerts' article
The link was not fixed when the page was moved into 'kbase/'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
f05a4fc766 scripts: hvsupport: Remove link into the 'html' directory
Linking to a list of files is not helpful.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
d51664b8da docs: formatcaps: Fix anchors of links into formatdomain.rst
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
0ad7ed199e docs: rpc: Fix broken headings
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
f97e769b63 docs: domainstatecapture: Fix broken links
Some links didn't exit the 'kbase/' directory and 'virDomainBackupEnd'
API never existed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
d049011697 docs: page.xsl: Fix link to 'mailing-lists' section
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
f50cfd9987 syntax-check: Add check prohibiting remote reference to local file
Within a file we should use the internal reference syntax.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
85044a3631 docs: uri: Fix link to libvirtd configuration section
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
0a78803843 docs: formatdomain: Use local reference directly
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
954119343b docs: formatdomain: Remove the 'anchor' role
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>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
a781f7980c docs: formatdomain: Remove 'launchSecurity' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
e8cdf37ebf docs: formatdomain: Remove 'keywrap' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
cab8c4c423 docs: formatdomain: Remove 'seclabel' anchor
One local reference required rewording of a whole paragraph to make
sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
2ca5661b38 docs: formatdomain: Remove 'vsock' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
0f4af23ede docs: formatdomain: Remove 'elementsIommu' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
fa5124bdbb docs: formatdomain: Remove 'elementsMemory' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
341b8b1c8f docs: formatdomain: Remove 'elementsTpm' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
a5018f1e0c docs: formatdomain: Remove 'elementsAudio' anchor
Local references were reworded to match.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
92bc35daa6 docs: formatdomain: Remove 'elementsCharHost' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
c81500b2a1 docs: formatdomain: Remove 'elementsCharHostInterface' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00
Peter Krempa
3956794b77 docs: formatdomain: Remove 'elementCharSerialAndConsole' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
33a324ba49 docs: formatdomain: Remove 'elementCharSerial' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
e3423c4f0e docs: formatdomain: Remove 'elementsConsole' anchor
Some rewording and rewraping was needed to accomodate the new local
references.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
525287e1bd docs: formatdomain: Remove 'elementsVideo' anchor
The surrounding paragraph around the only fixed use was rewrapped.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
58a7955c9c docs: formatdomain: Remove 'elementsGraphics' anchor
Local references needed rewording.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
0859e2135d docs: formatdomain: Remove 'elementVhostuser' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
696183be0e docs: formatdomain: Remove 'coalesce' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
00901cb4e4 docs: formatdomain: Remove 'mtu' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
fd36dc7397 docs: formatdomain: Remove 'elementPort' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
5d2c344407 docs: formatdomain: Remove 'elementVlanTag' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
8077974d64 docs: formatdomain: Remove 'elementQoS' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
99e01a44e4 docs: formatdomain: Remove 'elementsNICSTargetOverride' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
4506e4057d docs: formatdomain: Remove 'elementsNICSDirect' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
dadd384907 docs: formatdomain: Remove 'elementsNICS' anchor
The one local link addition prompted rewrapping of the whole paragraph.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
abc1b8ab60 docs: formatdomain: Remove 'elementsHostDev' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
5dc55c52ac docs: formatdomain: Remove 'elementsControllers' anchor
Local references were reworded.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
92e09c3659 docs: formatdomain: Remove 'elementsVirtioTransitional' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
fbce49ed9a docs: formatdomain: Remove 'elementsVirtio' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
02954a5f5d docs: formatdomain: Remove 'elementsAddress' anchor
All local links were reformulated to make sense with local references.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
4331a892d4 docs: formatdomain: Remove 'elementsDisks' anchor
Two paragraphs containing local links were reformulated and rewrapped.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
dff53731ec docs: formatdomain: Remove 'elementsDevices' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
4fbaa15362 docs: formatdomain: Remove 'elementsFeatures' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
2f36b98a42 docs: formatdomain: Remove 'elementsEvents' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
cc947d59eb docs: formatdomain: Remove 'hmat' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
456a710290 docs: formatdomain: Remove 'elementsCPU' anchor
Reworded documentation around the local link.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
de430ac139 docs: formatdomain: Remove 'elementsBlockTuning' anchor
Reworded documentation around the local link.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
763c35e7e6 docs: formatdomain: Remove 'elementsNUMATuning' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
88b97d9bce docs: formatdomain: Remove 'elementsMemoryTuning' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
e1f9c35220 docs: formatdomain: Remove 'elementsMemoryBacking' anchor
Reworded documentation around one of the local links.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
14f11cf375 docs: formatdomain: Remove 'elementsMemoryAllocation' anchor
Reworded documentation around local links.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
19bdd5d3d5 docs: formatdomain: Remove 'elementsCPUTuning' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
f97e788994 docs: formatdomain: Remove 'elementsIOThreadsAllocation' anchor
Reworded documentation around local links.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
6fee44f3f5 docs: formatdomain: Remove 'elementsCPUAllocation' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
9e7ac886bb docs: formatdomain: Remove 'elementsSysinfo' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
8593e550df docs: formatdomain: Remove 'elementsOSContainer' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
09ed0fd5b9 docs: formatdomain: Remove 'elementsOSBIOS' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
b680bb3bb6 docs: formatdomain: Remove 'elementsOS' anchor
Reworded the paragraph around the local link.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
d67964a47a docs: formatdomain: Remove 'elementsMetadata' anchor
Reworded the local link so that it retains the sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Peter Krempa
986d596fcc docs: formatdomain: Remove 'elements' anchor
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:09 +02:00
Martin Kletzander
1b71b3ac81 virt-host-validate: Improve failure message when no HW virt is found
Make sure that more users understand that without HW virtualization you cannot
have KVM working.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2086677
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 11:58:09 +02:00
Tim Wiederhake
1b05f2e50b Fix typos
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 09:55:48 +02:00
Michal Privoznik
2597296ea6 qemu_capspriv: Drop needless declarations
There are two functions declared in qemu_capspriv.h:
1) virQEMUCapsInitHostCPUModel() which is not used anywhere but
   qemu_capabilities.c,

2) virQEMUCapsSetSEVCapabilities() which is my personal favorite
   but despite that it's never implemented nor called.

Drop them.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2022-06-01 09:45:40 +02:00
Michal Privoznik
12be42ee7e network: Generate TFTP config regardless of DHCP
We already allow users to provide TFTP root path in network XML
and not specify any DHCP. This makes sense, because dnsmasq is
not only DHCP server but also TFTP server and users might have
a DHCP server configured on their own, outside of libvirt's
control and want just the TFTP part.

By moving TFTP config generator out of DHCP generator and calling
it for every IPv4 range, users can finally enable just TFTP.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2026765
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 09:40:40 +02:00
Michal Privoznik
bab462db6e network: Separate DHCP config generator into a function
Generating configuration file for dnsmasq is done in
networkDnsmasqConfContents() which is this big, self-contained
function. Separate at least DHCP part into its own function for
better readability.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 09:40:19 +02:00
Michal Privoznik
314dac422d network: Initialize variables in networkDnsmasqConfContents()
In networkDnsmasqConfContents() there's a for() loop which
initializes some variables in its initialization block. This
makes both the loop() statement and variable declaration block
look needlessly ugly. Speaking of variable declaration, also move
some variables which are used only within blocks into their
respective blocks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 09:40:07 +02:00
Michal Privoznik
f344005547 lib: Be consistent about vm->pid
The virDomainObj struct has @pid member where the domain's
hypervisor PID is stored (e.g. QEMU/bhyve/libvirt_lxc/... PID).
However, we are not consistent when it comes to shutoff state.
Initially, because virDomainObjNew() uses g_new0() the @pid is
initialized to 0. But when domain is shut off, some functions set
it to -1 (virBhyveProcessStop, virCHProcessStop, qemuProcessStop,
..).

In other places, the @pid is tested to be 0, on some other places
it's tested for being negative and in the rest for being
positive.

To solve this inconsistency we can stick with either value, -1 or
0. I've chosen the latter as it's safer IMO. For instance if by
mistake we'd kill(vm->pid, SIGTERM) we would kill ourselves
instead of init's process group.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2022-06-01 09:35:26 +02:00
Jiri Denemark
506210aab9 Post-release version bump to 8.5.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-06-01 09:30:38 +02:00
Jiri Denemark
0c92b08426 Release of libvirt-8.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-06-01 09:28:24 +02:00
Daniel P. Berrangé
8b8fd1bc67 ci: eliminate many cross arch CI builds
We currently build cross-arch containers for all three Debian
releases (10, 11, Sid), and do libvirt builds covering each
arch. This is overkill in terms of the number of problems it
identifies. The most important aspect of cross arch builds is
to find problems with 32-bit builds and problems with big
endian builds.

With this in mind the cross arch jobs are altered as follows

 - Debian 10
     - build the containers by default
     - build armv7 (32-bit) & s390x (big endian)
     - other arch builds manual

 - Debian 11 / Sid
     - container builds all optional
     - arch builds all optional

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-31 17:23:04 +02:00
Daniel P. Berrangé
bb9abaed26 ci: move Ubuntu GCC santizers build to 20.04
We currently build on Ubuntu 22.04 twice, for GCC and CLang
with santizers turned on. Moving the GCC santizers build
to 20.04 lets us cull one of the 22.04 jobs

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-31 17:23:04 +02:00
Daniel P. Berrangé
b7565a2145 ci: disable native builds on certain distros
Currently we do native builds on all distros that are covered
by the support matrix. This reduces that such that we mostly
only run builds on the newest (ie bleeding edge non-released)
version and the oldest version. The effect is that cut out
builds on the newest release version. This is acceptable,
because that version is sandwiched between two versions we
do still test, so unlikely to have failures not already
identified by other jobs.

This has the effect of disabling:

  - AlmaLinux 8 GCC - still has a CLang build
    and CentOS 8 Stream also gives coverage

  - Debian 11 - still has a Debian 10 and Sid
    build

  - Alpine 3.15 - still has a Alpine 3.14 and Edge
    build

Ideally Fedora 35 would be disabled too, but we rely on that
for the integration tests.

The Ubuntu jobs will be handled in the next patch.

The containers are still built since this is cheap-ish.

The build jobs can also be triggered manually if desired.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-31 17:23:04 +02:00
Daniel P. Berrangé
1c5bc460d3 ci: refresh with lcitool manifest
This refreshes the containers bringing in new behaviour when
builds/containers are disabled.

Instead of deleting the job entirely, the job still exists
but is set to be a manual job. It won't affect the pipeline
result, but can be triggered by the developer if they wish
to test a specific scenario.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-31 17:23:04 +02:00
Göran Uddeborg
77ffe16047 Translated using Weblate (Swedish)
Currently translated at 33.1% (3461 of 10431 strings)

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

Translated using Weblate (Swedish)

Currently translated at 32.9% (3441 of 10431 strings)

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

Translated using Weblate (Swedish)

Currently translated at 32.7% (3421 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-05-31 14:35:28 +02:00
Göran Uddeborg
78290b3cff Translated using Weblate (Swedish)
Currently translated at 32.7% (3421 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2022-05-31 12:13:00 +00:00
김인수
6813707157 Translated using Weblate (Korean)
Currently translated at 100.0% (10431 of 10431 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-05-31 12:13:00 +00:00
Yuri Chornoivan
e39fc69b8b Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10431 of 10431 strings)

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

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2022-05-31 12:13:00 +00:00
Weblate
f9ea509d52 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2022-05-31 12:13:00 +00:00
Han Han
bac9e55efe news: Add APIs virDomainSaveParams virDomainRestoreParams
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-31 12:26:42 +02:00
Han Han
586cbe754d news: Add qemu-vdagent
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-31 12:26:37 +02:00
Michal Privoznik
b4161c2d42 virDomainInputDefValidate: Validate model
If input device has one of virtio* models set then it has to go
onto virtio bus. Introduce such check into the validator.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2081981
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-30 16:30:21 +02:00
Michal Privoznik
bded22e3a7 virDomainInputDefValidate: Reformat
There are some formatting problems with virDomainInputDefValidate().
Reformat it to our standards. Use this opportunity to move error
messages onto a single line.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-30 16:30:09 +02:00
Peter Krempa
60d18ff746 NEWS: Mention 'absolute' clock offset
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-30 09:38:58 +02:00
Michal Privoznik
14bd5036e4 qemuProcessStop: Don't try to remove QoS on already removed TAP
When cleaning up after stopped domain, one of the things we do is
attempt to clear QoS settings on OVS type interfaces. Well, this
is needless because they were removed just a couple of lines
above. As a result, the attempt fails and a warning is printed
into logs, polluting them needlessly.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/313
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-30 09:14:41 +02:00
Daniel P. Berrangé
a5d9c70621 gitlab: mark job dependencies as optional
The container jobs are all optional in upstream now, only
running if dockerfile changes were made. Thus any build
jobs which reference the container jobs need to mark their
dependency as optional too.

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-27 08:11:15 -04:00
Michal Privoznik
7f463b4c0d nss: Compare hostname case insensitive
There are some tools that convert hostname to lowercase before
resolving it (e.g. ssh). In a way it makes sense because DNS is
case insensitive and in case of ssh the lowercase version is then
used to find matching record in its config file. However, our NSS
module performs case sensitive comparison, which makes it useless
with ssh. Just consider a machine named FooBar.

Therefore, switch to case insensitive string comparison.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1777873
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-27 13:43:14 +02:00
Martin Kletzander
76802e5dc6 ci: Refresh generated files
Notable changes:

* 'lcitool manifest' now generates absolute include paths

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-27 13:35:33 +02:00
Daniel P. Berrangé
bf769a4d42 build-aux: remove syntax checks for ATTRIBUTE_* and ARRAY_CARDINALITY
These checks made sense when we were in process of converting code.
Since the definition of the macros has been entirely removed now,
the compiler will already thrown an error. There aren't likely to
be any in-flight patches that would hit this anyone either.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-27 09:22:18 +01:00
Andrea Bolognani
be1d39f6bd ci: Don't mark any Fedora 36 job as optional
It's a stable distro, so we expect all jobs to succeed.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-26 16:41:23 +02:00
Andrea Bolognani
1234ea1d38 ci: Move MinGW jobs to Fedora 36
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-26 16:41:20 +02:00
Andrea Bolognani
a6f7ed6e72 ci: Add Fedora 36
The target is intentionally not added to the integration tests
at this time, because the corresponding VM template is not yet
available on the runner. A later patch will take care of that.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-26 16:41:19 +02:00
Andrea Bolognani
c000499c4f ci: Refresh generated files
Notable changes:

  * 'lcitool manifest' now generates GitLab CI rules spread
    across a bunch of files;

  * container images are built less frequently for the main
    repository.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-26 16:41:17 +02:00
Andrea Bolognani
af89e4b8f8 ci: Drop Fedora 34
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-26 16:41:14 +02:00
Scott Davis
8833b42f3b vircgroupv1: fix null string specifier argument in virCgroupV1ValidatePlacement
Detected by gcc 11 -Wformat-overflow:
../../src/util/vircgroupv1.c: In function ‘virCgroupV1ValidatePlacement’:
../../src/util/virerror.h:176:5: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
  176 |     virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  177 |                          __FUNCTION__, __LINE__, __VA_ARGS__)
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/util/vircgroupv1.c:411:13: note: in expansion of macro ‘virReportError’
  411 |             virReportError(VIR_ERR_INTERNAL_ERROR,
      |             ^~~~~~~~~~~~~~
../../src/util/vircgroupv1.c:412:80: note: format string is defined here
  412 |                            _("Could not find placement for v1 controller %s at %s"),
      |                                                                                ^~

Signed-off-by: Scott Davis <scott.davis@starlab.io>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-26 10:14:49 +02:00
Scott Davis
8cd9065352 remote: fix null string specifier argument in remoteProbeSessionDriverFromBinary
Detected by gcc 11 -Wformat-overflow:
../src/remote/remote_sockets.c: In function ‘remoteProbeSessionDriverFromBinary’:
../src/util/virlog.h:79:5: error: ‘%s’ directive argument is null [-Werror=format-overflow=]
   79 |     virLogMessage(src, VIR_LOG_DEBUG, filename, linenr, funcname, NULL, __VA_ARGS__)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/util/virlog.h:88:5: note: in expansion of macro ‘VIR_DEBUG_INT’
   88 |     VIR_DEBUG_INT(&virLogSelf, __FILE__, __LINE__, __func__, __VA_ARGS__)
      |     ^~~~~~~~~~~~~
../src/remote/remote_sockets.c:187:9: note: in expansion of macro ‘VIR_DEBUG’
  187 |         VIR_DEBUG("Probing driver '%s' via daemon %s", drivers[i], daemonpath);
      |         ^~~~~~~~~
../src/remote/remote_sockets.c:187:51: note: format string is defined here
  187 |         VIR_DEBUG("Probing driver '%s' via daemon %s", drivers[i], daemonpath);
      |                                                   ^~

Signed-off-by: Scott Davis <scott.davis@starlab.io>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-26 10:14:46 +02:00
Scott Davis
8c6fa38efc qemu: fix null string specifier argument in qemuDomainBlockJobAbort
Detected by gcc 11 -Wformat-overflow:
../../src/qemu/qemu_driver.c: In function ‘qemuDomainBlockJobAbort’:
../../src/util/virerror.h:176:5: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
  176 |     virReportErrorHelper(VIR_FROM_THIS, code, __FILE__, \
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  177 |                          __FUNCTION__, __LINE__, __VA_ARGS__)
      |                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/qemu/qemu_driver.c:14475:17: note: in expansion of macro ‘virReportError’
14475 |                 virReportError(VIR_ERR_OPERATION_FAILED,
      |                 ^~~~~~~~~~~~~~
../../src/qemu/qemu_driver.c:14476:73: note: format string is defined here
14476 |                                _("block job '%s' failed while pivoting: %s"),
      |                                                                         ^~

Signed-off-by: Scott Davis <scott.davis@starlab.io>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-26 10:14:40 +02:00
Jiri Denemark
c781b025c0 po: Refresh potfile for v8.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-05-25 22:18:56 +02:00
김인수
f0bcb31a53 Translated using Weblate (Korean)
Currently translated at 100.0% (10419 of 10419 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-05-25 15:12:24 +02:00
Weblate
42ec0dbfc0 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2022-05-25 15:12:24 +02:00
Ján Tomko
ad318a6c12 vbox: SnapshotConfAllChildren: reduce scope of tempSize
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-25 15:10:02 +02:00
Ján Tomko
9e41a59ce5 apparmor: report error when removing profile failed
Assign the return value to 'rc' before comparing it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-25 15:10:02 +02:00
Ján Tomko
ef17772900 Do not check if unsigned vars are less than zero
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-25 15:10:02 +02:00
Daniel Henrique Barboza
e79bfda145 NEWS.rst: document Power10 support
Update NEWS.rst with the now added Power10 processor support.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-24 14:25:41 -03:00
Daniel Henrique Barboza
316de7eb12 cpu_ppc64: add support for host-model on POWER10
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-24 14:25:41 -03:00
Daniel Henrique Barboza
38dba6a02e cpu_map: add POWER10 cpu model
Add POWER10 as a supported cpu model.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-24 14:25:41 -03:00
Jiri Denemark
76baf935aa qemu: Do not pass unused opaque pointer to monitor callbacks
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
88f3727e71 qemu: Do not use opaque pointer in QEMU monitor callbacks
It always points to QEMU driver, which is quite redundant as all
callbacks also get a pointer to a vm object. Let's get the driver
pointer from there instead.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
64d5d06c56 qemu: Drop driver parameter from qemuProcessEventSubmit
We can easily get it from the vm object.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
7b5046ff6c qemu: Make vm parameter of qemuProcessEventSubmit mandatory
All callers (QMP event handlers) always pass non-NULL vm pointer. Let's
make the parameter mandatory.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
3ccd69f8c0 qemu: Pass arguments to qemuProcessEventSubmit directly
Allocating and filling qemuProcessEvent structure is a repeated pattern
before all calls to qemuProcessEventSubmit. We can move the allocation
inside this function and let callers pass all arguments directly.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Jiri Denemark
b4662bbd1f qemu: Avoid unlocked access to vm object in monitor callbacks
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 16:26:04 +02:00
Michal Privoznik
1c23123732 qemu_tpm: Make APIs work over a single virDomainTPMDef
In qemu_extdevice.c lives code that handles helper daemons that
are required for some types of devices (e.g. virtiofsd,
vhost-user-gpu, swtpm, etc.). These devices have their own
handling code in separate files, with only a very basic functions
exposed (e.g. for starting/stopping helper process, placing it
into given CGroup, etc.). And these functions all work over a
single instance of device (virDomainVideoDef *, virDomainFSDef *,
etc.), except for TPM handling code which takes virDomainDef *
and iterates over it inside its module.

Remove this oddness and make qemuExtTPM*() functions look closer
to the rest of the code.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-24 16:15:29 +02:00
Michal Privoznik
3663a7d48c virprocess: Drop workaround for setns() wrt old glibc
We have our own implementation of setns() which was introduced in
v1.2.9-rc1~190 and extended afterwards. The reason was that back
in 2014 we were dealing with glibc that in some of its older
versions did not provide the function. Mostly for non-intel
arches. Nevertheless, glibc now offers the function for all
architectures we care about (aarch64 being the freshest
architecture where the function was introduced, in glibc-2.17).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-24 16:15:29 +02:00
Andrea Bolognani
9750edcfb0 syntax-check: Pull updates from gnulib
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 15:48:58 +02:00
Andrea Bolognani
a415225605 syntax-check: Add versioning information
Our copy of syntax-check has diverged quite a bit from the
gnulib original, but a lot of the core logic has remained
identical and it would be nice if we could periodically pull
improvements.

To make this manageable, record the gnulib commit our copy is
derived from: this way, the person updating the file will know
the range of gnulib commits that they have to consider.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 15:48:53 +02:00
Andrea Bolognani
7de9b74a84 src: Use archive.org for dead URLs
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:18 +02:00
Andrea Bolognani
fb5f2f100e docs: Use HTTPS where possible
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:17 +02:00
Andrea Bolognani
9a179fd65e docs: Update various URLs
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:16 +02:00
Andrea Bolognani
40d78e47e5 docs: Update URL for MinGW
The MinGW-w64 project has effectively replaced the original
MinGW project, and distributions such as Fedora have been shipping
packages based on the former for years now.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:15 +02:00
Andrea Bolognani
145f429f8c docs: Update URL for libxml2
The project is developed as part of GNOME these days, and the
old URL redirects to GNOME's GitLab instance.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:13 +02:00
Andrea Bolognani
bb8abcde2c docs: Use more generic URL for netcat
GNU netcat was last updated in 2004. These days, most operating
systems will include either the nmap or OpenBSD variant of the
tool.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:12 +02:00
Andrea Bolognani
d0a5eb59cb util: Drop references to netlink.pdf
The website no longer exists and the PDF file can't even be
retrieved via archive.org.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:11 +02:00
Andrea Bolognani
20afcc1c53 docs: apps: Drop Snooze
The website is still up, but the software itself was last
updated in 2014.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:10 +02:00
Andrea Bolognani
4c52d75f09 docs: apps: Drop Cracow Cloud One
The website is still up, although the latency is so high that it
could hardly considered usable; the software itself was last
updated in 2015.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:08 +02:00
Andrea Bolognani
37c8fd4f63 docs: apps: Drop Tivoli Provisioning Manager
It doesn't seem to be a current product: there is no proper
website for it, and the most recent installation instructions
I've been able to locate are targeted at RHEL 6.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:19:07 +02:00
Andrea Bolognani
4e61aecbc8 syntax-check: Drop unused http_sites
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 12:18:55 +02:00
Andrea Bolognani
7f403bc251 syntax-check: Enforce sc_prohibit_backslash_alignment everywhere
Basically all files in the repository are already passing the
check, except for syntax-check.mk itself. Fix that, and stop
limiting the files on which the test is performed.

These changes have been generated by running

  $ sed -Ei 's/[ '$'\t'']+\\$/ \\/g' $(git grep -El '[ '$'\t'']+\\$')

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:51 +02:00
Andrea Bolognani
6545173b69 syntax-check: Drop sc_ prefix when adding checks to meson
All checks are added to the syntax-check suite, and this name is
displayed prominently in the output of 'meson test', so there
really is no need to include the sc_ prefix too.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:50 +02:00
Andrea Bolognani
1a61e06af4 syntax-check: Add all target
The makefile is an implementation detail, so point users towards
the proper way of running syntax-check if they happen to call it
directly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:48 +02:00
Andrea Bolognani
af9eb9e399 syntax-check: Reorganize file
Due to the way make works, we are not forced to follow a strict
order in defining rules and variables. In fact _sc_search_regexp,
which is used by all checks, is only defined halfway through the
file.

Shuffle things around so that the things that we need to look at
the most frequently are closer to the top of the file.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:47 +02:00
Andrea Bolognani
dddbc95375 syntax-check: Detect awk the same as all other programs
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:46 +02:00
Andrea Bolognani
f98baa1b54 syntax-check: Drop ME variable
It's only used in diagnostics, and even there it's not
particularly useful and can make it more difficult to spot the
actual error message.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:45 +02:00
Andrea Bolognani
afa944afb7 syntax-check: Drop unused machinery
_equal is not used anywhere; the rest of the code implements the
syntax-check target, which takes care of figuring out the list of
checks that have been defined and running them, printing the name
of each check along with its execution time.

This was useful when we were using autotools, but these days we
have meson driving the entire build process and each of the
checks is registered as a separate test, which gives us all of
the features described above for free.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:43 +02:00
Andrea Bolognani
ab305ad5ca syntax-check: Simplify VC_LIST_ALWAYS_EXCLUDE_REGEX
Most of the pattern is no longer relevant, because the files it
was intended to match have been dropped from the repository.

Specifically:

               files        commit        date
  ------------------  ------------  ----------
               *.gif  6cb131e5cb  2022-01-19
               *.fig  9ad637c965  2020-07-10
  docs/news*.html.in  f45735786a  2020-06-02
        docs/*.patch  6be034a8c0  2018-08-23

We can also avoid having a fallback value for the pattern: that
made sense when the implementation was coming from gnulib, as
they wouldn't be able to know in advance if the user would need
to provide their own exclude patterns, but that scenario is no
longer relevant to us.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:42 +02:00
Andrea Bolognani
39d1c78967 syntax-check: Use VC_LIST_EXCEPT in sc_prohibit_backup_files
We can assume that VC_LIST_ALWAYS_EXCLUDE_REGEX will not be
defined in a way that would catch backup files.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:41 +02:00
Andrea Bolognani
18cb263100 syntax-check: Improve sc_prohibit_config_h_in_headers check
In its current form, the check will not only catch the intended

  #include <config.h>

but also stuff like

  #include <wireshark/config.h>
  #include "qemu_interop_config.h"
  #include <meson-config.h>

The last one is problematic, because it's used in config.h itself.
Making the pattern more strict allows us to drop the exception.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:40 +02:00
Andrea Bolognani
8aa6063ef9 syntax-check: Remove sc_copyright_usage exception
The pattern in build-aux/syntax-check.mk is written specifically
so that it won't match itself, which makes having an exception
for the file unnecessary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:38 +02:00
Andrea Bolognani
2c49bb1521 syntax-check: Remove sc_gettext_init exception
The file src/util/vireventglib.c doesn't contain a main() function
and so it's not even considered by the check.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:36 +02:00
Andrea Bolognani
4c8c336e78 syntax-check: Drop sc_bindtextdomain check
This is one of the standard checks that we have inherited from
gnulib, but it's not applicable to libvirt because we don't want
plain bindtextdomain() to be used: virGettextInitialize() is our
own private API that should be used instead.

The sc_gettext_init check ensures that our private API is used
in all the places where it makes sense, and the sc_bindtextdomain
check was disabled entirely via a blanket exception. Drop it
instead of keeping dead code around.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 11:09:28 +02:00
Michal Privoznik
2df6849d78 qemu_hotplug: Deny changing @rss and @rss_hash_report attributes of virtio vNICs
We have virDomainUpdateDeviceFlags() API that allows changing of
some attributes of a device whilst domain is still running (e.g.
setting different QoS, link state change on vNICs). But only very
limited set of attributes can be changed and we have to check
whether user isn't trying to sneak in a change that's not
allowed. Well, in case of a virtio vNIC we forgot to check for
@rss and @rss_hash_report attributes of <driver/>.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2082540
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2022-05-24 09:02:00 +02:00
Boris Fiuczynski
e37c39747b nodedev: prevent internal error on dev_busid parse
As "none" is a legal value represented in the sysfs attribute dev_busid
this patch prevents libvirt from incorrectly reporting an internal error.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Suggested-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-24 08:55:45 +02:00
Daniel Henrique Barboza
a46ff97762 qemuxml2argvtest.c: use CAPS_ARCH_LATEST() with pseries-cpu-compat-power9
Use the newly added ARG_CAPS_HOST_CPU_MODEL to set which host CPU we
expect the test to use - the test should fail when using a POWER8 host
cpu but complete when using a POWER9 host cpu.

Two new macros were added because we will be adding similar tests in the
near future when adding support for the Power10 chip.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-23 19:25:09 -03:00
Daniel Henrique Barboza
a678430492 testutilsqemu: introduce ARG_CAPS_HOST_CPU_MODEL
When loading a latest caps for an arch for the first time the following
occurs in testQemuInfoInitArgs():

- the caps file is located. It's not in the cache since it's the first time
it's being read;
- the cachecaps are retrieved using qemuTestParseCapabilitiesArch() and
stored in the capscache;
- FLAG_REAL_CAPS is set and regular flow continues.

Loading the same latest caps for the second time the caps are loaded from the
cache, skipping qemuTestParseCapabilitiesArch(). By skipping this function it
means that it also skips virQEMUCapsLoadCache() and, more relevant to
our case, virQEMUCapsInitHostCPUModel(). This function will use the
current arch and cpuModel settings to write the qemuCaps that are being
stored in the cache. And we're also setting FLAG_REAL_CAPS, meaning that
we won't be updating the qemucaps host model via testUpdateQEMUCaps() as
well.

This has side-effects such as:

- the first time the latest caps for an arch is loaded determines the
cpuModel it'll use during the current qemuxml2argvtest run. For
example, when running all tests, the first time the latest ppc64 caps
are read is on "disk-floppy-pseries" test. Since the current host arch
at this point is x86_64, the cpuModel that will be set for this
capability is "core2duo";

- every other latest arch test will use the same hostCPU as the first
one set since we read it from the cache after the first run.
qemuTestSetHostCPU() makes no difference because we won't update the
host model due to FLAG_REAL_CAPS being set. Using the previous example,
every other latest ppc64 test that will be run will be using the
"core2duo" cpuModel.

Using fake capabilities (e.g. using DO_TEST()) prevents FLAG_REAL_CAPS to
be set, meaning that the cpuModel will be updated using the current
settings the test is being ran due to testUpdateQEMUCaps().

Note that not all latest caps arch tests care about the cpuModel being
set to an unexpected default cpuModel. But some tests will care, e.g.
"pseries-cpu-compat-power9", and changing it from DO_TEST() to
DO_TEST_CAPS_ARCH_LATEST() will make it fail every time the
"disk-floppy-pseries" is being ran first.

One way of fixing it is to rethink all the existing logic, for example
not setting FLAG_REAL_CAPS for latest arch tests. Another way is
presented here. ARGS_CAPS_HOST_CPU_MODEL is a new testQemuInfo arg that
allow us to set any specific host CPU model we want when running latest
arch caps tests. This new arg can then be used when converting existing
DO_TEST() testcases to DO_TEST_CAPS_ARCH_LATEST() that requires a
specific host CPU setting to be successful, which we're going to do in
the next patch with "pseries-cpu-compat-power9".

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-23 19:24:42 -03:00
Daniel Henrique Barboza
8ccb4f463e qemu_capspriv.h: fix indentation
Fix identation of virQEMUCapsUpdateHostCPUModel() params.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-23 19:24:28 -03:00
Daniel Henrique Barboza
eca2a6cc92 qemuxml2xmltests.c: convert pseries tests to DO_TEST_CAPS_ARCH_LATEST
qemuxml2xmltests that have "pseries" in the name now use the
DO_TEST_CAPS_LATEST_ARCH() macro.

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
2022-05-23 19:19:16 -03:00
Jiri Denemark
9c495f8fcb qemu: Do not return NULL when qemuMigrationSrcBegin succeeds
My recent commit v8.3.0-201-gc500955e95 tried to fix a regression which
would cause the function to return success even if virCloseCallbacksSet
failed. But due to a strange code flow in the function introduced an
opposite regression. The function would return NULL on success when
called without VIR_MIGRATE_CHANGE_PROTECTION flag.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:59:05 +02:00
Boris Fiuczynski
127fda5e84 nodedev: add tests for optional device address to css device
Add nodedev schema parsing and format tests for the optional new device
address on the css devices.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:44 +02:00
Boris Fiuczynski
122b975e40 nodedev: add optional device address of channel device to css device
Add the new introduced sysfs attribute dev_busid which provides the address
of the device in the subchannel independent from the bound device driver.
It is added if available in the sysfs as optional channel_dev_addr element into
the css device capabilty providing the ccw deivce address attributes cssid,
ssid and devno.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:35 +02:00
Boris Fiuczynski
e9ba2ced0b schemas: refactor out nodedev ccw address schema
Refactor out nodedev ccw address schema for easy reuse later.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:10 +02:00
Boris Fiuczynski
245ff2d663 nodedev: refactor css XML parsing from ccw XML parsing
In preparation for easier extension later.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:08 +02:00
Boris Fiuczynski
4402295d37 nodedev: refactor ccw device address parsing from XML
Move ccw device address XML parsing into new method for later reuse.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:07 +02:00
Boris Fiuczynski
c586488506 nodedev: refactor css format from ccw format method
In preparation for easier extension later.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:32:03 +02:00
Boris Fiuczynski
9453eb458a util: add virCCWDeviceAddressFromString to virccw
Add a method to parse a ccw device address from a string.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:59 +02:00
Boris Fiuczynski
8d52f99f0b util: add ccw device address parsing into virccw
Add virCCWDeviceAddressParseFromString and use it in nodedev udev.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:57 +02:00
Boris Fiuczynski
2d9fd19bf5 conf: adjust method name virDomainDeviceCCWAddressParseXML
Adjust method name virDomainDeviceCCWAddressParseXML to
virCCWDeviceAddressParseXML.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:55 +02:00
Boris Fiuczynski
784b876035 util: refactor virDomainDeviceCCWAddressEqual into virccw
Refactor virDomainDeviceCCWAddressEqual into virccw and rename method as
virCCWDeviceAddressEqual.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:53 +02:00
Boris Fiuczynski
38756ce5ba util: refactor virDomainDeviceCCWAddressIsValid into virccw
Refactor virDomainDeviceCCWAddressIsValid into virccw and rename method
as virCCWDeviceAddressIsValid.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:52 +02:00
Boris Fiuczynski
be1e16ed11 util: refactor virDomainCCWAddressIncrement into virccw
Refactor virDomainCCWAddressIncrement into virccw and rename method as
virCCWDeviceAddressIncrement.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:49 +02:00
Boris Fiuczynski
5fe90d471a util: refactor ccw address constants into virccw
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:47 +02:00
Boris Fiuczynski
b41163005c util: make reuse of ccw device address format constant
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:45 +02:00
Boris Fiuczynski
1df0a19869 util: refactor virDomainCCWAddressAsString into virccw
Move virDomainCCWAddressAsString into virccw and rename method as
virCCWDeviceAddressAsString.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:42 +02:00
Boris Fiuczynski
45a8e3988f util: refactor virDomainDeviceCCWAddress into virccw.h
Refactor ccw data structure virDomainDeviceCCWAddress into util virccw.h
and rename it as virCCWDeviceAddress.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:40 +02:00
Boris Fiuczynski
78094a4bd1 nodedev: fix reported error msg in css cap XML parsing
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 16:31:37 +02:00
Michal Privoznik
a54391fbc2 remote_daemon: Don't run virStateCleanup() if virStateReload() is still running
When a SIGHUP is received a thread is spawned that runs
virStateReload(). However, if SIGINT is received while the former
thread is still running then we may get into problematic
situation: the cleanup code in main() sees drivers initialized
and thus calls virStateCleanup(). So now we have two threads, one
running virStateReload() the other virStateCleanup(). In this
situation it's very likely that a race condition occurs and
either of threads causes SIGSEGV.

To fix this, unmark drivers as initialized in the
virStateReload() thread for the time the function runs.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2075837
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-23 14:44:50 +02:00
Andrea Bolognani
2b98d5d91d apparmor: Allow locking AAVMF firmware
We already allow this for OVMF.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/312
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-23 14:01:21 +02:00
Andrea Bolognani
8d160b7979 syntax-check: Introduce sc_linguas_sorting
Make sure LINGUAS remains sorted correctly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:29 +02:00
Andrea Bolognani
6a2fea9283 po: Sort LINGUAS
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:28 +02:00
Andrea Bolognani
bed3781a30 syntax-check: Don't exclude src/false.c from sc_po_check
This is something that certainly made sense in the context of
gnulib, but we don't have a use for it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:26 +02:00
Andrea Bolognani
55ae46a6df po: Don't generate POTFILES
Now that we have dropped prefixes from the file, it no longer
needs to go through configure_file() and we can use it directly.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:25 +02:00
Andrea Bolognani
4172d1aedc po: Drop prefixes from POTFILES.in
Commit 8beb7fdd0e changed the handling of POTFILES so that it
could cope with files being located in either the source or build
directory: it did so by adding @SRCDIR@ and @BUILDDIR@
respectively at the beginning of each line, and then converting
them back to the actual values when generating POTFILES from
POTFILES.in.

Later, commit c6a0d3ff8b started passing --directory to
xgettext, which resulted in the tool being able to locate files
regardless of whether they are in the source or build directory.
However, @SRCDIR@ and @BUILDDIR@ were still added to POTFILES.in
only to be stripped when generating POTFILES.

Simplify things by not storing information that we know we're
going to discard later.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:24 +02:00
Andrea Bolognani
325dd585fb po: Stop using 'glib' preset for i18n.gettext()
Due to a bug in meson versions earlier than 0.60, the
--add-comments that's part of the 'glib' preset and the
--add-comments=TRANSLATORS: that we add ourselves might be
passed to xgettext in the wrong order, resulting in a bunch of
comments that we don't care about being added to the potfile.

Most of the options included in the 'glib' preset are not
applicable to libvirt anyway, so just stop using the preset and
pass a few extra options explicitly instead.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:22 +02:00
Andrea Bolognani
a4ed1e935f po: Drop unwanted comments from potfile
These managed to sneak in as part of ec02f5719a, when the
potfile was last refreshed, but are not supposed to be there.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-23 13:58:03 +02:00
Jiri Denemark
c500955e95 qemu: Fix error propagation in qemuMigrationBegin
Commit v8.3.0-152-g49ef0f95c6 removed explicit VIR_FREE from
qemuMigrationBegin, effectively reverting v1.2.14-57-g77ddd0bba2

The xml variable was used to hold the return value and thus had to be
unset when an error happened after xml was already non-NULL. Such code
may be quite confusing though and we usually avoid it by not storing
anything to a return variable until everything succeeded.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-23 13:13:37 +02:00
Max Goodhart
42cb548045 Allow VM to read sysfs PCI config, revision files
This fixes a blank screen when viewing a VM with virtio graphics and
gl-accelerated Spice display on Ubuntu 22.04 / libvirt 8.0.0 / qemu 6.2.

Without these AppArmor permissions, the libvirt error log contains
repetitions of:

qemu_spice_gl_scanout_texture: failed to get fd for texture

This appears to be similar to this GNOME Boxes issue:
https://gitlab.gnome.org/GNOME/gnome-boxes/-/issues/586

Fixes: https://launchpad.net/bugs/1972075

Signed-off-by: Max Goodhart <c@chromakode.com>
Reviewed-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2022-05-20 07:37:14 +02:00
Jiri Denemark
1bd24e79be util: Do not report useless error in virPortAllocatorRelease
If the port allocator bitmap does not have enough bits to keep the state
of the port we're going to release, the port is not reserved and thus is
trivially released without doing anything. No need to report an error in
such case.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-19 17:40:31 +02:00
Martin Kletzander
b7b8cd6ad6 apparmor: Add support for dbus chardev
Commit 7648e40da5 added support for dbus chardev but forgot to handle it in
AppArmor code.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-19 14:15:02 +02:00
Marc-André Lureau
89d789670d docs: document <graphics> type dbus
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:42 +02:00
Marc-André Lureau
3fa987cc42 qemu: add usbredir type 'dbus'
The USB device redirection works in a similar way as Spice. The
underlying 'dbus' channel is set to "org.qemu.usbredir" by default for
the client to identify the channel purpose (as specified in -display
dbus documentation).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:40 +02:00
Marc-André Lureau
53905292f9 qemu: add -chardev dbus support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:37 +02:00
Marc-André Lureau
7648e40da5 conf: add <serial type='dbus'>
Like a Spice port, a dbus serial must specify an associated channel name.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:35 +02:00
Marc-André Lureau
1ce258a570 qemu: add audio type 'dbus'
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:32 +02:00
Marc-André Lureau
a062f5f777 conf: add <audio type='dbus'> support
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:28 +02:00
Marc-André Lureau
bf213aa965 virsh: report the D-Bus bus URI for domdisplay
This implementation reports only Unix bus address using the URI format
proposed in https://gitlab.freedesktop.org/dbus/dbus/-/issues/348.

We prefer a URI form over the D-Bus address form, since all other
display protocols use a URI, allowing to distinguish between protocols
and making client implementation simpler.

Other transports (for example TCP) are not yet handled.

The client is assumed to know what to lookup on the bus (the bus name,
path & interface of the VM, eventually matching its UUID)

P2P mode doesn't report any available URI.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:24 +02:00
Marc-André Lureau
bde66322e8 qemu: add -display dbus support
By default, libvirt will start a private bus and tell QEMU to connect to
it. Instead, a D-Bus "address" to connect to can be specified, or the
p2p mode enabled.

D-Bus display works best with GL & a rendernode, which can be specified
with <gl> child element.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:20 +02:00
Marc-André Lureau
5c1e203a80 qemu: start the D-Bus daemon for the display
Start the daemon if necessary (it is already stopped in qemuProcessStop)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:17 +02:00
Marc-André Lureau
88ba34f5a0 conf: add <graphics type='dbus'>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:36:09 +02:00
Marc-André Lureau
14f45e5d8d qemu: add -display dbus capability check
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-19 12:35:26 +02:00
Michal Privoznik
b3e2fea3e8 remoteOpenConn: Pass correct variable to virConnectSetIdentity()
The remoteOpenConn() function was refactored recently. As a part
of that new variable @newconn was introduced which holds
virConnect object as it's being gradually constructed throughout
the function. At the very end, when everything succeeded the
variable is stolen into passed @conn. However, there was one
line missed in the refactor which still access the @conn instead
of @newconn leading to a NULL dereference.

Fixes: f7c422993e
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-19 10:15:48 +02:00
Han Han
577c336151 docs: drvqemu: Fix the syntax typo of Hypervisor.framework link
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:33 +02:00
Han Han
5ce918f3a5 docs: drivers: Mention KVM/HVF in the link of qemu driver
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:31 +02:00
Han Han
f073783979 news: Add news for rss and rss_hash_report attributes
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:30 +02:00
Han Han
facaa9ae98 docs: formatdomain: Add the introduced versions of net rss attrs
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:29 +02:00
Han Han
49b5200e16 docs: apps: Add desktop app gnome-boxes
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-19 10:10:23 +02:00
Han Han
1bd51b6afe news: Validation flags for creating net, nwfilter-binding, net port
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:57:36 +02:00
Han Han
5c1a99ff83 news: Add queue_size option to virtio disk
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:56:20 +02:00
Han Han
6921c2cf73 news: Support vhostuser in virsh attach-interface
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:56:15 +02:00
Han Han
07d950adda news: qemu: Add support for NFS disk protocol
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:59 +02:00
Han Han
4b4a7153d0 news: cpu_map: Add Snowridge cpu model
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:58 +02:00
Han Han
6e5852cb4b news: qemu: support kvm-poll-control performance hint
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:56 +02:00
Han Han
c9a37b64df news: Introduce "migrate_tls_force" to qemu.conf
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:55 +02:00
Han Han
c04bb76af7 news: qemu: Add 'fmode' and 'dmode' options for 9pfs
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:54 +02:00
Han Han
17fe7ae0cb news: qemu: virtiofs can be used without NUMA nodes
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:53 +02:00
Han Han
95f9d4290c news: qemu: Introduce virtio free page reporting feature
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:51 +02:00
Han Han
49211723b6 news: qemu: Set noqueue qdisc for TAP devices
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:50 +02:00
Han Han
28deb22485 news: logging: allow max_len=0 to disable log rollover
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:49 +02:00
Han Han
07666093f7 news: cpu: Support for XML validation in cpu comparison
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:48 +02:00
Han Han
0529cf77f2 news: cpu_map: Add EPYC-Rome cpu model
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:46 +02:00
Han Han
02c898d801 news: support device stats collection for SR-IOV VF hostdev
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:42 +02:00
Han Han
cb12f8b8c8 news: make SEV attrs 'cbitpos' & 'reducedPhysBits' optional
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-18 19:55:34 +02:00
Peter Krempa
f7c422993e doRemoteOpen: Refactor control flow
Use a temporary variable 'newconn' to hold the newly opened connection
until we are ready to pass it back instead of the original connection.

This way we can avoid complicated 'error'/'cleanup' sections.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Peter Krempa
7f50557c08 virIdentityGetParameters: Return 'virTypedParamList'
Refactor the code to use virTypedParamList which simplifies cleanup.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Peter Krempa
decc03857f virGetConnectGeneric: Fix memleak of 'identparams' when connecting between split daemons
The 'identparams' typed parameter list obtained from
virIdentityGetParameters is leaked when called from
'virGetConnectGeneric'.

Use 'virTypedParamListFromParams' to absorb it into a virTypedParamList
which can be autofreed.

Note that the memleak is observable only when running in split-daemon
mode.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/314
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Peter Krempa
45064119c1 util: typedparam: Introduce virTypedParamListFromParams
The helper constructs a virTypedParamList from loose params.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-18 13:46:30 +02:00
Jan Kuparinen
6c9117c988 Translated using Weblate (Finnish)
Currently translated at 22.9% (2386 of 10419 strings)

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

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2022-05-18 09:04:46 +02:00
Peter Krempa
579403ba2e virclosecallbacks: Don't pass opqaue pointer to callback invocation
Remove the argument from the function prototypes and the callback
handler.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
e90301134c bhyveProcessAutoDestroy: Use 'driver' from VM private data
Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
2cada2c31c lxcProcessAutoDestroy: Use 'driver' from VM private data
Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
02fe5fe298 qemuProcessAutoDestroy: Use 'driver' from VM private data
Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
2f072e24db qemuMigrationSrcCleanup: Use 'driver' from VM private data
Access the 'driver' struct from the private data rather than the passed
opaque pointer in preparation to remove the opaque pointer.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
6871553c3f lxc: Store 'driver' in VM private data
Similarly to the qemu driver if we store the immutable driver pointer in
the VM private data struct we don't have to questionably pass it through
opaque pointers to callbacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
f5c8abf176 bhyve: Store 'driver' in VM private data
Similarly to the qemu driver if we store the immutable driver pointer in
the VM private data struct we don't have to questionably pass it through
opaque pointers to callbacks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
49ef0f95c6 qemuMigrationSrcBegin: Automatically free 'xml' variable on error
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
4f6b1fbcfa virObjectLockGuard: Require that returned value is used
The returned value is used to unlock the object, so all callers must
necessarily make use of the returned value.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
66a014bc09 virclosecallbacks.h: Reformat header to contemporary style
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
58404f7871 qemu: fd: Fix documentation for FD set related functions
When dealing with fdsets only we don't need to pass the FD first as we
now generate fdset name directly. Also there are no more caveats in
passing multiple FDs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
4438b8ac09 qemuFDPassTransferCommand: Remove return value
Now that the 'direct' mode was separated and thus we don't have any
possible error case we can stop returning any values and simplify
callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
20ba291ebd qemu: fd: Remove support for 'direct' fd passing from 'qemuFDPass'
This finishes the separation of the fdset and direct helpers. Remove
'qemuFDPassNewDirect' and all internals which were applicable only in
direct mode.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
9bed5604db qemuFDPassValidate: Don't validate file descriptors
The callers adding the FDs are validating them regardless so this check
was redundant.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
15bdced9b3 qemu: Use 'qemuFDPassDirect' for 'unix' chardevs
Unix socket chardevs with FD passing need to use the direct mode so we
need to convert it to use qemuFDPassDirect.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
7e1c24c925 qemu: Convert passing of 'slirpfd' to 'qemuFDPassDirect'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:08 +02:00
Peter Krempa
1715dfce38 qemu: Convert passing of 'tapfds' to 'qemuFDPassDirect'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
7869eb9b31 qemu: Convert passing of 'vhostfd' to 'qemuFDPassDirect'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
bca9047906 qemu: fd: Add a distinct set of APIs for 'direct' fd passing mode
Originally I envisioned a common set of APIs for both FD passing
approaches but it turns out they are not really compatible enough for it
to make sense to use one set of APIs.

As of such introduce a distinct set of APIs for the 'direct' mode, which
will later be used to convert all places that currently use
'qemuFDPassNewDirect' and later clean up the existing APIs.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
e04acdf39d qemu: EVENTHANDLERS.txt: Move to kbase and rSTisze
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
1095803ffa qemu: MIGRATION.txt: Move to kbase and rSTisze
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
b414c4a00a qemu: THREADS.txt: rSTize and move to knowledge-base
Move the internal documentation about qemu threading to the knowledge
base.

The conversion included rstizing of the text document, mainly just
fixing of the headline and enclosing function names and code examples
into code block sections.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
fcd7741c48 qemuBuildCommandLine: Remove 'flags' argument
The flags are not used for anything.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
bab089d379 qemuBuildCommandLine: Don't avoid '-S' flag for 'domxml-to-native' conversion
The commandline generated from our XML->native convertor is the majority
of cases not usable without libvirt anyways and the situation will not
improve any more.

As of such there's no much utility of avoiding the use of stopped CPUs
flag in such case.

Remove the QEMU_BUILD_COMMAND_LINE_CPUS_RUNNING flag and the associated
logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
2afaa6894e qemuBuildCommandLine: Inline qemuCheckFips
Now that we store the state of the host FIPS mode setting in the qemu
driver object, we don't need to outsource the logic into
'qemuCheckFips'.

Additionally since we no longer support very old qemu's which would not
yet have --enable-fips we can drop the part of the comment about very
old qemus.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
9b765882cd qemuBuildCommandLine: Remove 'driver' argument
We pass 'vm' which already contains it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
d810ae2fae qemuConnectDomainXMLToNative: Refactor cleanup
Automatically free the 'vm' temporary domain object and remove the
'cleanup' label and 'ret' helper variable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
343920794d qemuBuildCommandLine: Sanitize debug logging
Improve the debug log inside 'qemuBuildCommandLine' to include the name
from the definition and remove useless data such as the pointer to the
qemuDriver object or qemuCaps.

Additionally remove the non-specific debug statements:

  VIR_DEBUG("Building emulator command line");

from the two callers of qemuBuildCommandLine.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
b5fd6f2b68 qemu: Store state of FIPS in virQEMUDriver
Rather than re-query all the time we can cache the state of FIPS of the
host as it will not change during the runtime of the guest.

Introduce a 'hostFips' flag to 'virQEMUDriver' and move the code
checking the state from 'qemuCheckFips' to 'qemuStateInitialize' and
also populate 'hostFips' in qemuxml2argvtest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
552790edf2 qemuBuildCommandLine: Convert 'standalone' flag to use 'flags'
Introduce 'qemuBuildCommandLineFlags' and use it instead of specific
flag booleans.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
0b64b75a09 qemu: command: Don't hide 'vhost' fds from 'standalone' command line
We already format a commandline using FD passing for the tap devices so
formatting the 'vhost' file descriptors won't make it any less usable
directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
5b9c880e89 docs: drvqemu: Decrease expectations about command line from 'virsh domxml-to-native'
In the qemu driver certain configs such as disk throttling or CPU
hotplug is configured by interacting with the monitor at the startup
phase of the hypervisor and thus is not part of the "native config".

Add a paragraph into the documentation outlining that the native
configuration might not be completely usable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
6272e780e2 virConnectDomainXMLToNative: Add note about dynamically configured features
In the qemu driver certain configs such as disk throttling or CPU
hotplug is configured by interacting with the monitor at the startup
phase of the hypervisor and thus is not part of the "native config" as
returned by 'virConnectDomainXMLToNative'.

Similarly at least the commandline for qemu contains resources passed
via file descriptors which are obviously not part of the returned
"native config".

Add a paragraph into the documentation outlining that the native
configuration might not be completely usable.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2022-05-17 19:31:07 +02:00
Peter Krempa
7bbfabc6b2 qemu: Implement 'absolute' clock offset mode
Add support for the mode and add the corresponding qemuxml2argv test
case.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-17 19:30:59 +02:00
Peter Krempa
d53e75aad0 conf: Introduce 'absolute' clock offset
The 'absolute' clock offset type has a 'start' attribute which is an
unix epoch timestamp to which the hardware clock is always set at start
of the VM.

This is useful if some VM needs to be kept set to an arbitrary time for
e.g. testing or working around broken software.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-17 19:30:59 +02:00
김인수
9cd2c5257a Translated using Weblate (Korean)
Currently translated at 100.0% (10419 of 10419 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-05-16 16:31:19 +02:00
Jonathon Jongsma
43aa510c19 util: Remove virCommandPassFDIndex()
The last use of this function was removed in commit 6d161bcc, so the
function is no longer used except as an internal implementation for
virCommandPassFD().

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-16 09:29:47 -05:00
Jonathon Jongsma
2e89805894 util: remove virCommandPassFDGetFDIndex()
commit f9236200 removed the last use of this function, so it can be
dropped.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-16 09:29:47 -05:00
Andrea Bolognani
b6705cdefb conf: Fix smm=off handling
We have to always store the state of the feature in the
virDomainDef struct, otherwise

  <smm state='off'/>

will incorrectly be interpreted as if the <smm> element was not
present.

Fixes: eeb94215b0
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 14:29:11 +02:00
Andrea Bolognani
a6ea77e0a5 tests: Introduce smm=off test
This complements the existing smm=on tests. Looking at the output
files, one can immediately see how this case is currently not being
handled correctly. We're going to fix that in the next commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 14:29:09 +02:00
Andrea Bolognani
dd3258da09 tests: Update smm=on test
Use DO_TEST_CAPS_LATEST() instead of hardcoding capabilities and
add the xml2xml part, which was missing; finally, rename it to
accomodate the complementary smm=off test that we're about to
introduce.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 14:29:04 +02:00
Peter Krempa
74bb510a7b qemu: slirp: Remove unused 'qemuSlirpGetFD'
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
485a336f5d qemuMonitorAddNetdev: Remove unneeded 'slirp' variables and useless debug
None of the callers now uses the slirp fd passing feature, so it can be
removed.

At this point even the VIR_DEBUG doesn't make sense as it would only log
the pointer of 'props'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
08b0ac6683 qemuDomainAttachNetDevice: Clean up unneeded 'slirp' helper variables
We don't need 'slirpfdName' and 'slirpfd'. The 'slirp' local can be
removed too as qemuSlirpStart is safe to be called if there's nothing to
do.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
c8633d35ca qemu: slirp: Pass FDs to qemu via qemuFDPass in the network private data
Populate the 'slirpfd' qemuFDPass structure inside the private data for
passing the fd to qemu rather than using out-of-band variables.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
812a36557d qemu: slirp: Call qemuSlirpOpen directly from qemuSlirpStart
No need to ask the callers to call this extra function.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
42b939d13a qemuSlirpStart: Simplify parameters
The 'driver' can be taken from the private data of 'vm' and 'slirp' can
be taken from private data of 'net', both of which we need anyways.

Additionally by checking whether slirp needs to be started inside the
function we don't need to do this logic in the callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
50d2489b7f qemuInterfacePrepareSlirp: Directly populate the 'slirp' variable in network private data
Both callers populate the variable when qemuInterfacePrepareSlirp
returned 1. We can save the hassle in the callers by just doing it right
away.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
13ae2e2e30 qemuMonitorAddNetdev: Remove unused 'tapfd' infrastructure
All callers pass NULL/0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
c0d25738b2 qemuBuildNicDevProps: Remove unused 'tapfd' infrastructure
All callers pass NULL/0.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
c613b1a211 qemuDomainAttachNetDevice: Remove unused 'tapfd' infrastructure
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
822a6dfc07 qemuBuildInterfaceCommandLine: Remove 'tapfd' infrastructure
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
7a38d3946b qemu: Move opening of tap file descriptors for net devices into qemuBuildInterfaceConnect
Use the new infrastructure which stores the fds inside 'qemuFDPass'
objects in the private data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
e22284d7bb qemuMonitorAddNetdev: Remove 'vhostfd' machinery
All callers now pass NULL/0 as arguments for vhostfd passing so we can
remove all the associated code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
4b3e730c77 qemuBuildHostNetProps: Remove 'vhostfd' machinery
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
a7241f85f6 qemuBuildInterfaceCommandLine: Remove 'vhostfd' machinery
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
7939e81f66 qemuDomainAttachNetDevice: Remove 'vhostfd' machinery
Now all the helper variables and code are not needed.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
f59a707d2c qemu: Move opening of vhost file descriptors for net devices into qemuBuildInterfaceConnect
Use the new infrastructure which stores the fds inside 'qemuFDPass'
objects in the private data.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
18f863a4da qemuInterfaceOpenVhostNet: Reformat error messages per new guidelines
Remove the linebreaks inside of error messages.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
7c43765513 qemuBuildNicDevProps: Don't pass 'vhostfdSize'
All callers effectively pass 'net->driver.virtio.queues'. In case of the
code in 'qemu_hotplug.c' this value was set to '1' if it was 0 before.

Since 'qemuBuildNicDevProps' only uses it if it's greater than 1 we can
remove all the extra complexity.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
29458f0491 qemu: Prepare netdev code for use of qemuFDPass for tapfd/vhostfd passing
Add alternative code paths for passing of the FDs using the new
infrastructure. This way we'll be able to refactor the code
incrementally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
3e9cc6e78e qemuDomainAttachNetDevice: Don't construct network device properties under monitor lock
After the 'qemuFDPass' code was refactored we no longer need to hand off
the FD to qemu before we know the path for it.

Thus the call to qemuBuildHostNetProps can be moved outside of the
monitor critical section.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
29067596f2 qemuBuildHostNetProps: Refactor construction of tapfd/vhostfd arguments
Pre-construct the array the same way for the case when there's only one
FD and when there are multiple. We just change the argument name
depending on the count.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
55485c56a4 qemuBuildHostNetProps: Move all 'tap' code together
Move the block guarded by 'is_tap' boolean to the only place where
'is_tap' is set to true.

This causes few arguments to change places.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
96d6fec8dc qemuBuildInterfaceConnect: Connect to 'vdpa' netdev
Move the setup of the 'vdpa' netdev into the new helper shared between
commandline and hotplug code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
29d022b1eb qemu: command: Introduce 'qemuBuildInterfaceConnect' helper
The helper will aggregate code that is used to connect the network
backend to the corresponding host portion.

This will be used to refactor the duplicated code between the cold-start
and hotplug helper functions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:46 +02:00
Peter Krempa
ba9e1f629c qemu: domain: Add qemuFDPass helpers into network private data
Prepare for the upcoming refactor to use qemuFDPass for all the network
related file descriptors:

    - tapfds
    - vhostfds
    - slirp
    - vdpa

This patch adds the private data variables and a utility function to
clear it. Clearing is useful since we don't really need the data once
the VM is running so we save some memory.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
686f83e66e qemu: Clear 'qemuFDPass' helpers of char devices when no longer needed
While the FDs are closed right after use to prevent leaks, at certain
point we don't need the whole helper any more. Clear them for char
devices after hotplug and on start.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
6b3373ffa5 qemuFDPassTransferMonitor: Close local copy of the FD as soon as it's passed to qemu
We don't want to keep the FDs open more than we need to.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
c8f255c10e qemuMonitorAddFileHandleToSet: Remove return of 'qemuMonitorAddFdInfo'
The only caller doesn't use the fdset info any more.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
1e925d1c17 qemu_fd: Don't rely on fdset id allocation by qemu
If we use our own fdset ID when hot-adding a fdset we can vastly
simplify our internals.

As a stop-gap when a fdset would be added behind libvirt's back we'll
validated that the fdset to be added is not yet used.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
278c630d2a qemu: domain: Store and update 'fdsetindex' across libvirtd restarts
While 'add-fd' qmp command gives the possibility to find an unused fdset
ID when hot-adding fdsets, such usage is extremely inconvenient.

This patch allows us to track the used fdset id so that we can avoid the
need to check results and thus employ simpler code flow when hot-adding
devices which use FD passing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
76709d4f48 qemuMonitorJSONQueryFdsets: Ensure that JSON arrays are valid before using them
The code didn't check that the reply value is an array and that the
'fds' array is present. This could lead to a crash if qemu wouldn't
return an array in those places.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
4e64cded66 qemu: monitor: Don't parse actual fd's from query-fdsets/add-fd replies
Libvirt doesn't use the returned value and in fact there's nothing we
could even do with them. Avoid parsing and storing them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
1d3e955938 qemuDomainAttachNetDevice: Use 'qemuFDPass' for the vdpa file descriptor
We use the qemuFDPass infrastructure when building the command line,
refactor the monitor too.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
5077263ecb qemu_fd: Remove error checking from qemuFDPassAddFD
It's effectively replaced by checks in qemuFDPassTransfer. This will
simplify cleanup paths on constructing the qemuFDPass object when FDs
are being handled.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
80f75fb758 qemu_fd: Add validation before transferring file descriptors
Add validation to the transfer step to make the adding step more simple
for easier cleanup paths.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Peter Krempa
bcfd23b762 qemu_fd: Add return value handling for qemuFDPassTransfer* APIs
Add possibility to delay checks to the point when the FDs are to be
passed to qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-16 09:15:45 +02:00
Han Han
7b0e2e4a55 virt-xml-validate: Add more XML formats support
Add these XML formats validation in manpage or script:
cpu, domainbackup, domaincaps, domaincheckpoint, networkport,
storagepoolcaps.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2022-05-13 17:15:24 +02:00
Michal Privoznik
af1933713b virDomainRestoreFlags: Require VIR_DOMAIN_SAVE_PARAM_FILE for now
Calling virDomainRestoreFlags() with no typed params results in
an error in open() because it tries to open a NULL path.
Obviously, this is wrong and path to restore from must be
provided, at least for now until other sources of restore are
introduced. Then this limitation can be relaxed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-13 17:10:10 +02:00
Michal Privoznik
f4e2910552 lib: Repurpose virDomainSaveParams() with no VIR_DOMAIN_SAVE_PARAM_FILE
When no VIR_DOMAIN_SAVE_PARAM_FILE typed param is set when
calling virDomainSaveParams() then in turn virQEMUFileOpenAs()
tries to open a NULL path.

We have two options now:
1) require the typed param, which in turn may be promoted to a
   regular argument, or

2) use this opportunity to make the API behave like
   virDomainManagedSave() and use typed params to pass extra
   arguments, instead of having to invent new managed save API
   with typed params.

Let's go with option 2, as it is more future proof.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-13 17:10:10 +02:00
Michal Privoznik
25b2f75c7a qemu: Separate out save code from qemuDomainManagedSave()
The code that actually does managed save within
qemuDomainManagedSave() is going to be reused shortly. Move it
out into a separate helper.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-13 17:10:10 +02:00
Han Han
43c83a2112 docs: formatdomain: Fix the introduced version of vdagent
The qemu-vdagent channel is introduced since:
"05b09f039e    conf: add qemu-vdagent channel"

It will be in the version 8.4.0.

Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2022-05-13 14:38:11 +02:00
김인수
635df6c4bb Translated using Weblate (Korean)
Currently translated at 100.0% (10419 of 10419 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-05-13 03:18:32 +02:00
Michal Privoznik
56ab5c3ae9 qemu: Don't check for qemuDomainManagedSavePath() retval
The qemuDomainManagedSavePath() function does no more than a
g_strdup_printf() and as such can't return NULL really.
Therefore, don't check for its return value.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-12 16:47:24 +02:00
Jiri Denemark
dc2b2b3ab9 qemu: Enable migration events only for fresh QEMU process
Every running QEMU process we are willing to reconnect (i.e., at least
3.1.0) supports migration events and we can assume the capability is
already enabled since last time libvirt daemon connected to its monitor.

Well, it's not guaranteed though. If libvirt 1.2.17 or older was used to
start QEMU 3.1.0 or newer, migration events would not be enabled. And if
the user decides to upgrade libvirt from 1.2.17 to 8.4.0 while the QEMU
process is still running, they would not be able to migrate the domain
because of disabled migration events. I think we do not really need to
worry about this scenario as libvirt 1.2.17 is 7 years old while QEMU
3.1.0 was released only 3.5 years ago. Thus a chance someone would be
running such configuration should be fairly small and a combination with
upgrading 1.2.17 to 8.4.0 (or newer) with running domains should get it
pretty much to zero. The issue would disappear ff the ancient libvirt is
first upgraded to something older than 8.4.0 and then to the current
libvirt.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-12 16:25:57 +02:00
Jiri Denemark
7f432214ab qemu: Make migration events mandatory
All QEMU versions we care about support migration events and we should
be able to enable the associated capability when connecting to the
monitor. Failure to do so is thus considered fatal now.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-12 16:25:57 +02:00
Jiri Denemark
62daebed13 qemu: Refactor qemuDomainGetJobInfoMigrationStats
The code was a bit too complicated, especially after removing the check
for QEMU_CAPS_MIGRATION_EVENT.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-12 16:25:57 +02:00
Jiri Denemark
b5fd70b367 qemu: Drop QEMU_CAPS_MIGRATION_EVENT
All QEMU versions we care about already support migration events.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-12 16:25:57 +02:00
Erik Skultety
b7fa48081d ci: Add a Fedora integration test job utilizing upstream QEMU
Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-12 11:12:26 +02:00
Erik Skultety
80ffd571a8 ci: Add a new integration job template for the upstream QEMU scenario
YAML anchors don't work with Shell condition structures, so we cannot
simply reference the QEMU build template YAML anchor conditionally and
hence have everything as part of a single job template.
Instead, we have to "subclass" the .integration_tests template and
inject the QEMU building bits explicitly.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-12 11:12:26 +02:00
Erik Skultety
de98075faf ci: Introduce a template for upstream QEMU build
This was heavily inspired by QEMU's upstream CI buildtest-template.yml.
Rather than referencing QEMU's template directly (which GitLab can do),
this patch resorts to hard-coding the build steps ourselves, solely
because there's no guarantee QEMU will keep either the template file
name or the template name from which the build steps were mostly copied
from.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-12 11:12:26 +02:00
Erik Skultety
72887b8f59 ci: Break off the integration_tests template into more templates
There's quite a lot happening in the .integration_tests template
already even without adding upstream QEMU build into the mix.
Let's break the template into more pieces which can then reference
in the .integration_tests template when putting all the pieces back
together using YAML anchors.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-12 11:12:26 +02:00
Erik Skultety
387932771a ci: Separate the integration job template to a separate file
Future patches will do more code extraction from the existing template
using YAML anchors so it'd be better that the templates would live
separately from job definitions.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-12 11:12:26 +02:00
Michal Privoznik
46fa0e46e1 lib: Rename VIR_SAVE_PARAM_* to VIR_DOMAIN_SAVE_PARAM_*
A few commits ago new APIs were introduced (virDomainSaveParams()
and virDomainRestoreParams()) and with them new typed parameters:
VIR_SAVE_PARAM_FILE and VIR_SAVE_PARAM_DXML. But their name does
not suggest they apply to either of the APIs nor that they are
intended for domain related APIs. Switch to
VIR_DOMAIN_SAVE_PARAM prefix to make it obvious.

It's true we already have VIR_DOMAIN_SAVE_* symbols which are
part of virDomainSaveRestoreFlags enum, therefore stick also with
'_PARAM_ ' part of the name to differentiate the two.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-12 11:00:08 +02:00
Martin Kletzander
36e86dbf33 qemu: Disable spice-related devices without spice graphics
For most of them qemu errors out with unclear message, and for the
audiodev qemu just falls back to timer-based audio with a warning
message, and will possibly also error out in the future.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2035163
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-12 10:20:37 +02:00
Martin Kletzander
45c0ff3eea conf: Add virDomainDefHasSpiceGraphics
It will be used in future patch in multiple places.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-12 10:20:37 +02:00
Martin Kletzander
90d36d625e tests: Adjust for invalid qemu command combinations
Everything spice is not supported (and does not make sense) without spice
graphics.  For some tests I also added cirrus VGA capability so that the XML
stays simple and libvirt can guess a default video model rather than adding too
much of an irrelevant XML into the individual tests.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-12 10:20:36 +02:00
Martin Kletzander
d00e51e10c Remove serial-spiceport-nospice test
This old test was added by me to allow people to keep the spicevmc
channel while changing graphics type from spice to something else.
However we do not do this in other places and also now we have all the
Validate functions so it is better to show the user they will not have
the spicevmc channel available rather than simply not formatting it on
the qemu command line.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-12 10:20:36 +02:00
Michal Privoznik
bc3387f38f qemu_domain: Drop needless 'error' label in qemuDomainObjPrivateXMLParse()
After previous cleanup the 'error' label in
qemuDomainObjPrivateXMLParse() contains nothing but a return
statement. Well, the label can be dropped and all 'goto'-s can be
replaced with the return statement directly.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-12 08:51:18 +02:00
Michal Privoznik
5b0bba799b qemu_domain: Drop needless free from qemuDomainObjPrivateXMLParse()
The qemuDomainObjPrivateXMLParse() is responsible for parsing
given XML into qemuDomainObjPrivate struct. As it does so, memory
might be allocated for some members. If an error occurs during
parsing the control jumps onto 'error' label where only some of
previously allocated memory is freed. The reason there's no
memory leak is simple: the only caller (virDomainObjParseXML())
unrefs freshly created virDomainObj which in turn causes
qemuDomainObjPrivateFree() to be called. Therefore, these
partial, selective frees are needless and should be just dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-12 08:50:54 +02:00
Michal Privoznik
21aec91790 qemu_domain: Format qemuDomainObjPrivate::originalMemlock
Now that qemuDomainObjPrivate struct gained new member format it
into XML and parse it so that the value is preserved across
daemon restarts.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-12 08:50:22 +02:00
Michal Privoznik
75df6d2c29 conf: Move virDomainObj::originalMemlock into qemuDomainObjPrivate
Since v1.3.0-90-gafbe1d4c56 the original value of memlock limit
is stored inside virDomainObj struct directly (under
originalMemlock member). This is needless because the value is
used only inside QEMU driver and thus can reside in
qemuDomainObjPrivate struct.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2022-05-12 08:49:30 +02:00
Jonathon Jongsma
2ba73a10fd qemu: add support for qemu-vdagent channel
Implement the qemu-vdagent channel introduced in the previous commit.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-05-10 11:00:16 -05:00
Jonathon Jongsma
05b09f039e conf: add qemu-vdagent channel
Add the ability to configure a qemu-vdagent in guest domains. This
device is similar to the spice vdagent channel except that qemu handles
the spice-vdagent protocol messages itself rather than routing them over
a spice protocol channel.

The qemu-vdagent device has two notable configuration options which
determine whether qemu will handle particular vdagent features:
'clipboard' and 'mouse'.

The 'clipboard' option allows qemu to synchronize its internal clipboard
manager with the guest clipboard, which enables client<->guest clipboard
synchronization for non-spice guests such as vnc.

The 'mouse' option allows absolute mouse positioning to be sent over the
vdagent channel rather than using a usb or virtio tablet device.

Sample configuration:
  <channel type='qemu-vdagent'>
    <target type='virtio' name='com.redhat.spice.0'/>
    <source>
      <clipboard copypaste='yes'/>
      <mouse mode='client'/>
    </source>
  </channel>

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-05-10 11:00:15 -05:00
Jonathon Jongsma
f135fdabab Rename virDomainGraphicsSpiceMouseMode to virDomainMouseMode
This enumeration will be useful for vnc with the upcoming qemu-vdagent
device so make the name more generic.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-05-10 11:00:15 -05:00
Jonathon Jongsma
b6dfb216c9 qemu: add capability for qemu-vdagent chardev
Detect whether qemu supports the qemu-vdagent character device. This
enables support for copy/paste with VNC graphics.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-05-10 11:00:13 -05:00
Peter Krempa
dfba8b3645 qemucapabilitiestest: Add test data for the qemu-7.1 dev cycle on x86_64
Notable schema changes:

 - 'cluster-id' is now reported for CPU topology
 - 'display-update' QMP command added
 - 'main-loop' QOM object added with a whole set of properties
 - 'cpu0-id' field reported in SEV data
 - 'blockdev-change-medium' command now has 'force' property
 - 'screendump' QMP command now has a 'format' property
    - supported formats are 'ppm' and 'png'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-10 14:02:31 +02:00
Han Han
81b928fa82 docs: apps: Add the app cockpit
Signed-off-by: Han Han <hhan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-10 10:16:05 +02:00
Jonathon Jongsma
8cb37bac33 util: fix insert/instead documentation mixup
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2022-05-09 15:21:08 -05:00
Jonathon Jongsma
728c75b93f conf: ensure only one vgpu has ramfb enabled
Validate the domain configuration to ensure that if there are more than
one vgpu assigned to a domain, only one of them has 'ramfb' enabled.

This was never a supported configuration. QEMU failed confusingly when
attempting to start a domain with this configuration. This change
attempts to provide better information about the error.

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

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-09 14:39:43 -05:00
Michal Privoznik
55c3e969cf qemu_security: Drop qemuSecurityStartVhostUserGPU()
There's no real difference between
qemuSecurityStartVhostUserGPU() and qemuSecurityCommandRun(). The
latter is used more frequently while the former has just one
user. Therefore, drop the less frequently used one.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-09 16:17:00 +02:00
Daniel Henrique Barboza
ae373781a4 tests: qemucapabilities: update ppc64 qemu caps for 7.0.0 release
There are no major changes since 7.0.0-rc2, but a few additional
features are enabled in this build.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-09 15:13:37 +02:00
luzhipeng
3e009bbdb8 apibuild: Fix self.waring method call
The parameters of self.warning is inconsistent with its definition, So
fix it.

Signed-off-by: luzhipeng <luzhipeng@cestc.cn>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-09 14:44:36 +02:00
Jan Kuparinen
1512119afd Translated using Weblate (Finnish)
Currently translated at 22.8% (2385 of 10419 strings)

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

Co-authored-by: Jan Kuparinen <copper_fin@hotmail.com>
Signed-off-by: Jan Kuparinen <copper_fin@hotmail.com>
2022-05-08 19:18:29 +02:00
Jiri Denemark
5890a320f8 NEWS: Mention improved heuristics for CPU baseline
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-06 23:30:44 +02:00
Jiri Denemark
bb6cedd208 cpu_x86: Ignore enabled features for input models in x86DecodeUseCandidate
While we don't want to aim for the shortest list of disabled features in
the baseline result (it would select a very old model), we want to do so
while looking at any of the input models for which we're trying to
compute a baseline CPU model. Given a set of input models, we always
want to take the least capable one of them (i.e., the one with shortest
list of disabled features) or a better model which is not one of the
input models.

So when considering an input model, we just check whether its list of
disabled features is shorter than the currently best one. When looking
at other models we check both enabled and disabled features while
penalizing disabled features as implemented by the previous patch.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 17:33:47 +02:00
Jiri Denemark
48341b025a cpu_x86: Penalize disabled features when computing CPU model
For finding the best matching CPU model for a given set of features
while we don't know the CPU signature (i.e., when computing a baseline
CPU model) we've been using a "shortest list of features" heuristics.
This works well if new CPU models are supersets of older models, but
that's not always the case. As a result it may actually select a new CPU
model as a baseline while removing some features from it to make it
compatible with older models. This is in general worse than using an old
CPU model with a bunch of added features as a guest OS or apps may crash
when using features that were disabled.

On the other hand we don't want to end up with a very old model which
would guarantee no disabled features as it could stop a guest OS or apps
from using some features provided by the CPU because they would not
expect them on such an old CPU.

This patch changes the heuristics to something in between. Enabled and
disabled features are counted separately so that a CPU model requiring
some features to be disabled looks worse than a model with fewer
disabled features even if its complete list of features is longer. The
penalty given for each additional disabled feature gets bigger to make
longer list of disabled features look even worse.

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 17:33:47 +02:00
Jiri Denemark
1d6ca40ac2 cpu_x86: Refactor feature list comparison in x86DecodeUseCandidate
It will become more complicated and so it deserves to be separated into
a new function.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 17:33:46 +02:00
Jiri Denemark
35ce086667 cpu_x86: Consolidate signature match in x86DecodeUseCandidate
Checking the signature in two different places makes no sense since the
code in between can only mark the candidate as the best option so far,
which is what the second signature match does as well.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 17:33:46 +02:00
Jiri Denemark
63d633b9a4 cputest: Add some real world baseline tests
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 17:33:46 +02:00
Jiri Denemark
3daa68e265 cputest: Give better names to baseline tests
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 17:33:46 +02:00
Jiri Denemark
6aff36019b cputest: Drop some old artificial baseline tests
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 17:33:46 +02:00
Jiri Denemark
d2e4d66be3 cpu_map: Disable cpu64-rhel* for host-model and baseline
These ancient RHEL-only CPU models should not really be used by any CPU
definition created by libvirt. We keep them just for backwards
compatibility with domains which might still be using them.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 17:33:46 +02:00
Claudio Fontana
3342278539 docs: update refs to virDomainSaveParams and virDomainRestoreParams
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
2022-05-06 15:34:30 +01:00
Claudio Fontana
9759639dd4 qemu: add implementation for virDomainRestoreParams API
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
2022-05-06 15:34:30 +01:00
Claudio Fontana
26c43c8129 qemu: add implementation for virDomainSaveParams API
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
2022-05-06 15:34:30 +01:00
Claudio Fontana
1140787c3c remote: Add RPC support for the virDomainRestoreParams API
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 15:34:30 +01:00
Claudio Fontana
8583199c8a gendispatch: add DomainRestoreParams as requiring conn argument
in preparation for the addition of DomainRestoreParams,
add it to the list of methods requiring a conn first argument.

Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 15:34:30 +01:00
Claudio Fontana
fbfbcf1729 remote: Add RPC support for the virDomainSaveParams API
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 15:34:30 +01:00
Claudio Fontana
f9a8e25b15 libvirt: introduce virDomainRestoreParams public API
add new API in order to be able to extend parameters to the domain
restore operation. We will use it to fit the existing arguments of
VirDomainRestoreFlags for now.

Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 15:34:30 +01:00
Claudio Fontana
6392cb1f1f libvirt: introduce virDomainSaveParams public API
create an alternative to virDomainSaveFlags that is more
extendible via parameters.

Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 15:34:30 +01:00
Claudio Fontana
f79de95b16 virfile: add comment about the use of SEEK_END in virFileDiskCopy
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 15:34:30 +01:00
Claudio Fontana
8c09638514 virfile: change virFileDiskCopy arguments to extend beyond stdin, stdout
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
2022-05-06 15:34:30 +01:00
Claudio Fontana
bcea5da257 virfile: rename runIO to virFileDiskCopy
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
2022-05-06 15:34:30 +01:00
Claudio Fontana
49d7a3a756 iohelper: move runIO function to virfile.c
where it can be reused by other helpers.
No changes other than the move.

Note that this makes iohelper now dependent on -lutil and -lacl.

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Claudio Fontana <cfontana@suse.de>
2022-05-06 15:34:30 +01:00
Claudio Fontana
42dc978c28 iohelper: refactor copy operation as a separate function
Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 15:34:30 +01:00
Claudio Fontana
8188716522 iohelper: introduce new struct to carry copy operation parameters
this is in preparation for a minor refactoring of the copy
function itself out of runIO().

Signed-off-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 15:34:30 +01:00
Andrea Bolognani
0495f841ee ci: Move clang/asan/ubsan jobs to Ubuntu 22.04
Using an updated toolchain means we're likely to catch more
issues.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 15:25:18 +02:00
Michal Privoznik
776e9a6b26 testutilsqemu: Write getter/setter for CPU def global variables
As of 47503cc859 we are statically linking libtest_utils_qemu.a
into qemuhotplugmock.so (see the original commit for reasoning).
However, this breaks ASAN on older clang because now
qemuhotplugtest has two instances of virCPUDef global variables
(cpuDefault, cpuHaswell, cpuPower8, cpuPower9). One that comes
from the binary itself (which also links with
libtest_utils_qemu.a) and the other from the mock. Resolve this
by making the variables static and introducing getter and setter.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 12:19:34 +02:00
Michal Privoznik
dff4b21585 testutils: Write setter for virTestHostArch global variable
As of 47503cc859 we are statically linking libtest_utils.a into
qemuhotplugmock.so (see the original commit for reasoning).
However, this breaks ASAN on older clang because now
qemuhotplugtest has two instances of virTestHostArch global
variable. One that comes from the binary itself (which also links
with libtest_utils.a) and the other from the mock. Resolve this
by making the variable static and introducing getter and setter.
Well, the former already exists (as virArchFromHost()) so only
the latter is needed.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-06 12:16:15 +02:00
Andrea Bolognani
29ee8c1d2e ci: Add Ubuntu 22.04
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 11:13:12 +02:00
Andrea Bolognani
1e25a480f5 ci: Refresh configuration
Notable changes:

  * use the most recent point release for FreeBSD 12.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 11:13:05 +02:00
Andrea Bolognani
3866a40a95 meson: Drop support for -Wl,-M
This was originally introduced in c2fb8bfee3, reportedly to
support symbol versioning on Solaris; more recently, 30b301c6ea
ported it to meson.

Up until the previous commit this has resulted in passing

  -M .../libvirt/build/src/libvirt.syms

to the linker on macOS, but the implementation of the -M option
on that platform's linker is literally

  else if ( strcmp(arg, "-M") == 0 ) {
      // FIX FIX
  }

so in practice we've been providing an additional input file,
which the linker understandably ignores after printing a warning
since it's not in any format that it recognizes.

Considering that LLVM's linker, which is now used by default on
FreeBSD, supports the same --version-script option as the GNU
linker, that we have introduced special handling for macOS, and
that we don't target Solaris, we can simply drop the branch at
this point.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 11:12:50 +02:00
Andrea Bolognani
b05dfcdfcb meson: Don't attempt to use version scripts on macOS
macOS libraries don't support symbol versioning, so the only
result that we achieve by passing additional flags to the linker
is a bunch of messages like

  ld: warning: ignoring file .../libvirt/build/src/libvirt.syms,
  building for macOS-x86_64 but attempting to link with file built
  for unknown-unsupported file format ( 0x23 0x20 0x57 0x41 ... )

being produced during the build.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 11:12:48 +02:00
Andrea Bolognani
fac80100c0 meson: Refactor handling of link_args and link_depends
This ensures variable names and the overall structure of the
code setting and using them is consistent. It will also make
upcoming changes less disruptive.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-06 11:12:44 +02:00
Michal Privoznik
5e5d030b1c tests: Deduplicate some WITH_* checks
When constructing mock_libs array it is firstly initialized to a
static set of mocks followed by couple of WITH_* checks to append
driver specific mocks. These checks are then repeated when
filling some other variables (e.g. supplementary helpers,
libraries, tests, etc.). Dissolve the former in the latter since
we are already doing that, partially, for qemu (qemucapsprobemock
and qemuhotplugmock)

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-05 13:26:32 +02:00
Michal Privoznik
47503cc859 test: Link qemuhotplugmock with test_utils_qemu and test_utils
As of ad81aa8ad0 the qemuhotplugmock.c calls
testQemuPrepareHostBackendChardevOne() which is implemented in
testutilsqemu.c. However, the mock is not linked with
testutilsqemu static library which makes some tools (valgrind
particularly) unhappy because the resulting mock library has
unresolved symbol.

The fix is simple, link mock library with test_utils_qemu_lib and
also with test_utils_lib since testutils.c calls some functions
from testutils.c.

Since these two libraries are declared only after mock_libs[], I
had to move the line that declares qemuhotplugmock after those
two.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-05 13:26:23 +02:00
Michal Privoznik
b399f2c000 virnetdev: Fix regression in setting VLAN tag
In the past, we did set VLAN tag on <interface type='direct'/>.
However, during rewrite (v8.1.0-rc1~191) virNetDevSetVfConfig()
was changed and a condition that was responsible for calling
a function that sets VLAN tag was changed accidentally resulting
in VLAN tag not being set anymore.

However, because of other changes in the same patchset, it may
happen that @adminMac is NULL (this is to work around yet another
broken SRIOV driver), and thus we must refrain from setting MAC
and have to set VLAN tag only.

Fixes: 73961771a1
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2075383
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-05 13:21:07 +02:00
Michal Privoznik
7899a11523 virNetDevSetVfMac: Fix error message on invalid args
If virNetDevSetVfMac() is called with either @macaddr or
@allowRetry arguments NULL an error is reported, because this is
considered invalid use. However, the error message is not
informative as it could be.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-05-05 13:19:43 +02:00
Niteesh Dubey
0236e6154c Support cpu0-id of Qemu QMP query-sev-capabilities
It allows libvirt to provide the value of cpu0-id retuned by the Qemu QMP
 command query-sev-capabilities as implemented by the Qemu Patch [1] which
 is merged to Qemu master branch and should be available with Qemu 7.1.
 This is used to get the signed Chip Endorsement Key (CEK) of the CPU of AMD
 system from AMD's Key Distribution Service (KDS).

Similar to  cbitpos, reducedPhysBits, maxGuests & maxESGuests;
 the value of cpu0-id is also provided using 'virsh domcapability'.

[1] https://lore.kernel.org/all/20220228093014.882288-1-dovmurik@linux.ibm.com/

Signed-off-by: Niteesh Dubey <niteesh@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-05 12:29:53 +02:00
Andrea Bolognani
b6bd6eabc0 include: Fix unmatched parentheses in comment
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-05-04 19:16:52 +02:00
Victor Toso
f3d4102d67 apibuild: remove 'v' from pattern matching
This makes it mandatory to *not* add 'v' to version numbers.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-04 18:12:30 +02:00
Victor Toso
dddf047dd1 docstring: remove 'v' from since metadata
Since: v1.2.3 -> Since: 1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-05-04 18:11:06 +02:00
Martin Kletzander
97ef63860a tests: Add test for missing network attribute in graphics' listen element
This tests a change done in commit 871a071abb.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2022-05-04 16:11:43 +02:00
Amneesh Singh
871a071abb conf: virDomainGraphicsDefValidate: validate attribute 'network' for listen type 'network'
Related: https://gitlab.com/libvirt/libvirt/-/issues/93
Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2022-05-04 14:33:02 +02:00
Liang Yan
d9f175379c qemu: do not use domain virt type to get default version
We do not need VIR_DOMAIN_VIRT_QEMU to get qemu default
version. With the 'os_type' and 'arch'in capabilities,
we could identify 'emulator' which is enough to get the version.

Actually VIR_DOMAIN_VIRT_QEMU is not the only domain virt type for
qemu driver, there are VIR_DOMAIN_VIRT_KVM and VIR_DOMAIN_VIRT_HVF.
If TCG is disabled in qemu, it will cause the error that could not
find suitable emulater when access version.

Signed-off-by: Liang Yan <lyan@digtalocean.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2022-05-04 12:02:32 +02:00
Daniel P. Berrangé
41e118fa4f build-aux: remove duplicated syntax check filter for 'select'
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-05-03 15:45:38 +01:00
Jiri Denemark
a12b2d8f21 Post-release version bump to 8.4.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-05-02 13:37:43 +02:00
Jiri Denemark
aff8961dd1 Release of libvirt-8.3.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2022-05-02 13:33:03 +02:00
Piotr Drąg
9684c7c97e Translated using Weblate (Polish)
Currently translated at 22.3% (2331 of 10419 strings)

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

Co-authored-by: Piotr Drąg <piotrdrag@gmail.com>
Signed-off-by: Piotr Drąg <piotrdrag@gmail.com>
2022-04-30 12:51:30 +02:00
Yuri Chornoivan
d0289cfa0e Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10419 of 10419 strings)

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

Co-authored-by: Yuri Chornoivan <yurchor@ukr.net>
Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2022-04-28 14:46:06 +02:00
김인수
755bd47b5f Translated using Weblate (Korean)
Currently translated at 100.0% (10419 of 10419 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2022-04-28 14:46:06 +02:00
Weblate
413bf1ed54 Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

Co-authored-by: Weblate <noreply@weblate.org>
Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2022-04-28 14:46:06 +02:00
Daniel P. Berrangé
a055308668 tests: don't set G_DEBUG=fatal-warnings on macOS
On macOS when BROKEN_POLL is set in GLib, our tests will periodically
trigger a warning:

  (process:50880): GLib-WARNING **: 02:54:15.272: poll(2) failed due to: Bad file descriptor.

Our code is inherantly racy, calling g_source_destroy which
removes the FD from the event thread poll asynchronously but
we close the FD immediately after g_source_destroy returns.

With poll() this results in POLLNVAL which we're ignoring, but
with select() it generates the BADF error on macOS.

We need to ignore the warnings on macOS to avoid abort()ing
our test programs.

Closes: https://gitlab.com/libvirt/libvirt/-/issues/303
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-28 13:45:44 +01:00
Daniel P. Berrangé
d4d5cebdf1 ci: print stack traces on macOS if any tests fail
Mostly the tests should fail cleanly, but sometimes the test might crash
or abort. In this case we'll need to know the stack traces in order to
debug the problem. Fortunately on the Cirrus CI macOS instances, the
crash reporting service is active and saving crashes to the directory
~/Library/Logs/DiagnosticReports/

Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-28 13:36:34 +01:00
Peter Krempa
297ef539d0 NEWS: Mention bump of minimum qemu version to qemu-3.1
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-04-28 13:38:08 +02:00
Martin Kletzander
381498796c cpu: Remove pointless check
These two pointers can never be NULL since they are initialised to a reference
of a struct.  This became apparent when commit 210a195394 added a VIR_DEBUG
which used both pointers because due to the concise condition the compiler saw
that if the "and" part of the condition did short-circuit (and it assumed that
can happen) the second variable would not be initialised, but it is used in the
debugging message, so the build failed with:

  In file included from ../src/cpu/cpu_x86.c:27:
  ../src/cpu/cpu_x86.c: In function ‘virCPUx86DataIsIdentical’:
  ../src/util/virlog.h:79:5: error: ‘bdata’ may be used uninitialized in this
  function [-Werror=maybe-uninitialized]

Fix this by just assigning the helper pointers and remove the condition
altogether.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2022-04-27 09:42:59 +02:00
Victor Toso
6975ed0a94 scripts: apibuild: add parsing variable's comments
scripts/apibuild.py did not consider exporting external variable's
comments into the XML API. This commits fixes that.

Noe that the way that CParser is designed, it is currently possible to
lose a parsed comment when parsing other fields as self.comment in
several places. I've added a comment to highlight this.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 17:54:33 +02:00
Victor Toso
4bce59d963 scripts: apibuild: factor out comment cleaning
So we can use for comments that are being hold in helper variables.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 17:54:30 +02:00
Victor Toso
034600e601 scripts: apibuild: parse 'Since' for functions
This patch adds 'version' parameter to generated XML API for functions
and functypes.

The 'version' metadata has been added with e0e0bf6628 by parsing .syms
files. This commit does not override that but it will warn if there is
not 'Since' metadata with new additions.

There is not clear benefit for keeping both. For now, I've added a
warning in case there is a mismatch between the version provided by
.syms and docstring.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 17:54:28 +02:00
Victor Toso
b7472a1d79 scripts: apibuild: parse 'Since' for macros
This patch adds 'version' parameter to the generated XML API for
macros

It'll require, for new additions, to add a comment with the version
that the macro was added. An example bellow of code diff and
the change in the generated XML.

Note that the Since tag is removed from the comment as there is a
proper field for it in the XML.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 17:54:27 +02:00
Victor Toso
8be766e39c scripts: apibuild: parse 'Since' for typedefs
This patch adds 'version' parameter to the generated XML API for
typedefs

It'll require, for new additions, to add a comment with the version
that the typedef value was added. An example bellow of code diff and
the change in the generated XML.

Note that the Since tag is removed from the comment as there is a
proper field for it in the XML.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 17:54:25 +02:00
Victor Toso
2f1c01e672 scripts: apibuild: fix parsing block comments from typedef enum
Removed the TODO as we can rely to the serialize_typedef() the job to
report missing comments.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 17:54:22 +02:00
Victor Toso
7958b7d9c5 scripts: apibuild: parse 'Since' version for enums
This patch adds 'version' parameter to the generated XML API for
enums.

It'll require, for new additions, to add a comment with the version
that the enum value was added.

Note that the Since tag is removed from the comment as there is a
proper field for it in the XML.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 17:54:17 +02:00
Andrea Bolognani
60d62c5ea1 include: Move version information
It belongs to the comment for VIR_DOMAIN_AFFECT_CONFIG, not to
the unrelated one immediately after it.

Fixes: 807cdbf759
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 17:38:35 +02:00
Daniel P. Berrangé
a45e4b42fe ci: print test suite logs on failure for Cirrus jobs
We don't have access to the 'testlog.txt' file, so we need meson to
print the failures for any broken tests directly.

Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2022-04-26 13:17:52 +01:00
Victor Toso
85a5d64618 docstring: function: admin: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given function was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 12:31:41 +02:00
Victor Toso
c628bce03b docstring: function: libvirt: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given function was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 12:31:41 +02:00
Victor Toso
032724b9c4 docstring: typedef: admin: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given typedef was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 12:31:41 +02:00
Victor Toso
a1d3324f02 docstring: macros: admin: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given macro was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 12:31:41 +02:00
Victor Toso
da6d307a34 docstring: enums: admin: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given enum value was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 12:31:41 +02:00
Victor Toso
807cdbf759 docstring: enums: libvirt: Add 'Since version' metadata
Either create or append to existing docstring, the version (git tag)
that a given enum value was introduced in the format:

    Since: v1.2.3

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 12:31:41 +02:00
Andrea Bolognani
aad910c228 include: Remove more comments between enum values
apibuild.py mistakes these as being a continuation of the
previous comment.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 12:31:41 +02:00
Andrea Bolognani
6237f2b84b include: Fix docstring indentation
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 12:31:40 +02:00
Victor Toso
7852d30bff docstring: avoid sc_prohibit_nonreentrant in a comment
Follow up patch will add Since metadata to enum values of
virStorageVolWipeAlgorithm.

This patch is necessary to avoid breaking the build with
syntax-check.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 11:25:25 +02:00
Victor Toso
1ae8b1df02 docstring: remove comments between enum values
scripts/apibuild.py does not handle well enum's with comments between
values. The outcome depends on whether the enum value has its own
docstring or not and if there is spaces between the enum values or
not.

This commit removes some generic comments that I have spotted.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 11:25:23 +02:00
Victor Toso
469f3467e1 docstring: typedef: fix a few version
Fixes: 034432e47b
Signed-off-by: Victor Toso <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2022-04-26 11:25:17 +02:00
1263 changed files with 142979 additions and 43188 deletions

View File

@@ -62,7 +62,8 @@ website:
stage: builds
image: $CI_REGISTRY_IMAGE/ci-almalinux-8:latest
needs:
- x86_64-almalinux-8-container
- job: x86_64-almalinux-8-container
optional: true
before_script:
- *script_variables
script:
@@ -82,7 +83,8 @@ codestyle:
stage: sanity_checks
image: $CI_REGISTRY_IMAGE/ci-opensuse-leap-153:latest
needs:
- x86_64-opensuse-leap-153-container
- job: x86_64-opensuse-leap-153-container
optional: true
before_script:
- *script_variables
script:
@@ -98,7 +100,8 @@ potfile:
stage: builds
image: $CI_REGISTRY_IMAGE/ci-almalinux-8:latest
needs:
- x86_64-almalinux-8-container
- job: x86_64-almalinux-8-container
optional: true
rules:
- if: "$CI_COMMIT_BRANCH == 'master'"
before_script:
@@ -120,7 +123,8 @@ potfile:
coverity:
image: $CI_REGISTRY_IMAGE/ci-almalinux-8:latest
needs:
- x86_64-almalinux-8-container
- job: x86_64-almalinux-8-container
optional: true
stage: builds
script:
- curl https://scan.coverity.com/download/linux64 --form project=$COVERITY_SCAN_PROJECT_NAME --form token=$COVERITY_SCAN_TOKEN -o /tmp/cov-analysis-linux64.tgz

View File

@@ -17,8 +17,3 @@
## Additional information
<!-- Attach XML configs, logs, stack traces, etc. Compress the files if necessary -->
<!-- See https://libvirt.org/kbase/debuglogs.html on how to configure logging -->
<!-- The line below ensures that proper tags are added to the issue. -- >
/label ~bug

View File

@@ -23,8 +23,3 @@ Thank you for your interest in helping us to make libvirt better!
## Additional information
<!-- The line below ensures that proper tags are added to the issue. -- >
/label ~enhancement

222
NEWS.rst
View File

@@ -8,22 +8,148 @@ the changes introduced by each of them.
For a more fine-grained view, use the `git log`_.
v8.3.0 (unreleased)
v8.6.0 (2022-08-01)
===================
* **Security**
* **Improvements**
* conf: Improved firmware autoselection
The firmware autoselection feature now behaves more intuitively, reports
better error messages on failure and comes with high-level documentation.
v8.5.0 (2022-07-01)
===================
* **New features**
* qemu: Introduce support for network backed NVRAM
Users can now use remote store NVRAM image by specifying newly introduced
attribute `type='network'` with `<nvram>` element.
* qemu: Add support for post-copy migration recovery
A new ``VIR_MIGRATE_POSTCOPY_RESUME`` flag (``virsh migrate --postcopy-resume``)
was introduced for recovering from a failed post-copy migration.
* Introduce thread_pool_min and thread_pool_max attributes to IOThread
New attributes ``thread_pool_min`` and ``thread_pool_max`` were introduced
to ``<iothread/>`` as well as new ``<defaultiothread/>`` element with the
same attributes. This way it's possible to instruct QEMU to spawn enough
worker threads for an IOThread upfront, resulting in predictable time
needed to process an I/O request.
* **Improvements**
* Define a TFTP server without a DHCP server in network configuration
It's now possible to define a network with no DHCP server but with a TFTP
server. This may be useful when DHCP service is provided by other entity on
the network than libvirt spawned dnsmasq.
* **Bug fixes**
* qemu: Restore label to temp file in qemuDomainScreenshot()
When virDomainScreenshot() is called, libvirt instructs QEMU to save the
screenshot into a temporary file. This file needs to be labelled correctly,
so that QEMU can access it. And since the file is temporary (it's deleted
after the screenshot was taken) the corresponding label restore was
missing. This proven to be problematic for profile based models, like
AppArmor, where the temporary files were added into the profile but never
removed, which resulted in longer profile recalculation times.
* qemuBuildInterfaceConnect: Initialize @tapfd array
Due to an uninitialized array, unsuccessful attempt to start a guest with
an ``<interface/>`` might have resulted in closing of a random FD and thus
sudden disconnect of a client or other random failures.
* qemu: Fix hotplug of network interfaces
A logic bug introduced in a recent refactor was fixed. The bug caused a
problem when hot-adding a network interface, which failed with the
following error::
error: internal error: unable to execute QEMU command 'netdev_add': File descriptor named '(null)' has not been found
* Fix ``startupPolicy`` validation for ``block`` disks
Setting of ``startupPolicy`` for a block disk would result in an error due
to a logic bug in a recent refactor.
* qemu: Fix crash when overriding device properties via ``<qemu:override>`` element
Adding an override for a device property would result in a crash of the qemu
driver.
v8.4.0 (2022-06-01)
===================
* **New features**
* qemu: D-Bus display
Libvirt is now able to setup a D-Bus display export, either with a private
bus or in p2p mode. This display is available in QEMU 7.0.0.
* qemu: ppc64 Power10 processor support
Support for the recently released IBM Power10 processor was added.
* qemu: Introduce ``absolute`` clock offset
The ``absolute`` clock offset type allows to set the guest clock to an
arbitrary epoch timestamp at each start. This is useful if some VM needs
to be kept set to an arbitrary time for e.g. testing or working around
broken software.
* qemu: add qemu-vdagent channel
This paravirtualized qemu vdagent channel can enable copy and paste between
a guest and a VNC client. It is available in QEMU 6.1.0.
* api: Add new APIs ``virDomainSaveParams`` and ``virDomainRestoreParams``
* ``virDomainSaveParams``: An alternative domain saving API, extends
``virDomainSaveFlags`` by adding parameters.
* ``virDomainRestoreParams``: An alternative domain restoring API, extends
``virDomainRestoreFlags`` by adding parameters.
* **Bug fixes**
* Improve heuristics for computing baseline CPU models
Both ``virConnectBaselineHypervisorCPU`` and ``virConnectBaselineCPU`` were
in some cases computing the result using a CPU model which was newer than
some of the input models. For example, ``Cascadelake-Server`` was used as a
baseline for ``Skylake-Server-IBRS`` and ``Cascadelake-Server``. The CPU
model selection heuristics was improved to choose a more appropriate model.
v8.3.0 (2022-05-02)
===================
* **Removed features**
* qemu: Remove support for QEMU < 3.1
In accordance with our platform support policy, the oldest supported QEMU
version is now bumped from 2.11 to 3.1.
* **New features**
* qemu: Introduce support for virtio-iommu
This IOMMU device can be used with both Q35 and ARM virt guests.
* **Improvements**
* qemu: Introduce attributes rss and rss_hash_report for net interface
* **Bug fixes**
They can enable in-qemu/ebpf RSS and in-qemu RSS hash report for virtio NIC.
Require QEMU >= 5.1.
v8.2.0 (2022-04-01)
@@ -450,6 +576,20 @@ v7.8.0 (2021-10-01)
active. This information can also be retrieved with the new virsh command
``nodedev-info``.
* qemu: Add attribute ``queue_size`` for virtio-blk devices
* **Improvements**
* api: Add XML validation for creating of: networkport, nwfilter-binding,
network
* Add flag ``VIR_NETWORK_PORT_CREATE_VALIDATE`` to validate network port
input xml of network-port creating.
* Add flag ``VIR_NETWORK_CREATE_VALIDATE`` to validate network input xml of
network creating.
* Add flag ``VIR_NWFILTER_BINDING_CREATE_VALIDATE`` to validate
nwfilter-binding input xml of nwfilter-binding creating.
v7.7.0 (2021-09-01)
===================
@@ -521,6 +661,8 @@ v7.7.0 (2021-09-01)
forbidden for older qemus which don't support the update API as the guest
could still reboot and execute some instructions until it was terminated.
* virsh: Support vhostuser in attach-interface
* **Bug fixes**
* qemu: Open chardev logfile on behalf of QEMU
@@ -996,6 +1138,14 @@ v7.0.0 (2021-01-15)
powered off or undefined. Add per-TPM emulator option ``persistent_state``
for keeping TPM state.
* cpu_map: Add Snowridge CPU model
It's supported in QEMU 4.1 and newer.
* qemu: Add support for NFS disk protocol
Implement support for the 'nfs' native protocol driver in the qemu driver.
* **Improvements**
* qemu: Discourage users from polling ``virDomainGetBlockJobInfo`` for block
@@ -1086,6 +1236,12 @@ v6.10.0 (2020-12-01)
option is missing are now '1'. This ensures that only legitimate clients
access servers, which don't have any additional form of authentication.
* qemu: Introduce "migrate_tls_force" qemu.conf option
The ``migrate_tls_force`` configuration option allows administrators to
always force connections used for migration to be TLS secured as if the
``VIR_MIGRATE_TLS`` flag had been used.
* **New features**
* qemu: Implement OpenSSH authorized key file management APIs
@@ -1104,6 +1260,18 @@ v6.10.0 (2020-12-01)
``virDomainSetVcpus()``, and ``virDomainSetVcpusFlags()`` APIs have been
implemented in the Hyper-V driver.
* qemu: Add 'fmode' and 'dmode' options for 9pfs
Expose QEMU's 9pfs 'fmode' and 'dmode' options via attributes on the
'filesystem' node in the domain XML. These options control the creation
mode of files and directories, respectively, when using accessmode=mapped.
It requires QEMU 2.10 or above.
* qemu: support kvm-poll-control performance hint
Implement the new KVM feature 'poll-control' to set this performance hint
for KVM guests. It requires QEMU 4.2 or above.
* **Improvements**
* virsh: Support network disks in ``virsh attach-disk``
@@ -1172,6 +1340,52 @@ v6.9.0 (2020-11-02)
using ``<interface type='vdpa'>``. The node device APIs also now
list and provide XML descriptions for vDPA devices.
* cpu_map: Add EPYC-Rome CPU model
It's supported in QEMU 5.0.0 and newer.
* cpu: Add a flag for XML validation in CPU comparison
The ``virConnectCompareCPU`` and ``virConnectCompareHypervisorCPU`` API
now support the ``VIR_CONNECT_COMPARE_CPU_VALIDATE_XML`` flag, which
enables XML validation. For virsh, this feature is enabled by passing
the ``--validate`` option to the ``cpu-compare`` and
``hypervisor-cpu-compare`` subcommands.
* qemu: Introduce virtio-balloon free page reporting feature
Introduce the optional attribute ``free-page-reporting`` for virtio
memballoon device. It enables/disables the ability of the QEMU virtio
memory balloon to return unused pages back to the hypervisor. QEMU 5.1
and newer support this feature.
* **Improvements**
* qemu: Make 'cbitpos' & 'reducedPhysBits' attrs optional
Libvirt probes the underlying platform in order to fill in these SEV
attributes automatically before launching a guest.
* util: support device stats collection for SR-IOV VF hostdev
For SR-IOV VF hostdevs, libvirt now supports retrieving device traffic
stats via the ``virDomainInterfaceStats`` API and ``virsh domifstat``.
* logging: Allow disabling log rollover
Set ``max_len=0`` in ``virtlogd.conf`` to disable log rollover.
* qemu: Set noqueue qdisc for TAP devices
Set ``noqueue`` instead of the former ``pfifo_fast`` queue discipline
for TAP devices. It will avoid needless cost of host CPU cycles and
thus improve performance.
* qemu: virtiofs can be used without NUMA nodes
Virtiofs is supported for the VM without NUMA nodes but configured with
shared memory.
* **Bug fixes**
* hyperv: ensure WQL queries work in all locales

View File

@@ -7,6 +7,7 @@ RUNUTF8 = @runutf8@
PYTHON = @PYTHON3@
GREP = @GREP@
SED = @SED@
AWK = @AWK@
# include syntax-check.mk file
include $(top_srcdir)/build-aux/syntax-check.mk

View File

@@ -26,6 +26,8 @@ else
grep_prog = find_program('grep')
endif
awk_prog = find_program('awk')
syntax_check_conf = configuration_data({
'top_srcdir': meson.source_root(),
'top_builddir': meson.build_root(),
@@ -34,6 +36,7 @@ syntax_check_conf = configuration_data({
'PYTHON3': python3_prog.path(),
'GREP': grep_prog.path(),
'SED': sed_prog.path(),
'AWK': awk_prog.path(),
})
configure_file(
@@ -44,7 +47,7 @@ configure_file(
rc = run_command(
'sed', '-n',
's/^\\(sc_[a-zA-Z0-9_-]*\\):.*/\\1/p',
's/^sc_\\([a-zA-Z0-9_-]*\\):.*/\\1/p',
meson.current_source_dir() / 'syntax-check.mk',
check: true,
)
@@ -59,7 +62,7 @@ if git
test(
target,
make_prog,
args: [ '-C', meson.current_build_dir(), target ],
args: [ '-C', meson.current_build_dir(), 'sc_@0@'.format(target) ],
depends: [
potfiles_dep,
],

File diff suppressed because it is too large Load Diff

View File

@@ -140,7 +140,7 @@ endif
CI_GIT_ARGS = \
-c advice.detachedHead=false \
-q \
--local \
--local \
$(NULL)
# Args to use when running the container

View File

@@ -10,8 +10,8 @@ Cirrus CI integration
=====================
libvirt currently supports three non-Linux operating systems: Windows, FreeBSD
and macOS. Windows cross-builds can be prepared on Linux by using `MinGW`_, but
for both FreeBSD and macOS we need to use the actual operating system, and
and macOS. Windows cross-builds can be prepared on Linux by using `MinGW-w64`_,
but for both FreeBSD and macOS we need to use the actual operating system, and
unfortunately GitLab shared runners are currently not available for either.
To work around this limitation, we take advantage of `Cirrus CI`_'s free
@@ -61,7 +61,7 @@ repository as usual and you'll automatically get the additional CI coverage.
.. _Cirrus CI GitHub app: https://github.com/marketplace/cirrus-ci
.. _Cirrus CI settings: https://cirrus-ci.com/settings/profile/
.. _Cirrus CI: https://cirrus-ci.com/
.. _MinGW: http://mingw.org/
.. _MinGW-w64: https://www.mingw-w64.org/
.. _cirrus-run: https://github.com/sio/cirrus-run/

View File

@@ -26,4 +26,4 @@ build_task:
- meson setup build
- meson dist -C build --no-tests
- meson compile -C build
- meson test -C build --no-suite syntax-check
- meson test -C build --no-suite syntax-check --print-errorlogs || (cat ~/Library/Logs/DiagnosticReports/*.crash && exit 1)

View File

@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils diskscrub fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py38-docutils py38-flake8 python3 qemu readline yajl'
PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils diskscrub fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py39-docutils py39-flake8 python3 qemu readline yajl'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'

View File

@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
NINJA='/usr/local/bin/ninja'
PACKAGING_COMMAND='pkg'
PIP3='/usr/local/bin/pip-3.8'
PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils diskscrub fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py38-docutils py38-flake8 python3 qemu readline yajl'
PKGS='augeas bash-completion ca_root_nss ccache codespell cppi curl cyrus-sasl diffutils diskscrub fusefs-libs gettext git glib gmake gnugrep gnutls gsed libpcap libpciaccess libssh libssh2 libxml2 libxslt meson ninja perl5 pkgconf polkit py39-docutils py39-flake8 python3 qemu readline yajl'
PYPI_PKGS=''
PYTHON='/usr/local/bin/python3'

View File

@@ -1,81 +0,0 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/alpine:3.14
RUN apk update && \
apk upgrade && \
apk add \
acl-dev \
attr-dev \
audit-dev \
augeas \
bash-completion \
ca-certificates \
ccache \
ceph-dev \
clang \
curl-dev \
cyrus-sasl-dev \
diffutils \
eudev-dev \
fuse-dev \
gcc \
gettext \
git \
glib-dev \
gnutls-dev \
grep \
iproute2 \
iptables \
kmod \
libcap-ng-dev \
libnl3-dev \
libpcap-dev \
libpciaccess-dev \
libselinux-dev \
libssh-dev \
libssh2-dev \
libtirpc-dev \
libxml2-dev \
libxml2-utils \
libxslt \
lvm2 \
lvm2-dev \
make \
meson \
musl-dev \
netcf-dev \
nfs-utils \
numactl-dev \
open-iscsi \
parted-dev \
perl \
pkgconf \
polkit \
py3-docutils \
py3-flake8 \
python3 \
qemu-img \
readline-dev \
rpcgen \
samurai \
sed \
util-linux-dev \
wireshark-dev \
xen-dev \
yajl-dev && \
apk list | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"

View File

@@ -11,6 +11,7 @@ RUN dnf distro-sync -y && \
dnf config-manager --set-enabled -y powertools && \
dnf install -y centos-release-advanced-virtualization && \
dnf install -y epel-release && \
dnf install -y epel-next-release && \
dnf install -y \
audit-libs-devel \
augeas \

View File

@@ -9,14 +9,14 @@ FROM quay.io/centos/centos:stream9
RUN dnf distro-sync -y && \
dnf install 'dnf-command(config-manager)' -y && \
dnf config-manager --set-enabled -y crb && \
dnf install -y \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm \
https://dl.fedoraproject.org/pub/epel/epel-next-release-latest-9.noarch.rpm && \
dnf install -y epel-release && \
dnf install -y epel-next-release && \
dnf install -y \
audit-libs-devel \
augeas \
bash-completion \
ca-certificates \
ccache \
clang \
cpp \
cyrus-sasl-devel \
@@ -50,6 +50,7 @@ RUN dnf distro-sync -y && \
librbd-devel \
libselinux-devel \
libssh-devel \
libssh2-devel \
libtirpc-devel \
libwsman-devel \
libxml2 \
@@ -81,9 +82,14 @@ RUN dnf distro-sync -y && \
yajl-devel && \
dnf autoremove -y && \
dnf clean all -y && \
rpm -qa | sort > /packages.txt
rpm -qa | sort > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"

View File

@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:35
FROM registry.fedoraproject.org/fedora:36
RUN dnf install -y nosync && \
echo -e '#!/bin/sh\n\

View File

@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:35
FROM registry.fedoraproject.org/fedora:36
RUN dnf install -y nosync && \
echo -e '#!/bin/sh\n\

View File

@@ -4,7 +4,7 @@
#
# https://gitlab.com/libvirt/libvirt-ci
FROM registry.fedoraproject.org/fedora:34
FROM registry.fedoraproject.org/fedora:36
RUN dnf install -y nosync && \
echo -e '#!/bin/sh\n\
@@ -69,7 +69,6 @@ exec "$@"' > /usr/bin/nosync && \
lvm2 \
make \
meson \
netcf-devel \
nfs-utils \
ninja-build \
numactl-devel \

View File

@@ -0,0 +1,101 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
FROM docker.io/library/ubuntu:22.04
RUN export DEBIAN_FRONTEND=noninteractive && \
apt-get update && \
apt-get install -y eatmydata && \
eatmydata apt-get dist-upgrade -y && \
eatmydata apt-get install --no-install-recommends -y \
augeas-lenses \
augeas-tools \
bash-completion \
ca-certificates \
ccache \
clang \
codespell \
cpp \
diffutils \
dwarves \
ebtables \
flake8 \
gcc \
gettext \
git \
grep \
iproute2 \
iptables \
kmod \
libacl1-dev \
libapparmor-dev \
libattr1-dev \
libaudit-dev \
libblkid-dev \
libc-dev-bin \
libc6-dev \
libcap-ng-dev \
libcurl4-gnutls-dev \
libdevmapper-dev \
libfuse-dev \
libglib2.0-dev \
libglusterfs-dev \
libgnutls28-dev \
libiscsi-dev \
libnl-3-dev \
libnl-route-3-dev \
libnuma-dev \
libopenwsman-dev \
libparted-dev \
libpcap0.8-dev \
libpciaccess-dev \
librbd-dev \
libreadline-dev \
libsanlock-dev \
libsasl2-dev \
libselinux1-dev \
libssh-dev \
libssh2-1-dev \
libtirpc-dev \
libudev-dev \
libxen-dev \
libxml2-dev \
libxml2-utils \
libyajl-dev \
locales \
lvm2 \
make \
meson \
nfs-common \
ninja-build \
numad \
open-iscsi \
perl-base \
pkgconf \
policykit-1 \
python3 \
python3-docutils \
qemu-utils \
scrub \
sed \
systemtap-sdt-dev \
wireshark-dev \
xsltproc && \
eatmydata apt-get autoremove -y && \
eatmydata apt-get autoclean -y && \
sed -Ei 's,^# (en_US\.UTF-8 .*)$,\1,' /etc/locale.gen && \
dpkg-reconfigure locales && \
dpkg-query --showformat '${Package}_${Version}_${Architecture}\n' --show > /packages.txt && \
mkdir -p /usr/libexec/ccache-wrappers && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/cc && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/clang && \
ln -s /usr/bin/ccache /usr/libexec/ccache-wrappers/gcc
ENV LANG "en_US.UTF-8"
ENV MAKE "/usr/bin/make"
ENV NINJA "/usr/bin/ninja"
ENV PYTHON "/usr/bin/python3"
ENV CCACHE_WRAPPERSDIR "/usr/libexec/ccache-wrappers"

View File

@@ -5,747 +5,30 @@
# https://gitlab.com/libvirt/libvirt-ci
.container_job:
image: docker:stable
stage: containers
needs: []
services:
- docker:dind
before_script:
- export TAG="$CI_REGISTRY_IMAGE/ci-$NAME:latest"
- export COMMON_TAG="$CI_REGISTRY/libvirt/libvirt/ci-$NAME:latest"
- docker info
- docker login registry.gitlab.com -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
script:
- docker pull "$TAG" || docker pull "$COMMON_TAG" || true
- docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG" -f "ci/containers/$NAME.Dockerfile" ci/containers
- docker push "$TAG"
after_script:
- docker logout
.gitlab_native_build_job:
image: $CI_REGISTRY_IMAGE/ci-$NAME:latest
stage: builds
.gitlab_cross_build_job:
image: $CI_REGISTRY_IMAGE/ci-$NAME-cross-$CROSS:latest
stage: builds
.cirrus_build_job:
stage: builds
image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master
needs: []
script:
- source ci/cirrus/$NAME.vars
- sed -e "s|[@]CI_REPOSITORY_URL@|$CI_REPOSITORY_URL|g"
-e "s|[@]CI_COMMIT_REF_NAME@|$CI_COMMIT_REF_NAME|g"
-e "s|[@]CI_COMMIT_SHA@|$CI_COMMIT_SHA|g"
-e "s|[@]CIRRUS_VM_INSTANCE_TYPE@|$CIRRUS_VM_INSTANCE_TYPE|g"
-e "s|[@]CIRRUS_VM_IMAGE_SELECTOR@|$CIRRUS_VM_IMAGE_SELECTOR|g"
-e "s|[@]CIRRUS_VM_IMAGE_NAME@|$CIRRUS_VM_IMAGE_NAME|g"
-e "s|[@]UPDATE_COMMAND@|$UPDATE_COMMAND|g"
-e "s|[@]UPGRADE_COMMAND@|$UPGRADE_COMMAND|g"
-e "s|[@]INSTALL_COMMAND@|$INSTALL_COMMAND|g"
-e "s|[@]PATH@|$PATH_EXTRA${PATH_EXTRA:+:}\$PATH|g"
-e "s|[@]PKG_CONFIG_PATH@|$PKG_CONFIG_PATH|g"
-e "s|[@]PKGS@|$PKGS|g"
-e "s|[@]MAKE@|$MAKE|g"
-e "s|[@]PYTHON@|$PYTHON|g"
-e "s|[@]PIP3@|$PIP3|g"
-e "s|[@]PYPI_PKGS@|$PYPI_PKGS|g"
-e "s|[@]XML_CATALOG_FILES@|$XML_CATALOG_FILES|g"
<ci/cirrus/build.yml >ci/cirrus/$NAME.yml
- cat ci/cirrus/$NAME.yml
- cirrus-run -v --show-build-log always ci/cirrus/$NAME.yml
rules:
- if: "$CIRRUS_GITHUB_REPO && $CIRRUS_API_TOKEN"
check-dco:
stage: sanity_checks
needs: []
image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master
script:
- /check-dco libvirt
except:
variables:
- $CI_PROJECT_NAMESPACE == 'libvirt'
variables:
GIT_DEPTH: 1000
# Native container jobs
x86_64-almalinux-8-container:
extends: .container_job
allow_failure: false
variables:
NAME: almalinux-8
x86_64-alpine-314-container:
extends: .container_job
allow_failure: false
variables:
NAME: alpine-314
x86_64-alpine-315-container:
extends: .container_job
allow_failure: false
variables:
NAME: alpine-315
x86_64-alpine-edge-container:
extends: .container_job
allow_failure: true
variables:
NAME: alpine-edge
x86_64-centos-stream-8-container:
extends: .container_job
allow_failure: false
variables:
NAME: centos-stream-8
x86_64-centos-stream-9-container:
extends: .container_job
allow_failure: false
variables:
NAME: centos-stream-9
x86_64-debian-10-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-10
x86_64-debian-11-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-11
x86_64-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid
x86_64-fedora-34-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-34
x86_64-fedora-35-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-35
x86_64-fedora-rawhide-container:
extends: .container_job
allow_failure: true
variables:
NAME: fedora-rawhide
x86_64-opensuse-leap-153-container:
extends: .container_job
allow_failure: false
variables:
NAME: opensuse-leap-153
x86_64-opensuse-tumbleweed-container:
extends: .container_job
allow_failure: true
variables:
NAME: opensuse-tumbleweed
x86_64-ubuntu-2004-container:
extends: .container_job
allow_failure: false
variables:
NAME: ubuntu-2004
# Cross container jobs
aarch64-debian-10-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-10-cross-aarch64
armv6l-debian-10-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-10-cross-armv6l
armv7l-debian-10-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-10-cross-armv7l
i686-debian-10-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-10-cross-i686
mips-debian-10-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-10-cross-mips
mips64el-debian-10-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-10-cross-mips64el
mipsel-debian-10-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-10-cross-mipsel
ppc64le-debian-10-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-10-cross-ppc64le
s390x-debian-10-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-10-cross-s390x
aarch64-debian-11-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-11-cross-aarch64
armv6l-debian-11-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-11-cross-armv6l
armv7l-debian-11-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-11-cross-armv7l
i686-debian-11-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-11-cross-i686
mips64el-debian-11-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-11-cross-mips64el
mipsel-debian-11-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-11-cross-mipsel
ppc64le-debian-11-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-11-cross-ppc64le
s390x-debian-11-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-11-cross-s390x
aarch64-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid-cross-aarch64
armv6l-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid-cross-armv6l
armv7l-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid-cross-armv7l
i686-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid-cross-i686
mips64el-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid-cross-mips64el
mipsel-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid-cross-mipsel
ppc64le-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid-cross-ppc64le
s390x-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid-cross-s390x
mingw32-fedora-35-container:
extends: .container_job
allow_failure: true
variables:
NAME: fedora-35-cross-mingw32
mingw64-fedora-35-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-35-cross-mingw64
mingw32-fedora-rawhide-container:
extends: .container_job
allow_failure: true
variables:
NAME: fedora-rawhide-cross-mingw32
mingw64-fedora-rawhide-container:
extends: .container_job
allow_failure: true
variables:
NAME: fedora-rawhide-cross-mingw64
# Native build jobs
x86_64-almalinux-8:
extends: .native_build_job
needs:
- x86_64-almalinux-8-container
allow_failure: false
variables:
NAME: almalinux-8
RPM: skip
x86_64-almalinux-8-clang:
extends: .native_build_job
needs:
- x86_64-almalinux-8-container
allow_failure: false
variables:
CC: clang
NAME: almalinux-8
RPM: skip
x86_64-alpine-314:
extends: .native_build_job
needs:
- x86_64-alpine-314-container
allow_failure: false
variables:
NAME: alpine-314
x86_64-alpine-315:
extends: .native_build_job
needs:
- x86_64-alpine-315-container
allow_failure: false
variables:
NAME: alpine-315
x86_64-alpine-edge:
extends: .native_build_job
needs:
- x86_64-alpine-edge-container
allow_failure: true
variables:
NAME: alpine-edge
x86_64-centos-stream-8:
extends: .native_build_job
needs:
- x86_64-centos-stream-8-container
allow_failure: false
variables:
NAME: centos-stream-8
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-centos-stream-9:
extends: .native_build_job
needs:
- x86_64-centos-stream-9-container
allow_failure: false
variables:
NAME: centos-stream-9
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-debian-10:
extends: .native_build_job
needs:
- x86_64-debian-10-container
allow_failure: false
variables:
NAME: debian-10
x86_64-debian-11:
extends: .native_build_job
needs:
- x86_64-debian-11-container
allow_failure: false
variables:
NAME: debian-11
x86_64-debian-11-clang:
extends: .native_build_job
needs:
- x86_64-debian-11-container
allow_failure: false
variables:
NAME: debian-11
x86_64-debian-sid:
extends: .native_build_job
needs:
- x86_64-debian-sid-container
allow_failure: true
variables:
NAME: debian-sid
x86_64-fedora-34:
extends: .native_build_job
needs:
- x86_64-fedora-34-container
allow_failure: false
variables:
NAME: fedora-34
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-fedora-35:
extends: .native_build_job
needs:
- x86_64-fedora-35-container
allow_failure: false
variables:
NAME: fedora-35
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-fedora-rawhide:
extends: .native_build_job
needs:
- x86_64-fedora-rawhide-container
allow_failure: true
variables:
NAME: fedora-rawhide
x86_64-fedora-rawhide-clang:
extends: .native_build_job
needs:
- x86_64-fedora-rawhide-container
allow_failure: true
variables:
CC: clang
NAME: fedora-rawhide
RPM: skip
x86_64-opensuse-leap-153:
extends: .native_build_job
needs:
- x86_64-opensuse-leap-153-container
allow_failure: false
variables:
NAME: opensuse-leap-153
RPM: skip
x86_64-opensuse-tumbleweed:
extends: .native_build_job
needs:
- x86_64-opensuse-tumbleweed-container
allow_failure: true
variables:
NAME: opensuse-tumbleweed
RPM: skip
x86_64-ubuntu-2004:
extends: .native_build_job
needs:
- x86_64-ubuntu-2004-container
allow_failure: false
variables:
ASAN_OPTIONS: verify_asan_link_order=0
MESON_ARGS: -Db_lundef=false -Db_sanitize=address,undefined
NAME: ubuntu-2004
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
x86_64-ubuntu-2004-clang:
extends: .native_build_job
needs:
- x86_64-ubuntu-2004-container
allow_failure: false
variables:
CC: clang
MESON_ARGS: -Db_lundef=false -Db_sanitize=address,undefined
NAME: ubuntu-2004
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
# Cross build jobs
armv6l-debian-10:
extends: .cross_build_job
needs:
- armv6l-debian-10-container
allow_failure: false
variables:
CROSS: armv6l
NAME: debian-10
mips-debian-10:
extends: .cross_build_job
needs:
- mips-debian-10-container
allow_failure: false
variables:
CROSS: mips
NAME: debian-10
mipsel-debian-10:
extends: .cross_build_job
needs:
- mipsel-debian-10-container
allow_failure: false
variables:
CROSS: mipsel
NAME: debian-10
armv7l-debian-11:
extends: .cross_build_job
needs:
- armv7l-debian-11-container
allow_failure: false
variables:
CROSS: armv7l
NAME: debian-11
mips64el-debian-11:
extends: .cross_build_job
needs:
- mips64el-debian-11-container
allow_failure: false
variables:
CROSS: mips64el
NAME: debian-11
ppc64le-debian-11:
extends: .cross_build_job
needs:
- ppc64le-debian-11-container
allow_failure: false
variables:
CROSS: ppc64le
NAME: debian-11
aarch64-debian-sid:
extends: .cross_build_job
needs:
- aarch64-debian-sid-container
allow_failure: true
variables:
CROSS: aarch64
NAME: debian-sid
i686-debian-sid:
extends: .cross_build_job
needs:
- i686-debian-sid-container
allow_failure: true
variables:
CROSS: i686
NAME: debian-sid
s390x-debian-sid:
extends: .cross_build_job
needs:
- s390x-debian-sid-container
allow_failure: true
variables:
CROSS: s390x
NAME: debian-sid
mingw64-fedora-35:
extends: .cross_build_job
needs:
- mingw64-fedora-35-container
allow_failure: false
variables:
CROSS: mingw64
NAME: fedora-35
mingw32-fedora-rawhide:
extends: .cross_build_job
needs:
- mingw32-fedora-rawhide-container
allow_failure: true
variables:
CROSS: mingw32
NAME: fedora-rawhide
# Native cirrus build jobs
x86_64-freebsd-12:
extends: .cirrus_build_job
needs: []
allow_failure: false
variables:
CIRRUS_VM_IMAGE_NAME: freebsd-12-2
CIRRUS_VM_IMAGE_SELECTOR: image_family
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
INSTALL_COMMAND: pkg install -y
NAME: freebsd-12
UPDATE_COMMAND: pkg update
UPGRADE_COMMAND: pkg upgrade -y
x86_64-freebsd-13:
extends: .cirrus_build_job
needs: []
allow_failure: false
variables:
CIRRUS_VM_IMAGE_NAME: freebsd-13-0
CIRRUS_VM_IMAGE_SELECTOR: image_family
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
INSTALL_COMMAND: pkg install -y
NAME: freebsd-13
UPDATE_COMMAND: pkg update
UPGRADE_COMMAND: pkg upgrade -y
x86_64-macos-11:
extends: .cirrus_build_job
needs: []
allow_failure: false
variables:
CIRRUS_VM_IMAGE_NAME: big-sur-base
CIRRUS_VM_IMAGE_SELECTOR: image
CIRRUS_VM_INSTANCE_TYPE: osx_instance
INSTALL_COMMAND: brew install
NAME: macos-11
PATH_EXTRA: /usr/local/opt/ccache/libexec:/usr/local/opt/gettext/bin:/usr/local/opt/libpcap/bin:/usr/local/opt/libxslt/bin:/usr/local/opt/rpcgen/bin
PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/libpcap/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig
UPDATE_COMMAND: brew update
UPGRADE_COMMAND: brew upgrade
# Variables that can be set to control the behaviour of
# pipelines that are run
#
# - RUN_ALL_CONTAINERS - build all containers
# even if they don't have any changes detected
#
# These can be set as git push options
#
# $ git push -o ci.variable=RUN_ALL_CONTAINERS=1
#
# Aliases can be set for common usage
#
# $ git config --local alias.push-all-ctr "push -o ci.variable=RUN_ALL_CONTAINERS=1"
#
# Allowing the less verbose invocation
#
# $ git push-all-ctr
#
# Pipeline variables can also be set in the repository
# pipeline config globally, or set against scheduled pipelines
include:
- local: '/ci/gitlab/container-templates.yml'
- local: '/ci/gitlab/build-templates.yml'
- local: '/ci/gitlab/sanity-checks.yml'
- local: '/ci/gitlab/containers.yml'
- local: '/ci/gitlab/builds.yml'

View File

@@ -0,0 +1,64 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
.gitlab_native_build_job:
image: $CI_REGISTRY_IMAGE/ci-$NAME:latest
stage: builds
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$JOB_OPTIONAL'
when: manual
allow_failure: true
- when: on_success
.gitlab_cross_build_job:
image: $CI_REGISTRY_IMAGE/ci-$NAME-cross-$CROSS:latest
stage: builds
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$JOB_OPTIONAL'
when: manual
allow_failure: true
- when: on_success
.cirrus_build_job:
stage: builds
image: registry.gitlab.com/libvirt/libvirt-ci/cirrus-run:master
needs: []
script:
- source ci/cirrus/$NAME.vars
- sed -e "s|[@]CI_REPOSITORY_URL@|$CI_REPOSITORY_URL|g"
-e "s|[@]CI_COMMIT_REF_NAME@|$CI_COMMIT_REF_NAME|g"
-e "s|[@]CI_COMMIT_SHA@|$CI_COMMIT_SHA|g"
-e "s|[@]CIRRUS_VM_INSTANCE_TYPE@|$CIRRUS_VM_INSTANCE_TYPE|g"
-e "s|[@]CIRRUS_VM_IMAGE_SELECTOR@|$CIRRUS_VM_IMAGE_SELECTOR|g"
-e "s|[@]CIRRUS_VM_IMAGE_NAME@|$CIRRUS_VM_IMAGE_NAME|g"
-e "s|[@]UPDATE_COMMAND@|$UPDATE_COMMAND|g"
-e "s|[@]UPGRADE_COMMAND@|$UPGRADE_COMMAND|g"
-e "s|[@]INSTALL_COMMAND@|$INSTALL_COMMAND|g"
-e "s|[@]PATH@|$PATH_EXTRA${PATH_EXTRA:+:}\$PATH|g"
-e "s|[@]PKG_CONFIG_PATH@|$PKG_CONFIG_PATH|g"
-e "s|[@]PKGS@|$PKGS|g"
-e "s|[@]MAKE@|$MAKE|g"
-e "s|[@]PYTHON@|$PYTHON|g"
-e "s|[@]PIP3@|$PIP3|g"
-e "s|[@]PYPI_PKGS@|$PYPI_PKGS|g"
-e "s|[@]XML_CATALOG_FILES@|$XML_CATALOG_FILES|g"
<ci/cirrus/build.yml >ci/cirrus/$NAME.yml
- cat ci/cirrus/$NAME.yml
- cirrus-run -v --show-build-log always ci/cirrus/$NAME.yml
rules:
- if: '$CIRRUS_GITHUB_REPO == null || $CIRRUS_API_TOKEN == null'
when: never
- if: '$JOB_OPTIONAL'
when: manual
allow_failure: true
- when: on_success

623
ci/gitlab/builds.yml Normal file
View File

@@ -0,0 +1,623 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
# Native build jobs
x86_64-almalinux-8:
extends: .native_build_job
needs:
- job: x86_64-almalinux-8-container
optional: true
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: almalinux-8
RPM: skip
x86_64-almalinux-8-clang:
extends: .native_build_job
needs:
- job: x86_64-almalinux-8-container
optional: true
allow_failure: false
variables:
CC: clang
NAME: almalinux-8
RPM: skip
x86_64-alpine-315:
extends: .native_build_job
needs:
- job: x86_64-alpine-315-container
optional: true
allow_failure: false
variables:
NAME: alpine-315
x86_64-alpine-edge:
extends: .native_build_job
needs:
- job: x86_64-alpine-edge-container
optional: true
allow_failure: true
variables:
NAME: alpine-edge
x86_64-centos-stream-8:
extends: .native_build_job
needs:
- job: x86_64-centos-stream-8-container
optional: true
allow_failure: false
variables:
NAME: centos-stream-8
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-centos-stream-9:
extends: .native_build_job
needs:
- job: x86_64-centos-stream-9-container
optional: true
allow_failure: false
variables:
NAME: centos-stream-9
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-debian-10:
extends: .native_build_job
needs:
- job: x86_64-debian-10-container
optional: true
allow_failure: false
variables:
NAME: debian-10
x86_64-debian-11:
extends: .native_build_job
needs:
- job: x86_64-debian-11-container
optional: true
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11
x86_64-debian-11-clang:
extends: .native_build_job
needs:
- job: x86_64-debian-11-container
optional: true
allow_failure: false
variables:
NAME: debian-11
x86_64-debian-sid:
extends: .native_build_job
needs:
- job: x86_64-debian-sid-container
optional: true
allow_failure: true
variables:
NAME: debian-sid
x86_64-fedora-35:
extends: .native_build_job
needs:
- job: x86_64-fedora-35-container
optional: true
allow_failure: false
variables:
NAME: fedora-35
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-fedora-36:
extends: .native_build_job
needs:
- job: x86_64-fedora-36-container
optional: true
allow_failure: false
variables:
NAME: fedora-36
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
x86_64-fedora-rawhide:
extends: .native_build_job
needs:
- job: x86_64-fedora-rawhide-container
optional: true
allow_failure: true
variables:
NAME: fedora-rawhide
x86_64-fedora-rawhide-clang:
extends: .native_build_job
needs:
- job: x86_64-fedora-rawhide-container
optional: true
allow_failure: true
variables:
CC: clang
NAME: fedora-rawhide
RPM: skip
x86_64-opensuse-leap-153:
extends: .native_build_job
needs:
- job: x86_64-opensuse-leap-153-container
optional: true
allow_failure: false
variables:
NAME: opensuse-leap-153
RPM: skip
x86_64-opensuse-tumbleweed:
extends: .native_build_job
needs:
- job: x86_64-opensuse-tumbleweed-container
optional: true
allow_failure: true
variables:
NAME: opensuse-tumbleweed
RPM: skip
x86_64-ubuntu-2004:
extends: .native_build_job
needs:
- job: x86_64-ubuntu-2004-container
optional: true
allow_failure: false
variables:
ASAN_OPTIONS: verify_asan_link_order=0
MESON_ARGS: -Db_lundef=false -Db_sanitize=address,undefined
NAME: ubuntu-2004
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
x86_64-ubuntu-2204:
extends: .native_build_job
needs:
- job: x86_64-ubuntu-2204-container
optional: true
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: ubuntu-2204
x86_64-ubuntu-2204-clang:
extends: .native_build_job
needs:
- job: x86_64-ubuntu-2204-container
optional: true
allow_failure: false
variables:
CC: clang
MESON_ARGS: -Db_lundef=false -Db_sanitize=address,undefined
NAME: ubuntu-2204
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
# Cross build jobs
aarch64-debian-10:
extends: .cross_build_job
needs:
- job: aarch64-debian-10-container
optional: true
allow_failure: true
variables:
CROSS: aarch64
JOB_OPTIONAL: 1
NAME: debian-10
armv6l-debian-10:
extends: .cross_build_job
needs:
- job: armv6l-debian-10-container
optional: true
allow_failure: true
variables:
CROSS: armv6l
JOB_OPTIONAL: 1
NAME: debian-10
armv7l-debian-10:
extends: .cross_build_job
needs:
- job: armv7l-debian-10-container
optional: true
allow_failure: false
variables:
CROSS: armv7l
NAME: debian-10
i686-debian-10:
extends: .cross_build_job
needs:
- job: i686-debian-10-container
optional: true
allow_failure: true
variables:
CROSS: i686
JOB_OPTIONAL: 1
NAME: debian-10
mips-debian-10:
extends: .cross_build_job
needs:
- job: mips-debian-10-container
optional: true
allow_failure: true
variables:
CROSS: mips
JOB_OPTIONAL: 1
NAME: debian-10
mips64el-debian-10:
extends: .cross_build_job
needs:
- job: mips64el-debian-10-container
optional: true
allow_failure: true
variables:
CROSS: mips64el
JOB_OPTIONAL: 1
NAME: debian-10
mipsel-debian-10:
extends: .cross_build_job
needs:
- job: mipsel-debian-10-container
optional: true
allow_failure: true
variables:
CROSS: mipsel
JOB_OPTIONAL: 1
NAME: debian-10
ppc64le-debian-10:
extends: .cross_build_job
needs:
- job: ppc64le-debian-10-container
optional: true
allow_failure: true
variables:
CROSS: ppc64le
JOB_OPTIONAL: 1
NAME: debian-10
s390x-debian-10:
extends: .cross_build_job
needs:
- job: s390x-debian-10-container
optional: true
allow_failure: true
variables:
CROSS: s390x
JOB_OPTIONAL: 1
NAME: debian-10
aarch64-debian-11:
extends: .cross_build_job
needs:
- job: aarch64-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: aarch64
JOB_OPTIONAL: 1
NAME: debian-11
armv6l-debian-11:
extends: .cross_build_job
needs:
- job: armv6l-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: armv6l
JOB_OPTIONAL: 1
NAME: debian-11
armv7l-debian-11:
extends: .cross_build_job
needs:
- job: armv7l-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: armv7l
JOB_OPTIONAL: 1
NAME: debian-11
i686-debian-11:
extends: .cross_build_job
needs:
- job: i686-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: i686
JOB_OPTIONAL: 1
NAME: debian-11
mips64el-debian-11:
extends: .cross_build_job
needs:
- job: mips64el-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: mips64el
JOB_OPTIONAL: 1
NAME: debian-11
mipsel-debian-11:
extends: .cross_build_job
needs:
- job: mipsel-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: mipsel
JOB_OPTIONAL: 1
NAME: debian-11
ppc64le-debian-11:
extends: .cross_build_job
needs:
- job: ppc64le-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: ppc64le
JOB_OPTIONAL: 1
NAME: debian-11
s390x-debian-11:
extends: .cross_build_job
needs:
- job: s390x-debian-11-container
optional: true
allow_failure: false
variables:
CROSS: s390x
JOB_OPTIONAL: 1
NAME: debian-11
aarch64-debian-sid:
extends: .cross_build_job
needs:
- job: aarch64-debian-sid-container
optional: true
allow_failure: false
variables:
CROSS: aarch64
JOB_OPTIONAL: 1
NAME: debian-sid
armv6l-debian-sid:
extends: .cross_build_job
needs:
- job: armv6l-debian-sid-container
optional: true
allow_failure: false
variables:
CROSS: armv6l
JOB_OPTIONAL: 1
NAME: debian-sid
armv7l-debian-sid:
extends: .cross_build_job
needs:
- job: armv7l-debian-sid-container
optional: true
allow_failure: false
variables:
CROSS: armv7l
JOB_OPTIONAL: 1
NAME: debian-sid
i686-debian-sid:
extends: .cross_build_job
needs:
- job: i686-debian-sid-container
optional: true
allow_failure: false
variables:
CROSS: i686
JOB_OPTIONAL: 1
NAME: debian-sid
mips64el-debian-sid:
extends: .cross_build_job
needs:
- job: mips64el-debian-sid-container
optional: true
allow_failure: false
variables:
CROSS: mips64el
JOB_OPTIONAL: 1
NAME: debian-sid
mipsel-debian-sid:
extends: .cross_build_job
needs:
- job: mipsel-debian-sid-container
optional: true
allow_failure: false
variables:
CROSS: mipsel
JOB_OPTIONAL: 1
NAME: debian-sid
ppc64le-debian-sid:
extends: .cross_build_job
needs:
- job: ppc64le-debian-sid-container
optional: true
allow_failure: false
variables:
CROSS: ppc64le
JOB_OPTIONAL: 1
NAME: debian-sid
s390x-debian-sid:
extends: .cross_build_job
needs:
- job: s390x-debian-sid-container
optional: true
allow_failure: false
variables:
CROSS: s390x
JOB_OPTIONAL: 1
NAME: debian-sid
mingw32-fedora-36:
extends: .cross_build_job
needs:
- job: mingw32-fedora-36-container
optional: true
allow_failure: false
variables:
CROSS: mingw32
JOB_OPTIONAL: 1
NAME: fedora-36
mingw64-fedora-36:
extends: .cross_build_job
needs:
- job: mingw64-fedora-36-container
optional: true
allow_failure: false
variables:
CROSS: mingw64
NAME: fedora-36
mingw32-fedora-rawhide:
extends: .cross_build_job
needs:
- job: mingw32-fedora-rawhide-container
optional: true
allow_failure: true
variables:
CROSS: mingw32
NAME: fedora-rawhide
mingw64-fedora-rawhide:
extends: .cross_build_job
needs:
- job: mingw64-fedora-rawhide-container
optional: true
allow_failure: true
variables:
CROSS: mingw64
JOB_OPTIONAL: 1
NAME: fedora-rawhide
# Native cirrus build jobs
x86_64-freebsd-12:
extends: .cirrus_build_job
needs: []
allow_failure: false
variables:
CIRRUS_VM_IMAGE_NAME: freebsd-12-3
CIRRUS_VM_IMAGE_SELECTOR: image_family
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
INSTALL_COMMAND: pkg install -y
NAME: freebsd-12
UPDATE_COMMAND: pkg update
UPGRADE_COMMAND: pkg upgrade -y
x86_64-freebsd-13:
extends: .cirrus_build_job
needs: []
allow_failure: false
variables:
CIRRUS_VM_IMAGE_NAME: freebsd-13-0
CIRRUS_VM_IMAGE_SELECTOR: image_family
CIRRUS_VM_INSTANCE_TYPE: freebsd_instance
INSTALL_COMMAND: pkg install -y
NAME: freebsd-13
UPDATE_COMMAND: pkg update
UPGRADE_COMMAND: pkg upgrade -y
x86_64-macos-11:
extends: .cirrus_build_job
needs: []
allow_failure: false
variables:
CIRRUS_VM_IMAGE_NAME: big-sur-base
CIRRUS_VM_IMAGE_SELECTOR: image
CIRRUS_VM_INSTANCE_TYPE: osx_instance
INSTALL_COMMAND: brew install
NAME: macos-11
PATH_EXTRA: /usr/local/opt/ccache/libexec:/usr/local/opt/gettext/bin:/usr/local/opt/libpcap/bin:/usr/local/opt/libxslt/bin:/usr/local/opt/rpcgen/bin
PKG_CONFIG_PATH: /usr/local/opt/curl/lib/pkgconfig:/usr/local/opt/libpcap/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/opt/ncurses/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig
UPDATE_COMMAND: brew update
UPGRADE_COMMAND: brew upgrade

View File

@@ -0,0 +1,57 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
# For upstream
#
# - Push to default branch:
# -> rebuild if dockerfile changed, no cache
# - Otherwise
# -> rebuild if RUN_ALL_CONTAINERS=1, no cache,
# to pick up new published distro packages or
# recover from deleted tag
#
# For forks
# - Always rebuild, with cache
#
.container_job:
image: docker:stable
stage: containers
needs: []
services:
- docker:dind
before_script:
- export TAG="$CI_REGISTRY_IMAGE/ci-$NAME:latest"
- export COMMON_TAG="$CI_REGISTRY/libvirt/libvirt/ci-$NAME:latest"
- docker info
- docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
script:
- if test $CI_PROJECT_NAMESPACE = "libvirt";
then
docker build --tag "$TAG" -f "ci/containers/$NAME.Dockerfile" ci/containers ;
else
docker pull "$TAG" || docker pull "$COMMON_TAG" || true ;
docker build --cache-from "$TAG" --cache-from "$COMMON_TAG" --tag "$TAG" -f "ci/containers/$NAME.Dockerfile" ci/containers ;
fi
- docker push "$TAG"
after_script:
- docker logout
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: '$CI_PROJECT_NAMESPACE == "libvirt" && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
when: on_success
changes:
- ci/gitlab/container-templates.yml
- ci/containers/$NAME.Dockerfile
- if: '$CI_PROJECT_NAMESPACE == "libvirt" && $RUN_ALL_CONTAINERS == "1"'
when: on_success
- if: '$CI_PROJECT_NAMESPACE == "libvirt"'
when: never
- if: '$JOB_OPTIONAL'
when: manual
allow_failure: true
- when: on_success

344
ci/gitlab/containers.yml Normal file
View File

@@ -0,0 +1,344 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
# Native container jobs
x86_64-almalinux-8-container:
extends: .container_job
allow_failure: false
variables:
NAME: almalinux-8
x86_64-alpine-315-container:
extends: .container_job
allow_failure: false
variables:
NAME: alpine-315
x86_64-alpine-edge-container:
extends: .container_job
allow_failure: true
variables:
NAME: alpine-edge
x86_64-centos-stream-8-container:
extends: .container_job
allow_failure: false
variables:
NAME: centos-stream-8
x86_64-centos-stream-9-container:
extends: .container_job
allow_failure: false
variables:
NAME: centos-stream-9
x86_64-debian-10-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-10
x86_64-debian-11-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-11
x86_64-debian-sid-container:
extends: .container_job
allow_failure: true
variables:
NAME: debian-sid
x86_64-fedora-35-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-35
x86_64-fedora-36-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-36
x86_64-fedora-rawhide-container:
extends: .container_job
allow_failure: true
variables:
NAME: fedora-rawhide
x86_64-opensuse-leap-153-container:
extends: .container_job
allow_failure: false
variables:
NAME: opensuse-leap-153
x86_64-opensuse-tumbleweed-container:
extends: .container_job
allow_failure: true
variables:
NAME: opensuse-tumbleweed
x86_64-ubuntu-2004-container:
extends: .container_job
allow_failure: false
variables:
NAME: ubuntu-2004
x86_64-ubuntu-2204-container:
extends: .container_job
allow_failure: false
variables:
NAME: ubuntu-2204
# Cross container jobs
aarch64-debian-10-container:
extends: .container_job
allow_failure: true
variables:
JOB_OPTIONAL: 1
NAME: debian-10-cross-aarch64
armv6l-debian-10-container:
extends: .container_job
allow_failure: true
variables:
JOB_OPTIONAL: 1
NAME: debian-10-cross-armv6l
armv7l-debian-10-container:
extends: .container_job
allow_failure: false
variables:
NAME: debian-10-cross-armv7l
i686-debian-10-container:
extends: .container_job
allow_failure: true
variables:
JOB_OPTIONAL: 1
NAME: debian-10-cross-i686
mips-debian-10-container:
extends: .container_job
allow_failure: true
variables:
JOB_OPTIONAL: 1
NAME: debian-10-cross-mips
mips64el-debian-10-container:
extends: .container_job
allow_failure: true
variables:
JOB_OPTIONAL: 1
NAME: debian-10-cross-mips64el
mipsel-debian-10-container:
extends: .container_job
allow_failure: true
variables:
JOB_OPTIONAL: 1
NAME: debian-10-cross-mipsel
ppc64le-debian-10-container:
extends: .container_job
allow_failure: true
variables:
JOB_OPTIONAL: 1
NAME: debian-10-cross-ppc64le
s390x-debian-10-container:
extends: .container_job
allow_failure: true
variables:
JOB_OPTIONAL: 1
NAME: debian-10-cross-s390x
aarch64-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-aarch64
armv6l-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-armv6l
armv7l-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-armv7l
i686-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-i686
mips64el-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-mips64el
mipsel-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-mipsel
ppc64le-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-ppc64le
s390x-debian-11-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-11-cross-s390x
aarch64-debian-sid-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-sid-cross-aarch64
armv6l-debian-sid-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-sid-cross-armv6l
armv7l-debian-sid-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-sid-cross-armv7l
i686-debian-sid-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-sid-cross-i686
mips64el-debian-sid-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-sid-cross-mips64el
mipsel-debian-sid-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-sid-cross-mipsel
ppc64le-debian-sid-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-sid-cross-ppc64le
s390x-debian-sid-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: debian-sid-cross-s390x
mingw32-fedora-36-container:
extends: .container_job
allow_failure: false
variables:
JOB_OPTIONAL: 1
NAME: fedora-36-cross-mingw32
mingw64-fedora-36-container:
extends: .container_job
allow_failure: false
variables:
NAME: fedora-36-cross-mingw64
mingw32-fedora-rawhide-container:
extends: .container_job
allow_failure: true
variables:
NAME: fedora-rawhide-cross-mingw32
mingw64-fedora-rawhide-container:
extends: .container_job
allow_failure: true
variables:
JOB_OPTIONAL: 1
NAME: fedora-rawhide-cross-mingw64

View File

@@ -0,0 +1,18 @@
# THIS FILE WAS AUTO-GENERATED
#
# $ lcitool manifest ci/manifest.yml
#
# https://gitlab.com/libvirt/libvirt-ci
check-dco:
stage: sanity_checks
needs: []
image: registry.gitlab.com/libvirt/libvirt-ci/check-dco:master
script:
- /check-dco libvirt
except:
variables:
- $CI_PROJECT_NAMESPACE == 'libvirt'
variables:
GIT_DEPTH: 1000

106
ci/integration-template.yml Normal file
View File

@@ -0,0 +1,106 @@
.qemu-build-template: &qemu-build-template
- git clone --depth 1 https://gitlab.com/qemu-project/qemu.git
- cd qemu
#
# inspired by upstream QEMU's buildtest-template.yml
- export JOBS="$(expr $(nproc) + 1)"
- mkdir build
- cd build
- ../configure --prefix=/usr
--enable-werror
--disable-tcg
--disable-docs
--target-list=x86_64-softmmu || (cat config.log meson-logs/meson-log.txt && exit 1)
- make -j"$JOBS"
- if test -n "$MAKE_CHECK_ARGS";
then
make -j"$JOBS" check-build;
fi
# we need the following since the fix for CVE-2022-24765 now causes a fatal
# error if a user issues a git command from within a directory owned by some
# other user
- sudo git config --global --add safe.directory "$SCRATCH_DIR/qemu"
- sudo make install
.install-deps: &install-deps
- sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/*
- sudo pip3 install --prefix=/usr avocado-framework
.enable-core-dumps: &enable-core-dumps
- sudo sh -c "echo DefaultLimitCORE=infinity >> /etc/systemd/system.conf" # Explicitly allow storing cores globally
- sudo systemctl daemon-reexec # need to reexec systemd after changing config
.enable-libvirt-debugging: &enable-libvirt-debugging
- source /etc/os-release # in order to query the vendor-provided variables
- if test "$ID" = "centos" && test "$VERSION_ID" -lt 9 ||
test "$ID" = "fedora" && test "$VERSION_ID" -lt 35;
then
DAEMONS="libvirtd virtlogd virtlockd";
else
DAEMONS="virtproxyd virtqemud virtinterfaced virtsecretd virtstoraged virtnwfilterd virtnodedevd virtlogd virtlockd";
fi
- for daemon in $DAEMONS;
do
LOG_OUTPUTS="1:file:/var/log/libvirt/${daemon}.log";
LOG_FILTERS="3:remote 4:event 3:util.json 3:util.object 3:util.dbus 3:util.netlink 3:node_device 3:rpc 3:access 1:*";
sudo augtool set /files/etc/libvirt/${daemon}.conf/log_filters "$LOG_FILTERS" &>/dev/null;
sudo augtool set /files/etc/libvirt/${daemon}.conf/log_outputs "$LOG_OUTPUTS" &>/dev/null;
sudo systemctl --quiet stop ${daemon}.service;
sudo systemctl restart ${daemon}.socket;
done
.collect-logs: &collect-logs
- mkdir logs
- test -e "$SCRATCH_DIR"/avocado && sudo mv "$SCRATCH_DIR"/avocado/latest/test-results logs/avocado;
- sudo coredumpctl info --no-pager > logs/coredumpctl.txt
- sudo mv /var/log/libvirt logs/libvirt
- sudo chown -R $(whoami):$(whoami) logs
# rename all Avocado stderr/stdout logs to *.log so that GitLab's web UI doesn't mangle the MIME type
- find logs/avocado/ -type f ! -name "*.log" -exec
sh -c 'DIR=$(dirname {}); NAME=$(basename {}); mv $DIR/$NAME{,.log}' \;
.integration_tests:
stage: integration_tests
before_script:
- mkdir "$SCRATCH_DIR"
- *install-deps
- *enable-core-dumps
- *enable-libvirt-debugging
- sudo virsh net-start default &>/dev/null || true;
script:
- cd "$SCRATCH_DIR"
- git clone --depth 1 https://gitlab.com/libvirt/libvirt-tck.git
- cd libvirt-tck
- sudo avocado --config avocado.config run --job-results-dir "$SCRATCH_DIR"/avocado
after_script:
- test "$CI_JOB_STATUS" = "success" && exit 0;
- *collect-logs
variables:
SCRATCH_DIR: "/tmp/scratch"
artifacts:
name: logs
paths:
- logs
when: on_failure
rules:
- if: '$LIBVIRT_CI_INTEGRATION'
when: on_success
- when: never
# YAML anchors don't work with Shell conditions so we can't use a variable
# to conditionally build+install QEMU from source.
# Instead, create a new test job template for this scenario.
.integration_tests_upstream_qemu:
extends: .integration_tests
before_script:
- !reference [.integration_tests, before_script]
- cd "$SCRATCH_DIR"
- *qemu-build-template
- sudo restorecon -R /usr

View File

@@ -1,55 +1,5 @@
.integration_tests:
stage: integration_tests
before_script:
- mkdir "$SCRATCH_DIR"
- sudo sh -c "echo DefaultLimitCORE=infinity >> /etc/systemd/system.conf" # Explicitly allow storing cores globally
- sudo systemctl daemon-reexec # need to reexec systemd after changing config
- sudo dnf install -y libvirt-rpms/* libvirt-perl-rpms/*
- sudo pip3 install --prefix=/usr avocado-framework
- source /etc/os-release # in order to query the vendor-provided variables
- if test "$ID" = "centos" && test "$VERSION_ID" -lt 9 ||
test "$ID" = "fedora" && test "$VERSION_ID" -lt 35;
then
DAEMONS="libvirtd virtlogd virtlockd";
else
DAEMONS="virtproxyd virtqemud virtinterfaced virtsecretd virtstoraged virtnwfilterd virtnodedevd virtlogd virtlockd";
fi
- for daemon in $DAEMONS;
do
LOG_OUTPUTS="1:file:/var/log/libvirt/${daemon}.log";
LOG_FILTERS="3:remote 4:event 3:util.json 3:util.object 3:util.dbus 3:util.netlink 3:node_device 3:rpc 3:access 1:*";
sudo augtool set /files/etc/libvirt/${daemon}.conf/log_filters "$LOG_FILTERS" &>/dev/null;
sudo augtool set /files/etc/libvirt/${daemon}.conf/log_outputs "$LOG_OUTPUTS" &>/dev/null;
sudo systemctl --quiet stop ${daemon}.service;
sudo systemctl restart ${daemon}.socket;
done
- sudo virsh net-start default &>/dev/null || true;
script:
- mkdir logs
- cd "$SCRATCH_DIR"
- git clone --depth 1 https://gitlab.com/libvirt/libvirt-tck.git
- cd libvirt-tck
- sudo avocado --config avocado.config run --job-results-dir "$SCRATCH_DIR"/avocado
after_script:
- test "$CI_JOB_STATUS" = "success" && exit 0;
- test -e "$SCRATCH_DIR"/avocado && sudo mv "$SCRATCH_DIR"/avocado/latest/test-results logs/avocado;
- sudo coredumpctl info --no-pager > logs/coredumpctl.txt
- sudo mv /var/log/libvirt logs/libvirt
- sudo chown -R $(whoami):$(whoami) logs
# rename all Avocado stderr/stdout logs to *.log so that GitLab's web UI doesn't mangle the MIME type
- find logs/avocado/ -type f ! -name "*.log" -exec
sh -c 'DIR=$(dirname {}); NAME=$(basename {}); mv $DIR/$NAME{,.log}' \;
variables:
SCRATCH_DIR: "/tmp/scratch"
artifacts:
name: logs
paths:
- logs
when: on_failure
rules:
- if: '$LIBVIRT_CI_INTEGRATION'
when: on_success
- when: never
include:
- 'ci/integration-template.yml'
centos-stream-8-tests:
extends: .integration_tests
@@ -83,22 +33,6 @@ centos-stream-9-tests:
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
fedora-34-tests:
extends: .integration_tests
needs:
- x86_64-fedora-34
- project: libvirt/libvirt-perl
job: x86_64-fedora-34
ref: master
artifacts: true
variables:
# needed by libvirt-gitlab-executor
DISTRO: fedora-34
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
fedora-35-tests:
extends: .integration_tests
needs:
@@ -114,3 +48,35 @@ fedora-35-tests:
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
fedora-36-tests:
extends: .integration_tests
needs:
- x86_64-fedora-36
- project: libvirt/libvirt-perl
job: x86_64-fedora-36
ref: master
artifacts: true
variables:
# needed by libvirt-gitlab-executor
DISTRO: fedora-36
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
fedora-36-upstream-qemu-tests:
extends: .integration_tests_upstream_qemu
needs:
- x86_64-fedora-36
- project: libvirt/libvirt-perl
job: x86_64-fedora-36
ref: master
artifacts: true
variables:
# needed by libvirt-gitlab-executor
DISTRO: fedora-36
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: redhat-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG

View File

@@ -9,6 +9,7 @@ targets:
almalinux-8:
jobs:
- arch: x86_64
builds: false
variables:
RPM: skip
@@ -18,8 +19,6 @@ targets:
RPM: skip
CC: clang
alpine-314: x86_64
alpine-315: x86_64
alpine-edge:
@@ -52,22 +51,26 @@ targets:
builds: false
- arch: armv6l
- arch: armv7l
allow-failure: true
builds: false
- arch: armv7l
- arch: i686
allow-failure: true
builds: false
- arch: mips
allow-failure: true
builds: false
- arch: mips64el
allow-failure: true
builds: false
- arch: mipsel
allow-failure: true
builds: false
- arch: ppc64le
allow-failure: true
@@ -80,34 +83,41 @@ targets:
debian-11:
jobs:
- arch: x86_64
builds: false
- arch: x86_64
suffix: -clang
- arch: aarch64
allow-failure: true
containers: false
builds: false
- arch: armv6l
allow-failure: true
containers: false
builds: false
- arch: armv7l
containers: false
builds: false
- arch: i686
allow-failure: true
containers: false
builds: false
- arch: mips64el
containers: false
builds: false
- arch: mipsel
allow-failure: true
containers: false
builds: false
- arch: ppc64le
containers: false
builds: false
- arch: s390x
allow-failure: true
containers: false
builds: false
debian-sid:
@@ -116,41 +126,36 @@ targets:
allow-failure: true
- arch: aarch64
allow-failure: true
containers: false
builds: false
- arch: armv6l
allow-failure: true
containers: false
builds: false
- arch: armv7l
allow-failure: true
containers: false
builds: false
- arch: i686
allow-failure: true
containers: false
builds: false
- arch: mips64el
allow-failure: true
containers: false
builds: false
- arch: mipsel
allow-failure: true
containers: false
builds: false
- arch: ppc64le
allow-failure: true
containers: false
builds: false
- arch: s390x
allow-failure: true
fedora-34:
jobs:
- arch: x86_64
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
containers: false
builds: false
fedora-35:
jobs:
@@ -160,8 +165,15 @@ targets:
paths:
- libvirt-rpms
fedora-36:
jobs:
- arch: x86_64
artifacts:
expire_in: 1 day
paths:
- libvirt-rpms
- arch: mingw32
allow-failure: true
builds: false
- arch: mingw64
@@ -217,6 +229,11 @@ targets:
MESON_ARGS: -Db_lundef=false -Db_sanitize=address,undefined
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
ubuntu-2204:
jobs:
- arch: x86_64
builds: false
- arch: x86_64
suffix: -clang
variables:

View File

@@ -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

View File

@@ -143,30 +143,22 @@ Desktop applications
or text console associated with a virtual machine or container.
`qt-remote-viewer <https://f1ash.github.io/qt-virt-manager/#virtual-machines-viewer>`__
The Qt VNC/SPICE viewer for access to remote desktops or VMs.
`GNOME Boxes <https://gnomeboxes.org/>`__
A GNOME application to access virtual machines.
Infrastructure as a Service (IaaS)
----------------------------------
`Cracow Cloud One <http://cc1.ifj.edu.pl>`__
The CC1 system provides a complete solution for Private Cloud
Computing. An intuitive web access interface with an administration
module and simple installation procedure make it easy to benefit from
private Cloud Computing technology.
`Eucalyptus <https://github.com/eucalyptus/eucalyptus>`__
Eucalyptus is an on-premise Infrastructure as a Service cloud
software platform that is open source and AWS-compatible. Eucalyptus
uses libvirt virtualization API to directly interact with Xen and KVM
hypervisors.
`Nimbus <http://www.nimbusproject.org>`__
`Nimbus <https://www.nimbusproject.org/>`__
Nimbus is an open-source toolkit focused on providing
Infrastructure-as-a-Service (IaaS) capabilities to the scientific
community. It uses libvirt for communication with all KVM and Xen
virtual machines.
`Snooze <http://snooze.inria.fr>`__
Snooze is an open-source scalable, autonomic, and energy-efficient
virtual machine (VM) management framework for private clouds. It
integrates libvirt for VM monitoring, live migration, and life-cycle
management.
`OpenStack <https://www.openstack.org>`__
OpenStack is a "cloud operating system" usable for both public and
private clouds. Its various parts take care of compute, storage and
@@ -232,14 +224,14 @@ Monitoring
for each guest without installing collectd on the guest systems. For
a full description, please refer to the libvirt section in the
collectd.conf(5) manual page.
`Host sFlow <https://www.sflow.net/>`__
`Host sFlow <https://sflow.net/>`__
Host sFlow is a lightweight agent running on KVM hypervisors that
links to libvirt library and exports standardized cpu, memory,
network and disk metrics for all virtual machines.
`Munin <https://honk.sigxcpu.org/projects/libvirt/#munin>`__
The plugins provided by Guido Günther allow to monitor various things
like network and block I/O with
`Munin <http://munin.projects.linpro.no/>`__.
`Munin <https://munin-monitoring.org/>`__.
`Nagios-virt <https://people.redhat.com/rjones/nagios-virt/>`__
Nagios-virt is a configuration tool to add monitoring of your
virtualised domains to `Nagios <https://www.nagios.org/>`__. You can
@@ -256,12 +248,6 @@ Monitoring
Provisioning
------------
`Tivoli Provisioning Manager <https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli+Provisioning+Manager>`__
Part of the IBM Tivoli family, Tivoli Provisioning Manager (TPM) is
an IT lifecycle automation product. It `uses
libvirt <http://publib.boulder.ibm.com/infocenter/tivihelp/v38r1/index.jsp?topic=/com.ibm.tivoli.tpm.apk.doc/libvirt_package.html>`__
for communication with virtualization hosts and guest domains.
`Foreman <https://theforeman.org>`__
Foreman is an open source web based application aimed to be a Single
Address For All Machines Life Cycle Management. Foreman:
@@ -331,6 +317,10 @@ Web applications
Secrets
- Create and launch VMs
- Configure VMs with easy panels or go pro and edit the VM's XML
`Cockpit <https://cockpit-project.org/>`__
Cockpit is a web-based graphical interface for servers. With
`cockpit-machines <https://github.com/cockpit-project/cockpit-machines>`__
it can create and manage virtual machines via libvirt.
Other
-----

View File

@@ -57,6 +57,6 @@ For information on using libvirt on **Windows** `please see the Windows
support page <windows.html>`__.
Support, requests or help for libvirt bindings are welcome on the
`mailing list <https://www.redhat.com/mailman/listinfo/libvir-list/>`__,
`mailing list <https://listman.redhat.com/mailman/listinfo/libvir-list/>`__,
as usual try to provide enough background information and make sure you
use recent version, see the `help page <bugs.html>`__.

216
docs/ci-dashboard.rst Normal file
View File

@@ -0,0 +1,216 @@
===================
GitLab CI Dashboard
===================
The dashboard below shows the current status of the GitLab CI jobs for each
repository:
Core project
------------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt
- .. image:: https://gitlab.com/libvirt/libvirt/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt/pipelines
:alt: libvirt pipeline status
Language bindings
-----------------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-csharp
- .. image:: https://gitlab.com/libvirt/libvirt-csharp/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-csharp/pipelines
:alt: libvirt-csharp pipeline status
* - libvirt-go-module
- .. image:: https://gitlab.com/libvirt/libvirt-go-module/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-go-module/pipelines
:alt: libvirt-go-module pipeline status
* - libvirt-java
- .. image:: https://gitlab.com/libvirt/libvirt-java/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-java/pipelines
:alt: libvirt-java pipeline status
* - libvirt-ocaml
- .. image:: https://gitlab.com/libvirt/libvirt-ocaml/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-ocaml/pipelines
:alt: libvirt-ocaml pipeline status
* - libvirt-perl
- .. image:: https://gitlab.com/libvirt/libvirt-perl/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-perl/pipelines
:alt: libvirt-perl pipeline status
* - libvirt-php
- .. image:: https://gitlab.com/libvirt/libvirt-php/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-php/pipelines
:alt: libvirt-php pipeline status
* - libvirt-python
- .. image:: https://gitlab.com/libvirt/libvirt-python/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-python/pipelines
:alt: libvirt-python pipeline status
* - libvirt-ruby
- .. image:: https://gitlab.com/libvirt/libvirt-ruby/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-ruby/pipelines
:alt: libvirt-ruby pipeline status
* - libvirt-rust
- .. image:: https://gitlab.com/libvirt/libvirt-rust/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-rust/pipelines
:alt: libvirt-rust pipeline status
Object mappings
---------------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-cim
- .. image:: https://gitlab.com/libvirt/libvirt-cim/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-cim/pipelines
:alt: libvirt-cim pipeline status
* - libvirt-dbus
- .. image:: https://gitlab.com/libvirt/libvirt-dbus/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-dbus/pipelines
:alt: libvirt-dbus pipeline status
* - libvirt-glib
- .. image:: https://gitlab.com/libvirt/libvirt-glib/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-glib/pipelines
:alt: libvirt-glib pipeline status
* - libvirt-go-xml-module
- .. image:: https://gitlab.com/libvirt/libvirt-go-xml-module/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-go-xml-module/pipelines
:alt: libvirt-go-xml-module pipeline status
* - libvirt-snmp
- .. image:: https://gitlab.com/libvirt/libvirt-snmp/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-snmp/pipelines
:alt: libvirt-snmp pipeline status
Testing
-------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-ci
- .. image:: https://gitlab.com/libvirt/libvirt-ci/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-ci/pipelines
:alt: libvirt-ci pipeline status
* - libvirt-test-API
- .. image:: https://gitlab.com/libvirt/libvirt-test-API/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-test-API/pipelines
:alt: libvirt-test-API pipeline status
* - libvirt-tck
- .. image:: https://gitlab.com/libvirt/libvirt-tck/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-tck/pipelines
:alt: libvirt-tck pipeline status
Documentation / websites
------------------------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-publican
- .. image:: https://gitlab.com/libvirt/libvirt-publican/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-publican/pipelines
:alt: libvirt-publican pipeline status
* - libvirt-appdev-guide-python
- .. image:: https://gitlab.com/libvirt/libvirt-appdev-guide-python/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-appdev-guide-python/pipelines
:alt: libvirt-appdev-guide-python pipeline status
* - libvirt-wiki
- .. image:: https://gitlab.com/libvirt/libvirt-wiki/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-wiki/pipelines
:alt: libvirt-wiki pipeline status
* - virttools-planet
- .. image:: https://gitlab.com/libvirt/virttools-planet/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/virttools-planet/pipelines
:alt: virttools-planet pipeline status
* - virttools-web
- .. image:: https://gitlab.com/libvirt/virttools-web/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/virttools-web/pipelines
:alt: virttools-web pipeline status
Miscellaneous
-------------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-console-proxy
- .. image:: https://gitlab.com/libvirt/libvirt-console-proxy/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-console-proxy/pipelines
:alt: libvirt-console-proxy pipeline status
* - libvirt-designer
- .. image:: https://gitlab.com/libvirt/libvirt-designer/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-designer/pipelines
:alt: libvirt-designer pipeline status
* - libvirt-devaddr
- .. image:: https://gitlab.com/libvirt/libvirt-devaddr/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-devaddr/pipelines
:alt: libvirt-devaddr pipeline status
* - libvirt-sandbox
- .. image:: https://gitlab.com/libvirt/libvirt-sandbox/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-sandbox/pipelines
:alt: libvirt-sandbox pipeline status
* - libvirt-sandbox-image
- .. image:: https://gitlab.com/libvirt/libvirt-sandbox-image/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-sandbox-image/pipelines
:alt: libvirt-sandbox-image pipeline status
* - libvirt-security-notice
- .. image:: https://gitlab.com/libvirt/libvirt-security-notice/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-security-notice/pipelines
:alt: libvirt-security-notice pipeline status

86
docs/ci-runners.rst Normal file
View File

@@ -0,0 +1,86 @@
GitLab CI Custom (Specific) Runners
===================================
.. contents::
GitLab's CI allows additional machines to be added to the project's or group's
pool of runners (a runner is a machine running the GitLab's
`gitlab-runner <https://gitlab.com/gitlab-org/gitlab-runner/>`__ agent service).
Upon registering the runner the runner will then be ready accepting CI jobs
depending on the pipeline configuration. Unlike the shared runners provided
directly by GitLab's hosted SaaS specific runners are only used within the
project/group which they were registered to, so you don't need to worry about
forks burning CPU cycles on your precious HW resources.
Understandably, we respect your decision to keep your runners only visible to
your fork, but for the sake of the community we'd appreciate if you decided to
register your runner with the upstream libvirt project instead. As we're only
interested in running upstream test workloads (which you can even help
defining) maintenance and security of the HW is your own responsibility and so
we can promise to never ask for physical or remote access to the machine.
Machine Setup Howto
-------------------
The following sections will guide you through the necessary setup of your
specific GitLab runners.
gitlab-runner setup and registration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The gitlab-runner agent needs to be installed on each machine that is supposed
to run jobs. The association between a machine and a GitLab project
happens with a registration token. To find the registration token for
your repository/project, navigate on GitLab's web UI to:
* Settings (the gears-like icon at the bottom of the left hand side
vertical toolbar), then
* CI/CD, then
* Runners, and click on the *Expand* button, then
* Under *Set up a specific Runner manually*, look for the value under
*And this registration token:*
Note that in order to register a runner with the upstream libvirt project
you'll need to work with the project maintainers to successfully register your
machine.
Following the `registration <https://docs.gitlab.com/runner/register/>`__
process, it's necessary to configure the runner tags, and optionally other
configurations on the GitLab UI. Navigate to:
* Settings (the gears like icon), then
* CI/CD, then
* Runners, and click on the *Expand* button, then
* *Runners activated for this project*, then
* Click on the *Edit* icon (next to the *Lock* Icon)
Don't forget to add a tag to your runner as these are used to route specific
jobs to specific runners, e.g. if a job in ``ci/integration.yml`` looked like
this ::
centos-stream-9-tests:
...
variables:
# needed by libvirt-gitlab-executor
DISTRO: centos-stream-9
# can be overridden in forks to set a different runner tag
LIBVIRT_CI_INTEGRATION_RUNNER_TAG: my-vm-host
tags:
- $LIBVIRT_CI_INTEGRATION_RUNNER_TAG
it would mean that the CentOS Stream 9 job would only be scheduled on runners
bearing the 'my-vm-host' tag.
Running integration tests
~~~~~~~~~~~~~~~~~~~~~~~~~
Libvirt's integration tests run in a nested virtualization environment. So, if
you wish to run integration tests on your bare-metal machine, you'll have to
make use of GitLab's
`custom executor <https://docs.gitlab.com/runner/executors/custom.html>`__
feature which allows you to provision any kind of environment for a workload to
run - in libvirt's case - a virtual machine. If you need any help with creating
VM template images ready to run libvirt's integration test suite, have a look
at the `libvirt-gitlab-executor <https://gitlab.com/libvirt/libvirt-custom-executor>`__
project which encapsulates provisioning, execution, and teardown of the
virtualized environments in a single tool.

View File

@@ -5,6 +5,11 @@ Libvirt Continuous Integration
.. contents::
The libvirt project uses GitLab CI for automated testing.
`Here's <ci-dashboard.html>`__ our CI dashboard which shows the current status
of our pipelines.
Builds and unit tests
=====================
Linux builds and cross-compiled Windows builds happen on GitLab CI's shared
runners, while FreeBSD and macOS coverage is achieved by triggering `Cirrus CI
@@ -13,217 +18,41 @@ runners, while FreeBSD and macOS coverage is achieved by triggering `Cirrus CI
Most of the tooling used to build CI pipelines is maintained as part of the
`libvirt-ci <https://gitlab.com/libvirt/libvirt-ci>`_ subproject.
GitLab CI Dashboard
===================
Integration tests
=================
The dashboard below shows the current status of the GitLab CI jobs for each
repository:
Integration tests in our CI pipelines require dedicated HW which is not
available to forks, see `GitLab CI Custom Runners <ci-runners.html>`__.
Therefore, in order to execute the integration tests as part of your libvirt
fork's GitLab CI you'll need to provide your own runner. You'll also need to
set a few CI variables to run the integration tests as part of the CI pipeline,
see below.
Core project
------------
GitLab CI variables
-------------------
.. list-table::
:widths: 80 20
:header-rows: 1
* ``LIBVIRT_CI_INTEGRATION`` - enables integration test runs manually or in forks
* ``LIBVIRT_CI_INTEGRATION_RUNNER_TAG`` - overrides the upstream runner tag on the
* - Project
- Pipeline
Retrieving test logs
--------------------
* - libvirt
- .. image:: https://gitlab.com/libvirt/libvirt/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt/pipelines
:alt: libvirt pipeline status
In case the integration test suite fails in our CI pipelines, a job artifact is
generated containing Avocado logs, libvirt debug logs, and the latest traceback
(if one was produced during a daemon's execution).
Adding new OS platforms OR build pre-requisites
===============================================
Since all of the Dockerfiles libvirt uses for CI have been generated by ``lcitool``
provided by the `libvirt-ci <https://gitlab.com/libvirt/libvirt-ci.git>`__ project,
most relevant changes will need to be introduced to ``lcitool`` first. Please
follow the instructions outlined
`here <https://gitlab.com/libvirt/libvirt-ci/-/blob/master/docs/platforms_and_mappings.rst>`__
Language bindings
-----------------
Running CI workloads locally
============================
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-csharp
- .. image:: https://gitlab.com/libvirt/libvirt-csharp/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-csharp/pipelines
:alt: libvirt-csharp pipeline status
* - libvirt-go-module
- .. image:: https://gitlab.com/libvirt/libvirt-go-module/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-go-module/pipelines
:alt: libvirt-go-module pipeline status
* - libvirt-java
- .. image:: https://gitlab.com/libvirt/libvirt-java/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-java/pipelines
:alt: libvirt-java pipeline status
* - libvirt-ocaml
- .. image:: https://gitlab.com/libvirt/libvirt-ocaml/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-ocaml/pipelines
:alt: libvirt-ocaml pipeline status
* - libvirt-perl
- .. image:: https://gitlab.com/libvirt/libvirt-perl/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-perl/pipelines
:alt: libvirt-perl pipeline status
* - libvirt-php
- .. image:: https://gitlab.com/libvirt/libvirt-php/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-php/pipelines
:alt: libvirt-php pipeline status
* - libvirt-python
- .. image:: https://gitlab.com/libvirt/libvirt-python/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-python/pipelines
:alt: libvirt-python pipeline status
* - libvirt-ruby
- .. image:: https://gitlab.com/libvirt/libvirt-ruby/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-ruby/pipelines
:alt: libvirt-ruby pipeline status
* - libvirt-rust
- .. image:: https://gitlab.com/libvirt/libvirt-rust/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-rust/pipelines
:alt: libvirt-rust pipeline status
Object mappings
---------------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-cim
- .. image:: https://gitlab.com/libvirt/libvirt-cim/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-cim/pipelines
:alt: libvirt-cim pipeline status
* - libvirt-dbus
- .. image:: https://gitlab.com/libvirt/libvirt-dbus/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-dbus/pipelines
:alt: libvirt-dbus pipeline status
* - libvirt-glib
- .. image:: https://gitlab.com/libvirt/libvirt-glib/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-glib/pipelines
:alt: libvirt-glib pipeline status
* - libvirt-go-xml-module
- .. image:: https://gitlab.com/libvirt/libvirt-go-xml-module/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-go-xml-module/pipelines
:alt: libvirt-go-xml-module pipeline status
* - libvirt-snmp
- .. image:: https://gitlab.com/libvirt/libvirt-snmp/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-snmp/pipelines
:alt: libvirt-snmp pipeline status
Testing
-------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-ci
- .. image:: https://gitlab.com/libvirt/libvirt-ci/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-ci/pipelines
:alt: libvirt-ci pipeline status
* - libvirt-test-API
- .. image:: https://gitlab.com/libvirt/libvirt-test-API/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-test-API/pipelines
:alt: libvirt-test-API pipeline status
* - libvirt-tck
- .. image:: https://gitlab.com/libvirt/libvirt-tck/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-tck/pipelines
:alt: libvirt-tck pipeline status
Documentation / websites
------------------------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-publican
- .. image:: https://gitlab.com/libvirt/libvirt-publican/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-publican/pipelines
:alt: libvirt-publican pipeline status
* - libvirt-appdev-guide-python
- .. image:: https://gitlab.com/libvirt/libvirt-appdev-guide-python/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-appdev-guide-python/pipelines
:alt: libvirt-appdev-guide-python pipeline status
* - libvirt-wiki
- .. image:: https://gitlab.com/libvirt/libvirt-wiki/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-wiki/pipelines
:alt: libvirt-wiki pipeline status
* - virttools-planet
- .. image:: https://gitlab.com/libvirt/virttools-planet/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/virttools-planet/pipelines
:alt: virttools-planet pipeline status
* - virttools-web
- .. image:: https://gitlab.com/libvirt/virttools-web/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/virttools-web/pipelines
:alt: virttools-web pipeline status
Miscellaneous
-------------
.. list-table::
:widths: 80 20
:header-rows: 1
* - Project
- Pipeline
* - libvirt-console-proxy
- .. image:: https://gitlab.com/libvirt/libvirt-console-proxy/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-console-proxy/pipelines
:alt: libvirt-console-proxy pipeline status
* - libvirt-designer
- .. image:: https://gitlab.com/libvirt/libvirt-designer/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-designer/pipelines
:alt: libvirt-designer pipeline status
* - libvirt-devaddr
- .. image:: https://gitlab.com/libvirt/libvirt-devaddr/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-devaddr/pipelines
:alt: libvirt-devaddr pipeline status
* - libvirt-sandbox
- .. image:: https://gitlab.com/libvirt/libvirt-sandbox/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-sandbox/pipelines
:alt: libvirt-sandbox pipeline status
* - libvirt-sandbox-image
- .. image:: https://gitlab.com/libvirt/libvirt-sandbox-image/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-sandbox-image/pipelines
:alt: libvirt-sandbox-image pipeline status
* - libvirt-security-notice
- .. image:: https://gitlab.com/libvirt/libvirt-security-notice/badges/master/pipeline.svg
:target: https://gitlab.com/libvirt/libvirt-security-notice/pipelines
:alt: libvirt-security-notice pipeline status
If you're interested in running the CI test workloads locally, please read
our `testing <testing.html>`__ guide.

View File

@@ -470,7 +470,9 @@ Pointer comparisons may be shortened. All long forms are okay.
if (!foo) # or: if (foo == NULL)
New code should avoid the ternary operator as much as possible.
Specifically it must never span more than one line or nest:
Its usage in basic cases is warranted (e.g. when deciding between
two constant strings), however, it must never span more than one
line or nest.
::
@@ -481,6 +483,9 @@ Specifically it must never span more than one line or nest:
char *foo = bar ? bar->baz ? bar->baz->foo : "nobaz" : "nobar";
GOOD:
virBufferAsprintf(buf, "<element>%s</element>\n", boolVar ? "yes" : "no");
Preprocessor
------------
@@ -628,7 +633,7 @@ analysis tools understand the code better:
``G_GNUC_FALLTHROUGH``
allow code reuse by multiple switch cases
``G_GNUC_NO_INLINE``
``G_NO_INLINE``
the function is mocked in the test suite
``G_GNUC_NORETURN``

View File

@@ -21,9 +21,9 @@ There are three mailing-lists:
**libvir-list@redhat.com** (for development)
Archives
https://www.redhat.com/archives/libvir-list
https://listman.redhat.com/archives/libvir-list
List info
https://www.redhat.com/mailman/listinfo/libvir-list
https://listman.redhat.com/mailman/listinfo/libvir-list
This is a high volume mailing list. It is a place for discussions about the
**development** of libvirt.
@@ -37,9 +37,9 @@ There are three mailing-lists:
**libvirt-users@redhat.com** (for users)
Archives
https://www.redhat.com/archives/libvirt-users
https://listman.redhat.com/archives/libvirt-users
List info
https://www.redhat.com/mailman/listinfo/libvirt-users
https://listman.redhat.com/mailman/listinfo/libvirt-users
This is a moderate volume mailing list. It is a place for discussions
involving libvirt **users**.
@@ -53,9 +53,9 @@ There are three mailing-lists:
**libvirt-announce@redhat.com** (for release notices)
Archives
https://www.redhat.com/archives/libvirt-announce
https://listman.redhat.com/archives/libvirt-announce
List info
https://www.redhat.com/mailman/listinfo/libvirt-announce
https://listman.redhat.com/mailman/listinfo/libvirt-announce
This is a low volume mailing list, with restricted posting, for announcements
of new libvirt releases.
@@ -80,7 +80,7 @@ Some of the libvirt developers may be found on IRC on the `OFTC
IRC <https://oftc.net>`__ network. Use the settings:
- server: irc.oftc.net
- port: 6667 (the usual IRC port)
- port: 6697 (the usual IRC TLS port)
- channel: #virt
NB There is no guarantee that someone will be watching or able to reply

View File

@@ -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>`__
@@ -136,8 +136,12 @@ Project development
`Project strategy <strategy.html>`__
Sets a vision for future direction & technical choices
`CI Testing <ci.html>`__
Details of the Continuous Integration testing strategy
`CI <ci.html>`__
Details on our Continuous Integration
`Upstream issue handling <issue-handling.html>`__
Outlines the process of handling issues as well as describes the supported
issue types along with their life cycle.
`Bug reports <bugs.html>`__
How and where to report bugs and request features
@@ -154,10 +158,8 @@ Project development
`API extensions <api_extension.html>`__
Adding new public libvirt APIs
`Functional testing <testsuites.html>`__
Testing libvirt with
`TCK test suite <testtck.html>`__ and
`Libvirt-test-API <testapi.html>`__
`Testing <testing.html>`__
Details various types of testing available for libvirt
`New repo setup <newreposetup.html>`__
Procedure for configuring new git repositories for libvirt

View File

@@ -19,7 +19,7 @@ The hypervisor drivers currently supported by libvirt are:
- `LXC <drvlxc.html>`__ - Linux Containers
- `OpenVZ <drvopenvz.html>`__
- `QEMU <drvqemu.html>`__
- `QEMU/KVM/HVF <drvqemu.html>`__
- `Test <drvtest.html>`__ - Used for testing
- `VirtualBox <drvvbox.html>`__
- `VMware ESX <drvesx.html>`__

View File

@@ -9,7 +9,7 @@ The libvirt Microsoft Hyper-V driver can manage Hyper-V 2012 R2 and newer.
Project Links
-------------
- The `Microsoft Hyper-V <http://www.microsoft.com/hyper-v-server/>`__
- The `Microsoft Hyper-V <https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/hyper-v-on-windows-server>`__
hypervisor
Connections to the Microsoft Hyper-V driver

View File

@@ -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.**
@@ -245,7 +245,7 @@ Systemd Socket Activation Integration
The libvirt LXC driver provides the ability to pass across pre-opened file
descriptors when starting LXC guests. This allows for libvirt LXC to support
systemd's `socket activation
capability <http://0pointer.de/blog/projects/socket-activated-containers.html>`__,
capability <https://0pointer.de/blog/projects/socket-activated-containers.html>`__,
where an incoming client connection in the host OS will trigger the startup of a
container, which runs another copy of systemd which gets passed the server
socket, and then activates the actual service handler in the container.

View File

@@ -20,7 +20,7 @@ Project Links
- The `KVM <https://www.linux-kvm.org/>`__ Linux hypervisor
- The `QEMU <https://wiki.qemu.org/Index.html>`__ emulator
- `Hypervisor.framework`<https://developer.apple.com/documentation/hypervisor>__` reference
- `Hypervisor.framework <https://developer.apple.com/documentation/hypervisor>`__ reference
Deployment pre-requisites
-------------------------
@@ -416,6 +416,89 @@ following command should be run as root, prior to starting libvirtd
libvirt will then place each virtual machine in a cgroup at
``/dev/cgroup/libvirt/qemu/$VMNAME/``
Live migration compatibility
----------------------------
Many factors can affect the ability to live migrate a guest between a pair
of hosts. It is critical that when QEMU is started on the destination host,
the exposed guest machine ABI matches what was exposed by the existing QEMU
process on the source host. To facilitate this, when libvirt receives a
guest configuration document, it will attempt to expand any features that
were not specified, to ensure a stable guest machine ABI. Mostly this involves
adding address information to all devices, and adding controllers to attach
the devices to.
Certain features that affect the guest ABI, however, may only be known at the
time the guest is started and can be influenced by features of the host OS
and its hardware. This means that even if the guest XML configuration is the
same, it may still be impossible to migrate the guest between two hosts.
Migration CPU model compatibility
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The most common problems with migration compatibility surround the use of
the guest CPU ``host-model`` or ``host-passthrough`` modes. Both of these
modes attempt to expose the full host CPU featureset to the guest. The
``host-model`` mode attempts to expose as many features as possible while
retaining the ability to accurately check compatibility between hosts prior
to migration running. The ``host-passthrough`` mode attempts to expose the
host CPU as precisely as possible, but with the cost that it is not possible
for libvirt to check compatibility prior to migration.
If using ``host-model`` the target host hardware and software deployment
must expose a superset of the features of the source host CPU. If using
``host-passthrough`` the target host CPU and software deployment must
always expose a superset of the features, however, it is further strongly
recommended that the source and destination hosts be identical in every
way.
In both cases, there are a number of factors that will influence the CPU
features available to the guest
* **Physical CPU model** - the core constraint on what features are available.
Check ``/proc/cpuinfo`` for CPU model name.
* **Firmware revision (BIOS/UEFI/etc)** - firmware updates may bundle microcode
updates which arbitrarily add or remove CPU features, typically in response
to new hardware vulnerabilities. Check ``dmidecode`` for details on ``x86``
and ``aarch64`` platforms for firmware version, and ``/proc/cpuinfo`` for
associated microcode version (if not updated by the OS).
* **Firmware settings** - certain firmware settings can affect accessibility of
features. For example, turning on/off SMT/HT not only affects the number
of logical CPUs available to the OS, but can indirectly influence other
factors such as the number of performance counters available for use. Check
the firmware specific configuration interface.
* **Host kernel version** - the host kernel software version may have a
need to block certain physical CPU features from use in the guest. It can
also emulate certain features that may not exist in the silicon, for example,
x2apic. Check ``uname -r`` output for kernel version.
* **Host kernel settings** - the kernel command line options can be used to
block certain physical CPU features from use in the guest, for example,
``tsx=off``, ``l1tf=...`` or ``nosmt``. Check ``/proc/cmdline`` and
``/etc/modprobe.d/*.conf``.
* **microcode update version** - while the firmware will load the initial
microcode in to the CPU, the OS may ship packages providing newer microcode
updates since these can be deployed on a more timely manner than firmware
updates. These updates can arbitrarily load add or remove CPU features.
Check ``/proc/cpuinfo`` for microcode version.
* **QEMU version** - even when the kernel supports exposing a CPU feature to
the guest, an update in the QEMU emulator version will be required to unlock
its usage with a guest, except with ``host-passthrough``. Check the output
of ``$QEMU -version``.
* **libvirt version** - even when the kernel and QEMU support exposing a CPU
feature to the guest, an update in the libvirt version will be required to
unlock its usage with a guest, except with ``host-passthrough``. Check
``virsh version``.
* **Nested virtualization** - due to the limitations of nested virtualization,
a L1 nested host may not be able to expose the same featureset as a bare
metal host, even if everything else is the same.
The ``virsh capabilities`` output will provide information on the high level
CPU model, its features, microcode version. Most of the time this will provide
enough information to know whether the CPUs of two hosts will be compatible.
If there are unexpected differences though, checking the above list of
influencing factors can reveal where the difference arises from.
Import and export of libvirt domain XML configs
-----------------------------------------------
@@ -443,10 +526,16 @@ Converting from domain XML to QEMU args
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``virsh domxml-to-native`` provides a way to convert a guest description
using libvirt Domain XML, into a set of QEMU args that can be run manually. Note
that currently the command line formatted by libvirt is no longer suited for
manually running qemu as the configuration expects various resources and open
file descriptors passed to the process which are usually prepared by libvirtd.
using libvirt Domain XML, into a set of QEMU args that would be used by libvirt
to start the qemu process.
Note that currently the command line formatted by libvirt is no longer suited
for manually running qemu as the configuration expects various resources and
open file descriptors passed to the process which are usually prepared by
libvirtd as well as certain features being configured via the monitor.
The qemu arguments as returned by ``virsh domxml-to-native`` thus are not
trivially usable outside of libvirt.
Pass-through of arbitrary qemu commands
---------------------------------------

View File

@@ -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.

View File

@@ -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:

View File

@@ -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``

File diff suppressed because it is too large Load Diff

View File

@@ -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.
@@ -68,14 +68,14 @@ 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
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.
::
@@ -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>`__.
::
@@ -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.
::
@@ -494,6 +494,41 @@ instance:
``driverType``
Options for the ``type`` attribute of the <filesystem><driver> element.
TPM device
^^^^^^^^^^
TPM device capabilities are exposed under the ``tpm`` element. For instance:
::
<domainCapabilities>
...
<devices>
<tpm supported='yes'>
<enum name='model'>
<value>tpm-tis</value>
<value>tpm-crb</value>
</enum>
<enum name='backendModel'>
<value>passthrough</value>
<value>emulator</value>
</enum>
<enum name='backendVersion'>
<value>1.2</value>
<value>2.0</value>
</enum>
</tpm>
...
</devices>
</domainCapabilities>
``model``
Options for the ``model`` attribute of the ``<tpm/>`` element.
``backendModel``
Options for the ``type`` attribute of the ``<tpm><backend/>`` element.
``backendVersion``
Options for the ``version`` attribute of the ``<tpm><backend/>`` element.
Features
~~~~~~~~
@@ -527,7 +562,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
^^^^^^^^^^^^^^^^
@@ -568,7 +603,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 +618,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

View File

@@ -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.
@@ -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,
@@ -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.

View File

@@ -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
~~~~~
@@ -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
^^^^^^^^

View File

@@ -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".

View File

@@ -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:
::
@@ -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:

View File

@@ -38,8 +38,9 @@ full system
Libvirt can manage all three types of snapshots. For now, VM state (memory)
snapshots are created only by the ``virDomainSave()``, ``virDomainSaveFlags``,
and ``virDomainManagedSave()`` functions, and restored via the
``virDomainRestore()``, ``virDomainRestoreFlags()``, ``virDomainCreate()``, and
``virDomainSaveParams`` and ``virDomainManagedSave()`` functions, and restored
via the ``virDomainRestore()``, ``virDomainRestoreFlags()``,
``virDomainRestoreParams``, ``virDomainCreate()``, and
``virDomainCreateWithFlags()`` functions (as well as via domain autostart). With
managed snapshots, libvirt tracks all information internally; with save images,
the user tracks the snapshot file, but libvirt provides functions such as
@@ -114,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
@@ -139,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)`.
@@ -158,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``

View File

@@ -350,7 +350,7 @@ following child elements:
``protocol``
For a ``netfs`` Storage Pool provide a mechanism to define which NFS protocol
version number will be used to contact the server's NFS service. The
attribute ``ver`` accepts an unsigned integer as the version number to use.
attribute ``ver`` accepts the version number to use.
:since:`Since 5.1.0`
``vendor``
Provides optional information about the vendor of the storage device. This
@@ -470,9 +470,9 @@ option in libvirt, and thus should never be used in production.
options for the mount command via the "-o" option for the ``fs`` or ``netfs``
type storage pools. In order to designate that the Storage Pool will be using
the mechanism, the ``pool`` element must be modified to provide the XML
namespace attribute syntax as follows:
namespace attribute syntax as follows::
xmlns:fs='http://libvirt.org/schemas/storagepool/fs/1.0'
xmlns:fs='http://libvirt.org/schemas/storagepool/fs/1.0'
The ``fs:mount_opts`` defines the mount options by specifying multiple
``fs:option`` subelements with the attribute ``name`` specifying the mount

View File

@@ -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:

182
docs/issue-handling.rst Normal file
View File

@@ -0,0 +1,182 @@
=========================
Handling of gitlab issues
=========================
.. contents::
This document describes the life cycle and handling of upstream gitlab issues.
Issue is an aggregate term for bug reports, feature requests, user questions
and discussions.
For members of the project this is a guideline how to handle issues and how to
transition them between states based on the interaction with the reporter.
It is imperative we collaboratively keep the issues organized and labeled,
otherwise we'll end up creating an unnecessary maintenance burden for us.
For others, this article should only server as an outline what to expect when
filing an issue.
Types of issues
---------------
Every issue in our GitLab tracker bears the ``kind::`` namespace prefix. Once
triaged, each issue will have one of the following types assigned to it.
Note that issues can be moved freely between the different issue kinds if
needed.
Bugs - ``kind::bug``
~~~~~~~~~~~~~~~~~~~~
This issue describes a flaw in the functionality. The user is expected to
describe how to reproduce the issue and add `debug logs`_ or a backtrace of all
daemon threads in case any of the components crashed.
Feature requests - ``kind::enhancement``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This issue type describes non-existing functionality the user would like to add
to libvirt. Generally the issue should first focus on what the user wants to
achieve rather than any form of technical detail so that it's obvious what the
end goal is.
Detailed technical aspects can be described later but should not be the main
focus of the initial report. With a clear end-goal it's sometimes possible to
recommend another solution with the same impact.
User support queries - ``kind::support``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This label is used with issues which don't directly correspond to a flaw or
a missing feature in the project like usage-related queries.
Discussions - ``kind::discussion``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Any form of discussion which isn't related to any existing bug or feature
request.
States of issues
----------------
States allow project maintainers filtering out issues which need attention, so
please keep the issue state updated at all times.
Confirmed issues - ``state::confirmed``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In case of ``kind::bug`` issues the **confirmed** state means that there is
a real problem with the functionality and there is (seemingly) enough
information to figure out where the problem is and fix it.
``kind::enhancement`` issues should be marked as **confirmed** as long as the
general idea of the required functionality makes sense and would be in line
of the project strategy.
**Note:** Unless the issue is assigned to a specific person, the **confirmed**
state does not necessarily mean that anybody is actively looking to implement
the functionality or fix the problem. See the `disclaimer`_.
Unconfirmed issues - ``state::unconfirmed``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``kind::bug`` issues are considered **unconfirmed** when there is seemingly
enough information describing the problem, but the triager is not sure whether
the problem would be considered a bug.
In case of ``kind::enhancement`` issues the **unconfirmed** state is similarly
used for feature requests which might not make sense.
In general use of the **unconfirmed** state should be avoided if possible,
although if the initial triager requests all necessary information from the
reporter, but is not sure about the issue itself it's okay to defer it to
somebody else by setting the ``state::unconfirmed`` label and thus deferring it
to somebody with more knowledge about the code.
Issues needing additional information from reporter - ``state::needinfo``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If additional information is requested from the reporter of the issue the
``state:needinfo`` label should be added, so that the issues can be easily
filtered.
If the reporter doesn't respond to the request in a timely manner (~2 weeks)
the issue should be closed prompting the reporter to reopen once they provide
the required information.
Triage process
--------------
The following steps should be applied to any new issue reported.
* Set the labels categorrizing the area of the issue, e.g. ``driver-qemu``,
``virsh``, ``xml`` etc. If an appropriate label is not available, add it.
* Check whether the reporter described the issue sufficiently.
If something is missing or unclear, ask for additional data and set
``state::needinfo``.
* Once all requested information is provided set the appropriate state:
- ``state::confirmed`` if you are certain where the bug is or that the
feature request makes sense
- ``state::unconfirmed`` to defer the investigation to somebody else
Issues needing attention
------------------------
The following gitlab search queries provide lists of issues which require
attention from the upstream community.
`Untriaged issues`_
Issues which haven't undergone the `Triage process`_ yet.
`Unconfirmed bugs`_
Bugs which should have all the information needed but the initial triager
couldn't determine nor confirm the problem.
`Unconfirmed features`_
Feature requests having the proper description of the request but it's not
yet clear whether the feature makes sense.
Assigning issues
----------------
When you plan to address an issue please assign it to yourself to indicate that
there's somebody working on it and thus prevent duplicated work.
Contribution possibility for non-members of the project
-------------------------------------------------------
Anyone is very welcome to assist in handling and triage of issues.
Even though non-members don't have permissions to set the labels mentioned
above, you can always post a comment to the issue, describing your findings or
prompt the reporter to provide more information (obviously adhering to the
`code of conduct`_) or even analyze where the problem lies followed by
submitting a patch to the mailing list.
Someone from the project members will then take care of applying the correct
label to the issue.
Disclaimer
----------
Please note that libvirt, like most open source projects, relies on
contributors who have motivation, skills and available time to work on
implementing particular features or fixing bugs as well as assisting the
upstream community.
Reporting an issue can be helpful for determining demand and interest or
reporting a problem, but doing so is not a guarantee that a contributor will
volunteer to implement or fix it.
We even welcome and encourage draft patches implementing a feature to be sent
to the mailing list where they can be discussed and further improved by the
community.
.. _Untriaged issues: https://gitlab.com/libvirt/libvirt/-/issues/?sort=created_date&state=opened&not%5Blabel_name%5D%5B%5D=state%3A%3Aunconfirmed&not%5Blabel_name%5D%5B%5D=state%3A%3Aneedinfo&not%5Blabel_name%5D%5B%5D=state%3A%3Aconfirmed&first_page_size=100
.. _Unconfirmed bugs: https://gitlab.com/libvirt/libvirt/-/issues/?sort=created_date&state=opened&label_name%5B%5D=kind%3A%3Abug&label_name%5B%5D=state%3A%3Aunconfirmed&first_page_size=100
.. _Unconfirmed features: https://gitlab.com/libvirt/libvirt/-/issues/?sort=created_date&state=opened&label_name%5B%5D=kind%3A%3Aenhancement&label_name%5B%5D=state%3A%3Aunconfirmed&first_page_size=100
.. _debug logs: https://libvirt.org/kbase/debuglogs.html
.. _code of conduct: governance.html#code-of-conduct

View File

@@ -194,6 +194,26 @@ package manager provided by your distribution to install this package.
guideline in the sections above in place of ``virt-admin`` in the examples
below if needed.
Timeout of the configured daemon
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Common deployments of libvirt start the libvirt daemons via socket activation
and with automatic shutdown timeout of 120 seconds when no client or object is
handled by the daemon. When a timeout is reached the daemon stops and all
settings done during runtime via ``virt-admin`` are discarded. The daemon then
is re-started with another command.
To prevent auto-shutdown of the daemon you can use the following command::
virt-admin daemon-timeout 0
The above is introduced in libvirt-8.6.0.
Adding filters and outputs
~~~~~~~~~~~~~~~~~~~~~~~~~~
The following command allows to query the list of currently active log filters:
::

View File

@@ -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

View File

@@ -61,6 +61,9 @@ Usage
`Snapshots <snapshots.html>`__
Details about snapshotting a VM
`Secure Boot <secureboot.html>`__
Enable and disable the Secure Boot feature
Debugging
---------
@@ -101,3 +104,12 @@ Internals
`RPC protocol & APIs <internals/rpc.html>`__
RPC protocol information and API / dispatch guide
`QEMU driver threading <internals/qemu-threads.html>`__
Basics of locking and threaded access to qemu driver primitives.
`QEMU migration internals <internals/qemu-migration.html>`__
Description of migration phases in the ``v2`` and ``v3`` migration protocol.
`QEMU monitor event handling <internals/qemu-event-handlers.html>`__
Brief outline how events emitted by qemu on the monitor are handlded.

View File

@@ -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
-----------

View File

@@ -127,7 +127,7 @@ locks, this will be done from the libvirtd process.
};
mgr = virLockManagerNew(lockPlugin,
VIR_LOCK_MANAGER_TYPE_DOMAIN,
ARRAY_CARDINALITY(params),
G_N_ELEMENTS(params),
params,
0)));
@@ -171,7 +171,7 @@ however, a process may voluntarily give up the lock by running
};
mgr = virLockManagerNew(lockPlugin,
VIR_LOCK_MANAGER_TYPE_DOMAIN,
ARRAY_CARDINALITY(params),
G_N_ELEMENTS(params),
params,
0)));

View File

@@ -5,6 +5,9 @@ docs_kbase_internals_files = [
'locking',
'migration',
'overview',
'qemu-event-handlers',
'qemu-migration',
'qemu-threads',
'rpc',
]

View File

@@ -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:

View File

@@ -1,10 +1,14 @@
===================
QEMU event handlers
===================
This is a short description of how an example qemu event can be used
to trigger handler code that is called from the context of a worker
thread, rather than directly from the event thread (which should
itself never block, and can't do things like send qemu monitor
commands, etc).
In this case (the NIC_RX_FILTER_CHANGED event) the event is handled by
In this case (the ``NIC_RX_FILTER_CHANGED`` event) the event is handled by
calling a qemu monitor command to get the current RX filter state,
then executing ioctls/sending netlink messages on the host in response
to changes in that filter state. This event is *not* propagated to the
@@ -14,39 +18,39 @@ to the end of this document, please do!).
Hopefully this narration will be helpful when adding handlers for
other qemu events in the future.
----------------------------------------------------
QEMU monitor events
-------------------
Any event emitted by qemu is received by
qemu_monitor_json.c:qemuMonitorJSONIOProcessEvent(). It looks up the
event by name in the table eventHandlers (in the same file), which
``qemu_monitor_json.c:qemuMonitorJSONIOProcessEvent()``. It looks up the
event by name in the table ``eventHandlers`` (in the same file), which
should have an entry like this for each event that libvirt
understands:
understands::
{ "NIC_RX_FILTER_CHANGED", qemuMonitorJSONHandleNicRxFilterChanged, },
NB: This table is searched with bsearch, so it *must* be
alphabetically sorted.
NB: This table is searched with bsearch, so it *must* be alphabetically sorted.
qemuMonitorJSONIOProcessEvent calls the function listed in
eventHandlers, e.g.:
``qemuMonitorJSONIOProcessEvent`` calls the function listed in
``eventHandlers``, e.g.::
qemu_monitor_json.c:qemuMonitorJSONHandleNicRxFilterChanged()
which extracts any required data from the JSON ("name" in this case),
and calls:
and calls::
qemu_monitor.c:qemuMonitorEmitNicRxFilterChanged()
which uses QEMU_MONITOR_CALLBACK() to call
mon->cb->domainNicRxFilterChanged(). domainNicRxFilterChanged is one
in a list of function pointers in qemu_process.c:monitorCallbacks. For
our example, it has been set to:
which uses ``QEMU_MONITOR_CALLBACK()`` to call
``mon->cb->domainNicRxFilterChanged()``. ``domainNicRxFilterChanged`` is one
in a list of function pointers in ``qemu_process.c:monitorCallbacks``. For
our example, it has been set to::
qemuProcessHandleNicRxFilterChanged()
This function allocates a qemuProcessEvent object, and queues an event
named QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED (you'll want to add an
enum to qemu_domain.h:qemuProcessEventType for your event) for a
This function allocates a ``qemuProcessEvent`` object, and queues an event
named ``QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED`` (you'll want to add an
enum to ``qemu_domain.h:qemuProcessEventType`` for your event) for a
worker thread to handle.
(Everything up to this point has happened in the context of the thread
@@ -56,17 +60,17 @@ monitor. Everything after this is handled in the context of a worker
thread, so it has more freedom to make qemu monitor calls and blocking
system calls on the host.)
When the worker thread gets the event, it calls
When the worker thread gets the event, it calls::
qemuProcessEventHandler()
which switches on the eventType (in our example,
QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED) and decides to call:
``QEMU_PROCESS_EVENT_NIC_RX_FILTER_CHANGED``) and decides to call::
processNicRxFilterChangedEvent()
and *that* is where the actual work will be done (and any
event-specific memory allocated during qemuProcessHandleXXX() will be
event-specific memory allocated during ``qemuProcessHandleXXX()`` will be
freed). Note that this function must do proper refcounting of the
domain object, and assure that the domain is still active prior to
performing any operations - it is possible that the domain could have

View File

@@ -1,84 +1,89 @@
QEMU Migration Phases
=====================
QEMU Migration Phases
=====================
.. contents::
QEMU supports only migration protocols 2 and 3 (1 was lacking too many
steps). Repeating the protocol sequences from libvirt.c:
Sequence v2:
Migration protocol v2 API Sequence
----------------------------------
Src: DumpXML
**Src**: ``DumpXML``
- Generate XML to pass to dst
Dst: Prepare
**Dst**: ``Prepare``
- Get ready to accept incoming VM
- Generate optional cookie to pass to src
Src: Perform
**Src**: ``Perform``
- Start migration and wait for send completion
- Kill off VM if successful, resume if failed
Dst: Finish
**Dst**: ``Finish``
- Wait for recv completion and check status
- Kill off VM if unsuccessful
Sequence v3:
Migration protocol v3 API Sequence
----------------------------------
Src: Begin
**Src**: ``Begin``
- Generate XML to pass to dst
- Generate optional cookie to pass to dst
Dst: Prepare
**Dst**: ``Prepare``
- Get ready to accept incoming VM
- Generate optional cookie to pass to src
Src: Perform
**Src**: ``Perform``
- Start migration and wait for send completion
- Generate optional cookie to pass to dst
Dst: Finish
**Dst**: ``Finish``
- Wait for recv completion and check status
- Kill off VM if failed, resume if success
- Generate optional cookie to pass to src
Src: Confirm
**Src**: ``Confirm``
- Kill off VM if success, resume if failed
QEMU Migration Locking Rules
============================
QEMU Migration Locking Rules
============================
Migration is a complicated beast which may span across several APIs on both
source and destination side and we need to keep the domain we are migrating in
a consistent state during the whole process.
To avoid anyone from changing the domain in the middle of migration we need to
keep MIGRATION_OUT job active during migration from Begin to Confirm on the
source side and MIGRATION_IN job has to be active from Prepare to Finish on
the destination side.
keep ``MIGRATION_OUT`` job active during migration from ``Begin`` to
``Confirm`` on the source side and ``MIGRATION_IN`` job has to be active from
``Prepare`` to ``Finish`` on the destination side.
For this purpose we introduce several helper methods to deal with locking
primitives (described in THREADS.txt) in the right way:
primitives (described in `qemu-threads <qemu-threads.html>`__) in the right way:
* qemuMigrationJobStart
* ``qemuMigrationJobStart``
* qemuMigrationJobContinue
* ``qemuMigrationJobContinue``
* qemuMigrationJobStartPhase
* ``qemuMigrationJobStartPhase``
* qemuMigrationJobSetPhase
* ``qemuMigrationJobSetPhase``
* qemuMigrationJobFinish
* ``qemuMigrationJobFinish``
The sequence of calling qemuMigrationJob* helper methods is as follows:
The sequence of calling ``qemuMigrationJob*`` helper methods is as follows:
- The first API of a migration protocol (Prepare or Perform/Begin depending on
migration type and version) has to start migration job and keep it active:
- The first API of a migration protocol (``Prepare`` or ``Perform/Begin``
depending on migration type and version) has to start migration job and keep
it active::
qemuMigrationJobStart(driver, vm, VIR_JOB_MIGRATION_{IN,OUT});
qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_*);
...do work...
qemuMigrationJobContinue(vm);
- All consequent phases except for the last one have to keep the job active:
- All consequent phases except for the last one have to keep the job active::
if (!qemuMigrationJobIsActive(vm, VIR_JOB_MIGRATION_{IN,OUT}))
return;
@@ -86,7 +91,7 @@ The sequence of calling qemuMigrationJob* helper methods is as follows:
...do work...
qemuMigrationJobContinue(vm);
- The last migration phase finally finishes the migration job:
- The last migration phase finally finishes the migration job::
if (!qemuMigrationJobIsActive(vm, VIR_JOB_MIGRATION_{IN,OUT}))
return;
@@ -94,7 +99,7 @@ The sequence of calling qemuMigrationJob* helper methods is as follows:
...do work...
qemuMigrationJobFinish(driver, vm);
While migration job is running (i.e., after qemuMigrationJobStart* but before
qemuMigrationJob{Continue,Finish}), migration phase can be advanced using
While migration job is running (i.e., after ``qemuMigrationJobStart*`` but before
``qemuMigrationJob{Continue,Finish}``), migration phase can be advanced using::
qemuMigrationJobSetPhase(driver, vm, QEMU_MIGRATION_PHASE_*);

View File

@@ -1,5 +1,7 @@
QEMU Driver Threading: The Rules
=================================
QEMU Driver Threading: The Rules
================================
.. contents::
This document describes how thread safety is ensured throughout
the QEMU driver. The criteria for this model are:
@@ -8,37 +10,36 @@ the QEMU driver. The criteria for this model are:
- Code which sleeps must be able to time out after suitable period
- Must be safe against dispatch of asynchronous events from monitor
Basic locking primitives
------------------------
There are a number of locks on various objects
* virQEMUDriver *
``virQEMUDriver``
The qemu_conf.h file has inline comments describing the locking
The ``qemu_conf.h`` file has inline comments describing the locking
needs for each field. Any field marked immutable, self-locking
can be accessed without the driver lock. For other fields there
are typically helper APIs in qemu_conf.c that provide serialized
access to the data. No code outside qemu_conf.c should ever
are typically helper APIs in ``qemu_conf.c`` that provide serialized
access to the data. No code outside ``qemu_conf.c`` should ever
acquire this lock
* virDomainObj *
``virDomainObj``
Will be locked and the reference counter will be increased after calling
any of the virDomainObjListFindBy{ID,Name,UUID} methods. The preferred way
any of the ``virDomainObjListFindBy{ID,Name,UUID}`` methods. The preferred way
of decrementing the reference counter and unlocking the domain is using the
virDomainObjEndAPI() function.
``virDomainObjEndAPI()`` function.
Lock must be held when changing/reading any variable in the virDomainObj *
Lock must be held when changing/reading any variable in the ``virDomainObj``
This lock must not be held for anything which sleeps/waits (i.e. monitor
commands).
* qemuMonitorPrivatePtr: Job conditions
``qemuMonitorPrivatePtr`` job conditions
Since virDomainObj *lock must not be held during sleeps, the job
Since ``virDomainObj`` lock must not be held during sleeps, the job
conditions provide additional protection for code making updates.
QEMU driver uses three kinds of job conditions: asynchronous, agent
@@ -61,30 +62,30 @@ There are a number of locks on various objects
Agent job condition is then used when thread wishes to talk to qemu
agent monitor. It is possible to acquire just agent job
(qemuDomainObjBeginAgentJob), or only normal job (qemuDomainObjBeginJob)
(``qemuDomainObjBeginAgentJob``), or only normal job (``qemuDomainObjBeginJob``)
but not both at the same time. Holding an agent job and a normal job would
allow an unresponsive or malicious agent to block normal libvirt API and
potentially result in a denial of service. Which type of job to grab
depends whether caller wishes to communicate only with agent socket, or
only with qemu monitor socket.
Immediately after acquiring the virDomainObj *lock, any method
Immediately after acquiring the ``virDomainObj`` lock, any method
which intends to update state must acquire asynchronous, normal or
agent job . The virDomainObj *lock is released while blocking on
agent job . The ``virDomainObj`` lock is released while blocking on
these condition variables. Once the job condition is acquired, a
method can safely release the virDomainObj *lock whenever it hits
method can safely release the ``virDomainObj`` lock whenever it hits
a piece of code which may sleep/wait, and re-acquire it after the
sleep/wait. Whenever an asynchronous job wants to talk to the
monitor, it needs to acquire nested job (a special kind of normal
job) to obtain exclusive access to the monitor.
Since the virDomainObj *lock was dropped while waiting for the
Since the ``virDomainObj`` lock was dropped while waiting for the
job condition, it is possible that the domain is no longer active
when the condition is finally obtained. The monitor lock is only
safe to grab after verifying that the domain is still active.
* qemuMonitor *: Mutex
``qemuMonitor`` mutex
Lock to be used when invoking any monitor command to ensure safety
wrt any asynchronous events that may be dispatched from the monitor.
@@ -92,118 +93,111 @@ There are a number of locks on various objects
The job condition *MUST* be held before acquiring the monitor lock
The virDomainObj *lock *MUST* be held before acquiring the monitor
The ``virDomainObj`` lock *MUST* be held before acquiring the monitor
lock.
The virDomainObj *lock *MUST* then be released when invoking the
The ``virDomainObj`` lock *MUST* then be released when invoking the
monitor command.
Helper methods
--------------
To lock the virDomainObj *
To lock the ``virDomainObj``
virObjectLock()
- Acquires the virDomainObj *lock
virObjectUnlock()
- Releases the virDomainObj *lock
``virObjectLock()``
- Acquires the ``virDomainObj`` lock
``virObjectUnlock()``
- Releases the ``virDomainObj`` lock
To acquire the normal job condition
qemuDomainObjBeginJob()
``qemuDomainObjBeginJob()``
- Waits until the job is compatible with current async job or no
async job is running
- Waits for job.cond condition 'job.active != 0' using virDomainObj *
- Waits for ``job.cond`` condition ``job.active != 0`` using ``virDomainObj``
mutex
- Rechecks if the job is still compatible and repeats waiting if it
isn't
- Sets job.active to the job type
- Sets ``job.active`` to the job type
qemuDomainObjEndJob()
``qemuDomainObjEndJob()``
- Sets job.active to 0
- Signals on job.cond condition
To acquire the agent job condition
qemuDomainObjBeginAgentJob()
``qemuDomainObjBeginAgentJob()``
- Waits until there is no other agent job set
- Sets job.agentActive tp the job type
qemuDomainObjEndAgentJob()
- Sets job.agentActive to 0
- Signals on job.cond condition
- Sets ``job.agentActive`` to the job type
``qemuDomainObjEndAgentJob()``
- Sets ``job.agentActive`` to 0
- Signals on ``job.cond`` condition
To acquire the asynchronous job condition
qemuDomainObjBeginAsyncJob()
``qemuDomainObjBeginAsyncJob()``
- Waits until no async job is running
- Waits for job.cond condition 'job.active != 0' using virDomainObj *
- Waits for ``job.cond`` condition ``job.active != 0`` using ``virDomainObj``
mutex
- Rechecks if any async job was started while waiting on job.cond
- Rechecks if any async job was started while waiting on ``job.cond``
and repeats waiting in that case
- Sets job.asyncJob to the asynchronous job type
qemuDomainObjEndAsyncJob()
- Sets job.asyncJob to 0
- Broadcasts on job.asyncCond condition
- Sets ``job.asyncJob`` to the asynchronous job type
``qemuDomainObjEndAsyncJob()``
- Sets ``job.asyncJob`` to 0
- Broadcasts on ``job.asyncCond`` condition
To acquire the QEMU monitor lock
qemuDomainObjEnterMonitor()
- Acquires the qemuMonitorObjPtr lock
- Releases the virDomainObj *lock
``qemuDomainObjEnterMonitor()``
- Acquires the ``qemuMonitorObj`` lock
- Releases the ``virDomainObj`` lock
qemuDomainObjExitMonitor()
- Releases the qemuMonitorObjPtr lock
- Acquires the virDomainObj *lock
``qemuDomainObjExitMonitor()``
- Releases the ``qemuMonitorObj`` lock
- Acquires the ``virDomainObj`` lock
These functions must not be used by an asynchronous job.
To acquire the QEMU monitor lock as part of an asynchronous job
qemuDomainObjEnterMonitorAsync()
``qemuDomainObjEnterMonitorAsync()``
- Validates that the right async job is still running
- Acquires the qemuMonitorObjPtr lock
- Releases the virDomainObj *lock
- Acquires the ``qemuMonitorObj`` lock
- Releases the ``virDomainObj`` lock
- Validates that the VM is still active
qemuDomainObjExitMonitor()
- Releases the qemuMonitorObjPtr lock
- Acquires the virDomainObj *lock
- Releases the ``qemuMonitorObj`` lock
- Acquires the ``virDomainObj`` lock
These functions are for use inside an asynchronous job; the caller
must check for a return of -1 (VM not running, so nothing to exit).
Helper functions may also call this with VIR_ASYNC_JOB_NONE when
Helper functions may also call this with ``VIR_ASYNC_JOB_NONE`` when
used from a sync job (such as when first starting a domain).
To keep a domain alive while waiting on a remote command
qemuDomainObjEnterRemote()
- Releases the virDomainObj *lock
``qemuDomainObjEnterRemote()``
- Releases the ``virDomainObj`` lock
qemuDomainObjExitRemote()
- Acquires the virDomainObj *lock
``qemuDomainObjExitRemote()``
- Acquires the ``virDomainObj`` lock
Design patterns
---------------
* Accessing something directly to do with a virDomainObj *
* Accessing something directly to do with a ``virDomainObj``::
virDomainObj *obj;
@@ -214,7 +208,7 @@ Design patterns
virDomainObjEndAPI(&obj);
* Updating something directly to do with a virDomainObj *
* Updating something directly to do with a ``virDomainObj``::
virDomainObj *obj;
@@ -229,7 +223,7 @@ Design patterns
virDomainObjEndAPI(&obj);
* Invoking a monitor command on a virDomainObj *
* Invoking a monitor command on a ``virDomainObj``::
virDomainObj *obj;
qemuDomainObjPrivate *priv;
@@ -252,7 +246,7 @@ Design patterns
virDomainObjEndAPI(&obj);
* Invoking an agent command on a virDomainObj *
* Invoking an agent command on a ``virDomainObj``::
virDomainObj *obj;
qemuAgent *agent;
@@ -276,7 +270,7 @@ Design patterns
virDomainObjEndAPI(&obj);
* Running asynchronous job
* Running asynchronous job::
virDomainObj *obj;
qemuDomainObjPrivate *priv;
@@ -316,7 +310,7 @@ Design patterns
virDomainObjEndAPI(&obj);
* Coordinating with a remote server for migration
* Coordinating with a remote server for migration::
virDomainObj *obj;
qemuDomainObjPrivate *priv;

View File

@@ -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.

View File

@@ -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:
::
@@ -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>`_:
::
@@ -150,7 +150,7 @@ siblings. This is achieved using the `CPU tuning config <../formatdomain.html#el
<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:
@@ -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>`_:
::
@@ -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>`_:
::

View File

@@ -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.
@@ -295,7 +295,9 @@ In order to make virtio devices work, we need to use
``<driver iommu='on'/>`` inside the given device XML element in order
to enable DMA API in the virtio driver.
::
Starting with QEMU 6.0.0 QEMU will set this for us by default. For earlier
versions though, you will need to explicitly enable this in the device XML as
follows::
# virsh edit <domain>
<domain>

View File

@@ -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

View File

@@ -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
====================

View File

@@ -15,6 +15,7 @@ docs_kbase_files = [
'qemu-passthrough-security',
'rpm-deployment',
's390_protected_virt',
'secureboot',
'secureusage',
'snapshots',
'systemtap',

View File

@@ -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.

102
docs/kbase/secureboot.rst Normal file
View File

@@ -0,0 +1,102 @@
===========
Secure Boot
===========
.. contents::
Quick configuration
===================
If you have libvirt 8.6.0 or newer, when creating a new VM you can
ask for Secure Boot to be enabled with
::
<os firmware='efi'>
<firmware>
<feature enabled='yes' name='enrolled-keys'/>
</firmware>
</os>
and for it to be disabled with
::
<os firmware='efi'>
<firmware>
<feature enabled='no' name='enrolled-keys'/>
</firmware>
</os>
These configuration will cause unsigned guest operating systems to
be rejected and allowed respectively.
Older libvirt versions
======================
If your libvirt version is older than 8.6.0 but newer than 7.2.0,
then enabling Secure Boot requires a slightly more verbose XML
snippet:
::
<os firmware='efi'>
<loader secure='yes'/>
<firmware>
<feature enabled='yes' name='enrolled-keys'/>
</firmware>
</os>
Versions older than 7.2.0 require manually providing all information
about the firmware and are not covered here. Please refer to `the
relevant documentation
<../formatdomain.html#operating-system-booting>`__ for details.
Changing an existing VM
=======================
Once the VM has been created, updating the XML configuration as
described above is **not** enough to change the Secure Boot status:
the NVRAM file associated with the VM has to be regenerated from its
template as well.
In order to do that, update the XML and then start the VM with
::
$ virsh start $vm --reset-nvram
This option is only available starting with libvirt 8.1.0, so if your
version of libvirt is older than that you will have to delete the
NVRAM file manually before starting the VM.
Most guest operating systems will be able to cope with the NVRAM file
being reinitialized, but in some cases the VM will be unable to boot
after the change.
Additional information
======================
There are two parts to enabling Secure Boot: the firmware supporting
the feature, and it being active.
Most host operating systems ship a build of EDKII (the open source
EFI implementation used for QEMU VMs) that supports the Secure Boot
feature, but simply using such a build will not result in unsigned
guest operating systems being rejected: for that to happen, keys that
can be used to validate the operating system signature need to be
provided as well.
Asking for the ``enrolled-keys`` firmware feature to be enabled will
cause libvirt to initialize the NVRAM file associated with the VM
from a template that contains a suitable set of keys. These keys
being present will cause the firmware to enforce the Secure Boot
signing requirements.
The opposite configuration, where the feature is explicitly disabled,
will result in no keys being present in the NVRAM file. Unable to
verify signatures, the firmware will allow even unsigned operating
systems to run.

View File

@@ -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:

View File

@@ -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*
@@ -1959,10 +1959,16 @@ backup-dumpxml
::
backup-dumpxml domain
backup-dumpxml [--xpath EXPRESSION] [--wrap] domain
Output XML describing the current backup job.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
domiflist
---------
@@ -2053,10 +2059,16 @@ domjobabort
::
domjobabort domain
domjobabort domain [--postcopy]
Abort the currently running domain job.
When the job to be aborted is a migration which entered post-copy mode, it
cannot be aborted as none of the hosts involved in migration has a complete
state of the domain. Optional *--postcopy* can be used to interrupt such
migration although doing so may effectively suspend the domain until the
migration is resumed (see also *--postcopy-resume* option of ``migrate``).
domjobinfo
----------
@@ -2646,7 +2658,8 @@ dumpxml
::
dumpxml domain [--inactive] [--security-info] [--update-cpu] [--migratable]
dumpxml [--inactive] [--security-info] [--update-cpu] [--migratable]
[--xpath EXPRESSION] [--wrap] domain
Output the domain information as an XML dump to stdout, this format can be used
by the ``create`` command. Additional options affecting the XML dump may be
@@ -2659,6 +2672,13 @@ migrations, i.e., compatible with older libvirt releases and possibly amended
with internal run-time options. This option may automatically enable other
options (*--update-cpu*, *--security-info*, ...) as necessary.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
edit
----
@@ -2993,7 +3013,8 @@ iothreadset
::
iothreadset domain iothread_id [[--poll-max-ns ns] [--poll-grow factor]
[--poll-shrink divisor]]
[--poll-shrink divisor] [--thread-pool-min value]
[--thread-pool-max value]]
[[--config] [--live] | [--current]]
Modifies an existing iothread of the domain using the specified
@@ -3010,6 +3031,16 @@ for a running guest. Saving, destroying, stopping, etc. the guest will
result in the polling values returning to hypervisor defaults at the
next start, restore, etc.
The *--thread-pool-min* and *--thread-pool-max* options then set lower and
upper bound, respectively of number of threads in worker pool of given
iothread. For changes to an inactive configuration -1 can be specified to
remove corresponding boundary from the domain configuration. For changes to a
running guest it's recommended to set the upper boundary first
(*--thread-pool-max*) and only after that set the lower boundary
(*--thread-pool-min*). It is allowed for the lower boundary to be the same as
the upper boundary, however it's not allowed for the upper boundary to be value
of zero.
If *--live* is specified, affect a running guest. If the guest is not
running an error is returned.
If *--current* is specified or *--live* is not specified, then handle
@@ -3073,12 +3104,19 @@ managedsave-dumpxml
::
managedsave-dumpxml domain [--security-info]
managedsave-dumpxml [--security-info] [--xpath EXPRESSION] [--wrap] domain
Extract the domain XML that was in effect at the time the saved state
file *file* was created with the ``managedsave`` command. Using
*--security-info* will also include security sensitive information.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
managedsave-edit
----------------
@@ -3246,7 +3284,8 @@ migrate
migrate [--live] [--offline] [--direct] [--p2p [--tunnelled]]
[--persistent] [--undefinesource] [--suspend] [--copy-storage-all]
[--copy-storage-inc] [--change-protection] [--unsafe] [--verbose]
[--rdma-pin-all] [--abort-on-error] [--postcopy] [--postcopy-after-precopy]
[--rdma-pin-all] [--abort-on-error] [--postcopy]
[--postcopy-after-precopy] [--postcopy-resume] [--zerocopy]
domain desturi [migrateuri] [graphicsuri] [listen-address] [dname]
[--timeout seconds [--timeout-suspend | --timeout-postcopy]]
[--xml file] [--migrate-disks disk-list] [--disks-port port]
@@ -3302,7 +3341,11 @@ Once migration is running, the user may switch to post-copy using the
automatically switch to post-copy after the first pass of pre-copy is finished.
The maximum bandwidth consumed during the post-copy phase may be limited using
*--postcopy-bandwidth*. The maximum bandwidth consumed during the pre-copy phase
may be limited using *--bandwidth*.
may be limited using *--bandwidth*. In case connection between the hosts breaks
while migration is in post-copy mode, the domain cannot be resumed on either
source or destination host and the ``migrate`` command will report an error
leaving the domain active on both hosts. To recover from such situation repeat
the original ``migrate`` command with an additional *--postcopy-resume* flag.
*--auto-converge* forces convergence during live migration. The initial
guest CPU throttling rate can be set with *auto-converge-initial*. If the
@@ -3319,6 +3362,11 @@ high (and thus allowing the domain to lock most of the host's memory). Doing so
may be dangerous to both the domain and the host itself since the host's kernel
may run out of memory.
*--zerocopy* requests zero-copy mechanism to be used for migrating memory pages.
For QEMU/KVM this means QEMU will be temporarily allowed to lock all guest
pages in host's memory, although only those that are queued for transfer will
be locked at the same time.
``Note``: Individual hypervisors usually do not support all possible types of
migration. For example, QEMU does not support direct migration.
@@ -3868,12 +3916,19 @@ save-image-dumpxml
::
save-image-dumpxml file [--security-info]
save-image-dumpxml [--security-info] [--xpath EXPRESSION] [--wrap] file
Extract the domain XML that was in effect at the time the saved state
file *file* was created with the ``save`` command. Using
*--security-info* will also include security sensitive information.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
save-image-edit
---------------
@@ -4645,7 +4700,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 +5061,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.
@@ -5222,7 +5277,7 @@ nodedev-dumpxml
::
nodedev-dumpxml device
nodedev-dumpxml [--xpath EXPRESSION] [--wrap] device
Dump a <device> XML representation for the given node device, including
such information as the device name, which bus owns the device, the
@@ -5231,6 +5286,13 @@ libvirt (such as whether device reset is supported). *device* can
be either device name or wwn pair in "wwnn,wwpn" format (only works
for HBA).
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
nodedev-info
------------
@@ -5411,13 +5473,20 @@ net-dumpxml
::
net-dumpxml network [--inactive]
net-dumpxml [--inactive] [--xpath EXPRESSION] [--wrap] network
Output the virtual network information as an XML dump to stdout.
If *--inactive* is specified, then physical functions are not
expanded into their associated virtual functions.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
net-edit
--------
@@ -5673,10 +5742,17 @@ net-port-dumpxml
::
net-port-dumpxml network port
net-port-dumpxml [--xpath EXPRESSION] [--wrap] network port
Output the network port information as an XML dump to stdout.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
net-port-delete
---------------
@@ -5760,12 +5836,19 @@ iface-dumpxml
::
iface-dumpxml interface [--inactive]
iface-dumpxml [--inactive] [--xpath EXPRESSION] [--wrap] interface
Output the host interface information as an XML dump to stdout. If
*--inactive* is specified, then the output reflects the persistent
state of the interface that will be used the next time it is started.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
iface-edit
----------
@@ -6236,12 +6319,19 @@ pool-dumpxml
::
pool-dumpxml [--inactive] pool-or-uuid
pool-dumpxml [--inactive] [--xpath EXPRESSION] [--wrap] pool-or-uuid
Returns the XML information about the *pool* object.
*--inactive* tells virsh to dump pool configuration that will be used
on next start of the pool as opposed to the current pool configuration.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
pool-edit
---------
@@ -6728,7 +6818,8 @@ vol-dumpxml
::
vol-dumpxml vol-name-or-key-or-path [--pool pool-or-uuid]
vol-dumpxml [--pool pool-or-uuid] [--xpath EXPRESSION] [--wrap]
vol-name-or-key-or-path
Output the volume information as an XML dump to stdout.
@@ -6740,6 +6831,13 @@ is in. If the volume name is provided instead of the key or path, then
providing the pool is necessary to find the volume to be uploaded into;
otherwise, the first volume found by the key or path will be used.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
vol-info
--------
@@ -6927,10 +7025,17 @@ secret-dumpxml
::
secret-dumpxml secret
secret-dumpxml [--xpath EXPRESSION] [--wrap] secret
Output properties of *secret* (specified by its UUID) as an XML dump to stdout.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
secret-event
------------
@@ -7348,12 +7453,20 @@ snapshot-dumpxml
::
snapshot-dumpxml domain snapshot [--security-info]
snapshot-dumpxml [--security-info] [--xpath EXPRESSION] [--wrap]
domain snapshot
Output the snapshot XML for the domain's snapshot named *snapshot*.
Using *--security-info* will also include security sensitive information.
Use ``snapshot-current`` to easily access the XML of the current snapshot.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
snapshot-parent
---------------
@@ -7633,7 +7746,8 @@ checkpoint-dumpxml
::
checkpoint-dumpxml domain checkpoint [--security-info] [--no-domain] [--size]
checkpoint-dumpxml [--security-info] [--no-domain] [--size]
[--xpath EXPRESSION] [--wrap] domain checkpoint
Output the checkpoint XML for the domain's checkpoint named
*checkpoint*. Using
@@ -7649,6 +7763,13 @@ space). Note that some hypervisors may require that *domain* is running when
Using *--no-domain* will omit the <domain> element from the
output for a more compact view.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
checkpoint-parent
-----------------
@@ -7751,10 +7872,17 @@ nwfilter-dumpxml
::
nwfilter-dumpxml nwfilter-name
nwfilter-dumpxml [--xpath EXPRESSION] [--wrap] nwfilter-name
Output the network filter XML.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
nwfilter-edit
-------------
@@ -7854,11 +7982,18 @@ nwfilter-binding-dumpxml
::
nwfilter-binding-dumpxml port-name
nwfilter-binding-dumpxml [--xpath EXPRESSION] [--wrap] port-name
Output the network filter binding XML for the network device called
``port-name``.
If the **--xpath** argument provides an XPath expression, it will be
evaluated against the output XML and only those matching nodes will
be printed. The default behaviour is to print each matching node as
a standalone document, however, for ease of additional processing,
the **--wrap** argument will cause the matching node to be wrapped
in a common root node.
HYPERVISOR-SPECIFIC COMMANDS
============================

View File

@@ -313,6 +313,18 @@ To define multiple outputs at once they need to be delimited by spaces:
$ virt-admin daemon-log-outputs "4:stderr 2:syslog:<msg_ident>"
daemon-timeout
--------------
**Syntax:**
::
daemon-timeout --timeout NUM
Sets the daemon timeout to the value of '--timeout' argument. Use ``--timeout 0``
to disable auto-shutdown of the daemon.
SERVER COMMANDS
===============

View File

@@ -31,18 +31,42 @@ from the name of the root element in the XML document.
Valid schema names currently include
- ``cpu``
The schema for the XML format of cpu
- ``domainsnapshot``
The schema for the XML format used by domain snapshot configuration
- ``domaincheckpoint``
The schema for the XML format used by domain checkpoint configuration
- ``domainbackup``
The schema for the XML format used by domain backup configuration
- ``domaincaps``
The schema for the XML format of domain capabilities
- ``domain``
The schema for the XML format used by guest domains configuration
- ``networkport``
The schema for the XML format used by network port configuration
- ``network``
The schema for the XML format used by virtual network configuration
- ``storagepoolcaps``
The schema for the XML format of storage pool capabilities
- ``storagepool``
The schema for the XML format used by storage pool configuration

View File

@@ -34,6 +34,8 @@ docs_rst_files = [
'bugs',
'cgroups',
'ci',
'ci-dashboard',
'ci-runners',
'coding-style',
'committer-guidelines',
'compiling',
@@ -81,6 +83,7 @@ docs_rst_files = [
'governance',
'hacking',
'hooks',
'issue-handling',
'java',
'libvirt-go',
'libvirt-go-xml',
@@ -103,7 +106,7 @@ docs_rst_files = [
'submitting-patches',
'support',
'testapi',
'testsuites',
'testing',
'testtck',
'uri',
'windows',
@@ -350,3 +353,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,
)

View File

@@ -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>

View File

@@ -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
@@ -55,7 +55,7 @@ Remote libvirt supports a range of transports:
``ssh``
Transported over an ordinary `ssh (secure
shell) <https://www.openssh.com/>`__ connection. Requires `Netcat
(nc) <http://netcat.sourceforge.net/>`__ installed and libvirtd should be
(nc) <https://en.wikipedia.org/wiki/Netcat>`__ installed and libvirtd should be
running on the remote machine. You should use some sort of ssh key management
(eg. `ssh-agent <http://mah.everybody.org/docs/ssh>`__) otherwise programs
which use this transport will stop to ask for a password.
@@ -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

View File

@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -68,7 +68,7 @@ particularly bad at this.
If everything went well, your patch should show up on the
`libvir-list
archives <https://www.redhat.com/archives/libvir-list/>`__ in a
archives <https://listman.redhat.com/archives/libvir-list/>`__ in a
matter of minutes; if you still can't find it on there after an
hour or so, you should double-check your setup. **Note that, if
you are not already a subscriber, your very first post to the
@@ -89,3 +89,24 @@ Moreover, such patch needs to be prefixed correctly with
``--subject-prefix=PATCHv2`` appended to
``git send-email`` (substitute ``v2`` with the
correct version if needed though).
Review process
--------------
Reviewing patches may take a lot of effort with review bandwidth being limited
in open source projects. Here are a few rules to follow to streamline the
process:
- **don't** contact individual maintainers/developers directly with your
patches; reviewers are subscribed to the mailing list
- **do** be patient; reviewers may be busy
- **do** respond to reviewer's questions
- **don't** ignore a suggestion from a reviewer; if you disagree discuss it on
the list before sending a new version
- **do** remind us of your patches on the list if they haven't gotten any
attention for a prolonged period (>1 week) by replying to your patches with a
"ping"
- **do** test your patches before sending
Don't feel obliged to review whole patch series if you see any major problems
in any of the comprising patches - just point them out on the list.

172
docs/testing.rst Normal file
View File

@@ -0,0 +1,172 @@
=======
Testing
=======
.. contents::
Different types of tests are available to libvirt developers for testing a
given libvirt release.
Unit tests
----------
The unit test suite present in the source code is mainly used to test our
XML parser/formatter, QEMU command line generator, QEMU capabilities probing,
etc. It is run by developers before submitting patches upstream and is
mandatory to pass for any contribution to be accepted upstream. One can run
the test suite in the source tree with the following::
$ ninja test
Container builds
----------------
Technically speaking these are not tests in the common sense. However, usage of
public container images to build libvirt in predefined and widely accessible
environments makes it possible to expand our coverage across distros,
architectures, toolchain flavors and library versions and as such is a very
valuable marker when accepting upstream contributions. Therefore, it is
recommended to run libvirt builds against your changes in various containers to
either locally or by using GitLab's shared CI runners to make sure everything
runs cleanly before submitting your patches. The images themselves come from
libvirt's GitLab container registry, but this can be overridden if needed, see
below.
Registry
~~~~~~~~
Libvirt project has its container registry hosted by GitLab at
``registry.gitlab.com/libvirt/libvirt`` which will automatically be
used to pull in pre-built layers. This avoids the need to build all the
containers locally using the Dockerfile recipes found in ``ci/containers/``.
Running container builds with GitLab CI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As long as your GitLab account has CI minutes available, pipelines will run
automatically on every branch push to your fork.
Running container builds locally
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In order to run container builds locally, we have a ``helper`` script inside
the ``ci`` directory that can pull, build, and test (if applicable) changes on
your current local branch. It supports both the Docker and Podman runtimes
with an automatic selection of whichever runtime is configured on your system.
In case neither has been enabled/configured, please go through the following
prerequisites. We recommend using podman because of its daemonless architecture
and security implications (i.e. rootless container execution by default) over
Docker.
Podman Prerequisites
~~~~~~~~~~~~~~~~~~~~
Install "podman" with the system package manager.
.. code::
$ sudo dnf install -y podman
$ podman ps
The last command should print an empty table, to verify the system is ready.
Docker Prerequisites
~~~~~~~~~~~~~~~~~~~~
Install "docker" with the system package manager and start the Docker service
on your development machine, then make sure you have the privilege to run
Docker commands. Typically it means setting up passwordless ``sudo docker``
command or login as root. For example:
.. code::
$ sudo dnf install -y docker
$ # or `apt-get install docker` for Ubuntu, etc.
$ sudo systemctl start docker
$ sudo docker ps
The last command should print an empty table, to verify the system is ready.
An alternative method to set up permissions is by adding the current user to
"docker" group and making the docker daemon socket file (by default
``/var/run/docker.sock``) accessible to the group:
.. code::
$ sudo groupadd docker
$ sudo usermod $USER -a -G docker
$ sudo chown :docker /var/run/docker.sock
Note that any one of above configurations makes it possible for the user to
exploit the whole host with Docker bind mounting or other privileged
operations. So only do it on development machines.
Examples of executing local container builds
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All of the following examples will utilize ``helper`` script mentioned earlier
sections. Let's start with the basics - listing available container images in
the default libvirt registry:
::
$ cd <libvirt_git>/ci
$ ./helper --help
$ ./helper list-images
Available x86 container images:
...
alpine-edge
fedora-rawhide
...
Available cross-compiler container images:
...
debian-sid-cross-s390x
fedora-rawhide-cross-mingw32
fedora-rawhide-cross-mingw64
...
Now let's say one would want to build their local libvirt changes on Alpine
Edge using their own GitLab's registry container. They'd then proceed with
::
$ ci/helper build --image-prefix registry.gitlab.com/<user>/libvirt/ci- alpine-edge
Finally, it would be nice if one could get an interactive shell inside the
test environment to debug potential build issues. This can be achieved with the
following:
::
$ ci/helper shell alpine-edge
Integration tests
-----------------
There are a few frameworks for writing and running functional tests in libvirt
with TCK being the one that runs in our upstream CI.
- the `TCK test suite <testtck.html>`__ is a functional test suite implemented
using the `Perl bindings <https://search.cpan.org/dist/Sys-Virt/>`__ of
libvirt. This is the recommended framework to use for writing upstream
functional tests at the moment. You can start by cloning the
`TCK git repo <https://gitlab.com/libvirt/libvirt-tck>`__.
- the `Avocado VT <https://github.com/avocado-framework/avocado-vt>`__ test
suite with the libvirt plugin is another framework implementing functional
testing utilizing the Avocado test framework underneath. Although written in
Python, the vast majority of the tests are exercising libvirt through the
command line client ``virsh``.
- the `libvirt-test-API <testapi.html>`__ is also a functional test suite, but
implemented using the `Python bindings <python.html>`__ of libvirt.
Unfortunately this framework is the least recommended one as it's largely
unmaintained and may be completely deprecated in the future in favour of TCK.
You can get it by cloning the
`git repo <https://gitlab.com/libvirt/libvirt-test-API/>`__.

View File

@@ -1,37 +0,0 @@
===========
Test suites
===========
There is a few test suites available to developers for testing a given version
of libvirt:
- the internal test suite: present in the source code, it is run by developers
before submitting patches upstream, it is also suggested to have it run and
pass as part of the packaging process for distributions. It is run by
launching:
::
make check (libvirt 6.6.0 and older)
::
ninja test (libvirt 6.7.0 and newer)
in a source tree after compilation has finished. It doesn't really make
functional testing but checks that large portions of the code not interacting
directly with virtualization functions properly.
- the `TCK test suite <testtck.html>`__ is a functional test suite implemented
using the `Perl bindings <https://search.cpan.org/dist/Sys-Virt/>`__ of
libvirt. It is available separately as a
`download <ftp://libvirt.org/libvirt/tck/>`__, as a
`package <https://rpmfind.net/linux/rpm2html/search.php?query=libvirt-tck>`__
in Fedora distributions, but best is probably to get the `version from
GIT <https://gitlab.com/libvirt/libvirt-tck>`__.
- the `libvirt-test-API <testapi.html>`__ is also a functional test suite, but
implemented using the `Python bindings <python.html>`__ of libvirt. It is
available separately as a
`download <ftp://libvirt.org/libvirt/libvirt-test-API/>`__, or directly get
the `version from GIT <https://gitlab.com/libvirt/libvirt-test-API/>`__.

View File

@@ -2,6 +2,8 @@
libvirt TCK : Technology Compatibility Kit
==========================================
.. contents::
The libvirt TCK provides a framework for performing testing of the integration
between libvirt drivers, the underlying virt hypervisor technology, related
operating system services and system configuration. The idea (and name) is
@@ -23,15 +25,90 @@ determine the level of compatibility of their platform, and evaluate whether it
will meet their needs, and get awareness of any regressions that may have
occurred since a previous test run.
For more details you can look at:
- The initial `mail from Daniel
Berrange <https://www.redhat.com/archives/libvir-list/2009-April/msg00176.html>`__
presenting the project.
- The `page describing
VirtTCK <https://fedoraproject.org/wiki/Features/VirtTCK>`__ the inclusion of
libvirt-TCK as a Fedora Feature.
Libvirt-TCK is maintained using `a GIT
repository <https://gitlab.com/libvirt/libvirt-tck>`__, and comment, patches and
reviews are carried on the `libvir-list <contact.html>`__ development list.
repository <https://gitlab.com/libvirt/libvirt-tck>`__. GitLab is also the place
where the whole TCK development workflow (issues, merge requests, comments)
happens.
Using TCK
---------
TCK can be used independently of the environment, i.e. both on your local host
or in a VM. We strongly recommend using a VM for the tests as TCK might affect
your current host setup, see `Running TCK`_.
Installing dependencies
~~~~~~~~~~~~~~~~~~~~~~~
Since TCK is based on libvirt Perl bindings, you'll need to have the proper
version of the bindings installed for the version of libvirt you wish to test
in order to be able execute the TCK test suite successfully. Additionally, a
number of Perl dependencies will need to be installed as well, some will be
available through the system package manager and some will likely need to be
installed from CPAN (Perl's equivalent of Python's PyPI). Here's where
`libvirt-ci's <https://gitlab.com/libvirt/libvirt-ci.git>`__ lcitool can help
with preparing a test environment in a fresh VM, taking care of the
dependencies along the way:
::
$ lcitool install --target fedora-36 tck-fedora36 --wait
would get you a new Fedora 36 VM named ``tck-fedora36``. Then
::
$ lcitool update tck-fedora36 libvirt,libvirt-perl,libvirt-tck+runtime
will install all the necessary dependencies to build libvirt, the corresponding
Perl bindings and all TCK runtime dependencies to be able to execute the tests.
We also recommend executing TCK using the Avocado framework as the test harness
engine which means that you'll have to install Avocado in the test environment
as well. You can get it either from
`PyPI <https://pypi.org/project/avocado-framework/>`__ (recommended), or if
you're on Fedora you can make use of the Avocado `module <https://avocado-framework.readthedocs.io/en/latest/guides/user/chapters/installing.html#installing-from-packages>`__.
Using Avocado is not mandatory for the time being and you can skip it, but
in the future we plan on making the TCK internal coupling with Avocado tighter.
Running TCK
~~~~~~~~~~~
Once you have all the dependencies installed, you can then proceed with running
as root the test suite as root (when running with Avocado):
::
# avocado --config avocado.config run --tap - ./scripts/
from the TCK's git root.
If you don't want to install Avocado you can execute tests using the
``libvirt-tck`` binary directly (again, from the git root). You'll need to pass
a few options that Avocado takes care of:
::
# PERL5LIB=./lib perl bin/libvirt-tck -c <path_to_config> --force ./scripts
Running with the ``--force`` argument is not necessary and you can safely omit
it, but it becomes useful if you need to interrupt a test run for some
reason. In such case using ``--force`` ensures the first thing TCK does before
running any tests is that it will clean up all resources from the previous test
run which may have been left behind if you had interrupted the previous TCK's
execution.
Note that running with root privileges is necessary since some tests need
access to system resources or configs. This, along with the fact that some
tests might affect the host system are good reasons to consider using a test VM
as described above.
Contributing a test
-------------------
We'd appreciate if you provided a functional test case whenever you're adding a
new feature or fixing a bug in libvirt with the only complication being that
in case you're adding a new public API then a Perl binding will have to be
introduced first. After that, the best way to start is looking at some existing
tests, copy-pasting one that fits your scenario the best and tweak the
remaining bits.

View File

@@ -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
~~~~~~~~~~~~~~~~~~~~~
@@ -178,7 +178,7 @@ Extra parameters can be added to remote URIs as part of the query string (the
part following ``?``). Remote URIs understand the extra parameters shown
below. Any others are passed unmodified through to the back end. Note that
parameter values must be
`URI-escaped <http://xmlsoft.org/html/libxml-uri.html#xmlURIEscapeStr>`__.
`URI-escaped <https://gnome.pages.gitlab.gnome.org/libxml2/devhelp/libxml2-uri.html#xmlURIEscapeStr>`__.
All transports support the following parameters:
@@ -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``

View File

@@ -104,8 +104,8 @@ desired <contact.html>`__.
Compiling yourself
------------------
Libvirt can be compiled on Windows using the free `MinGW
compiler <http://www.mingw.org/>`__.
Libvirt can be compiled on Windows using the free `MinGW-w64
compiler <https://www.mingw-w64.org/>`__.
MSYS Build script
~~~~~~~~~~~~~~~~~

View File

@@ -196,6 +196,9 @@ eventDetailToString(int event,
case VIR_DOMAIN_EVENT_RESUMED_POSTCOPY:
return "Post-copy";
case VIR_DOMAIN_EVENT_RESUMED_POSTCOPY_FAILED:
return "Post-copy Error";
case VIR_DOMAIN_EVENT_RESUMED_LAST:
break;
}

View File

@@ -37,6 +37,8 @@ extern "C" {
*
* a virAdmConnect is a private structure representing a connection to
* libvirt daemon.
*
* Since: 2.0.0
*/
typedef struct _virAdmConnect virAdmConnect;
@@ -45,6 +47,8 @@ typedef struct _virAdmConnect virAdmConnect;
*
* a virAdmServer is a private structure and client-side representation of
* a remote server object
*
* Since: 2.0.0
*/
typedef struct _virAdmServer virAdmServer;
@@ -53,6 +57,8 @@ typedef struct _virAdmServer virAdmServer;
*
* a virAdmClient is a private structure and client-side representation of
* a remote server's client object (as server sees clients connected to it)
*
* Since: 2.0.0
*/
typedef struct _virAdmClient virAdmClient;
@@ -62,6 +68,8 @@ typedef struct _virAdmClient virAdmClient;
* a virAdmConnectPtr is pointer to a virAdmConnect private structure,
* this is the type used to reference a connection to the daemon
* in the API.
*
* Since: 2.0.0
*/
typedef virAdmConnect *virAdmConnectPtr;
@@ -71,6 +79,8 @@ typedef virAdmConnect *virAdmConnectPtr;
* a virAdmServerPtr is a pointer to a virAdmServer structure,
* this is the type used to reference client-side representation of a
* remote server object throughout all the APIs.
*
* Since: 2.0.0
*/
typedef virAdmServer *virAdmServerPtr;
@@ -80,6 +90,8 @@ typedef virAdmServer *virAdmServerPtr;
* a virAdmClientPtr is a pointer to a virAdmClient structure,
* this is the type used to reference client-side representation of a
* client object throughout all the APIs.
*
* Since: 2.0.0
*/
typedef virAdmClient *virAdmClientPtr;
@@ -108,6 +120,8 @@ int virAdmConnectGetLibVersion(virAdmConnectPtr conn,
* @opaque: opaque client data
*
* A callback to be registered, in case a connection was closed.
*
* Since: 2.0.0
*/
typedef void (*virAdmConnectCloseFunc)(virAdmConnectPtr conn,
int reason,
@@ -132,6 +146,8 @@ virAdmServerPtr virAdmConnectLookupServer(virAdmConnectPtr conn,
* VIR_THREADPOOL_WORKERS_MIN:
* Macro for the threadpool minWorkers limit: represents the bottom limit to
* number of active workers in threadpool, as VIR_TYPED_PARAM_UINT.
*
* Since: 2.0.0
*/
# define VIR_THREADPOOL_WORKERS_MIN "minWorkers"
@@ -142,6 +158,8 @@ virAdmServerPtr virAdmConnectLookupServer(virAdmConnectPtr conn,
* number of active workers in threadpool, as VIR_TYPED_PARAM_UINT.
* The value of this limit has to be greater than VIR_THREADPOOL_WORKERS_MIN
* at all times.
*
* Since: 2.0.0
*/
# define VIR_THREADPOOL_WORKERS_MAX "maxWorkers"
@@ -150,6 +168,8 @@ virAdmServerPtr virAdmConnectLookupServer(virAdmConnectPtr conn,
* VIR_THREADPOOL_WORKERS_PRIORITY:
* Macro for the threadpool nPrioWorkers attribute: represents the current number
* of active priority workers in threadpool, as VIR_TYPED_PARAM_UINT.
*
* Since: 2.0.0
*/
# define VIR_THREADPOOL_WORKERS_PRIORITY "prioWorkers"
@@ -161,6 +181,8 @@ virAdmServerPtr virAdmConnectLookupServer(virAdmConnectPtr conn,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_THREADPOOL_WORKERS_FREE "freeWorkers"
@@ -172,6 +194,8 @@ virAdmServerPtr virAdmConnectLookupServer(virAdmConnectPtr conn,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_THREADPOOL_WORKERS_CURRENT "nWorkers"
@@ -183,6 +207,8 @@ virAdmServerPtr virAdmConnectLookupServer(virAdmConnectPtr conn,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_THREADPOOL_JOB_QUEUE_DEPTH "jobQueueDepth"
@@ -204,13 +230,18 @@ long long virAdmClientGetTimestamp(virAdmClientPtr client);
int virAdmClientGetTransport(virAdmClientPtr client);
int virAdmClientFree(virAdmClientPtr client);
/**
* virClientTransport:
*
* Since: 2.0.0
*/
typedef enum {
VIR_CLIENT_TRANS_UNIX = 0, /* connection via UNIX socket */
VIR_CLIENT_TRANS_TCP, /* connection via unencrypted TCP socket */
VIR_CLIENT_TRANS_TLS, /* connection via encrypted TCP socket */
VIR_CLIENT_TRANS_UNIX = 0, /* connection via UNIX socket (Since: 2.0.0) */
VIR_CLIENT_TRANS_TCP, /* connection via unencrypted TCP socket (Since: 2.0.0) */
VIR_CLIENT_TRANS_TLS, /* connection via encrypted TCP socket (Since: 2.0.0) */
# ifdef VIR_ENUM_SENTINELS
VIR_CLIENT_TRANS_LAST
VIR_CLIENT_TRANS_LAST /* (Since: 2.0.0) */
# endif
} virClientTransport;
@@ -233,6 +264,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_READONLY "readonly"
@@ -244,6 +277,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_SOCKET_ADDR "sock_addr"
@@ -255,6 +290,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_SASL_USER_NAME "sasl_user_name"
@@ -267,6 +304,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_X509_DISTINGUISHED_NAME "tls_x509_dname"
@@ -279,6 +318,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_UNIX_USER_ID "unix_user_id"
@@ -291,6 +332,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_UNIX_USER_NAME "unix_user_name"
@@ -303,6 +346,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_UNIX_GROUP_ID "unix_group_id"
@@ -315,6 +360,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_UNIX_GROUP_NAME "unix_group_name"
@@ -327,6 +374,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_UNIX_PROCESS_ID "unix_process_id"
@@ -339,6 +388,8 @@ virAdmServerLookupClient(virAdmServerPtr srv,
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_CLIENT_INFO_SELINUX_CONTEXT "selinux_context"
@@ -356,6 +407,8 @@ int virAdmClientClose(virAdmClientPtr client, unsigned int flags);
* VIR_SERVER_CLIENTS_MAX:
* Macro for per-server nclients_max limit: represents the upper limit to
* number of clients connected to the server, as uint.
*
* Since: 2.0.0
*/
# define VIR_SERVER_CLIENTS_MAX "nclients_max"
@@ -367,6 +420,8 @@ int virAdmClientClose(virAdmClientPtr client, unsigned int flags);
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_SERVER_CLIENTS_CURRENT "nclients"
@@ -376,6 +431,8 @@ int virAdmClientClose(virAdmClientPtr client, unsigned int flags);
* Macro for per-server nclients_unauth_max limit: represents the upper limit
* to number of clients connected to the server, but not authenticated yet,
* as VIR_TYPED_PARAM_UINT.
*
* Since: 2.0.0
*/
# define VIR_SERVER_CLIENTS_UNAUTH_MAX "nclients_unauth_max"
@@ -388,6 +445,8 @@ int virAdmClientClose(virAdmClientPtr client, unsigned int flags);
*
* NOTE: This attribute is read-only and any attempt to set it will be denied
* by daemon
*
* Since: 2.0.0
*/
# define VIR_SERVER_CLIENTS_UNAUTH_CURRENT "nclients_unauth"
@@ -421,6 +480,10 @@ int virAdmConnectSetLoggingFilters(virAdmConnectPtr conn,
const char *filters,
unsigned int flags);
int virAdmConnectSetDaemonTimeout(virAdmConnectPtr conn,
unsigned int timeout,
unsigned int flags);
# ifdef __cplusplus
}
# endif

View File

@@ -71,7 +71,7 @@ extern "C" {
* Macro providing the version of the library as
* version * 1,000,000 + minor * 1000 + micro
*
* Since: v0.0.1
* Since: 0.0.1
*/
# define LIBVIR_VERSION_NUMBER @LIBVIRT_VERSION_NUMBER@
@@ -88,7 +88,7 @@ extern "C" {
* // some code that only works in 1.1.3 and newer
* #endif
*
* Since: v1.2.0
* Since: 1.2.0
*/
# define LIBVIR_CHECK_VERSION(major, minor, micro) \
((major) * 1000000 + (minor) * 1000 + (micro) <= LIBVIR_VERSION_NUMBER)
@@ -108,23 +108,23 @@ extern "C" {
* abide by this requirement may lead to application deadlocks
* or crashes.
*
* Since: v0.5.0
* Since: 0.5.0
*/
typedef void (*virFreeCallback)(void *opaque);
/**
* virConnectCloseReason:
*
* Since: v0.10.0
* Since: 0.10.0
*/
typedef enum {
VIR_CONNECT_CLOSE_REASON_ERROR = 0, /* Misc I/O error (Since: v0.10.0) */
VIR_CONNECT_CLOSE_REASON_EOF = 1, /* End-of-file from server (Since: v0.10.0) */
VIR_CONNECT_CLOSE_REASON_KEEPALIVE = 2, /* Keepalive timer triggered (Since: v0.10.0) */
VIR_CONNECT_CLOSE_REASON_CLIENT = 3, /* Client requested it (Since: v0.10.0) */
VIR_CONNECT_CLOSE_REASON_ERROR = 0, /* Misc I/O error (Since: 0.10.0) */
VIR_CONNECT_CLOSE_REASON_EOF = 1, /* End-of-file from server (Since: 0.10.0) */
VIR_CONNECT_CLOSE_REASON_KEEPALIVE = 2, /* Keepalive timer triggered (Since: 0.10.0) */
VIR_CONNECT_CLOSE_REASON_CLIENT = 3, /* Client requested it (Since: 0.10.0) */
# ifdef VIR_ENUM_SENTINELS
VIR_CONNECT_CLOSE_REASON_LAST /* (Since: v0.10.0) */
VIR_CONNECT_CLOSE_REASON_LAST /* (Since: 0.10.0) */
# endif
} virConnectCloseReason;
@@ -133,19 +133,19 @@ typedef enum {
*
* Express the type of a virTypedParameter
*
* Since: v0.9.2
* Since: 0.9.2
*/
typedef enum {
VIR_TYPED_PARAM_INT = 1, /* integer case (Since: v0.9.2) */
VIR_TYPED_PARAM_UINT = 2, /* unsigned integer case (Since: v0.9.2) */
VIR_TYPED_PARAM_LLONG = 3, /* long long case (Since: v0.9.2) */
VIR_TYPED_PARAM_ULLONG = 4, /* unsigned long long case (Since: v0.9.2) */
VIR_TYPED_PARAM_DOUBLE = 5, /* double case (Since: v0.9.2) */
VIR_TYPED_PARAM_BOOLEAN = 6, /* boolean(character) case (Since: v0.9.2) */
VIR_TYPED_PARAM_STRING = 7, /* string case (Since: v0.9.8) */
VIR_TYPED_PARAM_INT = 1, /* integer case (Since: 0.9.2) */
VIR_TYPED_PARAM_UINT = 2, /* unsigned integer case (Since: 0.9.2) */
VIR_TYPED_PARAM_LLONG = 3, /* long long case (Since: 0.9.2) */
VIR_TYPED_PARAM_ULLONG = 4, /* unsigned long long case (Since: 0.9.2) */
VIR_TYPED_PARAM_DOUBLE = 5, /* double case (Since: 0.9.2) */
VIR_TYPED_PARAM_BOOLEAN = 6, /* boolean(character) case (Since: 0.9.2) */
VIR_TYPED_PARAM_STRING = 7, /* string case (Since: 0.9.8) */
# ifdef VIR_ENUM_SENTINELS
VIR_TYPED_PARAM_LAST /* (Since: v0.9.10) */
VIR_TYPED_PARAM_LAST /* (Since: 0.9.10) */
# endif
} virTypedParameterType;
@@ -156,7 +156,7 @@ typedef enum {
*
* These enums should not conflict with those of virDomainModificationImpact.
*
* Since: v0.9.8
* Since: 0.9.8
*/
typedef enum {
/* 1 << 0 is reserved for virDomainModificationImpact */
@@ -172,7 +172,7 @@ typedef enum {
* setting the flag can be used to reject servers that cannot
* return typed strings, even if no strings would be returned.
*
* Since: v0.9.8
* Since: 0.9.8
*/
VIR_TYPED_PARAM_STRING_OKAY = 1 << 2,
@@ -183,7 +183,7 @@ typedef enum {
*
* Macro providing the field length of virTypedParameter name
*
* Since: v0.9.2
* Since: 0.9.2
*/
# define VIR_TYPED_PARAM_FIELD_LENGTH 80
@@ -196,7 +196,7 @@ typedef enum {
* virMemoryParameter are aliases of this type, for use when
* targeting libvirt earlier than 0.9.2.
*
* Since: v0.9.2
* Since: 0.9.2
*/
typedef struct _virTypedParameter virTypedParameter;
@@ -219,7 +219,7 @@ struct _virTypedParameter {
*
* a pointer to a virTypedParameter structure.
*
* Since: v0.9.2
* Since: 0.9.2
*/
typedef virTypedParameter *virTypedParameterPtr;

View File

@@ -35,7 +35,7 @@
* domain disks have been altered since a point in time, but by itself does
* not allow reverting back to that point in time.
*
* Since: v5.2.0
* Since: 5.2.0
*/
typedef struct _virDomainCheckpoint virDomainCheckpoint;
@@ -46,7 +46,7 @@ typedef struct _virDomainCheckpoint virDomainCheckpoint;
* private structure, and is the type used to reference a domain
* checkpoint in the API.
*
* Since: v5.2.0
* Since: 5.2.0
*/
typedef virDomainCheckpoint *virDomainCheckpointPtr;
@@ -57,17 +57,17 @@ virConnectPtr virDomainCheckpointGetConnect(virDomainCheckpointPtr checkpoint);
/**
* virDomainCheckpointCreateFlags:
*
* Since: v5.6.0
* Since: 5.6.0
*/
typedef enum {
VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE = (1 << 0), /* Restore or alter
metadata */
metadata (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_CREATE_QUIESCE = (1 << 1), /* use guest agent to
quiesce all mounted
file systems within
the domain */
the domain (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_VALIDATE = (1 << 2), /* validate disk data state
when redefining a checkpoint */
when redefining a checkpoint (Since: 6.10.0) */
} virDomainCheckpointCreateFlags;
/* Create a checkpoint using the current VM state. */
@@ -77,14 +77,14 @@ virDomainCheckpointPtr virDomainCheckpointCreateXML(virDomainPtr domain,
/**
* virDomainCheckpointXMLFlags:
*
* Since: v5.6.0
* Since: 5.6.0
*/
typedef enum {
VIR_DOMAIN_CHECKPOINT_XML_SECURE = (1 << 0), /* Include sensitive data */
VIR_DOMAIN_CHECKPOINT_XML_SECURE = (1 << 0), /* Include sensitive data (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_XML_NO_DOMAIN = (1 << 1), /* Suppress <domain>
subelement */
subelement (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_XML_SIZE = (1 << 2), /* Include dynamic
per-<disk> size */
per-<disk> size (Since: 5.6.0) */
} virDomainCheckpointXMLFlags;
/* Dump the XML of a checkpoint */
@@ -101,23 +101,23 @@ char *virDomainCheckpointGetXMLDesc(virDomainCheckpointPtr checkpoint,
* recursive. Remaining bits come in groups; if all bits from a group
* are 0, then that group is not used to filter results.
*
* Since: v5.6.0
* Since: 5.6.0
*/
typedef enum {
VIR_DOMAIN_CHECKPOINT_LIST_ROOTS = (1 << 0), /* Filter by checkpoints
with no parents, when
listing a domain */
listing a domain (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_LIST_DESCENDANTS = (1 << 0), /* List all descendants,
not just children, when
listing a checkpoint */
listing a checkpoint (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_LIST_TOPOLOGICAL = (1 << 1), /* Ensure parents occur
before children in
the resulting list */
the resulting list (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_LIST_LEAVES = (1 << 2), /* Filter by checkpoints
with no children */
with no children (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_LIST_NO_LEAVES = (1 << 3), /* Filter by checkpoints
that have children */
that have children (Since: 5.6.0) */
} virDomainCheckpointListFlags;
/* Get all checkpoint objects for this domain */
@@ -144,12 +144,12 @@ virDomainCheckpointPtr virDomainCheckpointGetParent(virDomainCheckpointPtr check
*
* Delete a checkpoint
*
* Since: v5.6.0
* Since: 5.6.0
*/
typedef enum {
VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN = (1 << 0), /* Also delete children */
VIR_DOMAIN_CHECKPOINT_DELETE_METADATA_ONLY = (1 << 1), /* Delete just metadata */
VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN_ONLY = (1 << 2), /* Delete just children */
VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN = (1 << 0), /* Also delete children (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_DELETE_METADATA_ONLY = (1 << 1), /* Delete just metadata (Since: 5.6.0) */
VIR_DOMAIN_CHECKPOINT_DELETE_CHILDREN_ONLY = (1 << 2), /* Delete just children (Since: 5.6.0) */
} virDomainCheckpointDeleteFlags;
int virDomainCheckpointDelete(virDomainCheckpointPtr checkpoint,

View File

@@ -35,7 +35,7 @@
* time, with the intent that the guest can be reverted back to that
* state at a later time.
*
* Since: v0.8.0
* Since: 0.8.0
*/
typedef struct _virDomainSnapshot virDomainSnapshot;
@@ -45,7 +45,7 @@ typedef struct _virDomainSnapshot virDomainSnapshot;
* A virDomainSnapshotPtr is pointer to a virDomainSnapshot private structure,
* and is the type used to reference a domain snapshot in the API.
*
* Since: v0.8.0
* Since: 0.8.0
*/
typedef virDomainSnapshot *virDomainSnapshotPtr;
@@ -56,32 +56,32 @@ virConnectPtr virDomainSnapshotGetConnect(virDomainSnapshotPtr snapshot);
/**
* virDomainSnapshotCreateFlags:
*
* Since: v0.9.5
* Since: 0.9.5
*/
typedef enum {
VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE = (1 << 0), /* Restore or alter
metadata */
metadata (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_CREATE_CURRENT = (1 << 1), /* With redefine, make
snapshot current */
snapshot current (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA = (1 << 2), /* Make snapshot without
remembering it */
remembering it (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_CREATE_HALT = (1 << 3), /* Stop running guest
after snapshot */
after snapshot (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY = (1 << 4), /* disk snapshot, not
full system */
full system (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT = (1 << 5), /* reuse any existing
external files */
external files (Since: 0.9.10) */
VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE = (1 << 6), /* use guest agent to
quiesce all mounted
file systems within
the domain */
the domain (Since: 0.9.10) */
VIR_DOMAIN_SNAPSHOT_CREATE_ATOMIC = (1 << 7), /* atomically avoid
partial changes */
partial changes (Since: 0.9.11) */
VIR_DOMAIN_SNAPSHOT_CREATE_LIVE = (1 << 8), /* create the snapshot
while the guest is
running */
running (Since: 1.0.1) */
VIR_DOMAIN_SNAPSHOT_CREATE_VALIDATE = (1 << 9), /* validate the XML
against the schema */
against the schema (Since: 5.6.0) */
} virDomainSnapshotCreateFlags;
/* Take a snapshot of the current VM state */
@@ -91,10 +91,10 @@ virDomainSnapshotPtr virDomainSnapshotCreateXML(virDomainPtr domain,
/**
* virDomainSnapshotXMLFlags:
*
* Since: v5.1.0
* Since: 5.1.0
*/
typedef enum {
VIR_DOMAIN_SNAPSHOT_XML_SECURE = VIR_DOMAIN_XML_SECURE, /* dump security sensitive information too */
VIR_DOMAIN_SNAPSHOT_XML_SECURE = VIR_DOMAIN_XML_SECURE, /* dump security sensitive information too (Since: 5.1.0) */
} virDomainSnapshotXMLFlags;
/* Dump the XML of a snapshot */
@@ -113,50 +113,48 @@ char *virDomainSnapshotGetXMLDesc(virDomainSnapshotPtr snapshot,
* recursive. Remaining bits come in groups; if all bits from a group are
* 0, then that group is not used to filter results.
*
* Since: v0.9.5
* Since: 0.9.5
*/
typedef enum {
VIR_DOMAIN_SNAPSHOT_LIST_ROOTS = (1 << 0), /* Filter by snapshots
with no parents, when
listing a domain */
listing a domain (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_LIST_DESCENDANTS = (1 << 0), /* List all descendants,
not just children, when
listing a snapshot */
/* For historical reasons, groups do not use contiguous bits. */
listing a snapshot (Since: 0.9.7) */
VIR_DOMAIN_SNAPSHOT_LIST_LEAVES = (1 << 2), /* Filter by snapshots
with no children */
with no children (Since: 0.9.7) */
VIR_DOMAIN_SNAPSHOT_LIST_NO_LEAVES = (1 << 3), /* Filter by snapshots
that have children */
that have children (Since: 0.9.13) */
VIR_DOMAIN_SNAPSHOT_LIST_METADATA = (1 << 1), /* Filter by snapshots
which have metadata */
which have metadata (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_LIST_NO_METADATA = (1 << 4), /* Filter by snapshots
with no metadata */
with no metadata (Since: 0.9.13) */
VIR_DOMAIN_SNAPSHOT_LIST_INACTIVE = (1 << 5), /* Filter by snapshots
taken while guest was
shut off */
shut off (Since: 1.0.1) */
VIR_DOMAIN_SNAPSHOT_LIST_ACTIVE = (1 << 6), /* Filter by snapshots
taken while guest was
active, and with
memory state */
memory state (Since: 1.0.1) */
VIR_DOMAIN_SNAPSHOT_LIST_DISK_ONLY = (1 << 7), /* Filter by snapshots
taken while guest was
active, but without
memory state */
memory state (Since: 1.0.1) */
VIR_DOMAIN_SNAPSHOT_LIST_INTERNAL = (1 << 8), /* Filter by snapshots
stored internal to
disk images */
disk images (Since: 1.0.1) */
VIR_DOMAIN_SNAPSHOT_LIST_EXTERNAL = (1 << 9), /* Filter by snapshots
that use files external
to disk images */
to disk images (Since: 1.0.1) */
VIR_DOMAIN_SNAPSHOT_LIST_TOPOLOGICAL = (1 << 10), /* Ensure parents occur
before children in
the resulting list */
the resulting list (Since: 5.2.0) */
} virDomainSnapshotListFlags;
/* Return the number of snapshots for this domain */
@@ -213,13 +211,13 @@ int virDomainSnapshotHasMetadata(virDomainSnapshotPtr snapshot,
/**
* virDomainSnapshotRevertFlags:
*
* Since: v0.9.5
* Since: 0.9.5
*/
typedef enum {
VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING = 1 << 0, /* Run after revert */
VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED = 1 << 1, /* Pause after revert */
VIR_DOMAIN_SNAPSHOT_REVERT_FORCE = 1 << 2, /* Allow risky reverts */
VIR_DOMAIN_SNAPSHOT_REVERT_RESET_NVRAM = 1 << 3, /* Re-initialize NVRAM from template */
VIR_DOMAIN_SNAPSHOT_REVERT_RUNNING = 1 << 0, /* Run after revert (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_REVERT_PAUSED = 1 << 1, /* Pause after revert (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_REVERT_FORCE = 1 << 2, /* Allow risky reverts (Since: 0.9.7) */
VIR_DOMAIN_SNAPSHOT_REVERT_RESET_NVRAM = 1 << 3, /* Re-initialize NVRAM from template (Since: 8.1.0) */
} virDomainSnapshotRevertFlags;
/* Revert the domain to a point-in-time snapshot. The
@@ -234,12 +232,12 @@ int virDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
*
* Delete a snapshot
*
* Since: v0.8.0
* Since: 0.8.0
*/
typedef enum {
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN = (1 << 0), /* Also delete children */
VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY = (1 << 1), /* Delete just metadata */
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY = (1 << 2), /* Delete just children */
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN = (1 << 0), /* Also delete children (Since: 0.8.0) */
VIR_DOMAIN_SNAPSHOT_DELETE_METADATA_ONLY = (1 << 1), /* Delete just metadata (Since: 0.9.5) */
VIR_DOMAIN_SNAPSHOT_DELETE_CHILDREN_ONLY = (1 << 2), /* Delete just children (Since: 0.9.5) */
} virDomainSnapshotDeleteFlags;
int virDomainSnapshotDelete(virDomainSnapshotPtr snapshot,

File diff suppressed because it is too large Load Diff

View File

@@ -35,13 +35,13 @@
* to libvirt. A client app must translate to, and from POLL events when using
* this construct.
*
* Since: v0.5.0
* Since: 0.5.0
*/
typedef enum {
VIR_EVENT_HANDLE_READABLE = (1 << 0),
VIR_EVENT_HANDLE_WRITABLE = (1 << 1),
VIR_EVENT_HANDLE_ERROR = (1 << 2),
VIR_EVENT_HANDLE_HANGUP = (1 << 3),
VIR_EVENT_HANDLE_READABLE = (1 << 0), /* (Since: 0.5.0) */
VIR_EVENT_HANDLE_WRITABLE = (1 << 1), /* (Since: 0.5.0) */
VIR_EVENT_HANDLE_ERROR = (1 << 2), /* (Since: 0.5.0) */
VIR_EVENT_HANDLE_HANGUP = (1 << 3), /* (Since: 0.5.0) */
} virEventHandleType;
/**
@@ -54,6 +54,8 @@ typedef enum {
*
* Callback for receiving file handle events. The callback will
* be invoked once for each event which is pending.
*
* Since: 0.5.0
*/
typedef void (*virEventHandleCallback)(int watch, int fd, int events, void *opaque);
@@ -81,6 +83,8 @@ typedef void (*virEventHandleCallback)(int watch, int fd, int events, void *opaq
*
* Returns -1 if the file handle cannot be registered, otherwise a handle
* watch number to be used for updating and unregistering for events
*
* Since: 0.5.0
*/
typedef int (*virEventAddHandleFunc)(int fd, int event,
virEventHandleCallback cb,
@@ -94,6 +98,8 @@ typedef int (*virEventAddHandleFunc)(int fd, int event,
*
* Part of the EventImpl, this user-provided callback is notified when
* events to listen on change
*
* Since: 0.5.0
*/
typedef void (*virEventUpdateHandleFunc)(int watch, int event);
@@ -109,6 +115,8 @@ typedef void (*virEventUpdateHandleFunc)(int watch, int event);
* function call, when it is safe to release the user data.
*
* Returns -1 if the file handle was not registered, 0 upon success
*
* Since: 0.5.0
*/
typedef int (*virEventRemoveHandleFunc)(int watch);
@@ -119,6 +127,8 @@ typedef int (*virEventRemoveHandleFunc)(int watch);
* @opaque: user data registered with handle
*
* callback for receiving timer events
*
* Since: 0.5.0
*/
typedef void (*virEventTimeoutCallback)(int timer, void *opaque);
@@ -137,6 +147,8 @@ typedef void (*virEventTimeoutCallback)(int timer, void *opaque);
* this purpose.
*
* Returns a timer value
*
* Since: 0.5.0
*/
typedef int (*virEventAddTimeoutFunc)(int timeout,
virEventTimeoutCallback cb,
@@ -150,6 +162,8 @@ typedef int (*virEventAddTimeoutFunc)(int timeout,
*
* Part of the EventImpl, this user-defined callback updates an
* event timeout.
*
* Since: 0.5.0
*/
typedef void (*virEventUpdateTimeoutFunc)(int timer, int timeout);
@@ -164,6 +178,8 @@ typedef void (*virEventUpdateTimeoutFunc)(int timer, int timeout);
* function call, when it is safe to release the user data.
*
* Returns 0 on success, -1 on failure
*
* Since: 0.5.0
*/
typedef int (*virEventRemoveTimeoutFunc)(int timer);

View File

@@ -34,7 +34,7 @@
* a virConnect is a private structure representing a connection to
* the Hypervisor.
*
* Since: v0.0.1
* Since: 0.0.1
*/
typedef struct _virConnect virConnect;
@@ -44,7 +44,7 @@ typedef struct _virConnect virConnect;
* a virConnectPtr is pointer to a virConnect private structure, this is the
* type used to reference a connection to the Hypervisor in the API.
*
* Since: v0.0.1
* Since: 0.0.1
*/
typedef virConnect *virConnectPtr;
@@ -54,15 +54,15 @@ typedef virConnect *virConnectPtr;
* Flags to indicate which system-wide sleep state the host must be
* transitioned to.
*
* Since: v0.9.8
* Since: 0.9.8
*/
typedef enum {
VIR_NODE_SUSPEND_TARGET_MEM = 0,
VIR_NODE_SUSPEND_TARGET_DISK = 1,
VIR_NODE_SUSPEND_TARGET_HYBRID = 2,
VIR_NODE_SUSPEND_TARGET_MEM = 0, /* (Since: 0.9.8) */
VIR_NODE_SUSPEND_TARGET_DISK = 1, /* (Since: 0.9.8) */
VIR_NODE_SUSPEND_TARGET_HYBRID = 2, /* (Since: 0.9.8) */
# ifdef VIR_ENUM_SENTINELS
VIR_NODE_SUSPEND_TARGET_LAST /* This constant is subject to change */
VIR_NODE_SUSPEND_TARGET_LAST /* This constant is subject to change (Since: 0.9.8) */
# endif
} virNodeSuspendTarget;
@@ -71,7 +71,7 @@ typedef enum {
*
* a virStream is a private structure representing a data stream.
*
* Since: v0.7.2
* Since: 0.7.2
*/
typedef struct _virStream virStream;
@@ -81,7 +81,7 @@ typedef struct _virStream virStream;
* a virStreamPtr is pointer to a virStream private structure, this is the
* type used to reference a data stream in the API.
*
* Since: v0.7.2
* Since: 0.7.2
*/
typedef virStream *virStreamPtr;
@@ -91,7 +91,7 @@ typedef virStream *virStreamPtr;
* Macro providing the maximum length of the virSecurityLabel label string.
* Note that this value is based on that used by Labeled NFS.
*
* Since: v0.6.1
* Since: 0.6.1
*/
# define VIR_SECURITY_LABEL_BUFLEN (4096 + 1)
@@ -102,7 +102,7 @@ typedef virStream *virStreamPtr;
* providing the security label and associated attributes for the specified
* domain.
*
* Since: v0.6.1
* Since: 0.6.1
*/
typedef struct _virSecurityLabel virSecurityLabel;
@@ -116,7 +116,7 @@ struct _virSecurityLabel {
*
* a virSecurityLabelPtr is a pointer to a virSecurityLabel.
*
* Since: v0.6.1
* Since: 0.6.1
*/
typedef virSecurityLabel *virSecurityLabelPtr;
@@ -125,7 +125,7 @@ typedef virSecurityLabel *virSecurityLabelPtr;
*
* Macro providing the maximum length of the virSecurityModel model string.
*
* Since: v0.6.1
* Since: 0.6.1
*/
# define VIR_SECURITY_MODEL_BUFLEN (256 + 1)
@@ -134,7 +134,7 @@ typedef virSecurityLabel *virSecurityLabelPtr;
*
* Macro providing the maximum length of the virSecurityModel doi string.
*
* Since: v0.6.1
* Since: 0.6.1
*/
# define VIR_SECURITY_DOI_BUFLEN (256 + 1)
@@ -145,7 +145,7 @@ typedef virSecurityLabel *virSecurityLabelPtr;
* providing the per-hypervisor security model and DOI attributes for the
* specified domain.
*
* Since: v0.6.1
* Since: 0.6.1
*/
typedef struct _virSecurityModel virSecurityModel;
@@ -159,7 +159,7 @@ struct _virSecurityModel {
*
* a virSecurityModelPtr is a pointer to a virSecurityModel.
*
* Since: v0.6.1
* Since: 0.6.1
*/
typedef virSecurityModel *virSecurityModelPtr;
@@ -176,7 +176,7 @@ typedef virSecurityModel *virSecurityModelPtr;
* accurate relection of the system hardware. See the virNodeGetInfo()
* API documentation for further guidance.
*
* Since: v0.1.0
* Since: 0.1.0
*/
typedef struct _virNodeInfo virNodeInfo;
@@ -202,7 +202,7 @@ struct _virNodeInfo {
*
* Macro providing the field length of virNodeCPUStats
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_CPU_STATS_FIELD_LENGTH 80
@@ -211,10 +211,10 @@ struct _virNodeInfo {
*
* Value for specifying request for the total CPU time/utilization
*
* Since: v0.9.8
* Since: 0.9.8
*/
typedef enum {
VIR_NODE_CPU_STATS_ALL_CPUS = -1,
VIR_NODE_CPU_STATS_ALL_CPUS = -1, /* (Since: 0.9.3) */
} virNodeGetCPUStatsAllCPUs;
/**
@@ -223,7 +223,7 @@ typedef enum {
* Macro for the cumulative CPU time which was spent by the kernel,
* since the node booting up (in nanoseconds).
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_CPU_STATS_KERNEL "kernel"
@@ -233,7 +233,7 @@ typedef enum {
* The cumulative CPU time which was spent by user processes,
* since the node booting up (in nanoseconds).
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_CPU_STATS_USER "user"
@@ -243,7 +243,7 @@ typedef enum {
* The cumulative idle CPU time,
* since the node booting up (in nanoseconds).
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_CPU_STATS_IDLE "idle"
@@ -253,7 +253,7 @@ typedef enum {
* The cumulative I/O wait CPU time,
* since the node booting up (in nanoseconds).
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_CPU_STATS_IOWAIT "iowait"
@@ -263,7 +263,7 @@ typedef enum {
* The cumulative interrupt CPU time,
* since the node booting up (in nanoseconds).
*
* Since: v1.2.2
* Since: 1.2.2
*/
# define VIR_NODE_CPU_STATS_INTR "intr"
@@ -274,7 +274,7 @@ typedef enum {
* The usage value is in percent and 100% represents all CPUs of
* the node.
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_CPU_STATS_UTILIZATION "utilization"
@@ -284,7 +284,7 @@ typedef enum {
* a virNodeCPUStats is a structure filled by virNodeGetCPUStats()
* providing information about the CPU stats of the node.
*
* Since: v0.9.3
* Since: 0.9.3
*/
typedef struct _virNodeCPUStats virNodeCPUStats;
@@ -298,7 +298,7 @@ struct _virNodeCPUStats {
*
* Macro providing the field length of virNodeMemoryStats
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_MEMORY_STATS_FIELD_LENGTH 80
@@ -307,10 +307,10 @@ struct _virNodeCPUStats {
*
* Value for specifying request for the total memory of all cells.
*
* Since: v0.9.8
* Since: 0.9.8
*/
typedef enum {
VIR_NODE_MEMORY_STATS_ALL_CELLS = -1,
VIR_NODE_MEMORY_STATS_ALL_CELLS = -1, /* (Since: 0.9.3) */
} virNodeGetMemoryStatsAllCells;
/**
@@ -319,7 +319,7 @@ typedef enum {
* Macro for the total memory of specified cell:
* it represents the maximum memory.
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_MEMORY_STATS_TOTAL "total"
@@ -330,7 +330,7 @@ typedef enum {
* On Linux, it includes buffer and cached memory, in case of
* VIR_NODE_MEMORY_STATS_ALL_CELLS.
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_MEMORY_STATS_FREE "free"
@@ -340,7 +340,7 @@ typedef enum {
* Macro for the buffer memory: On Linux, it is only returned in case of
* VIR_NODE_MEMORY_STATS_ALL_CELLS.
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_MEMORY_STATS_BUFFERS "buffers"
@@ -350,7 +350,7 @@ typedef enum {
* Macro for the cached memory: On Linux, it is only returned in case of
* VIR_NODE_MEMORY_STATS_ALL_CELLS.
*
* Since: v0.9.3
* Since: 0.9.3
*/
# define VIR_NODE_MEMORY_STATS_CACHED "cached"
@@ -360,7 +360,7 @@ typedef enum {
* a virNodeMemoryStats is a structure filled by virNodeGetMemoryStats()
* providing information about the memory of the node.
*
* Since: v0.9.3
* Since: 0.9.3
*/
typedef struct _virNodeMemoryStats virNodeMemoryStats;
@@ -375,7 +375,7 @@ struct _virNodeMemoryStats {
* Macro for typed parameter that represents how many present pages
* to scan before the shared memory service goes to sleep.
*
* Since: v0.10.2
* Since: 0.10.2
*/
# define VIR_NODE_MEMORY_SHARED_PAGES_TO_SCAN "shm_pages_to_scan"
@@ -385,7 +385,7 @@ struct _virNodeMemoryStats {
* Macro for typed parameter that represents how many milliseconds
* the shared memory service should sleep before next scan.
*
* Since: v0.10.2
* Since: 0.10.2
*/
# define VIR_NODE_MEMORY_SHARED_SLEEP_MILLISECS "shm_sleep_millisecs"
@@ -395,7 +395,7 @@ struct _virNodeMemoryStats {
* Macro for typed parameter that represents how many the shared
* memory pages are being used.
*
* Since: v0.10.2
* Since: 0.10.2
*/
# define VIR_NODE_MEMORY_SHARED_PAGES_SHARED "shm_pages_shared"
@@ -405,7 +405,7 @@ struct _virNodeMemoryStats {
* Macro for typed parameter that represents how many sites are
* sharing the pages i.e. how much saved.
*
* Since: v0.10.2
* Since: 0.10.2
*/
# define VIR_NODE_MEMORY_SHARED_PAGES_SHARING "shm_pages_sharing"
@@ -415,7 +415,7 @@ struct _virNodeMemoryStats {
* Macro for typed parameter that represents how many pages unique
* but repeatedly checked for merging.
*
* Since: v0.10.2
* Since: 0.10.2
*/
# define VIR_NODE_MEMORY_SHARED_PAGES_UNSHARED "shm_pages_unshared"
@@ -425,7 +425,7 @@ struct _virNodeMemoryStats {
* Macro for typed parameter that represents how many pages changing
* too fast to be placed in a tree.
*
* Since: v0.10.2
* Since: 0.10.2
*/
# define VIR_NODE_MEMORY_SHARED_PAGES_VOLATILE "shm_pages_volatile"
@@ -435,7 +435,7 @@ struct _virNodeMemoryStats {
* Macro for typed parameter that represents how many times all
* mergeable areas have been scanned.
*
* Since: v0.10.2
* Since: 0.10.2
*/
# define VIR_NODE_MEMORY_SHARED_FULL_SCANS "shm_full_scans"
@@ -449,7 +449,7 @@ struct _virNodeMemoryStats {
* pages from all nodes can be merged. Other values are reserved
* for future use.
*
* Since: v1.0.0
* Since: 1.0.0
*/
# define VIR_NODE_MEMORY_SHARED_MERGE_ACROSS_NODES "shm_merge_across_nodes"
@@ -480,7 +480,7 @@ int virNodeGetCPUMap(virConnectPtr conn,
* This macro is to calculate the total number of CPUs supported
* but not necessary active in the host.
*
* Since: v0.1.4
* Since: 0.1.4
*/
# define VIR_NODEINFO_MAXCPUS(nodeinfo) ((nodeinfo).nodes*(nodeinfo).sockets*(nodeinfo).cores*(nodeinfo).threads)
@@ -489,7 +489,7 @@ int virNodeGetCPUMap(virConnectPtr conn,
*
* a virNodeInfoPtr is a pointer to a virNodeInfo structure.
*
* Since: v0.1.0
* Since: 0.1.0
*/
typedef virNodeInfo *virNodeInfoPtr;
@@ -498,7 +498,7 @@ typedef virNodeInfo *virNodeInfoPtr;
*
* a virNodeCPUStatsPtr is a pointer to a virNodeCPUStats structure.
*
* Since: v0.9.3
* Since: 0.9.3
*/
typedef virNodeCPUStats *virNodeCPUStatsPtr;
@@ -507,7 +507,7 @@ typedef virNodeCPUStats *virNodeCPUStatsPtr;
*
* a virNodeMemoryStatsPtr is a pointer to a virNodeMemoryStats structure.
*
* Since: v0.9.3
* Since: 0.9.3
*/
typedef virNodeMemoryStats *virNodeMemoryStatsPtr;
@@ -522,7 +522,7 @@ typedef virNodeMemoryStats *virNodeMemoryStatsPtr;
*
* Macro represents the Platform Diffie-Hellman key, as VIR_TYPED_PARAMS_STRING.
*
* Since: v4.5.0
* Since: 4.5.0
*/
# define VIR_NODE_SEV_PDH "pdh"
@@ -533,16 +533,27 @@ typedef virNodeMemoryStats *virNodeMemoryStatsPtr;
* endorsement key (PEK), owner certificate authority (OCD) and chip
* endorsement key (CEK), as VIR_TYPED_PARAMS_STRING.
*
* Since: v4.5.0
* Since: 4.5.0
*/
# define VIR_NODE_SEV_CERT_CHAIN "cert-chain"
/**
* VIR_NODE_SEV_CPU0_ID:
*
* Macro represents the unique ID of CPU0 (socket 0) needed to retrieve
* the signed CEK of the CPU from AMD's Key Distribution Service (KDS),
* as VIR_TYPED_PARAMS_STRING.
*
* Since: 8.4.0
*/
# define VIR_NODE_SEV_CPU0_ID "cpu0-id"
/**
* VIR_NODE_SEV_CBITPOS:
*
* Macro represents the CBit Position used by hypervisor when SEV is enabled.
*
* Since: v4.5.0
* Since: 4.5.0
*/
# define VIR_NODE_SEV_CBITPOS "cbitpos"
@@ -552,7 +563,7 @@ typedef virNodeMemoryStats *virNodeMemoryStatsPtr;
* Macro represents the number of bits we lose in physical address space
* when SEV is enabled in the guest.
*
* Since: v4.5.0
* Since: 4.5.0
*/
# define VIR_NODE_SEV_REDUCED_PHYS_BITS "reduced-phys-bits"
@@ -562,7 +573,7 @@ typedef virNodeMemoryStats *virNodeMemoryStatsPtr;
* Macro represents the number of SEV guests that can
* be run on the host, as a VIR_TYPED_PARAM_UINT.
*
* Since: v8.0.0
* Since: 8.0.0
*/
# define VIR_NODE_SEV_MAX_GUESTS "max-guests"
@@ -572,7 +583,7 @@ typedef virNodeMemoryStats *virNodeMemoryStatsPtr;
* Macro represents the number of SEV-ES guests that can
* be run on the host, as a VIR_TYPED_PARAM_UINT.
*
* Since: v8.0.0
* Since: 8.0.0
*/
# define VIR_NODE_SEV_MAX_ES_GUESTS "max-es-guests"
@@ -586,31 +597,31 @@ int virNodeGetSEVInfo (virConnectPtr conn,
*
* Flags when opening a connection to a hypervisor
*
* Since: v0.4.1
* Since: 0.4.1
*/
typedef enum {
VIR_CONNECT_RO = (1 << 0), /* A readonly connection */
VIR_CONNECT_NO_ALIASES = (1 << 1), /* Don't try to resolve URI aliases */
VIR_CONNECT_RO = (1 << 0), /* A readonly connection (Since: 0.4.1) */
VIR_CONNECT_NO_ALIASES = (1 << 1), /* Don't try to resolve URI aliases (Since: 0.9.7) */
} virConnectFlags;
/**
* virConnectCredentialType:
*
* Since: v0.4.1
* Since: 0.4.1
*/
typedef enum {
VIR_CRED_USERNAME = 1, /* Identity to act as */
VIR_CRED_AUTHNAME = 2, /* Identify to authorize as */
VIR_CRED_LANGUAGE = 3, /* RFC 1766 languages, comma separated */
VIR_CRED_CNONCE = 4, /* client supplies a nonce */
VIR_CRED_PASSPHRASE = 5, /* Passphrase secret */
VIR_CRED_ECHOPROMPT = 6, /* Challenge response */
VIR_CRED_NOECHOPROMPT = 7, /* Challenge response */
VIR_CRED_REALM = 8, /* Authentication realm */
VIR_CRED_EXTERNAL = 9, /* Externally managed credential */
VIR_CRED_USERNAME = 1, /* Identity to act as (Since: 0.4.1) */
VIR_CRED_AUTHNAME = 2, /* Identify to authorize as (Since: 0.4.1) */
VIR_CRED_LANGUAGE = 3, /* RFC 1766 languages, comma separated (Since: 0.4.1) */
VIR_CRED_CNONCE = 4, /* client supplies a nonce (Since: 0.4.1) */
VIR_CRED_PASSPHRASE = 5, /* Passphrase secret (Since: 0.4.1) */
VIR_CRED_ECHOPROMPT = 6, /* Challenge response (Since: 0.4.1) */
VIR_CRED_NOECHOPROMPT = 7, /* Challenge response (Since: 0.4.1) */
VIR_CRED_REALM = 8, /* Authentication realm (Since: 0.4.1) */
VIR_CRED_EXTERNAL = 9, /* Externally managed credential (Since: 0.4.1) */
# ifdef VIR_ENUM_SENTINELS
VIR_CRED_LAST /* More may be added - expect the unexpected */
VIR_CRED_LAST /* More may be added - expect the unexpected (Since: 0.9.10) */
# endif
} virConnectCredentialType;
@@ -626,14 +637,14 @@ struct _virConnectCredential {
/**
* virConnectCredential:
*
* Since: v0.4.1
* Since: 0.4.1
*/
typedef struct _virConnectCredential virConnectCredential;
/**
* virConnectCredentialPtr:
*
* Since: v0.4.1
* Since: 0.4.1
*/
typedef virConnectCredential *virConnectCredentialPtr;
@@ -650,6 +661,8 @@ typedef virConnectCredential *virConnectCredentialPtr;
* If an interaction cannot be filled, fill in NULL and 0.
*
* Returns 0 if all interactions were filled, or -1 upon error
*
* Since: 0.4.1
*/
typedef int (*virConnectAuthCallbackPtr)(virConnectCredentialPtr cred,
unsigned int ncred,
@@ -666,14 +679,14 @@ struct _virConnectAuth {
/**
* virConnectAuth:
*
* Since: v0.4.1
* Since: 0.4.1
*/
typedef struct _virConnectAuth virConnectAuth;
/**
* virConnectAuthPtr:
*
* Since: v0.4.1
* Since: 0.4.1
*/
typedef virConnectAuth *virConnectAuthPtr;
@@ -687,7 +700,7 @@ typedef virConnectAuth *virConnectAuthPtr;
* suitable for the application's needs an alternative implementation
* should be provided.
*
* Since: v0.4.1
* Since: 0.4.1
*/
VIR_EXPORT_VAR virConnectAuthPtr virConnectAuthPtrDefault;
@@ -697,7 +710,7 @@ VIR_EXPORT_VAR virConnectAuthPtr virConnectAuthPtrDefault;
* This macro provides the length of the buffer required
* for virDomainGetUUID()
*
* Since: v0.2.0
* Since: 0.2.0
*/
# define VIR_UUID_BUFLEN (16)
@@ -707,7 +720,7 @@ VIR_EXPORT_VAR virConnectAuthPtr virConnectAuthPtrDefault;
* This macro provides the length of the buffer required
* for virDomainGetUUIDString()
*
* Since: v0.2.0
* Since: 0.2.0
*/
# define VIR_UUID_STRING_BUFLEN (36+1)
@@ -734,7 +747,7 @@ int virConnectClose (virConnectPtr conn);
*
* The operating system user name as VIR_TYPED_PARAM_STRING.
*
* Since: v5.8.0
* Since: 5.8.0
*/
# define VIR_CONNECT_IDENTITY_USER_NAME "user-name"
@@ -743,7 +756,7 @@ int virConnectClose (virConnectPtr conn);
*
* The UNIX user ID as VIR_TYPED_PARAM_ULLONG.
*
* Since: v5.8.0
* Since: 5.8.0
*/
# define VIR_CONNECT_IDENTITY_UNIX_USER_ID "unix-user-id"
@@ -752,7 +765,7 @@ int virConnectClose (virConnectPtr conn);
*
* The operating system group name as VIR_TYPED_PARAM_STRING.
*
* Since: v5.8.0
* Since: 5.8.0
*/
# define VIR_CONNECT_IDENTITY_GROUP_NAME "group-name"
@@ -761,7 +774,7 @@ int virConnectClose (virConnectPtr conn);
*
* The UNIX group ID as VIR_TYPED_PARAM_ULLONG.
*
* Since: v5.8.0
* Since: 5.8.0
*/
# define VIR_CONNECT_IDENTITY_UNIX_GROUP_ID "unix-group-id"
@@ -770,7 +783,7 @@ int virConnectClose (virConnectPtr conn);
*
* The operating system process ID as VIR_TYPED_PARAM_LLONG.
*
* Since: v5.8.0
* Since: 5.8.0
*/
# define VIR_CONNECT_IDENTITY_PROCESS_ID "process-id"
@@ -783,7 +796,7 @@ int virConnectClose (virConnectPtr conn);
* host operating system. On Linux this is usually clock
* ticks (as reported in /proc/$PID/stat field 22).
*
* Since: v5.8.0
* Since: 5.8.0
*/
# define VIR_CONNECT_IDENTITY_PROCESS_TIME "process-time"
@@ -792,7 +805,7 @@ int virConnectClose (virConnectPtr conn);
*
* The SASL authenticated username as VIR_TYPED_PARAM_STRING
*
* Since: v5.8.0
* Since: 5.8.0
*/
# define VIR_CONNECT_IDENTITY_SASL_USER_NAME "sasl-user-name"
@@ -801,7 +814,7 @@ int virConnectClose (virConnectPtr conn);
*
* The TLS x509 certificate distinguished named as VIR_TYPED_PARAM_STRING
*
* Since: v5.8.0
* Since: 5.8.0
*/
# define VIR_CONNECT_IDENTITY_X509_DISTINGUISHED_NAME "x509-distinguished-name"
@@ -810,7 +823,7 @@ int virConnectClose (virConnectPtr conn);
*
* The application's SELinux context as VIR_TYPED_PARAM_STRING.
*
* Since: v5.8.0
* Since: 5.8.0
*/
# define VIR_CONNECT_IDENTITY_SELINUX_CONTEXT "selinux-context"
@@ -841,6 +854,8 @@ int virConnectSetKeepAlive(virConnectPtr conn,
*
* A callback function to be registered, and called when the connection
* is closed.
*
* Since: 0.10.0
*/
typedef void (*virConnectCloseFunc)(virConnectPtr conn,
int reason,
@@ -906,29 +921,29 @@ int virConnectIsAlive(virConnectPtr conn);
/**
* virCPUCompareResult:
*
* Since: v0.7.5
* Since: 0.7.5
*/
typedef enum {
VIR_CPU_COMPARE_ERROR = -1,
VIR_CPU_COMPARE_INCOMPATIBLE = 0,
VIR_CPU_COMPARE_IDENTICAL = 1,
VIR_CPU_COMPARE_SUPERSET = 2,
VIR_CPU_COMPARE_ERROR = -1, /* (Since: 0.7.5) */
VIR_CPU_COMPARE_INCOMPATIBLE = 0, /* (Since: 0.7.5) */
VIR_CPU_COMPARE_IDENTICAL = 1, /* (Since: 0.7.5) */
VIR_CPU_COMPARE_SUPERSET = 2, /* (Since: 0.7.5) */
# ifdef VIR_ENUM_SENTINELS
VIR_CPU_COMPARE_LAST
VIR_CPU_COMPARE_LAST /* (Since: 0.9.10) */
# endif
} virCPUCompareResult;
/**
* virConnectCompareCPUFlags:
*
* Since: v1.2.6
* Since: 1.2.6
*/
typedef enum {
VIR_CONNECT_COMPARE_CPU_FAIL_INCOMPATIBLE = (1 << 0), /* treat incompatible
CPUs as failure */
CPUs as failure (Since: 1.2.6) */
VIR_CONNECT_COMPARE_CPU_VALIDATE_XML = (1 << 1), /* validate the xml
document */
document (Since: 6.9.0) */
} virConnectCompareCPUFlags;
int virConnectCompareCPU(virConnectPtr conn,
@@ -952,11 +967,11 @@ int virConnectGetCPUModelNames(virConnectPtr conn,
*
* Flags when getting XML description of a computed CPU
*
* Since: v1.1.2
* Since: 1.1.2
*/
typedef enum {
VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES = (1 << 0), /* show all features */
VIR_CONNECT_BASELINE_CPU_MIGRATABLE = (1 << 1), /* filter out non-migratable features */
VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES = (1 << 0), /* show all features (Since: 1.1.2) */
VIR_CONNECT_BASELINE_CPU_MIGRATABLE = (1 << 1), /* filter out non-migratable features (Since: 1.2.14) */
} virConnectBaselineCPUFlags;
char *virConnectBaselineCPU(virConnectPtr conn,
@@ -983,14 +998,14 @@ int virNodeGetFreePages(virConnectPtr conn,
/**
* virNodeAllocPagesFlags:
*
* Since: v1.2.9
* Since: 1.2.9
*/
typedef enum {
VIR_NODE_ALLOC_PAGES_ADD = 0, /* Add @pageCounts to the pages pool. This
can be used only to size up the pool. */
can be used only to size up the pool. (Since: 1.2.9) */
VIR_NODE_ALLOC_PAGES_SET = (1 << 0), /* Don't add @pageCounts, instead set
passed number of pages. This can be
used to free allocated pages. */
used to free allocated pages. (Since: 1.2.9) */
} virNodeAllocPagesFlags;
int virNodeAllocPages(virConnectPtr conn,

View File

@@ -32,7 +32,7 @@
*
* a virInterface is a private structure representing a virtual interface.
*
* Since: v0.6.4
* Since: 0.6.4
*/
typedef struct _virInterface virInterface;
@@ -42,7 +42,7 @@ typedef struct _virInterface virInterface;
* a virInterfacePtr is pointer to a virInterface private structure, this is the
* type used to reference a virtual interface in the API.
*
* Since: v0.6.4
* Since: 0.6.4
*/
typedef virInterface *virInterfacePtr;
@@ -62,11 +62,11 @@ int virConnectListDefinedInterfaces (virConnectPtr conn,
*
* Flags used to filter the returned interfaces.
*
* Since: v0.10.2
* Since: 0.10.2
*/
typedef enum {
VIR_CONNECT_LIST_INTERFACES_INACTIVE = 1 << 0,
VIR_CONNECT_LIST_INTERFACES_ACTIVE = 1 << 1,
VIR_CONNECT_LIST_INTERFACES_INACTIVE = 1 << 0, /* (Since: 0.10.2) */
VIR_CONNECT_LIST_INTERFACES_ACTIVE = 1 << 1, /* (Since: 0.10.2) */
} virConnectListAllInterfacesFlags;
int virConnectListAllInterfaces (virConnectPtr conn,
@@ -84,19 +84,19 @@ const char* virInterfaceGetMACString (virInterfacePtr iface);
/**
* virInterfaceXMLFlags:
*
* Since: v0.7.3
* Since: 0.7.3
*/
typedef enum {
VIR_INTERFACE_XML_INACTIVE = 1 << 0 /* dump inactive interface information */
VIR_INTERFACE_XML_INACTIVE = 1 << 0 /* dump inactive interface information (Since: 0.7.3) */
} virInterfaceXMLFlags;
/**
* virInterfaceDefineFlags:
*
* Since: v7.7.0
* Since: 7.7.0
*/
typedef enum {
VIR_INTERFACE_DEFINE_VALIDATE = 1 << 0, /* Validate the XML document against schema */
VIR_INTERFACE_DEFINE_VALIDATE = 1 << 0, /* Validate the XML document against schema (Since: 7.7.0) */
} virInterfaceDefineFlags;
char * virInterfaceGetXMLDesc (virInterfacePtr iface,

View File

@@ -30,10 +30,10 @@
/**
* virNetworkXMLFlags:
*
* Since: v0.9.10
* Since: 0.9.10
*/
typedef enum {
VIR_NETWORK_XML_INACTIVE = (1 << 0), /* dump inactive network information */
VIR_NETWORK_XML_INACTIVE = (1 << 0), /* dump inactive network information (Since: 0.9.10) */
} virNetworkXMLFlags;
/**
@@ -41,7 +41,7 @@ typedef enum {
*
* a virNetwork is a private structure representing a virtual network.
*
* Since: v0.2.0
* Since: 0.2.0
*/
typedef struct _virNetwork virNetwork;
@@ -51,7 +51,7 @@ typedef struct _virNetwork virNetwork;
* a virNetworkPtr is pointer to a virNetwork private structure, this is the
* type used to reference a virtual network in the API.
*
* Since: v0.2.0
* Since: 0.2.0
*/
typedef virNetwork *virNetworkPtr;
@@ -61,7 +61,7 @@ typedef virNetwork *virNetworkPtr;
* a virNetworkPort is a private structure representing a virtual network
* port
*
* Since: v5.5.0
* Since: 5.5.0
*/
typedef struct _virNetworkPort virNetworkPort;
@@ -71,7 +71,7 @@ typedef struct _virNetworkPort virNetworkPort;
* a virNetworkPortPtr is pointer to a virNetworkPort private structure,
* this is the type used to reference a virtual network port in the API.
*
* Since: v5.5.0
* Since: 5.5.0
*/
typedef virNetworkPort *virNetworkPortPtr;
@@ -101,17 +101,17 @@ int virConnectListDefinedNetworks (virConnectPtr conn,
* Flags used to filter the returned networks. Flags in each group
* are exclusive attributes of a network.
*
* Since: v0.10.2
* Since: 0.10.2
*/
typedef enum {
VIR_CONNECT_LIST_NETWORKS_INACTIVE = 1 << 0,
VIR_CONNECT_LIST_NETWORKS_ACTIVE = 1 << 1,
VIR_CONNECT_LIST_NETWORKS_INACTIVE = 1 << 0, /* (Since: 0.10.2) */
VIR_CONNECT_LIST_NETWORKS_ACTIVE = 1 << 1, /* (Since: 0.10.2) */
VIR_CONNECT_LIST_NETWORKS_PERSISTENT = 1 << 2,
VIR_CONNECT_LIST_NETWORKS_TRANSIENT = 1 << 3,
VIR_CONNECT_LIST_NETWORKS_PERSISTENT = 1 << 2, /* (Since: 0.10.2) */
VIR_CONNECT_LIST_NETWORKS_TRANSIENT = 1 << 3, /* (Since: 0.10.2) */
VIR_CONNECT_LIST_NETWORKS_AUTOSTART = 1 << 4,
VIR_CONNECT_LIST_NETWORKS_NO_AUTOSTART = 1 << 5,
VIR_CONNECT_LIST_NETWORKS_AUTOSTART = 1 << 4, /* (Since: 0.10.2) */
VIR_CONNECT_LIST_NETWORKS_NO_AUTOSTART = 1 << 5, /* (Since: 0.10.2) */
} virConnectListAllNetworksFlags;
int virConnectListAllNetworks (virConnectPtr conn,
@@ -130,10 +130,10 @@ virNetworkPtr virNetworkLookupByUUIDString (virConnectPtr conn,
/**
* virNetworkCreateFlags:
*
* Since: v7.8.0
* Since: 7.8.0
*/
typedef enum {
VIR_NETWORK_CREATE_VALIDATE = 1 << 0, /* Validate the XML document against schema */
VIR_NETWORK_CREATE_VALIDATE = 1 << 0, /* Validate the XML document against schema (Since: 7.8.0) */
} virNetworkCreateFlags;
/*
@@ -147,10 +147,10 @@ virNetworkPtr virNetworkCreateXMLFlags(virConnectPtr conn,
/**
* virNetworkDefineFlags:
*
* Since: v7.7.0
* Since: 7.7.0
*/
typedef enum {
VIR_NETWORK_DEFINE_VALIDATE = 1 << 0, /* Validate the XML document against schema */
VIR_NETWORK_DEFINE_VALIDATE = 1 << 0, /* Validate the XML document against schema (Since: 7.7.0) */
} virNetworkDefineFlags;
/*
@@ -173,16 +173,16 @@ int virNetworkUndefine (virNetworkPtr network);
* describes which type of update to perform on a <network>
* definition.
*
* Since: v0.10.2
* Since: 0.10.2
*/
typedef enum {
VIR_NETWORK_UPDATE_COMMAND_NONE = 0, /* (invalid) */
VIR_NETWORK_UPDATE_COMMAND_MODIFY = 1, /* modify an existing element */
VIR_NETWORK_UPDATE_COMMAND_DELETE = 2, /* delete an existing element */
VIR_NETWORK_UPDATE_COMMAND_ADD_LAST = 3, /* add an element at end of list */
VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST = 4, /* add an element at start of list */
VIR_NETWORK_UPDATE_COMMAND_NONE = 0, /* invalid (Since: 0.10.2) */
VIR_NETWORK_UPDATE_COMMAND_MODIFY = 1, /* modify an existing element (Since: 0.10.2) */
VIR_NETWORK_UPDATE_COMMAND_DELETE = 2, /* delete an existing element (Since: 0.10.2) */
VIR_NETWORK_UPDATE_COMMAND_ADD_LAST = 3, /* add an element at end of list (Since: 0.10.2) */
VIR_NETWORK_UPDATE_COMMAND_ADD_FIRST = 4, /* add an element at start of list (Since: 0.10.2) */
# ifdef VIR_ENUM_SENTINELS
VIR_NETWORK_UPDATE_COMMAND_LAST
VIR_NETWORK_UPDATE_COMMAND_LAST /* (Since: 0.10.2) */
# endif
} virNetworkUpdateCommand;
@@ -192,24 +192,24 @@ typedef enum {
* describes which section of a <network> definition the provided
* xml should be applied to.
*
* Since: v0.10.2
* Since: 0.10.2
*/
typedef enum {
VIR_NETWORK_SECTION_NONE = 0, /* (invalid) */
VIR_NETWORK_SECTION_BRIDGE = 1, /* <bridge> */
VIR_NETWORK_SECTION_DOMAIN = 2, /* <domain> */
VIR_NETWORK_SECTION_IP = 3, /* <ip> */
VIR_NETWORK_SECTION_IP_DHCP_HOST = 4, /* <ip>/<dhcp>/<host> */
VIR_NETWORK_SECTION_IP_DHCP_RANGE = 5, /* <ip>/<dhcp>/<range> */
VIR_NETWORK_SECTION_FORWARD = 6, /* <forward> */
VIR_NETWORK_SECTION_FORWARD_INTERFACE = 7, /* <forward>/<interface> */
VIR_NETWORK_SECTION_FORWARD_PF = 8, /* <forward>/<pf> */
VIR_NETWORK_SECTION_PORTGROUP = 9, /* <portgroup> */
VIR_NETWORK_SECTION_DNS_HOST = 10, /* <dns>/<host> */
VIR_NETWORK_SECTION_DNS_TXT = 11, /* <dns>/<txt> */
VIR_NETWORK_SECTION_DNS_SRV = 12, /* <dns>/<srv> */
VIR_NETWORK_SECTION_NONE = 0, /* invalid (Since: 0.10.2) */
VIR_NETWORK_SECTION_BRIDGE = 1, /* <bridge> (Since: 0.10.2) */
VIR_NETWORK_SECTION_DOMAIN = 2, /* <domain> (Since: 0.10.2) */
VIR_NETWORK_SECTION_IP = 3, /* <ip> (Since: 0.10.2) */
VIR_NETWORK_SECTION_IP_DHCP_HOST = 4, /* <ip>/<dhcp>/<host> (Since: 0.10.2) */
VIR_NETWORK_SECTION_IP_DHCP_RANGE = 5, /* <ip>/<dhcp>/<range> (Since: 0.10.2) */
VIR_NETWORK_SECTION_FORWARD = 6, /* <forward> (Since: 0.10.2) */
VIR_NETWORK_SECTION_FORWARD_INTERFACE = 7, /* <forward>/<interface> (Since: 0.10.2) */
VIR_NETWORK_SECTION_FORWARD_PF = 8, /* <forward>/<pf> (Since: 0.10.2) */
VIR_NETWORK_SECTION_PORTGROUP = 9, /* <portgroup> (Since: 0.10.2) */
VIR_NETWORK_SECTION_DNS_HOST = 10, /* <dns>/<host> (Since: 0.10.2) */
VIR_NETWORK_SECTION_DNS_TXT = 11, /* <dns>/<txt> (Since: 0.10.2) */
VIR_NETWORK_SECTION_DNS_SRV = 12, /* <dns>/<srv> (Since: 0.10.2) */
# ifdef VIR_ENUM_SENTINELS
VIR_NETWORK_SECTION_LAST
VIR_NETWORK_SECTION_LAST /* (Since: 0.10.2) */
# endif
} virNetworkUpdateSection;
@@ -218,13 +218,13 @@ typedef enum {
*
* Flags to control options for virNetworkUpdate()
*
* Since: v0.10.2
* Since: 0.10.2
*/
typedef enum {
VIR_NETWORK_UPDATE_AFFECT_CURRENT = 0, /* affect live if network is active,
config if it's not active */
VIR_NETWORK_UPDATE_AFFECT_LIVE = 1 << 0, /* affect live state of network only */
VIR_NETWORK_UPDATE_AFFECT_CONFIG = 1 << 1, /* affect persistent config only */
config if it's not active (Since: 0.10.2) */
VIR_NETWORK_UPDATE_AFFECT_LIVE = 1 << 0, /* affect live state of network only (Since: 0.10.2) */
VIR_NETWORK_UPDATE_AFFECT_CONFIG = 1 << 1, /* affect persistent config only (Since: 0.10.2) */
} virNetworkUpdateFlags;
/*
@@ -274,16 +274,16 @@ int virNetworkIsPersistent(virNetworkPtr net);
*
* a virNetworkEventLifecycleType is emitted during network lifecycle events
*
* Since: v1.2.1
* Since: 1.2.1
*/
typedef enum {
VIR_NETWORK_EVENT_DEFINED = 0,
VIR_NETWORK_EVENT_UNDEFINED = 1,
VIR_NETWORK_EVENT_STARTED = 2,
VIR_NETWORK_EVENT_STOPPED = 3,
VIR_NETWORK_EVENT_DEFINED = 0, /* (Since: 1.2.1) */
VIR_NETWORK_EVENT_UNDEFINED = 1, /* (Since: 1.2.1) */
VIR_NETWORK_EVENT_STARTED = 2, /* (Since: 1.2.1) */
VIR_NETWORK_EVENT_STOPPED = 3, /* (Since: 1.2.1) */
# ifdef VIR_ENUM_SENTINELS
VIR_NETWORK_EVENT_LAST
VIR_NETWORK_EVENT_LAST /* (Since: 1.2.1) */
# endif
} virNetworkEventLifecycleType;
@@ -300,6 +300,8 @@ typedef enum {
*
* The callback signature to use when registering for an event of type
* VIR_NETWORK_EVENT_ID_LIFECYCLE with virConnectNetworkEventRegisterAny()
*
* Since: 1.2.1
*/
typedef void (*virConnectNetworkEventLifecycleCallback)(virConnectPtr conn,
virNetworkPtr net,
@@ -313,7 +315,7 @@ typedef void (*virConnectNetworkEventLifecycleCallback)(virConnectPtr conn,
* Used to cast the event specific callback into the generic one
* for use for virConnectNetworkEventRegisterAny()
*
* Since: v1.2.1
* Since: 1.2.1
*/
# define VIR_NETWORK_EVENT_CALLBACK(cb) ((virConnectNetworkEventGenericCallback)(cb))
@@ -324,10 +326,10 @@ typedef void (*virConnectNetworkEventLifecycleCallback)(virConnectPtr conn,
* virConnectNetworkEventRegisterAny(). Each event id determines which
* signature of callback function will be used.
*
* Since: v1.2.1
* Since: 1.2.1
*/
typedef enum {
VIR_NETWORK_EVENT_ID_LIFECYCLE = 0, /* virConnectNetworkEventLifecycleCallback */
VIR_NETWORK_EVENT_ID_LIFECYCLE = 0, /* virConnectNetworkEventLifecycleCallback (Since: 1.2.1) */
# ifdef VIR_ENUM_SENTINELS
VIR_NETWORK_EVENT_ID_LAST
@@ -335,6 +337,8 @@ typedef enum {
* NB: this enum value will increase over time as new events are
* added to the libvirt API. It reflects the last event ID supported
* by this version of the libvirt API.
*
* Since: 1.2.1
*/
# endif
} virNetworkEventID;
@@ -342,28 +346,28 @@ typedef enum {
/**
* virIPAddrType:
*
* Since: v1.2.6
* Since: 1.2.6
*/
typedef enum {
VIR_IP_ADDR_TYPE_IPV4,
VIR_IP_ADDR_TYPE_IPV6,
VIR_IP_ADDR_TYPE_IPV4, /* (Since: 1.2.6) */
VIR_IP_ADDR_TYPE_IPV6, /* (Since: 1.2.6) */
# ifdef VIR_ENUM_SENTINELS
VIR_IP_ADDR_TYPE_LAST
VIR_IP_ADDR_TYPE_LAST /* (Since: 1.2.6) */
# endif
} virIPAddrType;
/**
* virNetworkDHCPLease:
*
* Since: v1.2.6
* Since: 1.2.6
*/
typedef struct _virNetworkDHCPLease virNetworkDHCPLease;
/**
* virNetworkDHCPLeasePtr:
*
* Since: v1.2.6
* Since: 1.2.6
*/
typedef virNetworkDHCPLease *virNetworkDHCPLeasePtr;
struct _virNetworkDHCPLease {
@@ -396,6 +400,8 @@ int virNetworkGetDHCPLeases(virNetworkPtr network,
* have a customization with extra parameters, often with @opaque being
* passed in a different parameter position; use VIR_NETWORK_EVENT_CALLBACK()
* when registering an appropriate handler.
*
* Since: 1.2.1
*/
typedef void (*virConnectNetworkEventGenericCallback)(virConnectPtr conn,
virNetworkPtr net,
@@ -424,11 +430,11 @@ virNetworkPortLookupByUUIDString(virNetworkPtr net,
/**
* virNetworkPortCreateFlags:
*
* Since: v5.5.0
* Since: 5.5.0
*/
typedef enum {
VIR_NETWORK_PORT_CREATE_RECLAIM = (1 << 0), /* reclaim existing used resources */
VIR_NETWORK_PORT_CREATE_VALIDATE = (1 << 1), /* Validate the XML document against schema */
VIR_NETWORK_PORT_CREATE_RECLAIM = (1 << 0), /* reclaim existing used resources (Since: 5.5.0) */
VIR_NETWORK_PORT_CREATE_VALIDATE = (1 << 1), /* Validate the XML document against schema (Since: 7.8.0) */
} virNetworkPortCreateFlags;
virNetworkPortPtr
@@ -457,7 +463,7 @@ virNetworkPortGetUUIDString(virNetworkPortPtr port,
*
* Macro represents the inbound average of NIC bandwidth, as a uint.
*
* Since: v5.5.0
* Since: 5.5.0
*/
# define VIR_NETWORK_PORT_BANDWIDTH_IN_AVERAGE "inbound.average"
@@ -466,7 +472,7 @@ virNetworkPortGetUUIDString(virNetworkPortPtr port,
*
* Macro represents the inbound peak of NIC bandwidth, as a uint.
*
* Since: v5.5.0
* Since: 5.5.0
*/
# define VIR_NETWORK_PORT_BANDWIDTH_IN_PEAK "inbound.peak"
@@ -475,7 +481,7 @@ virNetworkPortGetUUIDString(virNetworkPortPtr port,
*
* Macro represents the inbound burst of NIC bandwidth, as a uint.
*
* Since: v5.5.0
* Since: 5.5.0
*/
# define VIR_NETWORK_PORT_BANDWIDTH_IN_BURST "inbound.burst"
@@ -484,7 +490,7 @@ virNetworkPortGetUUIDString(virNetworkPortPtr port,
*
* Macro represents the inbound floor of NIC bandwidth, as a uint.
*
* Since: v5.5.0
* Since: 5.5.0
*/
# define VIR_NETWORK_PORT_BANDWIDTH_IN_FLOOR "inbound.floor"
@@ -493,7 +499,7 @@ virNetworkPortGetUUIDString(virNetworkPortPtr port,
*
* Macro represents the outbound average of NIC bandwidth, as a uint.
*
* Since: v5.5.0
* Since: 5.5.0
*/
# define VIR_NETWORK_PORT_BANDWIDTH_OUT_AVERAGE "outbound.average"
@@ -502,7 +508,7 @@ virNetworkPortGetUUIDString(virNetworkPortPtr port,
*
* Macro represents the outbound peak of NIC bandwidth, as a uint.
*
* Since: v5.5.0
* Since: 5.5.0
*/
# define VIR_NETWORK_PORT_BANDWIDTH_OUT_PEAK "outbound.peak"
@@ -511,7 +517,7 @@ virNetworkPortGetUUIDString(virNetworkPortPtr port,
*
* Macro represents the outbound burst of NIC bandwidth, as a uint.
*
* Since: v5.5.0
* Since: 5.5.0
*/
# define VIR_NETWORK_PORT_BANDWIDTH_OUT_BURST "outbound.burst"

View File

@@ -33,7 +33,7 @@
*
* A virNodeDevice contains a node (host) device details.
*
* Since: v0.5.0
* Since: 0.5.0
*/
typedef struct _virNodeDevice virNodeDevice;
@@ -45,7 +45,7 @@ typedef struct _virNodeDevice virNodeDevice;
* to call virNodeDeviceFree when done using a virNodeDevicePtr obtained
* from any of the above functions to avoid leaking memory.
*
* Since: v0.5.0
* Since: 0.5.0
*/
typedef virNodeDevice *virNodeDevicePtr;
@@ -65,34 +65,34 @@ int virNodeListDevices (virConnectPtr conn,
* Flags used to filter either by capability or active state, the
* returned node devices.
*
* Since: v0.10.2
* Since: 0.10.2
*/
typedef enum {
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM = 1 << 0, /* System capability */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV = 1 << 1, /* PCI device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV = 1 << 2, /* USB device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE = 1 << 3, /* USB interface */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET = 1 << 4, /* Network device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST = 1 << 5, /* SCSI Host Bus Adapter */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET = 1 << 6, /* SCSI Target */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI = 1 << 7, /* SCSI device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE = 1 << 8, /* Storage device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST = 1 << 9, /* FC Host Bus Adapter */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS = 1 << 10, /* Capable of vport */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC = 1 << 11, /* Capable of scsi_generic */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM = 1 << 12, /* DRM device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES = 1 << 13, /* Capable of mediated devices */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV = 1 << 14, /* Mediated device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV = 1 << 15, /* CCW device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV = 1 << 16, /* CSS device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA = 1 << 17, /* vDPA device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD = 1 << 18, /* s390 AP Card device */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE = 1 << 19, /* s390 AP Queue */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX = 1 << 20, /* s390 AP Matrix */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPD = 1 << 21, /* Device with VPD */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM = 1 << 0, /* System capability (Since: 0.10.2) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV = 1 << 1, /* PCI device (Since: 0.10.2) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV = 1 << 2, /* USB device (Since: 0.10.2) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE = 1 << 3, /* USB interface (Since: 0.10.2) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET = 1 << 4, /* Network device (Since: 0.10.2) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST = 1 << 5, /* SCSI Host Bus Adapter (Since: 0.10.2) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET = 1 << 6, /* SCSI Target (Since: 0.10.2) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI = 1 << 7, /* SCSI device (Since: 0.10.2) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE = 1 << 8, /* Storage device (Since: 0.10.2) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST = 1 << 9, /* FC Host Bus Adapter (Since: 1.0.4) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS = 1 << 10, /* Capable of vport (Since: 1.0.4) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC = 1 << 11, /* Capable of scsi_generic (Since: 1.1.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_DRM = 1 << 12, /* DRM device (Since: 3.1.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV_TYPES = 1 << 13, /* Capable of mediated devices (Since: 3.4.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_MDEV = 1 << 14, /* Mediated device (Since: 3.4.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_CCW_DEV = 1 << 15, /* CCW device (Since: 3.4.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_CSS_DEV = 1 << 16, /* CSS device (Since: 6.8.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_VDPA = 1 << 17, /* vDPA device (Since: 6.9.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_CARD = 1 << 18, /* s390 AP Card device (Since: 7.0.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_QUEUE = 1 << 19, /* s390 AP Queue (Since: 7.0.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_AP_MATRIX = 1 << 20, /* s390 AP Matrix (Since: 7.0.0) */
VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPD = 1 << 21, /* Device with VPD (Since: 7.9.0) */
VIR_CONNECT_LIST_NODE_DEVICES_INACTIVE = 1 << 30, /* Inactive devices */
VIR_CONNECT_LIST_NODE_DEVICES_ACTIVE = 1U << 31, /* Active devices */
VIR_CONNECT_LIST_NODE_DEVICES_INACTIVE = 1 << 30, /* Inactive devices (Since: 7.3.0) */
VIR_CONNECT_LIST_NODE_DEVICES_ACTIVE = 1U << 31, /* Active devices (Since: 7.3.0) */
} virConnectListAllNodeDeviceFlags;
int virConnectListAllNodeDevices (virConnectPtr conn,
@@ -162,7 +162,7 @@ int virNodeDeviceIsActive(virNodeDevicePtr dev);
* Used to cast the event specific callback into the generic one
* for use for virConnectNodeDeviceEventRegisterAny()
*
* Since: v2.2.0
* Since: 2.2.0
*/
# define VIR_NODE_DEVICE_EVENT_CALLBACK(cb)((virConnectNodeDeviceEventGenericCallback)(cb))
@@ -173,11 +173,11 @@ int virNodeDeviceIsActive(virNodeDevicePtr dev);
* virConnectNodeDeviceEventRegisterAny(). Each event id determines which
* signature of callback function will be used.
*
* Since: v2.2.0
* Since: 2.2.0
*/
typedef enum {
VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE = 0, /* virConnectNodeDeviceEventLifecycleCallback */
VIR_NODE_DEVICE_EVENT_ID_UPDATE = 1, /* virConnectNodeDeviceEventGenericCallback */
VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE = 0, /* virConnectNodeDeviceEventLifecycleCallback (Since: 2.2.0) */
VIR_NODE_DEVICE_EVENT_ID_UPDATE = 1, /* virConnectNodeDeviceEventGenericCallback (Since: 2.2.0) */
# ifdef VIR_ENUM_SENTINELS
VIR_NODE_DEVICE_EVENT_ID_LAST
@@ -185,6 +185,8 @@ typedef enum {
* NB: this enum value will increase over time as new events are
* added to the libvirt API. It reflects the last event ID supported
* by this version of the libvirt API.
*
* Since: 2.2.0
*/
# endif
} virNodeDeviceEventID;
@@ -200,6 +202,8 @@ typedef enum {
* have a customization with extra parameters, often with @opaque being
* passed in a different parameter position; use
* VIR_NODE_DEVICE_EVENT_CALLBACK() when registering an appropriate handler.
*
* Since: 2.2.0
*/
typedef void (*virConnectNodeDeviceEventGenericCallback)(virConnectPtr conn,
virNodeDevicePtr dev,
@@ -222,16 +226,16 @@ int virConnectNodeDeviceEventDeregisterAny(virConnectPtr conn,
* a virNodeDeviceEventLifecycleType is emitted during node device
* lifecycle events
*
* Since: v2.2.0
* Since: 2.2.0
*/
typedef enum {
VIR_NODE_DEVICE_EVENT_CREATED = 0,
VIR_NODE_DEVICE_EVENT_DELETED = 1,
VIR_NODE_DEVICE_EVENT_DEFINED = 2,
VIR_NODE_DEVICE_EVENT_UNDEFINED = 3,
VIR_NODE_DEVICE_EVENT_CREATED = 0, /* (Since: 2.2.0) */
VIR_NODE_DEVICE_EVENT_DELETED = 1, /* (Since: 2.2.0) */
VIR_NODE_DEVICE_EVENT_DEFINED = 2, /* (Since: 7.3.0) */
VIR_NODE_DEVICE_EVENT_UNDEFINED = 3, /* (Since: 7.3.0) */
# ifdef VIR_ENUM_SENTINELS
VIR_NODE_DEVICE_EVENT_LAST
VIR_NODE_DEVICE_EVENT_LAST /* (Since: 2.2.0) */
# endif
} virNodeDeviceEventLifecycleType;
@@ -249,6 +253,8 @@ typedef enum {
* The callback signature to use when registering for an event of type
* VIR_NODE_DEVICE_EVENT_ID_LIFECYCLE with
* virConnectNodeDeviceEventRegisterAny()
*
* Since: 2.2.0
*/
typedef void (*virConnectNodeDeviceEventLifecycleCallback)(virConnectPtr conn,
virNodeDevicePtr dev,

View File

@@ -32,7 +32,7 @@
*
* a virNWFilter is a private structure representing a network filter
*
* Since: v0.8.0
* Since: 0.8.0
*/
typedef struct _virNWFilter virNWFilter;
@@ -42,7 +42,7 @@ typedef struct _virNWFilter virNWFilter;
* a virNWFilterPtr is pointer to a virNWFilter private structure,
* this is the type used to reference a network filter in the API.
*
* Since: v0.8.0
* Since: 0.8.0
*/
typedef virNWFilter *virNWFilterPtr;
@@ -52,7 +52,7 @@ typedef virNWFilter *virNWFilterPtr;
* a virNWFilterBinding is a private structure representing a network
* filter binding to a port
*
* Since: v4.5.0
* Since: 4.5.0
*/
typedef struct _virNWFilterBinding virNWFilterBinding;
@@ -63,7 +63,7 @@ typedef struct _virNWFilterBinding virNWFilterBinding;
* structure, this is the type used to reference a network filter
* port binding in the API.
*
* Since: v4.5.0
* Since: 4.5.0
*/
typedef virNWFilterBinding *virNWFilterBindingPtr;
@@ -90,10 +90,10 @@ virNWFilterPtr virNWFilterLookupByUUIDString (virConnectPtr conn,
/**
* virNWFilterDefineFlags:
*
* Since: v7.7.0
* Since: 7.7.0
*/
typedef enum {
VIR_NWFILTER_DEFINE_VALIDATE = 1 << 0, /* Validate the XML document against schema */
VIR_NWFILTER_DEFINE_VALIDATE = 1 << 0, /* Validate the XML document against schema (Since: 7.7.0) */
} virNWFilterDefineFlags;
/*
@@ -123,10 +123,10 @@ int virNWFilterFree (virNWFilterPtr nwfilter);
/**
* virNWFilterBindingCreateFlags:
*
* Since: v7.8.0
* Since: 7.8.0
*/
typedef enum {
VIR_NWFILTER_BINDING_CREATE_VALIDATE = 1 << 0, /* Validate the XML document against schema */
VIR_NWFILTER_BINDING_CREATE_VALIDATE = 1 << 0, /* Validate the XML document against schema (Since: 7.8.0) */
} virNWFilterBindingCreateFlags;
const char* virNWFilterGetName (virNWFilterPtr nwfilter);

View File

@@ -33,11 +33,11 @@ extern "C" {
/**
* virDomainQemuMonitorCommandFlags:
*
* Since: v0.8.8
* Since: 0.8.8
*/
typedef enum {
VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT = 0, /* (Since: v0.8.8) */
VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP = (1 << 0), /* cmd is in HMP (Since: v0.8.8) */
VIR_DOMAIN_QEMU_MONITOR_COMMAND_DEFAULT = 0, /* (Since: 0.8.8) */
VIR_DOMAIN_QEMU_MONITOR_COMMAND_HMP = (1 << 0), /* cmd is in HMP (Since: 0.8.8) */
} virDomainQemuMonitorCommandFlags;
int virDomainQemuMonitorCommand(virDomainPtr domain, const char *cmd,
@@ -58,14 +58,14 @@ virDomainPtr virDomainQemuAttach(virConnectPtr domain,
/**
* virDomainQemuAgentCommandTimeoutValues:
*
* Since: v0.10.0
* Since: 0.10.0
*/
typedef enum {
VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK, /* (Since: v0.10.0) */
VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK, /* (Since: v0.10.0) */
VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT, /* (Since: v0.10.0) */
VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT, /* (Since: v0.10.0) */
VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN = 60, /* (Since: v1.2.15) */
VIR_DOMAIN_QEMU_AGENT_COMMAND_MIN = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK, /* (Since: 0.10.0) */
VIR_DOMAIN_QEMU_AGENT_COMMAND_BLOCK = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_BLOCK, /* (Since: 0.10.0) */
VIR_DOMAIN_QEMU_AGENT_COMMAND_DEFAULT = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_DEFAULT, /* (Since: 0.10.0) */
VIR_DOMAIN_QEMU_AGENT_COMMAND_NOWAIT = VIR_DOMAIN_AGENT_RESPONSE_TIMEOUT_NOWAIT, /* (Since: 0.10.0) */
VIR_DOMAIN_QEMU_AGENT_COMMAND_SHUTDOWN = 60, /* (Since: 1.2.15) */
} virDomainQemuAgentCommandTimeoutValues;
char *virDomainQemuAgentCommand(virDomainPtr domain, const char *cmd,
@@ -85,7 +85,7 @@ char *virDomainQemuAgentCommand(virDomainPtr domain, const char *cmd,
* The callback signature to use when registering for a qemu monitor
* event with virConnectDomainQemuMonitorEventRegister().
*
* Since: v1.2.3
* Since: 1.2.3
*/
typedef void (*virConnectDomainQemuMonitorEventCallback)(virConnectPtr conn,
virDomainPtr dom,
@@ -99,13 +99,13 @@ typedef void (*virConnectDomainQemuMonitorEventCallback)(virConnectPtr conn,
/**
* virConnectDomainQemuMonitorEventRegisterFlags:
*
* Since: v1.2.3
* Since: 1.2.3
*/
typedef enum {
/* Event filter is a regex rather than a literal string (Since: v1.2.3) */
/* Event filter is a regex rather than a literal string (Since: 1.2.3) */
VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_REGEX = (1 << 0),
/* Event filter is case insensitive (Since: v1.2.3) */
/* Event filter is case insensitive (Since: 1.2.3) */
VIR_CONNECT_DOMAIN_QEMU_MONITOR_EVENT_REGISTER_NOCASE = (1 << 1),
} virConnectDomainQemuMonitorEventRegisterFlags;

View File

@@ -34,29 +34,29 @@
* A virSecret stores a secret value (e.g. a passphrase or encryption key)
* and associated metadata.
*
* Since: v0.7.1
* Since: 0.7.1
*/
typedef struct _virSecret virSecret;
/**
* virSecretPtr:
*
* Since: v0.7.1
* Since: 0.7.1
*/
typedef virSecret *virSecretPtr;
/**
* virSecretUsageType:
*
* Since: v0.7.1
* Since: 0.7.1
*/
typedef enum {
VIR_SECRET_USAGE_TYPE_NONE = 0,
VIR_SECRET_USAGE_TYPE_VOLUME = 1,
VIR_SECRET_USAGE_TYPE_CEPH = 2,
VIR_SECRET_USAGE_TYPE_ISCSI = 3,
VIR_SECRET_USAGE_TYPE_TLS = 4,
VIR_SECRET_USAGE_TYPE_VTPM = 5,
VIR_SECRET_USAGE_TYPE_NONE = 0, /* (Since: 0.7.1) */
VIR_SECRET_USAGE_TYPE_VOLUME = 1, /* (Since: 0.7.1) */
VIR_SECRET_USAGE_TYPE_CEPH = 2, /* (Since: 0.9.7) */
VIR_SECRET_USAGE_TYPE_ISCSI = 3, /* (Since: 1.0.4) */
VIR_SECRET_USAGE_TYPE_TLS = 4, /* (Since: 2.3.0) */
VIR_SECRET_USAGE_TYPE_VTPM = 5, /* (Since: 5.6.0) */
# ifdef VIR_ENUM_SENTINELS
VIR_SECRET_USAGE_TYPE_LAST
@@ -64,6 +64,8 @@ typedef enum {
* NB: this enum value will increase over time as new usage types are
* added to the libvirt API. It reflects the last usage type supported
* by this version of the libvirt API.
*
* Since: 0.9.7
*/
# endif
} virSecretUsageType;
@@ -80,17 +82,17 @@ int virConnectListSecrets (virConnectPtr conn,
* Flags used to filter the returned secrets. Flags in each group
* are exclusive attributes of a secret.
*
* Since: v0.10.2
* Since: 0.10.2
*/
typedef enum {
VIR_CONNECT_LIST_SECRETS_EPHEMERAL = 1 << 0, /* kept in memory, never
stored persistently */
VIR_CONNECT_LIST_SECRETS_NO_EPHEMERAL = 1 << 1,
stored persistently (Since: 0.10.2) */
VIR_CONNECT_LIST_SECRETS_NO_EPHEMERAL = 1 << 1, /* (Since: 0.10.2) */
VIR_CONNECT_LIST_SECRETS_PRIVATE = 1 << 2, /* not revealed to any caller
of libvirt, nor to any other
node */
VIR_CONNECT_LIST_SECRETS_NO_PRIVATE = 1 << 3,
node (Since: 0.10.2) */
VIR_CONNECT_LIST_SECRETS_NO_PRIVATE = 1 << 3, /* (Since: 0.10.2) */
} virConnectListAllSecretsFlags;
int virConnectListAllSecrets(virConnectPtr conn,
@@ -106,10 +108,10 @@ virSecretPtr virSecretLookupByUsage(virConnectPtr conn,
/**
* virSecretDefineFlags:
*
* Since: v7.7.0
* Since: 7.7.0
*/
typedef enum {
VIR_SECRET_DEFINE_VALIDATE = 1 << 0, /* Validate the XML document against schema */
VIR_SECRET_DEFINE_VALIDATE = 1 << 0, /* Validate the XML document against schema (Since: 7.7.0) */
} virSecretDefineFlags;
virSecretPtr virSecretDefineXML (virConnectPtr conn,
@@ -140,7 +142,7 @@ int virSecretFree (virSecretPtr secret);
* Used to cast the event specific callback into the generic one
* for use for virConnectSecretEventRegisterAny()
*
* Since: v3.0.0
* Since: 3.0.0
*/
# define VIR_SECRET_EVENT_CALLBACK(cb)((virConnectSecretEventGenericCallback)(cb))
@@ -151,11 +153,11 @@ int virSecretFree (virSecretPtr secret);
* virConnectSecretEventRegisterAny(). Each event id determines which
* signature of callback function will be used.
*
* Since: v3.0.0
* Since: 3.0.0
*/
typedef enum {
VIR_SECRET_EVENT_ID_LIFECYCLE = 0, /* virConnectSecretEventLifecycleCallback */
VIR_SECRET_EVENT_ID_VALUE_CHANGED = 1, /* virConnectSecretEventGenericCallback */
VIR_SECRET_EVENT_ID_LIFECYCLE = 0, /* virConnectSecretEventLifecycleCallback (Since: 3.0.0) */
VIR_SECRET_EVENT_ID_VALUE_CHANGED = 1, /* virConnectSecretEventGenericCallback (Since: 3.0.0) */
# ifdef VIR_ENUM_SENTINELS
VIR_SECRET_EVENT_ID_LAST
@@ -163,6 +165,8 @@ typedef enum {
* NB: this enum value will increase over time as new events are
* added to the libvirt API. It reflects the last event ID supported
* by this version of the libvirt API.
*
* Since: 3.0.0
*/
# endif
} virSecretEventID;
@@ -178,6 +182,8 @@ typedef enum {
* have a customization with extra parameters, often with @opaque being
* passed in a different parameter position; use
* VIR_SECRET_EVENT_CALLBACK() when registering an appropriate handler.
*
* Since: 3.0.0
*/
typedef void (*virConnectSecretEventGenericCallback)(virConnectPtr conn,
virSecretPtr secret,
@@ -200,14 +206,14 @@ int virConnectSecretEventDeregisterAny(virConnectPtr conn,
* a virSecretEventLifecycleType is emitted during secret
* lifecycle events
*
* Since: v3.0.0
* Since: 3.0.0
*/
typedef enum {
VIR_SECRET_EVENT_DEFINED = 0,
VIR_SECRET_EVENT_UNDEFINED = 1,
VIR_SECRET_EVENT_DEFINED = 0, /* (Since: 3.0.0) */
VIR_SECRET_EVENT_UNDEFINED = 1, /* (Since: 3.0.0) */
# ifdef VIR_ENUM_SENTINELS
VIR_SECRET_EVENT_LAST
VIR_SECRET_EVENT_LAST /* (Since: 3.0.0) */
# endif
} virSecretEventLifecycleType;
@@ -225,6 +231,8 @@ typedef enum {
* The callback signature to use when registering for an event of type
* VIR_SECRET_EVENT_ID_LIFECYCLE with
* virConnectSecretEventRegisterAny()
*
* Since: 3.0.0
*/
typedef void (*virConnectSecretEventLifecycleCallback)(virConnectPtr conn,
virSecretPtr secret,

Some files were not shown because too many files have changed in this diff Show More