]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
2 years agoqemucapabilitiestest: Update qemu capabilities for qemu-7.1 release
Peter Krempa [Wed, 27 Jul 2022 08:28:53 +0000 (10:28 +0200)]
qemucapabilitiestest: Update qemu capabilities for qemu-7.1 release

qemu-7.1 is released now. Update the capabilities for the final time.

Notable change since last update:
 - 'exit-failure' action for 'panic' lifecycle action added

The 'min-xlevel' change is related to upgrade of the host kernel.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 years agoqemuValidateDomainDef: Clarify error message when S390 PV launch security is unsuppor...
Peter Krempa [Tue, 30 Aug 2022 11:46:06 +0000 (13:46 +0200)]
qemuValidateDomainDef: Clarify error message when S390 PV launch security is unsupported by the kernel

Split up the condition and report a different error message when the
host or host config results in S390 PV launch security being
unavailable.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2122534
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
2 years agoqemu: command: Don't use deprecated chardev backend drivers 'tty' and 'parport'
Peter Krempa [Mon, 29 Aug 2022 13:34:56 +0000 (15:34 +0200)]
qemu: command: Don't use deprecated chardev backend drivers 'tty' and 'parport'

The replacement is 'serial' and 'parallel' respectively introduced at
least in qemu-2.9 and the old versions are deprecated since qemu-6.0
(qemu commit 5965243641d797b22 ).

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefParseXML: Reject '-1' for PCI controller target properties
Peter Krempa [Fri, 26 Aug 2022 12:02:52 +0000 (14:02 +0200)]
virDomainControllerDefParseXML: Reject '-1' for PCI controller target properties

All of the properties use '-1' as default and the code omits formatting
them when the property is '-1'. Additionally subsequent validation code
rejects all other negative values anyways.

Since we've never formatted '-1' into an XML formatted by libvirt we can
make the parser more strict, as we will never fail to parse existing
on-disk libvirt-owned XMLs.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2121627
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefParseXML: Return early if there's unexpectedly many elements
Peter Krempa [Fri, 26 Aug 2022 11:56:48 +0000 (13:56 +0200)]
virDomainControllerDefParseXML: Return early if there's unexpectedly many elements

Move some checks earlier so that they are not tucked at the back of the
block of code doing the actual parsing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefParseXML: Parse 'index' by virXMLPropInt
Peter Krempa [Fri, 26 Aug 2022 11:50:28 +0000 (13:50 +0200)]
virDomainControllerDefParseXML: Parse 'index' by virXMLPropInt

'index' is parsed to fit into a signed int but not have negative values.
virXMLPropInt can do that internally.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefParseXML: Remove explicit checks for negative value
Peter Krempa [Fri, 26 Aug 2022 11:47:09 +0000 (13:47 +0200)]
virDomainControllerDefParseXML: Remove explicit checks for negative value

Refactor all cases which use virXMLPropInt and then subsequently check
that the parsed value is not '-1'/negative by using the VIR_XML_PROP_NONNEGATIVE
flag for virXMLPropInt.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefParseXML: Fix broken error reporting when parsing 'index'
Peter Krempa [Fri, 26 Aug 2022 11:28:47 +0000 (13:28 +0200)]
virDomainControllerDefParseXML: Fix broken error reporting when parsing 'index'

The code attempted to report an error if the user added the 'index'
attribute to the 'target' element, but neglected to actually return an
error code.

Fix it by using the VIR_XML_PROP_NONNEGATIVE flag for virXMLPropInt
which refuses user passed negative numbers.

Fixes: 020dd80ecbd
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefParseXML: Fix broken code indentation when parsing PCI contolle...
Peter Krempa [Fri, 26 Aug 2022 11:38:45 +0000 (13:38 +0200)]
virDomainControllerDefParseXML: Fix broken code indentation when parsing PCI contoller target

Code was not indented properly for one of the nested conditions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefFormatPCI: Refactor formatting of '<target>' subelement
Peter Krempa [Fri, 26 Aug 2022 10:41:50 +0000 (12:41 +0200)]
virDomainControllerDefFormatPCI: Refactor formatting of '<target>' subelement

Rewrite the code to use virXMLFormat element so that we can avoid a
bunch of unnecessary checks.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefFormat: Split out formatting of PCI controller
Peter Krempa [Fri, 26 Aug 2022 10:36:54 +0000 (12:36 +0200)]
virDomainControllerDefFormat: Split out formatting of PCI controller

Move the PCI controller code into virDomainControllerDefFormatPCI.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefFormat: Use proper type for enum
Peter Krempa [Fri, 26 Aug 2022 10:25:23 +0000 (12:25 +0200)]
virDomainControllerDefFormat: Use proper type for enum

