]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
3 years agovirInterfaceDefParseXML: Simplify and cleanup
Tim Wiederhake [Wed, 12 Jan 2022 12:41:25 +0000 (13:41 +0100)]
virInterfaceDefParseXML: Simplify and cleanup

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirInterfaceDefParseIfAdressing: Simplify and cleanup
Tim Wiederhake [Wed, 12 Jan 2022 12:40:00 +0000 (13:40 +0100)]
virInterfaceDefParseIfAdressing: Simplify and cleanup

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirInterfaceDefParseProtoIPv6: Simplify and cleanup
Tim Wiederhake [Wed, 12 Jan 2022 12:39:08 +0000 (13:39 +0100)]
virInterfaceDefParseProtoIPv6: Simplify and cleanup

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirInterfaceDefParseProtoIPv4: Simplify and cleanup
Tim Wiederhake [Wed, 12 Jan 2022 12:38:50 +0000 (13:38 +0100)]
virInterfaceDefParseProtoIPv4: Simplify and cleanup

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirInterfaceDefParseDhcp: Simplify and cleanup
Tim Wiederhake [Wed, 12 Jan 2022 12:07:51 +0000 (13:07 +0100)]
virInterfaceDefParseDhcp: Simplify and cleanup

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirInterfaceDefParseIP: Simplify and cleanup
Tim Wiederhake [Wed, 12 Jan 2022 11:49:38 +0000 (12:49 +0100)]
virInterfaceDefParseIP: Simplify and cleanup

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirInterfaceDefParseXML: Inline trivial virInterfaceDefParseName
Tim Wiederhake [Wed, 12 Jan 2022 11:28:49 +0000 (12:28 +0100)]
virInterfaceDefParseXML: Inline trivial virInterfaceDefParseName

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: interface: Remove ret and goto
Tim Wiederhake [Tue, 11 Jan 2022 16:41:56 +0000 (17:41 +0100)]
conf: interface: Remove ret and goto

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: interface: Use g_auto
Tim Wiederhake [Tue, 11 Jan 2022 16:29:22 +0000 (17:29 +0100)]
conf: interface: Use g_auto

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: interface: Preparation for g_auto
Tim Wiederhake [Tue, 11 Jan 2022 16:54:56 +0000 (17:54 +0100)]
conf: interface: Preparation for g_auto

These changes make the g_auto-ification in the next commit clearer.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirInterfaceDefDevFormat: Add missing error handling
Tim Wiederhake [Wed, 12 Jan 2022 11:17:39 +0000 (12:17 +0100)]
virInterfaceDefDevFormat: Add missing error handling

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoPost-release version bump to 8.1.0
Jiri Denemark [Fri, 14 Jan 2022 14:17:26 +0000 (15:17 +0100)]
Post-release version bump to 8.1.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoRelease of libvirt-8.0.0
Jiri Denemark [Fri, 14 Jan 2022 14:03:30 +0000 (15:03 +0100)]
Release of libvirt-8.0.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 13 Jan 2022 21:16:32 +0000 (22:16 +0100)]
Translated using Weblate (Swedish)

