]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
23 months agovirNWFilterRuleDefDetailsFormat: Refactor formatter
Peter Krempa [Thu, 16 Feb 2023 13:09:31 +0000 (14:09 +0100)]
virNWFilterRuleDefDetailsFormat: Refactor formatter

Format the rule attributes in two passes, first for positive 'match' and
second pass for negative. This removes the crazy logic for switching
between match modes inside the formatter.

The refactor makes it also more clear in which cases we actually do
format something.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirNWFilterRuleParse: Refactor attribute parser
Peter Krempa [Thu, 16 Feb 2023 12:56:53 +0000 (13:56 +0100)]
virNWFilterRuleParse: Refactor attribute parser

Use virXMLNodeGetSubelementList to get the elements to process.

The new approach documents the complexity of the parser, which is
designed to ignore unknown attributes and parse only a single kind of
them after finding the first valid one.

Note that the XML schema doesn't actually allow having multiple
sub-elements, but I'm not sure how that translates to actual configs
present.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirNWFilterRuleParse: Parse 'priority' via 'virXMLPropInt'
Peter Krempa [Thu, 16 Feb 2023 12:20:03 +0000 (13:20 +0100)]
virNWFilterRuleParse: Parse 'priority' via 'virXMLPropInt'

Use modern parsing. Invalid numbers are now rejected. Semantis for
numbers out of range is preserved.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirNWFilterRuleDef: Turn 'action' and 'tt' into proper enum types
Peter Krempa [Thu, 16 Feb 2023 12:14:45 +0000 (13:14 +0100)]
virNWFilterRuleDef: Turn 'action' and 'tt' into proper enum types

Convert the fields to the proper types and use virXMLPropEnum for
parsing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoconf: nwfilter: Refactor XML formatting in virNWFilterRuleDefFormat
Peter Krempa [Thu, 16 Feb 2023 09:18:46 +0000 (10:18 +0100)]
conf: nwfilter: Refactor XML formatting in virNWFilterRuleDefFormat

Use virXMLFormatElement to simplify the formatter. Drop return value of
virNWFilterRuleDefFormat as there are no errors to report.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoconf: network: Refactor XML parsing in virNetworkDHCPDefParseXML
Peter Krempa [Wed, 15 Feb 2023 16:10:18 +0000 (17:10 +0100)]
conf: network: Refactor XML parsing in virNetworkDHCPDefParseXML

Use virXMLNodeGetSubelement(List) instead of the looped parser and
simplify the code.

Note that handling of the 'bootp' element now conforms to the schema
where we allow just one and the 'file' attribute is mandatory.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agonwfilterxml2xmltest: Add test case for parser and formatter quirks
Peter Krempa [Thu, 16 Feb 2023 09:46:41 +0000 (10:46 +0100)]
nwfilterxml2xmltest: Add test case for parser and formatter quirks

The parser and formatter for nwfilter rules is very strange and has
weird quirks. Add a test case trying to capture some of the quirks to
visualize how it will change when the code is refactored.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoutil: xml: Introduce virXMLNodeGetSubelementList
Peter Krempa [Mon, 13 Feb 2023 14:53:23 +0000 (15:53 +0100)]
util: xml: Introduce virXMLNodeGetSubelementList

The new helper is similar to virXPathNodeSet list but for cases where we
want to get subelements directly rather than using XPath.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirNetworkDHCPDefParseXML: Refactor cleanup
Peter Krempa [Mon, 13 Feb 2023 14:18:21 +0000 (15:18 +0100)]
virNetworkDHCPDefParseXML: Refactor cleanup

There's nothing to clean up in the 'host' local variable on error as
the function which fills it makes sure to fill it only on success. In
such case it's also directly assigned to the array thus the 'host'
variable is cleared.

Remove the 'cleanup' label and 'ret' variable as we can now directly
return -1 on error.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirNetDevBandwidthParse: Use virXMLNodeGetSubelement instead of looped parser
Peter Krempa [Mon, 13 Feb 2023 14:08:53 +0000 (15:08 +0100)]
virNetDevBandwidthParse: Use virXMLNodeGetSubelement instead of looped parser

Extract the 'inbound'/'outbound' subelements using
virXMLNodeGetSubelement to simplify the code.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirNetDevBandwidthParseRate: Refactor parsing
Peter Krempa [Mon, 13 Feb 2023 13:59:46 +0000 (14:59 +0100)]
virNetDevBandwidthParseRate: Refactor parsing

Remove the unnecessary check for valid arguments and use
virXMLPropULongLong instead of hand-written property parsers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirNetDevBandwidthParse: Use 'virXMLPropUInt' to parse 'classID'
Peter Krempa [Mon, 13 Feb 2023 13:45:45 +0000 (14:45 +0100)]
virNetDevBandwidthParse: Use 'virXMLPropUInt' to parse 'classID'

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirNetDevBandwidthParse: Don't validate element name
Peter Krempa [Mon, 13 Feb 2023 13:38:09 +0000 (14:38 +0100)]
virNetDevBandwidthParse: Don't validate element name

Callers make sure to pass the correct element.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agotestQEMUSchemaValidateObjectMember: validate QMP object member deprecation
Peter Krempa [Mon, 22 May 2023 10:49:17 +0000 (12:49 +0200)]
testQEMUSchemaValidateObjectMember: validate QMP object member deprecation