Typecast the controller type variable and add all cases to the switch
statement.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainControllerDefValidate: Un-break lines in error messages
Peter Krempa [Fri, 26 Aug 2022 08:39:12 +0000 (10:39 +0200)]
virDomainControllerDefValidate: Un-break lines in error messages

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: capabilities: Retire QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY
Peter Krempa [Thu, 25 Aug 2022 14:59:07 +0000 (16:59 +0200)]
qemu: capabilities: Retire QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Remove extra logic around QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY
Peter Krempa [Thu, 23 Jun 2022 11:49:03 +0000 (13:49 +0200)]
qemu: Remove extra logic around QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY

The virtio-*-(non-)-transitional device models which replace the use of
'disable-legacy'/'disable-modern' features were introduced in qemu-4.0.

This means we can remove the specific parts of the code for formatting
the old-style device options and replace all other code to solely depend
on the QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL flag.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2xmltest: Convert all test cases asserting QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY
Peter Krempa [Thu, 25 Aug 2022 14:44:55 +0000 (16:44 +0200)]
qemuxml2xmltest: Convert all test cases asserting QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY

Turn them into DO_TEST_CAPS_LATEST tests so that we are closer to real
world.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2*test: Remove 'q35-virtio-pci' test case
Peter Krempa [Thu, 25 Aug 2022 14:41:23 +0000 (16:41 +0200)]
qemuxml2*test: Remove 'q35-virtio-pci' test case

As noted by the comments the only difference was the qemu capabilities
asserted. Now that we use only real caps for this test case it makes no
sense to have two copies.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Convert all test cases asserting QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY
Peter Krempa [Thu, 25 Aug 2022 13:46:09 +0000 (15:46 +0200)]
qemuxml2argvtest: Convert all test cases asserting QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY

Turn them into DO_TEST_CAPS_VER bound to qemu-4.2 to show the minimum
amount of change. We already have DO_TEST_CAPS_LATEST versions.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Add DO_TEST_CAPS_LATEST versions of tests which assert QEMU_CAPS_VI...
Peter Krempa [Thu, 23 Jun 2022 15:11:57 +0000 (17:11 +0200)]
qemuxml2argvtest: Add DO_TEST_CAPS_LATEST versions of tests which assert QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY

Further patches will try to remove QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY,
so add few more modern tests before doing that.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2*test: Use QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL for macos hfv tests
Peter Krempa [Thu, 25 Aug 2022 13:35:48 +0000 (15:35 +0200)]
qemuxml2*test: Use QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL for macos hfv tests

Switch from QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY to
QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL as it has no impact on the test
output.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: address: Use PCIe for virtio devices also with QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL
Peter Krempa [Thu, 25 Aug 2022 13:36:49 +0000 (15:36 +0200)]
qemu: address: Use PCIe for virtio devices also with QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL

QEMU_CAPS_VIRTIO_PCI_TRANSITIONAL is the evolution of
QEMU_CAPS_VIRTIO_PCI_DISABLE_LEGACY from qemu's point of view. Make sure
that we consider both when assesing whether a device belongs on PCIe.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemudomainsnapshotxml2xmltest: Add test case for a snapshot with 'inactiveDomain...
Peter Krempa [Thu, 25 Aug 2022 08:52:21 +0000 (10:52 +0200)]
qemudomainsnapshotxml2xmltest: Add test case for a snapshot with 'inactiveDomain' element

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: Add schema for '<inactiveDomain>' element used in the snapshot definition
Peter Krempa [Thu, 25 Aug 2022 09:29:30 +0000 (11:29 +0200)]
schema: Add schema for '<inactiveDomain>' element used in the snapshot definition

The '<inactiveDomain>' element stores the next-start definition of a VM
on snapshot. It was not covered by the schema when it was introduced.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2121276
Fixes: 152c165d34cb6dcd21d08427422850f406cd0643
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschemas: domaincommon: Extract contents of the 'domain' element definition
Peter Krempa [Thu, 25 Aug 2022 09:25:39 +0000 (11:25 +0200)]
schemas: domaincommon: Extract contents of the 'domain' element definition

Move all definition under the <domain> element into a separate
definition so that it can be referenced from elements with other names.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschemas: Extract overrides for the domain element from 'domain.rng'
Peter Krempa [Thu, 25 Aug 2022 09:20:50 +0000 (11:20 +0200)]
schemas: Extract overrides for the domain element from 'domain.rng'

Move the overrides into a single file so that later patches can add
another top level element 'inactiveDomain' used in snapshots.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemudomainsnapshotxml2xmltest: Allow regenerating into non-existing output file
Peter Krempa [Thu, 25 Aug 2022 09:05:39 +0000 (11:05 +0200)]
qemudomainsnapshotxml2xmltest: Allow regenerating into non-existing output file