Currently translated at 30.3% (3175 of 10455 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>
3 years agovirt-ssh-helper: Move manual page to section 8
Andrea Bolognani [Thu, 13 Jan 2022 13:42:21 +0000 (14:42 +0100)]
virt-ssh-helper: Move manual page to section 8

While sections are somewhat loosely defined and thus the choice
is not quite a clear-cut one, section 8 might be a slightly
better fit in this case.

Suggested-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoPrint errors on daemon startup if logging setup fails
Martin Kletzander [Thu, 13 Jan 2022 13:41:03 +0000 (14:41 +0100)]
Print errors on daemon startup if logging setup fails

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoNEWS: Mention propagation of sub-cluster allocation on snapshots and block-copy
Peter Krempa [Thu, 13 Jan 2022 12:13:56 +0000 (13:13 +0100)]
NEWS: Mention propagation of sub-cluster allocation on snapshots and block-copy

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoNEWS: Document my contributions for upcoming release
Michal Privoznik [Wed, 12 Jan 2022 14:52:06 +0000 (15:52 +0100)]
NEWS: Document my contributions for upcoming release

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
3 years agodocs: tpm: Clarify omission or removal of active_pcr_banks node
Stefan Berger [Wed, 12 Jan 2022 15:49:52 +0000 (10:49 -0500)]
docs: tpm: Clarify omission or removal of active_pcr_banks node

Add a sentence to the active_pcr_banks node documentation that clarifies
that when the active_pcr_banks node is removed from the XML or when it
is omitted that the set of active PCR banks is not changed anymore.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2039246
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
3 years agodocs: minor fix in launchSecurity
Boris Fiuczynski [Tue, 11 Jan 2022 09:03:32 +0000 (10:03 +0100)]
docs: minor fix in launchSecurity

Correcting XML element.

Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
3 years agoqemuSnapshotRedefine: Fix use of snapshot definition after free
Peter Krempa [Wed, 12 Jan 2022 09:31:59 +0000 (10:31 +0100)]
qemuSnapshotRedefine: Fix use of snapshot definition after free

Commit f4aae9726df factored out the snapshot redefinition code into a
separate function, but didn't account for the fact that the code is
consuming the reference to the snapshot definition and by moving the
code away the caller (qemuSnapshotCreateXML) now frees the definition
which didn't happen before as we cleared the pointer.

Fix it by increasing the reference locally. Later patches will refactor
the code so that it's more obvious what's happening.

Fixes: f4aae9726df
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2039651
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuSnapshotRedefine: Rename 'def' to 'snapdef'
Peter Krempa [Wed, 12 Jan 2022 15:15:19 +0000 (16:15 +0100)]
qemuSnapshotRedefine: Rename 'def' to 'snapdef'

'def' is commonly used to refer to domain definition. Most of the
snapshot code uses 'snapdef' for the snapshot definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuSnapshotCreate: Don't insert snapshot into list with VIR_DOMAIN_SNAPSHOT_CREATE_N...
Peter Krempa [Tue, 11 Jan 2022 09:28:45 +0000 (10:28 +0100)]
qemuSnapshotCreate: Don't insert snapshot into list with VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA

Our approach to snapshots without metadata was to insert them to the
snapshot list and then later remove them from the list when the flag is
present.

This quirky logic was broken in a recent refactor of the snapshot code
causing that the snapshot stayed inserted in the snapshot list.

Recent refactor of the snapshot code didn't faithfully relocate this
logic to the new function.

Rather than attempting to restore the quirky logic of adding and then
removing the object, don't add the snapshot into the list at all when
the user doesn't want metadata.

We achieve this by creating a temporary 'virDomainMomentObj' wrapper
which is not inserted into the list and using that instead of calling
virDomainSnapshotAssignDef.

Fixes: 9bad0fb809b
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2039131
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoconf: moment: Export helpers to create the virDomainMoment wrapper
Peter Krempa [Tue, 11 Jan 2022 09:27:11 +0000 (10:27 +0100)]
conf: moment: Export helpers to create the virDomainMoment wrapper

Export 'virDomainMomentObjNew' and 'virDomainMomentObjFree' and define
the latter as autoptr cleanup function for 'virDomainMomentObj'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agovirdomainmomentobjlist.h: Convert to modern header style
Peter Krempa [Tue, 11 Jan 2022 09:09:12 +0000 (10:09 +0100)]
virdomainmomentobjlist.h: Convert to modern header style

Format the function prototypes the same way as in the .c file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Wed, 12 Jan 2022 10:44:50 +0000 (11:44 +0100)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10455 of 10455 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>
3 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Wed, 12 Jan 2022 10:44:49 +0000 (11:44 +0100)]
Translated using Weblate (Swedish)

Currently translated at 30.2% (3160 of 10455 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>
3 years agoTranslated using Weblate (Korean)
simmon [Wed, 12 Jan 2022 10:44:48 +0000 (11:44 +0100)]
Translated using Weblate (Korean)

Currently translated at 99.5% (10410 of 10455 strings)

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

Co-authored-by: simmon <simmon@nplob.com>
Signed-off-by: simmon <simmon@nplob.com>
3 years agoUpdate translation files
Weblate [Wed, 12 Jan 2022 10:44:46 +0000 (11:44 +0100)]
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>
3 years agoreport error when virProcessGetStatInfo() is unable to parse data
Ani Sinha [Tue, 11 Jan 2022 10:20:43 +0000 (15:50 +0530)]
report error when virProcessGetStatInfo() is unable to parse data

Currently virProcessGetStatInfo() always returns success and only logs error
when it is unable to parse the data. Make this function actually report the
error and return a negative value in this error scenario.

Fix the callers so that they do not override the error generated.
Also fix non-linux implementation of this function so as to report error.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoFix some typos
Tim Wiederhake [Mon, 10 Jan 2022 14:48:54 +0000 (15:48 +0100)]
Fix some typos

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agopo: Refresh potfile for v8.0.0
Jiri Denemark [Mon, 10 Jan 2022 09:47:00 +0000 (10:47 +0100)]
po: Refresh potfile for v8.0.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 10 Jan 2022 08:39:56 +0000 (09:39 +0100)]
Translated using Weblate (Swedish)

Currently translated at 30.1% (3147 of 10439 strings)

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

Translated using Weblate (Swedish)