The QMP schema validator wasn't adapted to consider features of 'object'
members and thus we didn't catch the deprecation of 'device' in
'block_set_io_throttle'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemuMonitorSetBlockIoThrottle: Drop 'diskalias' argument
Peter Krempa [Tue, 23 May 2023 13:32:49 +0000 (15:32 +0200)]
qemuMonitorSetBlockIoThrottle: Drop 'diskalias' argument

Every caller will pass 'qdevid' as it's populated in the data
mandatorily with qemu-4.2 and onwards due to mandatory -blockdev use.

Thus we can drop compatibility with the old way of matching the disk via
alias.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemuMonitorGetBlockIoThrottle: Drop 'diskalias' argument
Peter Krempa [Tue, 23 May 2023 13:32:49 +0000 (15:32 +0200)]
qemuMonitorGetBlockIoThrottle: Drop 'diskalias' argument

Every caller will pass 'qdevid' as it's populated in the data
mandatorily with qemu-4.2 and onwards due to mandatory -blockdev use.

Thus we can drop compatibility with the old way of matching the disk via
alias.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemumonitorjsontest: Use 'id' instead of deprecated 'device' argument of 'block_set_i...
Peter Krempa [Tue, 23 May 2023 12:20:29 +0000 (14:20 +0200)]
qemumonitorjsontest: Use 'id' instead of deprecated 'device' argument of 'block_set_io_throttle'

The 'device' argument is deprecated. All real usage in the qemu driver
already uses 'id' as we populate the 'qomName' for everything except for
SD cards where throttling didn't work with libvirt for a very long time.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemu: Refuse setting <iotune> for 'SD' disks
Peter Krempa [Thu, 25 May 2023 14:48:24 +0000 (16:48 +0200)]
qemu: Refuse setting <iotune> for 'SD' disks

Historically this didn't work with any supported qemu version as we
don't set the alias of the device, and thus qemu uses a different alias
resulting in a failure to startup the VM:

  internal error: unable to execute QEMU command 'block_set_io_throttle': Device 'drive-sd-disk0' not found

Refuse setting throttling as this is unlikely to be needed and proper
fix requires using -device instead of -drive if=sd.

Note that this was broken when I moved the setup of throttling as a
command at startup for blockdev integration quite a while ago. Until
then throttling was passed as arguments for -drive.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemuDiskConfigBlkdeviotuneEnabled: Make 'disk' argument const
Peter Krempa [Thu, 25 May 2023 14:52:36 +0000 (16:52 +0200)]
qemuDiskConfigBlkdeviotuneEnabled: Make 'disk' argument const

The function doesn't modify it. Fix the argument declaration so that the
function can be used in a context where we have a 'const' disk
definition.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemumonitorjsontest: Drop 'schema-meta' case
Peter Krempa [Mon, 22 May 2023 11:17:17 +0000 (13:17 +0200)]
qemumonitorjsontest: Drop 'schema-meta' case

The test case is validating the QMP schema against itself. This was
useful when I was developing the validator but at this point it's no
longer needed.

Additionally the QMP schema has few deprecated members now, which our
validator doesn't catch yet, so this test would start failing once I fix
the validator.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoDrop unused qemuMonitorTestAddItemParams
Peter Krempa [Mon, 22 May 2023 15:32:45 +0000 (17:32 +0200)]
Drop unused qemuMonitorTestAddItemParams

Using qemuMonitorTestAddItemVerbatim is more universal and that helper
also does QMP schema validation. Remove the now unused helper.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agotestQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle: Rewrite using qemuMonitorTestAd...
Peter Krempa [Mon, 22 May 2023 15:08:27 +0000 (17:08 +0200)]
testQemuMonitorJSONqemuMonitorJSONSetBlockIoThrottle: Rewrite using qemuMonitorTestAddItemVerbatim

Replace qemuMonitorTestAddItemParams by qemuMonitorTestAddItemVerbatim

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agotestQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime: Rewrite using qemuMonitorTestAddIt...
Peter Krempa [Mon, 22 May 2023 15:08:27 +0000 (17:08 +0200)]
testQemuMonitorJSONqemuMonitorJSONSendKeyHoldtime: Rewrite using qemuMonitorTestAddItemVerbatim

Replace qemuMonitorTestAddItemParams by qemuMonitorTestAddItemVerbatim

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agotestQemuAgentFSTrim: Rewrite using qemuMonitorTestAddItemVerbatim
Peter Krempa [Mon, 22 May 2023 15:08:27 +0000 (17:08 +0200)]
testQemuAgentFSTrim: Rewrite using qemuMonitorTestAddItemVerbatim

Replace qemuMonitorTestAddItemParams by qemuMonitorTestAddItemVerbatim

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agotestQemuAgentCPU: Rewrite using qemuMonitorTestAddItemVerbatim
Peter Krempa [Mon, 22 May 2023 15:08:27 +0000 (17:08 +0200)]
testQemuAgentCPU: Rewrite using qemuMonitorTestAddItemVerbatim