Replacing the 'virTestLoadFile' + 'virTestDifferenceFull' by '
virTestCompareToFile' allows to use the VIR_TEST_REGENERATE_OUTPUT=1
option to also generate the output file if it doesn't exist.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agonodedevschematest: Add example file for a HBA with 'vport_ops' capability
Peter Krempa [Thu, 25 Aug 2022 08:39:11 +0000 (10:39 +0200)]
nodedevschematest: Add example file for a HBA with 'vport_ops' capability

Illustrate the problem in the schema fixed by previous commit.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoschema: nodedev: Fix schema attribute value for the 'vport_ops' capability
Peter Krempa [Thu, 25 Aug 2022 08:34:58 +0000 (10:34 +0200)]
schema: nodedev: Fix schema attribute value for the 'vport_ops' capability

The code (since 448be8f706693327d77) useds 'vport_ops' in XML.
Later commit cc17f09246212ef added schema for 'vports_ops' (extra 's').
Fix the schema and the corresponding docs.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2121262
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainBackupGetXMLDesc: Fix and use full link to XML documentation
Peter Krempa [Tue, 23 Aug 2022 11:28:51 +0000 (13:28 +0200)]
virDomainBackupGetXMLDesc: Fix and use full link to XML documentation

Use the full link to the backup XML description page and use the proper
anchor after html->RST coversion.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agovirDomainCheckpointCreateXML: Add disclaimer about creating checkpoints
Peter Krempa [Tue, 23 Aug 2022 11:19:38 +0000 (13:19 +0200)]
virDomainCheckpointCreateXML: Add disclaimer about creating checkpoints

Checkpoints created via virDomainCheckpointCreateXML are generally not
very useful as they need to be coupled with a backup.

Add a disclaimer to the docs explaining why users should use
virDomainBackupBegin instead.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agovirDomainCheckpointCreateXML: Don't use HTML in function docs and fix link
Peter Krempa [Tue, 23 Aug 2022 11:01:21 +0000 (13:01 +0200)]
virDomainCheckpointCreateXML: Don't use HTML in function docs and fix link

Fix the link target after the conversion of the XML description to RST
which renamed anchors and drop the <a> tag from the C code comment.
Apart from not working properly in the .c file it didn't work in the
generated docs either as the brackets were escaped.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agodocs: newapi: Consider also 'https://' links in the API generator XSL
Peter Krempa [Tue, 23 Aug 2022 11:13:52 +0000 (13:13 +0200)]
docs: newapi: Consider also 'https://' links in the API generator XSL

We converted exclusively to https links so the generator should wrap
those in appropriate link tags too.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2 years agostorage: Remove the sheepdog storage driver backend source code
Peter Krempa [Fri, 22 Jul 2022 13:23:53 +0000 (15:23 +0200)]
storage: Remove the sheepdog storage driver backend source code

Remove the unused source code for the sheepdog storage backend.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoRemove support for building the sheepdog storage driver backend
Peter Krempa [Wed, 17 Aug 2022 12:39:17 +0000 (14:39 +0200)]
Remove support for building the sheepdog storage driver backend

The sheepdog project is unmaintained, with last commit in 2018 and
numerous unanswered issues reported.

Remove the libvirt storage driver support for it to follow the removal
of the client support in qemu.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Remove storage pool/vol tests for sheepdog
Peter Krempa [Wed, 17 Aug 2022 13:50:57 +0000 (15:50 +0200)]
tests: Remove storage pool/vol tests for sheepdog

The support for the sheepdog storage backend will be dropped in the
upcoming patches. Remove all the relevant tests.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agospec: Drop libvirt-daemon-driver-storage-sheepdog package
Peter Krempa [Wed, 17 Aug 2022 12:21:55 +0000 (14:21 +0200)]
spec: Drop libvirt-daemon-driver-storage-sheepdog package

Upstream will be dropping the sheepdog storage backend, so we need to
stop building the package and obsolete it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Claudio Fontana <cfontana@suse.de>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: qemuxml2argv: Convert all 'boot*' cases to DO_TEST_CAPS_LATEST
Peter Krempa [Tue, 23 Aug 2022 13:13:53 +0000 (15:13 +0200)]
tests: qemuxml2argv: Convert all 'boot*' cases to DO_TEST_CAPS_LATEST

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: qemuxml2argv: Use x86_64 arch and emulator in all boot* test files
Peter Krempa [Tue, 23 Aug 2022 15:36:28 +0000 (17:36 +0200)]
tests: qemuxml2argv: Use x86_64 arch and emulator in all boot* test files

Using the modern emulator and arch will allow us to convert all of the
tests to use DO_TEST_CAPS_LATEST.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemuxml2argvtest: Use different network storage protocol for boot order tests
Peter Krempa [Tue, 23 Aug 2022 13:08:28 +0000 (15:08 +0200)]
qemuxml2argvtest: Use different network storage protocol for boot order tests