Currently translated at 29.9% (3129 of 10439 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>
3 years agomeson: Fix yajl workaround
Andrea Bolognani [Sat, 8 Jan 2022 10:36:47 +0000 (11:36 +0100)]
meson: Fix yajl workaround

Meson reports

  WARNING: pkgconfig variable 'cflags' not defined for dependency yajl.

which makes sense, because "cflags" is not one of the variables
reported by

  $ pkg-config --print-variables yajl

and

  $ pkg-config --variable=cflags yajl

doesn't work either.

The breakage was introduced when we switched from calling
pkg-config directly to using get_pkgconfig_variable() in 7.5.0
and, somehow, it went undetected until now.

Use "includedir", which is a proper pkg-config variable,
instead.

Fixes: c32c5ca29aeb63d329e2c1e60e249246c010f2f3
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Tested-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
3 years agoNEWS: Mention device hot-unplug regression with qemu-6.2 and workarounds for it
Peter Krempa [Mon, 3 Jan 2022 15:17:30 +0000 (16:17 +0100)]
NEWS: Mention device hot-unplug regression with qemu-6.2 and workarounds for it

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemu: Revert to using non-JSON commandline for -device
Peter Krempa [Mon, 3 Jan 2022 14:50:49 +0000 (15:50 +0100)]
qemu: Revert to using non-JSON commandline for -device

When -device is configured via JSON a bug [1] is triggered in qemu were
the DEVICE_DELETED event for the removal of the device frontend is no
longer delivered to libvirt. Without the DEVICE_DELETED event we don't
remove the corresponding entries in the VM XML.

Until qemu will be fixed we must stop using the JSON syntax for -device.

This patch removes the detection of the capability. The capability is
used only during startup of a fresh VM so we don't need to consider any
compaitibility steps for existing VMs.

For users who wish to use 'libvirt-7.9' and 'libvirt-7.10' with
'qemu-6.2' there are two possible workarounds:

 - filter out the 'device.json' qemu capability '/etc/libvirt/qemu.conf':

   capability_filters = [ "device.json" ]

 - filter out the 'device.json' qemu capability via qemu namespace XML:

   <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
     [...]
     <qemu:capabilities>
       <qemu:del capability='device.json'/>
     </qemu:capabilities>
   </domain>

We must never again use the same capability name as we are now
instructing users to filter it as a workaround so once qemu is fixed
we'll need to pick a new capability value for it.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2036669

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2035237
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirt-ssh-helper: Add manual page
Andrea Bolognani [Fri, 10 Dec 2021 14:56:29 +0000 (15:56 +0100)]
virt-ssh-helper: Add manual page

We don't usually provide manual pages for internal tools,
but in the case of virt-ssh-helper the command is installed
inside the default $PATH and so it's likely that the user
will stumble upon it by using the shell's completion feature
when invoking another virt-* command, which makes it a good
idea to provide at least a minimal manual page.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agodo not report generic OPERATION_FAILED error when calling virConnectOpenAuth()
Ani Sinha [Thu, 6 Jan 2022 17:07:06 +0000 (22:37 +0530)]
do not report generic OPERATION_FAILED error when calling virConnectOpenAuth()

virConnectOpenAuth() calls virConnectOpenInternal(). This later function
generates fine grained errors arising from various failure conditions that are
more accurate than a "catch all" broader VIR_ERR_OPERATION_FAILED error that
the callers of this function generates. Remove the broader error so that more
specific errors can be caught and processed.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 30 Dec 2021 13:16:29 +0000 (14:16 +0100)]
Translated using Weblate (Swedish)

Currently translated at 29.8% (3111 of 10439 strings)

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

Translated using Weblate (Swedish)

Currently translated at 29.2% (3051 of 10439 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>
3 years agosrc: Don't check for retval of some glib functions
Michal Privoznik [Fri, 7 Jan 2022 07:52:57 +0000 (08:52 +0100)]
src: Don't check for retval of some glib functions

There are a few glib functions that abort on OOM and thus there's
no point in checking their retval against NULL. Nevertheless, we
do have those checks in a few places. Remove them.

Generated using the following spatch:

  @@
  expression x;
  identifier n;
  expression r;
  @@
  (
    x = g_strdup_printf(...);
  | x = g_strdup_vprintf(...);
  | x = g_strdup(...);
  | x = g_strndup(...);
  | x = g_new0(...);
  | x = g_realloc(...);
  )
    ... when != x
  - if(!x)
  (
  -   return r;
  |
  -   goto n;
  )

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agovirprocess: Provide non-Linux stubs for virProcessGet{Stat,Sched}Info
Michal Privoznik [Thu, 6 Jan 2022 19:13:08 +0000 (20:13 +0100)]
virprocess: Provide non-Linux stubs for virProcessGet{Stat,Sched}Info

Both virProcessGetStatInfo() and virProcessGetSchedInfo() are
Linux centric. Provide stubs for non-Linux platforms.

Fixes: d73852c49962fbfe652fc7bec595a3f242faf847
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoutil: Improve log output parsing errors
Martin Kletzander [Wed, 5 Jan 2022 13:05:58 +0000 (14:05 +0100)]
util: Improve log output parsing errors

Suggested-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
3 years agoqemuTestCapsCacheInsert: Rewrite caps cache insertion
Peter Krempa [Wed, 5 Jan 2022 19:53:18 +0000 (20:53 +0100)]
qemuTestCapsCacheInsert: Rewrite caps cache insertion

Until now we did 2 weird things when inserting the qemuCaps used for
individual test cases into the capability cache:

1) we inserted the same caps for all emulators
2) we always (expensively) copied them