Replace qemuMonitorTestAddItemParams by qemuMonitorTestAddItemVerbatim

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agovirRaiseErrorLog: Don't skip error printing when enabling debug logging env variable
Peter Krempa [Mon, 22 May 2023 12:58:38 +0000 (14:58 +0200)]
virRaiseErrorLog: Don't skip error printing when enabling debug logging env variable

When a user requests debug logging by setting the environment variable:

LIBVIRT_DEBUG=1

we should log any errors regardless of the setting of e.g.
'LIBVIRT_LOG_OUTPUTS' as the code will log every 'debug' and 'info'
level message to stderr but will skip 'error' level messages.

This obviously makes debugging things very complicated as you can get to
a situation when the error itself is missing.

This can happen e.g. in tests.

Fix the issue by probing the default log level and calling the logger if
it's set for VIR_LOG_DEBUG.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoci: fix Cirrus CI jobs run from merge requests
Daniel P. Berrangé [Mon, 5 Jun 2023 10:25:01 +0000 (11:25 +0100)]
ci: fix Cirrus CI jobs run from merge requests

Preferentially fetch from $CI_MERGE_REQUEST_REF_PATH if it is
defined, otherwise use $CI_COMMIT_REF_NAME

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
23 months agoqemu: Set proper PCI backend for <interface/>-s that are actually hostdevs
Michal Privoznik [Thu, 1 Jun 2023 11:47:14 +0000 (13:47 +0200)]
qemu: Set proper PCI backend for <interface/>-s that are actually hostdevs

When starting a domain, it's done so in two steps (actually more,
but lets focus on just the following two):

  1) qemuProcessPrepareDomain(), followed by

  2) qemuProcessPrepareHost().

Now, in the first step (PrepareDomain()), PCI backends for all
hostdevs is set (qemuProcessPrepareDomain() ->
qemuProcessPrepareDomainHostdevs() -> qemuDomainPrepareHostdev()
-> qemuDomainPrepareHostdevPCI()). Perfect.

But then, additional hostdevs may appear, because in the host
prepare phase we may insert some hostdevs into domain definition
(qemuProcessPrepareHost() -> qemuProcessNetworkPrepareDevices()).

Now, these additional hostdevs don't undergo the same prepare as
hostdevs that were already present in the domain definition (i.e.
in qemuProcessPrepareDomain() phase). Therefore, we have to call
corresponding prepare function explicitly.

NB, the interface hotplug code (qemuDomainAttachNetDevice()) does
not suffer from this problem, because it calls top level
qemuDomainAttachHostDevice() which is used to hotplug regular
hostdevs too and as such calls qemuDomainPrepareHostdev().

Fixes: 3b87709c768480e085556e06bd8d08f62270d42d
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2209853
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoci: refresh with latest lcitool manifest
Erik Skultety [Wed, 31 May 2023 09:32:09 +0000 (11:32 +0200)]
ci: refresh with latest lcitool manifest

Main lcitool changes:
- added Alpine 3.17 and 3.18 targets
- dropped Alpine 3.15 and 3.16

Note that we're not actively testing all Alpine targets due to CI
quota, so only 3.17 is used as a replacement for 3.15 in this patch.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
23 months agoqemuMonitorTestAddItemExpect: Remove unused helper
Peter Krempa [Mon, 22 May 2023 14:30:59 +0000 (16:30 +0200)]
qemuMonitorTestAddItemExpect: Remove unused helper

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemuMonitorJSONTestAttachOneChardev: Rewrite using qemuMonitorTestAddItemVerbatim
Peter Krempa [Mon, 22 May 2023 11:43:53 +0000 (13:43 +0200)]
qemuMonitorJSONTestAttachOneChardev: Rewrite using qemuMonitorTestAddItemVerbatim

'qemuMonitorTestAddItemExpect' doesn't do QMP schema validation. Since
it's the only use we can reimplement it using 'qemuMonitorTestAddItemVerbatim'
which does schema validation and remove the old code instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agotestQemuMonitorJSONAttachChardev: Move all setup code under virTestRun
Peter Krempa [Mon, 22 May 2023 14:18:40 +0000 (16:18 +0200)]
testQemuMonitorJSONAttachChardev: Move all setup code under virTestRun

Any failure which happens outside is hard to debug as errors will be
reset and not raised.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemuMonitorTestAddHandler: Remove return value
Peter Krempa [Mon, 22 May 2023 12:07:50 +0000 (14:07 +0200)]
qemuMonitorTestAddHandler: Remove return value

The function always returns 0. Remove the return value and fix callers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemuMonitorTestAddItemVerbatim: Simplify cleanup
Peter Krempa [Mon, 22 May 2023 12:05:46 +0000 (14:05 +0200)]
qemuMonitorTestAddItemVerbatim: Simplify cleanup

Reformat the JSON string before allocating the test data structure so
that we don't have to free it if the reformatting fails.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: Use '--exit-status=' option for 'rst2html5'
Peter Krempa [Thu, 25 May 2023 13:36:28 +0000 (15:36 +0200)]
docs: Use '--exit-status=' option for 'rst2html5'

Ensure that also 'non-halting' messages stop the build process.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agodocs: go: Add 'go-import' metadata via rST
Peter Krempa [Tue, 23 May 2023 14:52:24 +0000 (16:52 +0200)]
docs: go: Add 'go-import' metadata via rST