The support for 'sheepdog' was dropped from qemu-6.1 and later, to
convert the tests to latest caps we need to use something else. Use
'nbd'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoPost-release version bump to 8.8.0
Jiri Denemark [Thu, 1 Sep 2022 10:00:29 +0000 (12:00 +0200)]
Post-release version bump to 8.8.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoRelease of libvirt-8.7.0
Jiri Denemark [Thu, 1 Sep 2022 09:58:42 +0000 (11:58 +0200)]
Release of libvirt-8.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoTranslated using Weblate (Ukrainian)
Yuri Chornoivan [Thu, 1 Sep 2022 08:44:49 +0000 (10:44 +0200)]
Translated using Weblate (Ukrainian)

Currently translated at 100.0% (10440 of 10440 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>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 1 Sep 2022 08:44:48 +0000 (10:44 +0200)]
Translated using Weblate (Swedish)

Currently translated at 44.0% (4594 of 10440 strings)

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

Translated using Weblate (Swedish)

Currently translated at 43.8% (4574 of 10440 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>
2 years agoTranslated using Weblate (Korean)
김인수 [Thu, 1 Sep 2022 08:44:47 +0000 (10:44 +0200)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10440 of 10440 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>
2 years agoTranslated using Weblate (Japanese)
Ludek Janda [Thu, 1 Sep 2022 08:44:46 +0000 (10:44 +0200)]
Translated using Weblate (Japanese)

Currently translated at 99.8% (10420 of 10440 strings)

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

Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 99.8% (10420 of 10440 strings)

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

Translated using Weblate (Japanese)

Currently translated at 99.8% (10420 of 10440 strings)

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

Co-authored-by: Ludek Janda <ljanda@redhat.com>
Signed-off-by: Ludek Janda <ljanda@redhat.com>
2 years agoNEWS: Fix spelling of 'subelment'
Jim Fehlig [Tue, 30 Aug 2022 22:35:57 +0000 (16:35 -0600)]
NEWS: Fix spelling of 'subelment'

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
2 years agoconf: Add more checks for VDS interface parameters
Martin Kletzander [Tue, 30 Aug 2022 12:41:04 +0000 (14:41 +0200)]
conf: Add more checks for VDS interface parameters

Add some checks that commit 0225483adce9 forgot to include.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoNEWS: Mention bumping of minimum qemu version to 4.2
Peter Krempa [Mon, 29 Aug 2022 07:39:02 +0000 (09:39 +0200)]
NEWS: Mention bumping of minimum qemu version to 4.2

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoNEWS: mention vdpa/vfio memlock bump in release notes
Jonathon Jongsma [Mon, 22 Aug 2022 21:15:38 +0000 (16:15 -0500)]
NEWS: mention vdpa/vfio memlock bump in release notes

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agoUpdate translation files
Weblate [Fri, 26 Aug 2022 09:02:15 +0000 (11:02 +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>
2 years agopo: Refresh potfile for v8.7.0
Jiri Denemark [Fri, 26 Aug 2022 08:53:24 +0000 (10:53 +0200)]
po: Refresh potfile for v8.7.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agodocs: formatdomain: Fix small typos and syntax errors
Carlos Bilbao [Thu, 25 Aug 2022 16:18:52 +0000 (11:18 -0500)]
docs: formatdomain: Fix small typos and syntax errors

Fix some small typos and syntax errors in file formatdomain.rs.

Signed-off-by: Carlos Bilbao <carlos.bilbao@amd.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2 years agonodedev: wait a bit longer for new node devices
Jonathon Jongsma [Tue, 23 Aug 2022 17:28:02 +0000 (12:28 -0500)]
nodedev: wait a bit longer for new node devices

Openstack developers reported that newly-created mdevs were not
recognized by libvirt until after a libvirt daemon restart. The source
of the problem appears to be that when libvirt gets the udev 'add'
event, the sysfs tree for that device might not be ready and so libvirt
waits 100ms for it to appear (max 100 waits of 1ms each). But in the
OpenStack environment, the sysfs tree for new mediated devices was
taking closer to 250ms to appear and therefore libvirt gave up waiting
and didn't add these new devices to its list of nodedevs.

By changing the wait time to 1 second (max 100 waits of 10ms each), this
should provide enough time to enable these deployments to recognize
newly-created mediated devices, but it shouldn't increase the delay for
more traditional deployments too much.

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

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2 years agoRename iterface type='dummy' to type='null'
Martin Kletzander [Wed, 24 Aug 2022 20:46:05 +0000 (22:46 +0200)]
Rename iterface type='dummy' to type='null'

When commit bac6b266fb6a added this "functionality" this was the only
naming I could think of, but after discussion with Dan we found the name
'null' fits a bit better, so change it before we make a release with the
old name.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agovirhostcpu: Fix build with clang and newest kernel headers
Peter Krempa [Tue, 23 Aug 2022 13:29:43 +0000 (15:29 +0200)]
virhostcpu: Fix build with clang and newest kernel headers

The most recent environment e.g. present in our Fedora Rawhide builds
fail to build the tree with clang with the following error:

../src/util/virhostcpu.c:1291:25: error: field 'header' with variable sized type 'struct kvm_msrs' not at the end of a struct or class is a GNU extension [-Werror,-Wgnu-variable-sized-type-not-at-end]
        struct kvm_msrs header;
                        ^

The problem seems to be that clang doesn't like the new way the
'entries' field in struct kvm_msrs is declared.

To work around the issue we can simply allocate the variable dynamically
and use the 'entries' member as it was intended to to access the
members.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoqemu: Do not keep swtpm pidfile around after stopping
Martin Kletzander [Thu, 18 Aug 2022 14:03:01 +0000 (16:03 +0200)]
qemu: Do not keep swtpm pidfile around after stopping

Just like the socket, remove the pidfile when TPM emulator is being stopped.  In
order to make this a bit cleaner, try to remove it even if swtpm_ioctl does not
exist.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoutil: don't use virFirewallRuleToString() to log the rule being applied
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)]
util: don't use virFirewallRuleToString() to log the rule being applied

Instead of separately building the commandline into a string to log,
just wait a few lines until we've built the virCommand object, and
call virCommandToString, which does the same thing.

(As a bonus, we were already calling virCommandToString to put the
commandline in a string in case of a failure when running it - from
the point of view of *that* usage, we're just moving the call to
virCommandToString *up* a few lines, i.e. we now only construct the
commandline string once.)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: make virFirewallRuleToString() global
Laine Stump [Thu, 21 Apr 2022 21:42:30 +0000 (17:42 -0400)]
util: make virFirewallRuleToString() global

Although the next commit will eliminate the one current use of
virFirewallRuleToString(), a future commit will once again have a use
for it, but in a different source file so it will need to be a global
function rather than static. Make that change now so that we don't get
a compile error from having an unused static function in the next
commit.

(The arg list is also changed to include the name of the command as a
separate argument rather than just assuming that it can be derived
from the rule's layer (which is correct for iptables, but won't be
correct for nftables)).

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: remove unused function virFirewallApplyRuleFirewallD()
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)]
util: remove unused function virFirewallApplyRuleFirewallD()