Now when real capabilities are used we don't touch them at all just
simply inser them. This allows us one big optimization, by trading a
copy for just a virObjectRef as we can borrow the caps object to the
cache.

For fake caps we still copy them as we insert the fake machine types
into them, but second big optimization is to insert the capabilities
only for the architecture they belong to.

Additionally this commit also ensures that all other entries in the
cache for the binary are poisoned by empty caps so that it's obvious
that the test is doing the right thing.

Apart from this making actually more sense this shaves off more than 40%
of runtime from qemuxml2argvtest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuTestCapsCacheInsert: Extract code for populating fake machine types
Peter Krempa [Tue, 4 Jan 2022 16:11:30 +0000 (17:11 +0100)]
qemuTestCapsCacheInsert: Extract code for populating fake machine types

Separate the code to aid further refactors.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Convert 'missing-machine' to DO_TEST_CAPS_LATEST
Peter Krempa [Wed, 5 Jan 2022 21:46:50 +0000 (22:46 +0100)]
qemuxml2argvtest: Convert 'missing-machine' to DO_TEST_CAPS_LATEST

Emulator binary change is needed to use the latest caps properly. The
comment is no longer needed, the expected error is recorded in the 'err'
file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Enable qemuxml2argv version of 'blkdeviotune' test
Peter Krempa [Wed, 5 Jan 2022 21:38:24 +0000 (22:38 +0100)]
qemuxml2argvtest: Enable qemuxml2argv version of 'blkdeviotune' test

Also ensure that the emulator and architecture are correct for
DO_TEST_CAPS_LATEST.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2(xml|argv)test: Test real state of things with 'x86-kvm-32-on-64'
Peter Krempa [Wed, 5 Jan 2022 21:19:40 +0000 (22:19 +0100)]
qemuxml2(xml|argv)test: Test real state of things with 'x86-kvm-32-on-64'

As demonstrated by the qemuxml2xmltest DO_TEST_CAPS_LATEST data based on
the 'x86-kvm-32-on-64' test case the post parse CPU selection code which
fills in the CPU into the definition does not have exactly the same
logic as we used to have when the cpu model was picked when formatting
the commandline.

Change the qemuxml2argv test to use DO_TEST_CAPS_LATEST too as it
doesn't really make sense to test this on fake data.

In addition to 'latest' versions, this also adds second invocation
locked to qemu-4.1.0 which demonstrates the old behaviour.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Don't insert capabilities into cache twice
Peter Krempa [Tue, 4 Jan 2022 17:21:36 +0000 (18:21 +0100)]
qemuxml2argvtest: Don't insert capabilities into cache twice

Fake capabilities are inserted twice, as in a few tests the architecture
is not present in the XML (testing filling in of the architecture).
Since we already know which architecture will be picked we don't need to
be adding the capabilities twice.

This doesn't impact the tests as they use the same approach to determine
the default arch.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvdata: Use proper arch and emulator for aarch64 real capability tests
Peter Krempa [Tue, 4 Jan 2022 15:36:46 +0000 (16:36 +0100)]
qemuxml2argvdata: Use proper arch and emulator for aarch64 real capability tests

Upcoming patches will modify how we populate the capability cache in
tests to be more sane. This also means that the emulator binary and
architecture used in the test files using real capabilities must match
what the real capabilities have.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvdata: Use proper arch and emulator for x86 real capability tests
Peter Krempa [Tue, 4 Jan 2022 15:36:46 +0000 (16:36 +0100)]
qemuxml2argvdata: Use proper arch and emulator for x86 real capability tests

Upcoming patches will modify how we populate the capability cache in
tests to be more saner. This also means that the emulator binary and
architecture used in the test files using real capabilities must match
what the real capabilities have.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotestutilsqemu: Remove unused fake-caps x86 machine types
Peter Krempa [Wed, 5 Jan 2022 08:21:14 +0000 (09:21 +0100)]
testutilsqemu: Remove unused fake-caps x86 machine types

None of our tests reference 'isapc', and 'pc-i440fx-2.6'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agosecurityselinuxlabeldata: Purge unneeded versioned machine type
Peter Krempa [Thu, 6 Jan 2022 09:03:42 +0000 (10:03 +0100)]
securityselinuxlabeldata: Purge unneeded versioned machine type

Use 'pc' instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuhotplugtestdomains: Remove unnecessary use of versioned pc machine types
Peter Krempa [Wed, 5 Jan 2022 18:34:32 +0000 (19:34 +0100)]
qemuhotplugtestdomains: Remove unnecessary use of versioned pc machine types