The '.. meta::' rST directive allows adding header metadata. Move the
specific metadata from page.xsl into the individual files and pass them
through into the header from page.xsl.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agodocs: page.xsl: Drop passhrough of <script> elements into header
Peter Krempa [Thu, 25 May 2023 12:09:22 +0000 (14:09 +0200)]
docs: page.xsl: Drop passhrough of <script> elements into header

No generated headers have inline javascript.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agodocs: newapi: Remove unused 'docomponents' template
Peter Krempa [Thu, 25 May 2023 11:44:13 +0000 (13:44 +0200)]
docs: newapi: Remove unused 'docomponents' template

Never used since introduction in b38893c3eaa56617a3ef313c45e505da6e50

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu_passt: Format portForward device even without address
Michal Privoznik [Thu, 1 Jun 2023 08:37:04 +0000 (10:37 +0200)]
qemu_passt: Format portForward device even without address

It's almost like we've anticipated this. Our XML parser and
formatter handles @address and @dev attributes of <portForward/>
element completely independent of each other. And as of commit
2023_03_29.b10b983~3 passt allows handling these two separately
too. All that's left is generate the cmd line according to this
new fact.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2210287
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoconf: Reject invalid device's <seclabel relabel='yes'/> with no <label/>
Michal Privoznik [Thu, 25 May 2023 13:43:56 +0000 (15:43 +0200)]
conf: Reject invalid device's <seclabel relabel='yes'/> with no <label/>

We allow (some) domain devices to have a different <seclabel/>
than the top level domain one (this is mostly to allow access to
a resource for multiple domains). Now, we do couple of sanity
checks for such <seclabel/>, e.g. when the <label/> is specified,
but '@relabel' is set to no. But what we are missing is the
opposite: when '@relabel' is set, but no <label/> was provided.

Our schema already denies such combination. Make our parser
behave the same.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2160356
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoPost-release version bump to 9.5.0
Jiri Denemark [Thu, 1 Jun 2023 09:50:19 +0000 (11:50 +0200)]
Post-release version bump to 9.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoRelease of libvirt-9.4.0
Jiri Denemark [Thu, 1 Jun 2023 09:40:25 +0000 (11:40 +0200)]
Release of libvirt-9.4.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoTranslated using Weblate (Georgian)
Temuri Doghonadze [Thu, 1 Jun 2023 04:20:44 +0000 (06:20 +0200)]
Translated using Weblate (Georgian)