This was a wrapper to call a function in virfirewalld.c that sends an
iptables passthrough rule to firewalld. It hasn't been used in a year
or two, and won't ever be used in the future since passthrough rules
are only supported for iptables, and we've determined that we
shouldn't use iptables passthrough rules.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: replace g_snprintf with g_autofreed g_strdup_printf in viriptables.c
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)]
util: replace g_snprintf with g_autofreed g_strdup_printf in viriptables.c

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agonetwork: create separate config object for virNetworkDriverState
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)]
network: create separate config object for virNetworkDriverState

Similar to the other drivers, virNetworkDriverState now has a
virObject-derived object called virNetworkDriverConfig which is used
for config items.

As a starting point, the directory paths used by the network driver
are moved there (again, parallelling what is done for other drivers).

Using items in virNetworkDriverConfig is (yes, again) similar to using
items in the other drivers' config - anything in the config object is
immutable (once initialized), so the state object only needs to be
locked while getting a reference to the config object, and then the
members of the config object can be safely used until the config
object is unrefed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agonetwork: move driver state struct into bridge_driver_conf.h
Laine Stump [Sun, 13 Mar 2022 18:21:02 +0000 (14:21 -0400)]
network: move driver state struct into bridge_driver_conf.h

This is more similar to lxc and qemu drivers, where the driver state
struct is defined along with a config struct in ${driver}_conf.h

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: remove superfluous cleanup: labels and ret return variables
Laine Stump [Thu, 18 Aug 2022 17:29:07 +0000 (13:29 -0400)]
tests: remove superfluous cleanup: labels and ret return variables

After converting virNetworkDef * to g_autoptr(virNetworkDef) the
cleanup codepath was empty, so it has been removed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: remove superfluous cleanup: labels and ret return variables
Laine Stump [Thu, 18 Aug 2022 17:28:55 +0000 (13:28 -0400)]
qemu: remove superfluous cleanup: labels and ret return variables

After converting virNetworkDef * to g_autoptr(virNetworkDef) the
cleanup codepath was empty, so it has been removed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: remove superfluous cleanup: labels and ret return variables
Laine Stump [Thu, 18 Aug 2022 17:28:39 +0000 (13:28 -0400)]
conf: remove superfluous cleanup: labels and ret return variables