The specific machine type is not important for the test. We can use 'pc'
instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemuxml2argvdata: Purge versioned i440fx machine types from fake-caps tests
Peter Krempa [Wed, 5 Jan 2022 10:52:04 +0000 (11:52 +0100)]
tests: qemuxml2argvdata: Purge versioned i440fx machine types from fake-caps tests

Use the 'pc' alias for them as it's equivalent.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2(argv|xml)test: Unify usage of DO_TEST_CAPS_LATEST
Peter Krempa [Wed, 5 Jan 2022 09:23:42 +0000 (10:23 +0100)]
qemuxml2(argv|xml)test: Unify usage of DO_TEST_CAPS_LATEST

The qemuxml2argv invocation of some tests used DO_TEST_CAPS_LATEST while
the qemuxml2xmltest invocation uses fake caps. Unify them on
DO_TEST_CAPS_LATEST.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2(argv|xml)test: Enable 'controller-usb-order' for qemuxml2argv and convert...
Peter Krempa [Wed, 5 Jan 2022 12:01:10 +0000 (13:01 +0100)]
qemuxml2(argv|xml)test: Enable 'controller-usb-order' for qemuxml2argv and convert it to latest caps

Since introduction in fc03eb53c0bf3f654 there wasn't a qemuxml2argv
version. As we are touching the files convert them to
DO_TEST_CAPS_LATEST directly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2xmltest: Replace 'interface-server' by 'net-server' test case
Peter Krempa [Wed, 5 Jan 2022 11:35:40 +0000 (12:35 +0100)]
qemuxml2xmltest: Replace 'interface-server' by 'net-server' test case

According to commit 52222568490 the test case was added to verify that
the '<address>' element is covered by the schema. The test was not
registered for qemuxml2argvtest though. We can use 'net-server' instead
as it has the same type. On the other hand that one was not registered
for qemuxml2xmltest.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemuxml2argvdata: Remove specific q35 machine types from fake-caps tests
Peter Krempa [Wed, 5 Jan 2022 09:19:36 +0000 (10:19 +0100)]
tests: qemuxml2argvdata: Remove specific q35 machine types from fake-caps tests

Use q35 instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotests: qemuxml2argvdata: Remove use of 'pc-1.0' and 'pc-1.2' machine types
Peter Krempa [Wed, 5 Jan 2022 08:28:31 +0000 (09:28 +0100)]
tests: qemuxml2argvdata: Remove use of 'pc-1.0' and 'pc-1.2' machine types

There's nothing special about the tests requiring to use very old
machine types. Most usage is cargo-culted from other tests. Switch all
the tests to use 'pc' instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agotestutilsqemu: Remove unused non-x86 fake machine types
Peter Krempa [Tue, 4 Jan 2022 15:10:31 +0000 (16:10 +0100)]
testutilsqemu: Remove unused non-x86 fake machine types

For tests with fake capabilities we fill in a bunch of machine types
which the tests might use. For now there's a random collection of
machine types which are not actually used. Purge the unused ones for
non-x86 machines.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuxml2argvtest: Remove redundant floppy controller tests
Peter Krempa [Wed, 5 Jan 2022 09:07:41 +0000 (10:07 +0100)]
qemuxml2argvtest: Remove redundant floppy controller tests

The two test cases were added to avoid regressions such as fixed in
17dff3584855e9. Nowadays the code is much simpler and any Q35 machine
will trigger the explicit FDC.

Remove the '2.11' machine type version and turn the '2.9' version into a
generic q35 machine.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuDomainNeedsFDC: Simplify and improve checking if a machine needs FDC
Peter Krempa [Wed, 5 Jan 2022 08:51:22 +0000 (09:51 +0100)]
qemuDomainNeedsFDC: Simplify and improve checking if a machine needs FDC

Commit c7f3a1f7870 turned qemuDomainMachineNeedsFDC() effectively into
qemuDomainIsQ35. Use it instead as it also matches the non-canonicalized
'q35'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agoqemuProcessPrepareQEMUCaps: Don't clear QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE
Peter Krempa [Tue, 4 Jan 2022 14:13:45 +0000 (15:13 +0100)]
qemuProcessPrepareQEMUCaps: Don't clear QEMU_CAPS_CHARDEV_FD_PASS_COMMANDLINE

All the fd-passing setup of chardevs which this hack meant to disable
was moved to the host-preparation phase which is skipped for formatting
of non-real commandlines.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
3 years agochange return type of virURIParamAppend() to void type
Ani Sinha [Thu, 6 Jan 2022 17:07:55 +0000 (22:37 +0530)]
change return type of virURIParamAppend() to void type