Currently translated at 3.8% (402 of 10397 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>
23 months agoconf: node_device: use separate variables for parsing integers
Ján Tomko [Tue, 30 May 2023 14:59:56 +0000 (16:59 +0200)]
conf: node_device: use separate variables for parsing integers

In virNodeDeviceGetSCSIHostCaps, there is a pattern of reusing
a tmp value and stealing the pointer.

But in two case it is not stolen. Use separate variables for them
to avoid mixing autofree with manual free() calls.

Fixes: 8a0cb5f73ade3900546718eabe70cb064c6bd22c
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agoinclude: Fix 'Since' for new VIR_MIGRATE_PARAM_COMPRESSION_* macros
Michal Privoznik [Wed, 31 May 2023 09:02:21 +0000 (11:02 +0200)]
include: Fix 'Since' for new VIR_MIGRATE_PARAM_COMPRESSION_* macros

In v9.3.0-98-g150ae3e62b two new macros were introduced:
VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL and
VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL. But both list 9.1.0 as
the version they were introduced in (this is because the patch
was sent in that release time frame). Change the version to the
current release.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
23 months agoNEWS: Document my contributions for upcoming release
Michal Privoznik [Tue, 30 May 2023 07:43:43 +0000 (09:43 +0200)]
NEWS: Document my contributions for upcoming release

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoTranslated using Weblate (Korean)
김인수 [Tue, 30 May 2023 05:20:45 +0000 (07:20 +0200)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10397 of 10397 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>
23 months agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Sat, 27 May 2023 15:20:43 +0000 (17:20 +0200)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10397 of 10397 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>
23 months agoqemu_command: Generate .memaddr for virtio-mem and virtio-pmem
Michal Privoznik [Tue, 28 Mar 2023 08:44:15 +0000 (10:44 +0200)]
qemu_command: Generate .memaddr for virtio-mem and virtio-pmem

This is fairly trivial. Just set .memaddr attribute if a value
was set in the XML.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2180679
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu: Fill virtio-mem/virtio-pmem .memaddr at runtime
Michal Privoznik [Tue, 28 Mar 2023 08:41:39 +0000 (10:41 +0200)]
qemu: Fill virtio-mem/virtio-pmem .memaddr at runtime

After a QEMU domain is started, among other thing we query memory
device information. And while memory address is returned by QEMU
for all models, we store it only for DIMMs and NVDIMMs. Do store
it for VIRTIO_MEM and VIRTIO_PMEM too.

This effectively reports the address the virtio-mem/virtio-pmem
is mapped to in live XML.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoconf: Introduce <address/> for virtio-mem and virtio-pmem
Michal Privoznik [Tue, 28 Mar 2023 08:39:55 +0000 (10:39 +0200)]
conf: Introduce <address/> for virtio-mem and virtio-pmem

Both virtio-mem and virtio-pmem devices have '.memaddr' attribute
which controls the address where they are mapped in the guest
memory. Ideally, users do not need to specify this as QEMU does
the right thing and computes addresses automatically on startup.

But soon, we will need to record this address as it is part of
guest ABI. And also, there might be some users that want to
control this value. Now, we are in a bit of a pickle, because
both these device types already have a PCI address, therefore we
can't just use <address/> blindly. But what we can do, is
introduce <address/> under the <target/> element. This is also
more conceptual, as knobs under <target/> control guest visible
config of memory device (and .memaddr surely falls into that
category).

NB, SgxEPCDeviceInfo struct in QMP definition also has .memaddr
attribute, but because of the way we build cmd line there's no
(easy) way to set the attribute. So ignore that for now.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoconf: Run virDomainInputDefPostParse() only for VIR_DOMAIN_DEVICE_INPUT
Michal Privoznik [Fri, 26 May 2023 14:15:56 +0000 (16:15 +0200)]
conf: Run virDomainInputDefPostParse() only for VIR_DOMAIN_DEVICE_INPUT

Due to missed break; statement the virDomainInputDefPostParse()
is called not only for VIR_DOMAIN_DEVICE_INPUT but also
VIR_DOMAIN_DEVICE_LEASE and VIR_DOMAIN_DEVICE_NET, which can lead
to all sort of unpredictable results.

Fixes: c4bc4d3b82fbe22e03c986ca896090f481df5c10
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoUpdate translation files
Weblate [Fri, 26 May 2023 12:08:02 +0000 (14:08 +0200)]
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>
23 months agopo: Refresh potfile for v9.4.0
Jiri Denemark [Fri, 26 May 2023 11:56:42 +0000 (13:56 +0200)]
po: Refresh potfile for v9.4.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
23 months agosync_qemu_models_i386.py: Add missing features
Tim Wiederhake [Wed, 24 May 2023 07:50:14 +0000 (09:50 +0200)]
sync_qemu_models_i386.py: Add missing features

This brings the tool's list of features in sync with qemu
commit 886c0453cbf10eebd42a9ccf89c3e46eb389c357.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agosync_qemu_models_i386.py: Fix complaint from flake8
Tim Wiederhake [Wed, 24 May 2023 08:02:10 +0000 (10:02 +0200)]
sync_qemu_models_i386.py: Fix complaint from flake8

Line was too long.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "vnmi"
Tim Wiederhake [Wed, 24 May 2023 07:33:04 +0000 (09:33 +0200)]
cpu_map: Add missing feature "vnmi"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "stibp-always-on"
Tim Wiederhake [Wed, 24 May 2023 07:32:10 +0000 (09:32 +0200)]
cpu_map: Add missing feature "stibp-always-on"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "prefetchiti"
Tim Wiederhake [Wed, 24 May 2023 07:30:56 +0000 (09:30 +0200)]
cpu_map: Add missing feature "prefetchiti"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "null-sel-clr-base"
Tim Wiederhake [Wed, 24 May 2023 07:29:49 +0000 (09:29 +0200)]
cpu_map: Add missing feature "null-sel-clr-base"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "no-nested-data-bp"
Tim Wiederhake [Wed, 24 May 2023 07:29:03 +0000 (09:29 +0200)]
cpu_map: Add missing feature "no-nested-data-bp"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "lfence-always-serializing"
Tim Wiederhake [Wed, 24 May 2023 07:28:32 +0000 (09:28 +0200)]
cpu_map: Add missing feature "lfence-always-serializing"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "flush-l1d"
Tim Wiederhake [Wed, 24 May 2023 07:25:05 +0000 (09:25 +0200)]
cpu_map: Add missing feature "flush-l1d"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "fb-clear"
Tim Wiederhake [Wed, 24 May 2023 07:23:48 +0000 (09:23 +0200)]
cpu_map: Add missing feature "fb-clear"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "cmpccxadd"
Tim Wiederhake [Wed, 24 May 2023 07:22:31 +0000 (09:22 +0200)]
cpu_map: Add missing feature "cmpccxadd"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "avx-vnni-int8"
Tim Wiederhake [Wed, 24 May 2023 07:21:30 +0000 (09:21 +0200)]
cpu_map: Add missing feature "avx-vnni-int8"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "avx-ne-convert"
Tim Wiederhake [Wed, 24 May 2023 07:20:53 +0000 (09:20 +0200)]
cpu_map: Add missing feature "avx-ne-convert"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "avx-ifma"
Tim Wiederhake [Wed, 24 May 2023 07:18:04 +0000 (09:18 +0200)]
cpu_map: Add missing feature "avx-ifma"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "auto-ibrs"
Tim Wiederhake [Wed, 24 May 2023 07:16:04 +0000 (09:16 +0200)]
cpu_map: Add missing feature "auto-ibrs"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "amx-fp16"
Tim Wiederhake [Wed, 24 May 2023 07:12:45 +0000 (09:12 +0200)]
cpu_map: Add missing feature "amx-fp16"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agocpu_map: Add missing feature "amd-psfd"
Tim Wiederhake [Wed, 24 May 2023 07:10:41 +0000 (09:10 +0200)]
cpu_map: Add missing feature "amd-psfd"

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
23 months agodocs: Clarify values reported by virDomainMemoryStats()
Michal Privoznik [Wed, 24 May 2023 08:53:03 +0000 (10:53 +0200)]
docs: Clarify values reported by virDomainMemoryStats()

I was approached by a KubeVirt developer to clarify what value
does VIR_DOMAIN_MEMORY_STAT_DISK_CACHES report, whether it's from
the guest or the host POV. And since I didn't know the answer
even after reading the docs I think we can do better. Clarify the
POV then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
23 months agodocs: newapi.xsl: Generate overall docs for enums too
Michal Privoznik [Tue, 23 May 2023 16:46:58 +0000 (18:46 +0200)]
docs: newapi.xsl: Generate overall docs for enums too

There are/can be overall docs for enums (e.g.
virDomainModificationImpact) not just individual values. But
these never make it into the generated HTML which is a bit
unfortunate as they can contain valuable information for users.

Generate a block with overall enum documentation, just like we do
for functions.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
23 months agodocs: newapi.xsl: Generate docs on generic typedefs
Michal Privoznik [Wed, 24 May 2023 08:22:47 +0000 (10:22 +0200)]
docs: newapi.xsl: Generate docs on generic typedefs

We have plenty of generic typedefs (that basically just alias a
struct, or our popular virXXXPtr). Because we do not generate
HTML docs for it, the documentation is placed at random places,
e.g.: comment from virDomainPtr typedef ("a virDomainPtr is
pointer to a virDomain private structure ...") ends up after
virDomainProcessSignal enum block.

There are some less weird occurrences of this problem (e.g.
virBlkioParameterPtr), but yet - the typedef appears in TOC.

Therefore, generate a block for each typedef and put its
description there.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
23 months agocpu_map: Add SapphireRapids CPU model
Lin Yang [Thu, 18 May 2023 00:30:57 +0000 (17:30 -0700)]
cpu_map: Add SapphireRapids CPU model

Introduced in QEMU by commit v8.0.0-7eb061b06e.

Signed-off-by: Lin Yang <lin.a.yang@intel.com>
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Tim Wiederhake <twiederh@redhat.com>
23 months agonodedev: update transient mdevs
Boris Fiuczynski [Mon, 8 May 2023 17:10:46 +0000 (19:10 +0200)]
nodedev: update transient mdevs

Instead of updating defined mdevs only add another update for active
devices as well to cover transient mdev devices as well.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2143158
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
23 months agoqemu_hotplug: Temporarily allow emulator thread to access other NUMA nodes during...
Michal Privoznik [Mon, 22 May 2023 13:55:10 +0000 (15:55 +0200)]
qemu_hotplug: Temporarily allow emulator thread to access other NUMA nodes during mem hotplug

Again, this fixes the same problem as one of previous commits,
but this time for memory hotplug. Long story short, if there's a
domain running and the emulator thread is restricted to a subset
of host NUMA nodes, but the memory that's about to be hotplugged
requires memory from a host NUMA node that's not in the set we
need to allow emulator thread to access the node, temporarily.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu: Start emulator thread with more generous cpuset.mems
Michal Privoznik [Fri, 19 May 2023 12:02:06 +0000 (14:02 +0200)]
qemu: Start emulator thread with more generous cpuset.mems

Consider a domain with two guest NUMA nodes and the following
<numatune/> setting :

  <numatune>
    <memory mode="strict" nodeset="0"/>
    <memnode cellid="0" mode="strict" nodeset="1"/>
  </numatune>

What this means is the emulator thread is pinned onto host NUMA
node #0 (by setting corresponding cpuset.mems to "0"), and two
memory-backend-* objects are created:

  -object '{"qom-type":"memory-backend-ram","id":"ram-node0", .., "host-nodes":[1],"policy":"bind"}' \
  -numa node,nodeid=0,cpus=0-1,memdev=ram-node0 \
  -object '{"qom-type":"memory-backend-ram","id":"ram-node1", .., "host-nodes":[0],"policy":"bind"}' \
  -numa node,nodeid=1,cpus=2-3,memdev=ram-node1 \

Note, the emulator thread is pinned well before QEMU is even
exec()-ed.

Now, the way memory allocation works in QEMU is: the emulator
thread calls mmap() followed by mbind() (which is sane, that's
how everybody should do it). BUT, because the thread is already
restricted by CGroups to just NUMA node #0, calling:

  mbind(host-nodes:[1]); /* made up syntax (TM) */

fails. This is expected though. Kernel was instructed to place
the memory at NUMA node "0" and yet, process is trying to place
it elsewhere.

We used to solve this by not restricting emulator thread at all
initially, and only after it's done initializing (i.e. we got the
QMP greeting) we placed it onto desired nodes. But this had its
own problems (e.g. QEMU might have locked pieces of its memory
which were then unable to migrate onto different NUMA nodes).

Therefore, in v5.1.0-rc1~282 we've changed this and set cgroups
upfront (even before exec()-ing QEMU). And this used to work, but
something has changed (I can't really put my finger on it).

Therefore, for the initialization start the thread with union of
all configured host NUMA nodes ("0-1" in our example) and fix the
placement only after QEMU is started.

NB, the memory hotplug suffers the same problem, but that will
be fixed in the next commit.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2138150
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemuProcessSetupPid: Use @numatune variable more
Michal Privoznik [Fri, 19 May 2023 12:02:01 +0000 (14:02 +0200)]
qemuProcessSetupPid: Use @numatune variable more

Inside of qemuProcessSetupPid() there's @numatune variable which
is set to vm->def->numa, but it lives only in one block. In the
rest of places the expanded form (vm->def->numa) is used instead.
Move the variable declaration at the beginning of the function
and use it instead of the expanded form.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agoqemu: Use thread-context even with numatune's restrictive mode
Martin Kletzander [Fri, 19 May 2023 09:52:27 +0000 (11:52 +0200)]
qemu: Use thread-context even with numatune's restrictive mode

We cannot use host-nodes attribute for it, but there is no reason for us
to skip the preallocation optimisation using thread-context in such
case.  Thankfully returning the proper nodemask from
qemuBuildMemoryBackendProps is enough to trigger this.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocpu-data.py: Filter out apic current logical processor
Tim Wiederhake [Tue, 28 Mar 2023 14:14:55 +0000 (16:14 +0200)]
cpu-data.py: Filter out apic current logical processor

Commit 10b5e789c5 attempts to filter out the logical processor id
in the generated data to remove noise and irrelevant changes in the
output.

cpuid-leaf 0x0B may have more than two sub-leaves though. Filter out
logical processor id from all sub-leaves of 0x0B and 0x1F (superset
of the information in 0x0B).

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoNEWS: Mention support for compressing parallel migration
Jiri Denemark [Thu, 18 May 2023 13:56:34 +0000 (15:56 +0200)]
NEWS: Mention support for compressing parallel migration

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
23 months agoRevert "conf: Introduce MTE domain feature"
Andrea Bolognani [Mon, 22 May 2023 07:50:20 +0000 (09:50 +0200)]
Revert "conf: Introduce MTE domain feature"

The QEMU interface is still in a state of flux, and KVM support
has been pulled shortly after having been merged. Let's not
commit to a stable interface in libvirt just yet.

Reverts: 720e8f13ff71377580cd37b118cee8a1f982d1d8
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
23 months agoRevert "qemu:: Introduce QEMU_CAPS_MACHINE_VIRT_MTE capability"
Andrea Bolognani [Mon, 22 May 2023 07:50:06 +0000 (09:50 +0200)]
Revert "qemu:: Introduce QEMU_CAPS_MACHINE_VIRT_MTE capability"

The QEMU interface is still in a state of flux, and KVM support
has been pulled shortly after having been merged. Let's not
commit to a stable interface in libvirt just yet.

Reverts: 1347a19f75a23b4d92e6a7b549fcde52b23f0258
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
23 months agoRevert "qemu: Validate MTE feature"
Andrea Bolognani [Mon, 22 May 2023 07:49:51 +0000 (09:49 +0200)]
Revert "qemu: Validate MTE feature"

The QEMU interface is still in a state of flux, and KVM support
has been pulled shortly after having been merged. Let's not
commit to a stable interface in libvirt just yet.

Reverts: c6c9b5d251de215ed378aa0bc31daa2e1170409e
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
23 months agoRevert "qemu: Generate command line for MTE feature"
Andrea Bolognani [Mon, 22 May 2023 07:49:33 +0000 (09:49 +0200)]
Revert "qemu: Generate command line for MTE feature"

The QEMU interface is still in a state of flux, and KVM support
has been pulled shortly after having been merged. Let's not
commit to a stable interface in libvirt just yet.

Reverts: b10bc8f7ab6f9986ccc54ba04fc5b3bad7576be6
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
23 months agorpm: Explain BuildRequires on qemu-img
Andrea Bolognani [Fri, 5 May 2023 17:42:59 +0000 (19:42 +0200)]
rpm: Explain BuildRequires on qemu-img

It's not used as part of the build process or searched for at
build time, and the QEMU driver detects its path at runtime,
so one could think that the BuildRequires is unnecessary. But
we actually need it to be present at build time in order to
run the full test suite.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
23 months agonuma_conf: Deny other memory modes than 'restrictive' if a memnode is 'restrictive'
Michal Privoznik [Thu, 18 May 2023 08:31:12 +0000 (10:31 +0200)]
numa_conf: Deny other memory modes than 'restrictive' if a memnode is 'restrictive'

We already do check that if there's <memory mode='restrictive'/>
then all <memnode/> have to be of 'restrictive' mode too. But
what we are missing the reverse: if there is <memnode/> with
'restrictive' mode, then the <memory/> has to be of the same mode
too.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2208946
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agonuma_conf: Move memnode mode validation into virDomainNumaDefValidate()
Michal Privoznik [Thu, 18 May 2023 08:27:52 +0000 (10:27 +0200)]
numa_conf: Move memnode mode validation into virDomainNumaDefValidate()

When parsing a <memnode/> we also check whether the @mode
argument fulfills some requirements wrt 'restrictive' mode. This
is not the right place though. There's virDomainNumaDefValidate()
which contains other checks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agovirDomainNumatuneNodeSpecified: Fix const correctness
Michal Privoznik [Thu, 18 May 2023 08:27:36 +0000 (10:27 +0200)]
virDomainNumatuneNodeSpecified: Fix const correctness

The virDomainNumatuneNodeSpecified() function does not write into
passed @numatune pointer, it just reads from it. Therefore, the
argument should be const, which allows this function to be called
from places where virDomainNuma is already const (e.g. domain
validation code).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
23 months agodocs: make isa-debugcon example more useful / directly applicable
Laszlo Ersek [Thu, 18 May 2023 12:59:39 +0000 (14:59 +0200)]
docs: make isa-debugcon example more useful / directly applicable

The type='pty' attribute in the <serial> element causes a Pseudo TTY to be
allocated on the host side via "/dev/ptmx", which is meant to be
interacted with via "virsh console" or similar.

That's not how a firmware log is typically viewed or saved. Replace
type='pty' with type='file', and also provide an example <source> element
(with the pathname of the logfile), similarly to how the <serial> example
just above provides a <source> element too.

Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Andrea Bolognani <abologna@redhat.com>
Updates: 654968381df0256c047d2ecd4542ccc90dc57ad0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: fix typo in isa-debugcon example
Laszlo Ersek [Thu, 18 May 2023 12:59:38 +0000 (14:59 +0200)]
docs: fix typo in isa-debugcon example

The <serial> opening tag is paired with the </console> closing tag; that's
a mismatch. The question is then whether to modify the former to
<console>, or the latter to </serial>.

Per section "Relationship between serial ports and consoles", <serial> is
used for emulated (not paravirt) consoles, and it's the type that's
suitable for early debug output (such as from firmware). Thus, change
</console> to </serial>.

Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Andrea Bolognani <abologna@redhat.com>
Fixes: 654968381df0256c047d2ecd4542ccc90dc57ad0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agoqemu: support set parallel migration compression method
Jiang Jiacheng [Fri, 24 Feb 2023 09:27:12 +0000 (17:27 +0800)]
qemu: support set parallel migration compression method

Add new compress methods zlib and zstd for parallel migration,
these method should be used with migration option --comp-methods
and will be processed in 'qemuMigrationParamsSetCompression'.
Note that only one compress method could be chosen for parallel
migration and they cann't be used in compress migration.

Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agovirsh: Add migrate options to set parallel compress level
Jiang Jiacheng [Fri, 24 Feb 2023 09:27:11 +0000 (17:27 +0800)]
virsh: Add migrate options to set parallel compress level

Add migrate options: --compression-zlib-level
                     --compression-zstd-level
These options are used to set compress level for "zlib"
or "zstd" during parallel migration if the compress method
is specified.

Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agoAdd public API for parallel compression method
Jiang Jiacheng [Fri, 24 Feb 2023 09:27:10 +0000 (17:27 +0800)]
Add public API for parallel compression method

Add description for VIR_MIGRATE_PARAM_COMPRESSION, it will
be reused in choosing compression method during parallel migration.
Add public API VIR_MIGRATE_PARAM_COMPRESSION_ZLIB_LEVEL,
VIR_MIGRATE_PARAM_COMPRESSION_ZSTD_LEVEL for migration APIs
to support set compress level during parallel migration.

Signed-off-by: Jiang Jiacheng <jiangjiacheng@huawei.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
23 months agodocs: xsl: Simplify templating XSL
Peter Krempa [Wed, 17 May 2023 12:17:56 +0000 (14:17 +0200)]
docs: xsl: Simplify templating XSL

Wrap the auto-generated pages (API ref and hvsupport.html) in the proper
top level element similarly to what the pages generated from RST have to
remove the extra case when templating our web.

(Best viewed with 'git show -w')

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: newapi.xsl: Remove support for generating index page
Peter Krempa [Wed, 17 May 2023 14:48:09 +0000 (16:48 +0200)]
docs: newapi.xsl: Remove support for generating index page

Since we need to generate API docs for multiple input files the index
page is not useful for us and was replaced by a manual one. Drop the XSL
for generating it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agodocs: html: Add a manually written index page
Peter Krempa [Wed, 17 May 2023 14:41:35 +0000 (16:41 +0200)]
docs: html: Add a manually written index page

The auto-generated index contains only references to one run of the
generator but we in total run it 4 times missing the admin, lxc, and
qemu specific apis.

Rewrite it manually so that we can drop the generator for it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agocss: Remove override of width for 'hvsupport' page
Peter Krempa [Wed, 17 May 2023 14:21:59 +0000 (16:21 +0200)]
css: Remove override of width for 'hvsupport' page

Now that the table is not so wide we can treat it as any other page.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
23 months agohvsupport: Split out common APIs from hypervisor API section
Peter Krempa [Wed, 17 May 2023 13:59:30 +0000 (15:59 +0200)]
hvsupport: Split out common APIs from hypervisor API section

Common APIs such as virConnectOpen/Close and similar which are used by
the non-hypervisor drivers in libvirt are grouped together with
hypervisor drivers, which makes the table very wide.

Split them out into a separate group and clean up the list of hypervisor
drivers.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>