After converting virNetworkDef * to g_autoptr(virNetworkDef) the
cleanup codepath was empty, so it has been removed.

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:26:34 +0000 (13:26 -0400)]
tests: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovbox: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:26:13 +0000 (13:26 -0400)]
vbox: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotest driver: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:25:55 +0000 (13:25 -0400)]
test driver: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:25:32 +0000 (13:25 -0400)]
qemu: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agonetwork: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:25:11 +0000 (13:25 -0400)]
network: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoesx: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:24:53 +0000 (13:24 -0400)]
esx: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)
Laine Stump [Thu, 18 Aug 2022 17:24:41 +0000 (13:24 -0400)]
conf: replace explicit virNetworkDefFree() with g_autoptr(virNetworkDef)

Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoci: Switch from macOS 11 to macOS 12
Andrea Bolognani [Thu, 11 Aug 2022 10:05:24 +0000 (12:05 +0200)]
ci: Switch from macOS 11 to macOS 12

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoci: Refresh generated files
Andrea Bolognani [Thu, 11 Aug 2022 10:04:48 +0000 (12:04 +0200)]
ci: Refresh generated files

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodocs: fix syntax errors in IPv6 NAT example XML
Daniel P. Berrangé [Tue, 23 Aug 2022 15:10:56 +0000 (16:10 +0100)]
docs: fix syntax errors in IPv6 NAT example XML

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agolib: Don't check for retval for virCommandNew*()
Michal Privoznik [Tue, 23 Aug 2022 12:35:47 +0000 (14:35 +0200)]
lib: Don't check for retval for virCommandNew*()

The virCommand module is specifically designed so that no caller
has to check for retval of individual virCommand*() APIs except
for virCommandRun() where the actual error is reported. Moreover,
virCommandNew*() use g_new0() to allocate memory and thus it's
not really possible for those APIs to return NULL. Which is why
they are even marked as ATTRIBUTE_NONNULL. But there are few
places where we do check the retval which is a dead code
effectively. Drop those checks.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agoTranslated using Weblate (Chinese (Simplified) (zh_CN))
Ludek Janda [Tue, 23 Aug 2022 13:11:36 +0000 (15:11 +0200)]
Translated using Weblate (Chinese (Simplified) (zh_CN))

Currently translated at 99.0% (10379 of 10480 strings)

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

Co-authored-by: Ludek Janda <ljanda@redhat.com>
Signed-off-by: Ludek Janda <ljanda@redhat.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Sun, 21 Aug 2022 00:48:32 +0000 (02:48 +0200)]
Translated using Weblate (Swedish)