virURIParamAppend() unconditionally returns 0. Simplify and make the return type
as void type.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoNEWS: Fix indentation
Andrea Bolognani [Fri, 7 Jan 2022 07:03:28 +0000 (08:03 +0100)]
NEWS: Fix indentation

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
3 years agoch_monitor: Get nicindexes in prep for cgroup mgmt
Vineeth Pillai [Fri, 10 Dec 2021 20:34:41 +0000 (20:34 +0000)]
ch_monitor: Get nicindexes in prep for cgroup mgmt

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoch_driver: domainGetVcpuPinInfo and nodeGetCPUMap
Vineeth Pillai [Fri, 10 Dec 2021 20:34:40 +0000 (20:34 +0000)]
ch_driver: domainGetVcpuPinInfo and nodeGetCPUMap

Add domainGetVcpuPinInfo and nodeGetCPUMap callbacks to ch driver

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoch_driver, ch_domain: vcpu info getter callbacks
Praveen K Paladugu [Fri, 10 Dec 2021 20:34:39 +0000 (20:34 +0000)]
ch_driver, ch_domain: vcpu info getter callbacks

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoch_domain: add methods to manage private vcpu data
Vineeth Pillai [Fri, 10 Dec 2021 20:34:38 +0000 (20:34 +0000)]
ch_domain: add methods to manage private vcpu data

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoch_domain: add virCHDomainGetMonitor helper method
Vineeth Pillai [Fri, 10 Dec 2021 20:34:37 +0000 (20:34 +0000)]
ch_domain: add virCHDomainGetMonitor helper method

Signed-off-by: Vineeth Pillai <viremana@linux.microsoft.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoutil: Helper functions to get process info
Praveen K Paladugu [Fri, 10 Dec 2021 20:34:36 +0000 (20:34 +0000)]
util: Helper functions to get process info

Move qemuGetProcessInfo and qemuGetSchedInfo methods to util and share them
with ch driver.

Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
3 years agoAdd VM info to improve error log message for qemu monitor
Rohit Kumar [Tue, 4 Jan 2022 12:43:11 +0000 (04:43 -0800)]
Add VM info to improve error log message for qemu monitor

This change adds the domain name in the error and debug logs during
monitor IO processing so that we may infer which VM experienced
errors such as IO or socket hangup. This may help in debugging
monitor IO errors.

Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: agent: remove all code around disabled DEBUG_IO/DEBUG_RAW_IO definitions
Ani Sinha [Tue, 4 Jan 2022 12:17:43 +0000 (17:47 +0530)]
qemu: agent: remove all code around disabled DEBUG_IO/DEBUG_RAW_IO definitions

DEBUG_IO and DEBUG_RAW_IO are disabled and hence the code #defined under them
are useless. Remove them.

Signed-off-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
3 years agoqemu: monitor: Remove disabled debug infrastructure
Peter Krempa [Mon, 3 Jan 2022 16:33:27 +0000 (17:33 +0100)]
qemu: monitor: Remove disabled debug infrastructure

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
3 years agoAccount for fact that virDomainDeviceDefCopy() does an inactive copy
Michal Privoznik [Tue, 4 Jan 2022 16:47:00 +0000 (17:47 +0100)]
Account for fact that virDomainDeviceDefCopy() does an inactive copy

In a few places (e.g. device attach/detach/update) we are given a
device XML, parse it but then need a copy of parsed data so that
the original can be passed to function handling the request over
inactive XML and the copy is then passed to function handling the
operation over live XML. Note, both functions consume passed
device on success, hence the need for copy.

The problem is in combination of how the copy is obtained and
where is passed. The copy is done by calling
virDomainDeviceDefCopy() which does only inactive copy, i.e. no
live information is copied over (e.g. no aliases).

Then, this copy (inactive XML effectively) is passed to function
handling live part of the operation (e.g.
qemuDomainUpdateDeviceLive()) and the definition containing all
the juicy, live bits is passed to function handling inactive part
of the operation (e.g. qemuDomainUpdateDeviceConfig()).

This is rather incorrect, and XML copies should be passed to
their respective functions.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2036895
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
3 years agoutil: fix prototype of virDaemonSetupLogging
Ján Tomko [Wed, 5 Jan 2022 15:32:28 +0000 (16:32 +0100)]
util: fix prototype of virDaemonSetupLogging

The commit that added error checking to this function
forgot to adjust the WIN32 stub.

Fixes: a873924e36b28c5b125621e35b32beb6b077bcc8
Signed-off-by: Ján Tomko <jtomko@redhat.com>
3 years agoDo not print error in remote_daemon.c:main
Martin Kletzander [Mon, 20 Dec 2021 21:19:15 +0000 (22:19 +0100)]
Do not print error in remote_daemon.c:main

There is no need to do that since both fallible functions do that already.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoDispatch error in virInitialize
Martin Kletzander [Mon, 20 Dec 2021 20:55:07 +0000 (21:55 +0100)]
Dispatch error in virInitialize

Callers that already do this anyway can be cleaned up thanks to this and the one
that does not (daemon startup) gains the benefit of the error being printed to
standard error output changing:

LIBVIRT_LOG_OUTPUTS=1:invalid libvirtd
/home/nert/dev/libvirt/upstream/build/src/libvirtd: initialisation failed

into:

LIBVIRT_LOG_OUTPUTS=1:invalid libvirtd
libvirt:  error : invalid argument: Invalid destination 'invalid' for output '1:invalid'
/home/nert/dev/libvirt/upstream/build/src/libvirtd: initialisation failed

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Check for errors in virLogSetFromEnv
Martin Kletzander [Wed, 15 Dec 2021 15:34:16 +0000 (16:34 +0100)]
util: Check for errors in virLogSetFromEnv

And make callers check the return value as well.  This helps error out early for
invalid environment variables.

That is desirable because it could lead to deadlocks.  This can happen when
resetting logging after fork() reports translated errors because gettext
functions are not reentrant.  Well, it is not limited to resetting logging after
fork(), it can be any translation at that phase, but parsing environment
variables is easy to make fail on purpose to show the result, it can also happen
just due to a typo.

Before this commit it is possible to deadlock the daemon on startup
with something like:

LIBVIRT_LOG_FILTERS='1:*' LIBVIRT_LOG_OUTPUTS=1:stdout libvirtd

where filters are used to enable more logging and hence make the race less rare
and outputs are set to invalid

Combined with the previous patches this changes
the following from:

...
<deadlock>

to:

...
libvirtd: initialisation failed

The error message is improved in future commits and is also possible thanks to
this patch.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoExit on errors from virDaemonSetupLogging
Martin Kletzander [Wed, 15 Dec 2021 15:35:41 +0000 (16:35 +0100)]
Exit on errors from virDaemonSetupLogging

This prevents starting any daemons with improper logging settings.  This is
desirable on its own, but will be even more beneficial when more functions start
reporting errors and failing on them, coming up in following patches

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Initialize virLogMutex statically
Martin Kletzander [Wed, 15 Dec 2021 15:36:51 +0000 (16:36 +0100)]
util: Initialize virLogMutex statically

The only difference is that we are not going to be guaranteed that the mutex is
normal (as opposed to recursive, although there is no system known to me that
would default to recursive mutexes), but that was done only to find occasional
errors (during runtime, back in 2010, commit 336fd879c00b).  Functions using
this mutex are mostly stable and unchanging, and it makes the virLogOnceInit()
function only return 0 (or possibly abort in glib calls).  On top of that we can
assume that the virLogMutex is always initialized which enables us to be more
consistent in some early error reporting.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Report error in virLogSetDefaultOutputToFile
Martin Kletzander [Tue, 4 Jan 2022 11:10:54 +0000 (12:10 +0100)]
util: Report error in virLogSetDefaultOutputToFile

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Do not hide errors in virLogSetDefaultOutput
Martin Kletzander [Wed, 15 Dec 2021 15:37:39 +0000 (16:37 +0100)]
util: Do not hide errors in virLogSetDefaultOutput

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoutil: Report error in virLogParseDefaultPriority
Martin Kletzander [Wed, 15 Dec 2021 15:37:10 +0000 (16:37 +0100)]
util: Report error in virLogParseDefaultPriority

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
3 years agoNEWS: Mention new virDomainSetLaunchSecurityState API
Jim Fehlig [Tue, 21 Dec 2021 02:58:06 +0000 (19:58 -0700)]
NEWS: Mention new virDomainSetLaunchSecurityState API

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agotools: Add domsetlaunchsecstate virsh command
Jim Fehlig [Wed, 15 Dec 2021 03:15:40 +0000 (20:15 -0700)]
tools: Add domsetlaunchsecstate virsh command

After attesting a domain with the help of domlaunchsecinfo,
domsetlaunchsecstate can be used to set a secret in the guest
domain's memory prior to running the vcpus.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu: Implement the virDomainSetLaunchSecurityState API
Jim Fehlig [Wed, 17 Nov 2021 01:21:19 +0000 (18:21 -0700)]
qemu: Implement the virDomainSetLaunchSecurityState API

Set a launch secret in guest memory using the sev-inject-launch-secret
QMP API. Only supported with qemu >= 6.0.0 and SEV-enabled guests in a
paused state.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoqemu_capabilities: Introduce QEMU_CAPS_SEV_INJECT_LAUNCH_SECRET
Jim Fehlig [Tue, 21 Dec 2021 01:07:37 +0000 (18:07 -0700)]
qemu_capabilities: Introduce QEMU_CAPS_SEV_INJECT_LAUNCH_SECRET

The 'sev-inject-launch-secret' qmp command is only available with
qemu >= 6.0.0. Introduce a capability for sev-inject-launch-secret.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoremote: Add RPC support for the virDomainSetLaunchSecurityState API
Jim Fehlig [Tue, 16 Nov 2021 23:39:44 +0000 (16:39 -0700)]
remote: Add RPC support for the virDomainSetLaunchSecurityState API

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agolibvirt: Introduce virDomainSetLaunchSecurityState public API
Jim Fehlig [Tue, 9 Nov 2021 23:28:55 +0000 (16:28 -0700)]
libvirt: Introduce virDomainSetLaunchSecurityState public API