Currently translated at 43.0% (4513 of 10480 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>
2 years agoqemu: adjust memlock for multiple vfio/vdpa devices
Jonathon Jongsma [Wed, 20 Jul 2022 17:12:23 +0000 (12:12 -0500)]
qemu: adjust memlock for multiple vfio/vdpa devices

When multiple VFIO or VDPA devices are assigned to a guest, the guest
can fail to start because the guest fails to map enough memory. For
example, the case mentioned in
https://bugzilla.redhat.com/show_bug.cgi?id=2111317 results in this
failure:

    2021-08-05T09:51:47.692578Z qemu-kvm: failed to write, fd=31, errno=14 (Bad address)
    2021-08-05T09:51:47.692590Z qemu-kvm: vhost vdpa map fail!
    2021-08-05T09:51:47.692594Z qemu-kvm: vhost-vdpa: DMA mapping failed, unable to continue

The current memlock limit calculation does not work for scenarios where
there are multiple such devices assigned to a guest. The root causes are
a little bit different between VFIO and VDPA devices.

For VFIO devices, the issue only occurs when a vIOMMU is present. In
this scenario, each vfio device is assigned a separate AddressSpace
fully mapping guest RAM. When there is no vIOMMU, the devices are all
within the same AddressSpace so no additional memory limit is needed.

For VDPA devices, each device requires the full memory to be mapped
regardless of whether there is a vIOMMU or not.

In order to enable these scenarios, we need to multiply memlock limit
by the number of VDPA devices plus the number of VFIO devices for guests
with a vIOMMU. This has the potential for pushing the memlock limit
above the host physical memory and negating any protection that these
locked memory limits are providing, but there is no other short-term
solution.

In the future, there should be have a revised userspace iommu interface
(iommufd) that the VFIO and VDPA backends can make use of. This will be
able to share locked memory limits between both vfio and vdpa use cases
and address spaces and then we can disable these short term hacks. But
this is still in development upstream.

Resolves: https://bugzilla.redhat.com/2111317

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2 years agolibxl: Fix build with recent Xen that introduces new disk backend type
Oleksandr Tyshchenko [Fri, 29 Jul 2022 15:50:24 +0000 (18:50 +0300)]
libxl: Fix build with recent Xen that introduces new disk backend type

Xen toolstack has gained basic Virtio support recently which becides
adding various virtio related stuff introduces new disk backend type
LIBXL_DISK_BACKEND_STANDALONE [1].

Unfortunately, this caused a regression in libvirt build with Xen support
enabled, reported by the osstest today [2]:

CC       libxl/libvirt_driver_libxl_impl_la-xen_xl.lo
../../src/libxl/xen_xl.c: In function 'xenParseXLDisk':
../../src/libxl/xen_xl.c:779:17: error: enumeration value 'LIBXL_DISK_BACKEND_STANDALONE'
   not handled in switch [-Werror=switch-enum]
                 switch (libxldisk->backend) {
                 ^~~~~~
cc1: all warnings being treated as errors

The interesting fact is that switch already has a default branch (which ought
to cover such new addition), but the error is triggered as -Wswitch-enum
gives a warning about an omitted enumeration code even if there is a default
label.

Also there is a similar issue in libxlUpdateDiskDef() which I have reproduced
after fixing the first one, but it that case the corresponding switch doesn't
have a default branch.

Fix both issues by inserting required enumeration item to make the compiler
happy and adding ifdef guard to be able to build against old Xen libraries
as well (without LIBXL_HAVE_DEVICE_DISK_SPECIFICATION). Also add a default
branch to switch in libxlUpdateDiskDef().

Please note, that current patch doesn't implement the proper handling of
LIBXL_DISK_BACKEND_STANDALONE and friends, it is just intended to fix
the regression immediately to unblock the osstest.  Also it worth mentioning
that current patch won't solve the possible additions in the future.

[1] https://lore.kernel.org/xen-devel/20220716163745.28712-1-olekstysh@gmail.com/
[2] https://lore.kernel.org/xen-devel/E1oHEQO-0008GA-Uo@osstest.test-lab.xenproject.org/

Signed-off-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu: do not probe for -pcihost properties
Ján Tomko [Fri, 19 Aug 2022 14:32:03 +0000 (16:32 +0200)]
qemu: do not probe for -pcihost properties

Now that we no longer care about any of their properties, there's no need
to call `device-list-properties` on these devices.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: retire QEMU_CAPS_Q35_PCI_HOLE64_SIZE
Ján Tomko [Fri, 19 Aug 2022 14:31:57 +0000 (16:31 +0200)]
qemu: retire QEMU_CAPS_Q35_PCI_HOLE64_SIZE

We no longer use it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: Retire QEMU_CAPS_I440FX_PCI_HOLE64_SIZE
Ján Tomko [Fri, 19 Aug 2022 14:31:09 +0000 (16:31 +0200)]
qemu: Retire QEMU_CAPS_I440FX_PCI_HOLE64_SIZE

We no longer use it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: always assume QEMU_CAPS_*_HOLE64_SIZE
Ján Tomko [Thu, 11 Aug 2022 17:08:35 +0000 (19:08 +0200)]
qemu: always assume QEMU_CAPS_*_HOLE64_SIZE

Introduced back in 2013 by QEMU commit:
  commit 398489018183d613306ab022653552247d93919f

      pc: limit 64 bit hole to 2G by default

Released in 1.6.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: retire QEMU_CAPS_DUMP_GUEST_MEMORY
Ján Tomko [Thu, 11 Aug 2022 16:52:46 +0000 (18:52 +0200)]
qemu: retire QEMU_CAPS_DUMP_GUEST_MEMORY

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemu: always assume QEMU_CAPS_DUMP_GUEST_MEMORY
Ján Tomko [Thu, 11 Aug 2022 16:50:00 +0000 (18:50 +0200)]
qemu: always assume QEMU_CAPS_DUMP_GUEST_MEMORY

Introduced back in 2012 by QEMU commit:
  commit 783e9b4826b95e53e33c42db6b4bd7d89bdff147
      introduce a new monitor command 'dump-guest-memory' to dump guest's memory

Released in QEMU 1.2.0

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agotests: Reset macOS dyld environment
Andrea Bolognani [Wed, 17 Aug 2022 13:41:57 +0000 (15:41 +0200)]
tests: Reset macOS dyld environment

This is needed to ensure the environment variables that we need
for the test program itself, specifically to load mock libraries,
do not interfere with any command that gets invoked by it, either
directly or indirectly. We already perform the same cleanup step
for LD_* variables.

This makes the test failures

  error : virCommandWait:2752 : internal error: Child process
    (/usr/libexec/qemu/vhost-user/test-vhost-user-gpu --print-capabilities)
    unexpected fatal signal 6: dyld[8896]: symbol not found in flat
    namespace '_virQEMUCapsGet'
  error : qemuVhostUserFillDomainGPU:394 : operation failed: Unable to
    find a satisfying vhost-user-gpu

that were showing up on macOS 12 go away.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: Preserve macOS dyld environment by default
Andrea Bolognani [Wed, 17 Aug 2022 13:37:16 +0000 (15:37 +0200)]
util: Preserve macOS dyld environment by default

The DYLD_* environment variables on macOS have the same purpose
as the LD_* variables have on Linux. Since we're preserving the
latter by default, it makes sense to do the same for the former
as well.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Drop irrelevant CPU config from graphics-spice-timeout
Jiri Denemark [Thu, 18 Aug 2022 14:13:45 +0000 (16:13 +0200)]
tests: Drop irrelevant CPU config from graphics-spice-timeout

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu_tpm: Don't crash if qemuTPMPcrBankBitmapToStr(NULL)
Michal Privoznik [Thu, 11 Aug 2022 18:57:02 +0000 (20:57 +0200)]
qemu_tpm: Don't crash if qemuTPMPcrBankBitmapToStr(NULL)

Historically, the tpm->data.emulator.activePcrBanks member was an
unsigned int but since it was used as a bitmap it was converted
to virBitmap type instead. Now, the virBitmap is allocated inside
of virDomainTPMDefParseXML() but only if <activePcrBanks/> was
found with at last one child element. Otherwise it stays NULL.

Fast forward to starting a domain with TPM 2.0 and no
<activePcrBanks/> configured. Eventually,
qemuTPMEmulatorBuildCommand() is called, which subsequently calls
qemuTPMEmulatorReconfigure() and finally
qemuTPMPcrBankBitmapToStr() passing the NULL value. Before
rewrite to virBitmap this function would return NULL for empty
activePcrBanks but now, well, now it crashes.

Fixes: 52c7c31c8038aa31d502f59a40e4fb4ba9f61113
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovmx: Fix leak in virVMXParseEthernet
Martin Kletzander [Thu, 18 Aug 2022 13:43:13 +0000 (15:43 +0200)]
vmx: Fix leak in virVMXParseEthernet

Commit 580538c5dd7f forgot to free switchId.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu_driver: use qemuMonitorQueryStats to extract halt poll time
Amneesh Singh [Thu, 18 Aug 2022 03:17:20 +0000 (08:47 +0530)]
qemu_driver: use qemuMonitorQueryStats to extract halt poll time

This patch uses qemuMonitorQueryStats to query "halt_poll_success_ns"
and "halt_poll_fail_ns" for every vCPU. The respective values for each
vCPU are then added together.

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu_capabilities: add "query-stats" QMP command to the QEMU capabilities
Amneesh Singh [Thu, 18 Aug 2022 03:17:19 +0000 (08:47 +0530)]
qemu_capabilities: add "query-stats" QMP command to the QEMU capabilities

Related: https://gitlab.com/libvirt/libvirt/-/issues/276

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agoqemu_monitor: add qemuMonitorQueryStats
Amneesh Singh [Thu, 18 Aug 2022 03:17:18 +0000 (08:47 +0530)]
qemu_monitor: add qemuMonitorQueryStats

Related: https://gitlab.com/libvirt/libvirt/-/issues/276

This patch adds an API for the "query-stats" QMP command.

The query returns a JSON containing the statistics based on the target,
which can either be vCPU or VM, and the providers. The API deserializes
the query result into an array of GHashMaps, which can later be used to
extract all the query statistics. GHashMaps are used to avoid traversing
the entire array to find the statistics you are looking for. This would
be a singleton array if the target is a VM since the returned JSON is
also a singleton array in that case.

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2 years agonews: Mention esx support for new interface types
Martin Kletzander [Thu, 18 Aug 2022 10:44:02 +0000 (12:44 +0200)]
news: Mention esx support for new interface types

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
2 years agovmx: Add support for VDS interface
Martin Kletzander [Wed, 17 Aug 2022 12:44:55 +0000 (14:44 +0200)]
vmx: Add support for VDS interface

Since we cannot properly plug a new VM into the distributed switch, we can at
least report the provided pieces of information, so that XML editing still works
even for VMs with such interfaces.

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

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf, docs, schemas: Add support for interface type vds
Martin Kletzander [Wed, 17 Aug 2022 12:35:17 +0000 (14:35 +0200)]
conf, docs, schemas: Add support for interface type vds

This represents an interface connected to a VMWare Distributed Switch,
previously obscured as a dummy interface.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovmx: Require networkName for bridged and custom NICs
Martin Kletzander [Tue, 9 Aug 2022 13:00:06 +0000 (15:00 +0200)]
vmx: Require networkName for bridged and custom NICs

Commit 70768cda9740 marked this particular config string optional, but
forgot that two of the interface types still require this name to
exist.  Mark it as optional only if there is no connectionType.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Rewrite virNetDevVPortProfileCopy
Martin Kletzander [Thu, 11 Aug 2022 12:59:09 +0000 (14:59 +0200)]
conf: Rewrite virNetDevVPortProfileCopy

This makes it nicer to use as since it cannot fail shortens the usage in all
callers.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Fix vmx/xml filenames
Martin Kletzander [Thu, 11 Aug 2022 13:16:36 +0000 (15:16 +0200)]
tests: Fix vmx/xml filenames

Commit 70768cda9740 added a functionality that was previously (in an unsubmitted
version of the commit) represented differently in the XML, but the filenames
kept the old name.  Fix the name so they are not misleading.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Reviewed-by: Ján Tomko <jtomko@redhat.com>