This API allows setting a launch secret within a guests's memory. The
launch secret is created by the guest owner after retrieving and
verifying the launch measurement with virDomainGetLaunchSecurityInfo.

The API uses virTypedParameter for input, allowing it to be expanded
to support other confidential computing technologies. In the case of
SEV, a basic guest launch workflow is described in the SEV API spec
in section "1.3.1 Launch"

https://www.amd.com/system/files/TechDocs/55766_SEV-KM_API_Specification.pdf

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agoci: Refresh configuration
Andrea Bolognani [Tue, 4 Jan 2022 16:01:48 +0000 (17:01 +0100)]
ci: Refresh configuration

Notable changes:

  * drop parted and XFS headers.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
3 years agoNEWS: Add entries for libxl changes during 8.0.0 development
Jim Fehlig [Mon, 3 Jan 2022 22:57:19 +0000 (15:57 -0700)]
NEWS: Add entries for libxl changes during 8.0.0 development

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agovirnetdevopenvswitch: Fix 'burst' value passed to ovs-vsctl
Michal Privoznik [Mon, 3 Jan 2022 15:24:58 +0000 (16:24 +0100)]
virnetdevopenvswitch: Fix 'burst' value passed to ovs-vsctl

As described in the previous commit, the units for 'burst' are
kibibytes and not kilobytes, i.e. multiples of 1024 not 1000.
Therefore, when constructing ovs-vsctl command the burst value
must be multiplied by 1024 and not just 1000. And because ovs
expects this size in bits the value has to be multiplied again by
8.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1510237#c26
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodocs: Clarify 'burst' units for QoS
Michal Privoznik [Mon, 3 Jan 2022 14:56:43 +0000 (15:56 +0100)]
docs: Clarify 'burst' units for QoS

The burst attribute for bandwidth specifies how much bytes can be
transmitted in a single burst. Therefore, the unit is in
multiples of 1024 (thus kibibytes) not SI-like 1000. It has
always been like that.

The 'tc' output is still confusing though, for instance:

  # tc class add dev $DEV parent 1: classid 1:1 htb rate 1000kbps burst 2097152
  # tc class show dev vnet2
  class htb 1:1 root rate 8Mbit ceil 8Mbit burst 2Mb cburst 1600b

Please note that 2097152 = 2*1024*1024. Even the man page is
confusing. From tc(8):

  kb or k        Kilobytes
  mb or m        Megabytes

But I guess this is because 'tc' predates IEC standardisation of
binary multiples and thus can't change without breaking scripts
parsing its output.

And while at it, adjust _virNetDevBandwidthRate struct member
description, to make it obvious which members use SI/IEC units.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
3 years agodomain_conf: Use virXMLFormatElement*() more in virDomainDefFormatFeatures()
Michal Privoznik [Tue, 14 Dec 2021 12:54:44 +0000 (13:54 +0100)]
domain_conf: Use virXMLFormatElement*() more in virDomainDefFormatFeatures()

There are few places in virDomainDefFormatFeatures() which can
use virXMLFormatElement() or virXMLFormatElementEmpty() instead
of writing directly into the output buffer.

After this, there are still a lot of places left, but that is
much bigger task.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agoqemuxml2xmloutdata: Turn kvm-features*.xml into symlinks
Michal Privoznik [Tue, 14 Dec 2021 11:28:34 +0000 (12:28 +0100)]
qemuxml2xmloutdata: Turn kvm-features*.xml into symlinks

There's no real difference between input and output XMLs for
kvm-features and kvm-features-off test cases. Do what we usually
do in such case - turn the output file into a symlink of the
input file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
3 years agodocs: Move font definitions with other CSS files
Andrea Bolognani [Tue, 21 Dec 2021 15:21:35 +0000 (16:21 +0100)]
docs: Move font definitions with other CSS files

We have a subdirectory specifically for CSS files now, so it makes
sense to have the stylesheet that defines fonts to be there too.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Move all CSS files to a subdirectory
Andrea Bolognani [Tue, 21 Dec 2021 15:10:13 +0000 (16:10 +0100)]
docs: Move all CSS files to a subdirectory

This unclutters the top-level docs directory.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Move all images to a subdirectory
Andrea Bolognani [Tue, 21 Dec 2021 11:11:25 +0000 (12:11 +0100)]
docs: Move all images to a subdirectory

This unclutters the top-level docs directory.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
3 years agodocs: Drop structures.svg
Andrea Bolognani [Tue, 21 Dec 2021 11:13:39 +0000 (12:13 +0100)]
docs: Drop structures.svg

It was introduced in ff4ede005567 but it doesn't seem to have
ever actually been used anywhere.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>