]> xenbits.xensource.com Git - libvirt.git/log
libvirt.git
2 years agoUpdate translation files
Weblate [Thu, 30 Jun 2022 00:21:24 +0000 (02:21 +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 agoTranslated using Weblate (Swedish)
Göran Uddeborg [Thu, 30 Jun 2022 00:21:21 +0000 (02:21 +0200)]
Translated using Weblate (Swedish)

Currently translated at 37.5% (3942 of 10491 strings)

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

Translated using Weblate (Swedish)

Currently translated at 37.4% (3920 of 10472 strings)

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

Translated using Weblate (Swedish)

Currently translated at 37.3% (3901 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoqemucapabilitiestest: Update capabilities for the 7.1 release cycle on x86_64
Peter Krempa [Fri, 24 Jun 2022 09:03:07 +0000 (11:03 +0200)]
qemucapabilitiestest: Update capabilities for the 7.1 release cycle on x86_64

Update to v7.0.0-2187-g2a8835cb45

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

    - removed:
        - piix3-ide-xen

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: virDomainMemoryDefValidate: Improve error message
Liu Yiding [Tue, 28 Jun 2022 03:53:35 +0000 (11:53 +0800)]
conf: virDomainMemoryDefValidate: Improve error message

An explicit limit would be more user friendly. Add the limit to error message.

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

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

Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoNEWS: Document my contributions for the upcoming release
Michal Privoznik [Mon, 27 Jun 2022 07:52:15 +0000 (09:52 +0200)]
NEWS: Document my contributions for the upcoming release

There are couple of features/improvements/bugfixes I contributed
into the upcoming release. Include those worth mentioning in the
NEWS.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agopo: Refresh potfile for v8.5.0
Jiri Denemark [Mon, 27 Jun 2022 06:56:55 +0000 (08:56 +0200)]
po: Refresh potfile for v8.5.0

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Sat, 25 Jun 2022 08:18:52 +0000 (10:18 +0200)]
Translated using Weblate (Swedish)

Currently translated at 37.0% (3861 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoschema: Be more flexible for diskSourceNetworkProtocolPropsCommon
Jonathon Jongsma [Wed, 15 Jun 2022 16:29:47 +0000 (11:29 -0500)]
schema: Be more flexible for diskSourceNetworkProtocolPropsCommon

Add <interleave> to allow the subproperties to be specified in any
order.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodocs: clarify 'readahead' and 'timeout' for disks
Jonathon Jongsma [Wed, 15 Jun 2022 16:21:58 +0000 (11:21 -0500)]
docs: clarify 'readahead' and 'timeout' for disks

Document the format of the 'readahead' and 'timeout' XML elements more
accurately.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoqemu_migration: Implement VIR_MIGRATE_ZEROCOPY flag
Jiri Denemark [Wed, 22 Jun 2022 14:37:31 +0000 (16:37 +0200)]
qemu_migration: Implement VIR_MIGRATE_ZEROCOPY flag

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

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirsh: Add support for VIR_MIGRATE_ZEROCOPY flag
Jiri Denemark [Wed, 22 Jun 2022 14:36:53 +0000 (16:36 +0200)]
virsh: Add support for VIR_MIGRATE_ZEROCOPY flag

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoAdd VIR_MIGRATE_ZEROCOPY flag
Jiri Denemark [Wed, 22 Jun 2022 14:35:50 +0000 (16:35 +0200)]
Add VIR_MIGRATE_ZEROCOPY flag

The flag can be used to enable zero-copy mechanism for migrating memory
pages.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu_migration: Don't set unlimited memlock limit for RDMA
Jiri Denemark [Thu, 23 Jun 2022 12:25:30 +0000 (14:25 +0200)]
qemu_migration: Don't set unlimited memlock limit for RDMA

Our documentation says RDMA migration requires hard_limit to be set so
that we know how big memory locking limit should be set for the domain
during migration. But since commit v1.2.13-71-gcf521fc8ba (which changed
the default hard_limit value from 0 to
VIR_DOMAIN_MEMORY_PARAM_UNLIMITED) we were actually setting memlock
limit to unlimited if hard_limit was not set.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu_migration: Restore original memory locking limit
Jiri Denemark [Wed, 22 Jun 2022 14:12:02 +0000 (16:12 +0200)]
qemu_migration: Restore original memory locking limit

For RDMA migration we update memory locking limit, but never set it back
once migration finishes (on the destination host) or aborts (on the
source host).

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu_migration: Use qemuDomainSetMaxMemLock
Jiri Denemark [Wed, 22 Jun 2022 07:04:04 +0000 (09:04 +0200)]
qemu_migration: Use qemuDomainSetMaxMemLock

This helper will not try to set the limit if it is already big enough,
which may be useful when libvirt daemon is running in a containerized
environment and is not allowed to change memory locking limit.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Add qemuDomainSetMaxMemLock helper
Jiri Denemark [Wed, 22 Jun 2022 13:21:30 +0000 (15:21 +0200)]
qemu: Add qemuDomainSetMaxMemLock helper

qemuDomainAdjustMaxMemLock combined computing the desired limit with
applying it. This patch separates the code to apply a memory locking
limit to a new qemuDomainSetMaxMemLock helper for better reusability.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agostoragefile: set size field of ploop to 8
Ján Tomko [Wed, 18 May 2022 13:59:36 +0000 (15:59 +0200)]
storagefile: set size field of ploop to 8

For all file formats, the length of the size field is assumed
and hardcoded to be 8 bytes.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: virDomainDefParseMemory: remove pointless assignment
Ján Tomko [Wed, 22 Jun 2022 11:44:06 +0000 (13:44 +0200)]
conf: virDomainDefParseMemory: remove pointless assignment

Evaluate the XPath as a boolean, instead of trying to get a node
out of it.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodocs: update links to listman
Ján Tomko [Wed, 22 Jun 2022 11:37:18 +0000 (13:37 +0200)]
docs: update links to listman

The mailman for mailing lists hosted by Red Hat seems to have moved
to listman.redhat.com. While the old links still seem to work,
point our docs to the new location to avoid the redirect.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agolibxl: remove cleanup label from libxlDomainMigrationSrcPerform
Ján Tomko [Wed, 22 Jun 2022 05:32:42 +0000 (07:32 +0200)]
libxl: remove cleanup label from libxlDomainMigrationSrcPerform

Use VIR_AUTOCLOSE for the remaining file descriptor that uses
manual cleanup and remove the label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 years agoqemu: remove cleanup label from qemuMigrationSrcGraphicsRelocate
Ján Tomko [Wed, 22 Jun 2022 05:29:22 +0000 (07:29 +0200)]
qemu: remove cleanup label from qemuMigrationSrcGraphicsRelocate

Remove the label and use 'rc' instead of 'ret'.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 years agovmx: use g_autofree in virVMXParseSerial
Ján Tomko [Wed, 22 Jun 2022 05:27:39 +0000 (07:27 +0200)]
vmx: use g_autofree in virVMXParseSerial

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 years agovz: refactor prlsdkGetSerialInfo
Ján Tomko [Wed, 22 Jun 2022 05:24:59 +0000 (07:24 +0200)]
vz: refactor prlsdkGetSerialInfo

Use g_autofree for the two strings still using manual cleanup
and remove the pointless cleanup label.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 years agotests: remove pointless label in testURIParse
Ján Tomko [Wed, 22 Jun 2022 05:21:54 +0000 (07:21 +0200)]
tests: remove pointless label in testURIParse

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 years agoUse g_auto for virURI almost everywhere
Ján Tomko [Wed, 22 Jun 2022 05:14:04 +0000 (07:14 +0200)]
Use g_auto for virURI almost everywhere

Convert all the cases where we can unconditionally free
the virURI at the end of scope.

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Wed, 22 Jun 2022 09:18:51 +0000 (11:18 +0200)]
Translated using Weblate (Swedish)

Currently translated at 36.4% (3801 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoNEWS: Add support for network backed NVRAM
Rohit Kumar [Tue, 21 Jun 2022 12:22:26 +0000 (05:22 -0700)]
NEWS: Add support for network backed NVRAM

Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agosrc: QemuMonitorCommandWithFiles: report error when fd passing is unsupported
Ján Tomko [Wed, 18 May 2022 13:56:23 +0000 (15:56 +0200)]
src: QemuMonitorCommandWithFiles: report error when fd passing is unsupported

The result of the <= 0 comparison was assigned to 'rc', rendering the
if (rc == 0) condition dead code.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agolibxl: Fix domain startup failure error reporting
Cole Robinson [Fri, 17 Jun 2022 21:09:32 +0000 (17:09 -0400)]
libxl: Fix domain startup failure error reporting

When domain startup fails, domain cleanup calls
libxlNetworkUnwindDevices, which calls virGetConnectNetwork, which
is a top level API entry point, which resets the initial saved error,
leading to clients seeing:

  error: An error occurred, but the cause is unknown

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

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2 years agoqemu: validate: use domcaps for tpm validation
Cole Robinson [Sat, 18 Jun 2022 17:22:52 +0000 (13:22 -0400)]
qemu: validate: use domcaps for tpm validation

Replace tpm->type and tpm->model qemuCaps validation with the
similar logic in domcaps.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2 years agotests: mock swtpm initialization for all qemu tests
Cole Robinson [Sat, 18 Jun 2022 17:21:57 +0000 (13:21 -0400)]
tests: mock swtpm initialization for all qemu tests

Don't restrict this to domcaps testing only, we will soon
need it for qemu command line validation

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2 years agoqemu: command: Use correct tpm device for all non-x86
Cole Robinson [Sat, 18 Jun 2022 16:46:03 +0000 (12:46 -0400)]
qemu: command: Use correct tpm device for all non-x86

The qemu `tpm-tis` device is an ISA device, so only really applicable
to x86 archs. For all non-x86 archs we should use `tpm-tis-device`

This fixes tpm-tis usage on armv7l and riscv

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2 years agoqemu: validate: Drop tpm-tis arch validation
Cole Robinson [Sat, 18 Jun 2022 16:52:29 +0000 (12:52 -0400)]
qemu: validate: Drop tpm-tis arch validation

Checking against qemu capabilities should be enough here

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

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2 years agoTranslated using Weblate (Russian)
Sergey A [Mon, 20 Jun 2022 09:42:19 +0000 (11:42 +0200)]
Translated using Weblate (Russian)

Currently translated at 91.8% (9582 of 10431 strings)

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

Co-authored-by: Sergey A <sw@atrus.ru>
Signed-off-by: Sergey A. <sw@atrus.ru>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 20 Jun 2022 09:42:19 +0000 (11:42 +0200)]
Translated using Weblate (Swedish)

Currently translated at 36.0% (3761 of 10431 strings)

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

Translated using Weblate (Swedish)

Currently translated at 35.6% (3721 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agonwfilter: spawn thread for reloading on firewalld trigger
Daniel P. Berrangé [Fri, 1 Apr 2022 09:24:37 +0000 (10:24 +0100)]
nwfilter: spawn thread for reloading on firewalld trigger

When firewalld is restarted or has its rules reloaded, we trigger a
reload of the nwfilter driver. This is done directly in the main
event loop thread which is a bad idea.

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

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

    libvirtd: fix potential deadlock when reloading

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

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agotools: add '--xpath EXPRESSION --wrap' args to all dumpxml commands
Daniel P. Berrangé [Thu, 16 Jun 2022 15:29:54 +0000 (16:29 +0100)]
tools: add '--xpath EXPRESSION --wrap' args to all dumpxml commands

While you can chain the virsh output up to a later 'xmllint' or 'xpath'
command, integrating it into virsh avoids needs for installing extra
binaries which we've often found to be missing on production installs
of libvirt. It also gives better response if the initial virsh command
hits an error, as you don't get an aborted pipeline.

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

If multiple nodes match, they are emitted individually:

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

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

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

Fixes https://gitlab.com/libvirt/libvirt/-/issues/244
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agotools: add helper method for printing an XML document
Daniel P. Berrangé [Thu, 16 Jun 2022 14:59:03 +0000 (15:59 +0100)]
tools: add helper method for printing an XML document

The trivial case of fully printing an XML document is boring, but
this helper does more by allowing an XPath expression to be given.
It will then print just the subset of nodes which match the
expression. It either print each match as a standalone XML doc
or can put them into one new XML doc wrapped woith <nodes>...</nodes>

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2 years agoconf: cpu: Add <signature family=X model=X stepping=X/>
Cole Robinson [Sat, 11 Jun 2022 16:24:37 +0000 (12:24 -0400)]
conf: cpu: Add <signature family=X model=X stepping=X/>

Internally we already collect x86 host family + model + stepping
numeric values. This exposed them in capabilities CPU output.
Example:

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

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

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2 years agoqemu: Fix alignment in qemuFirmwareMappingFlashFormat()
Andrea Bolognani [Mon, 13 Jun 2022 09:53:09 +0000 (11:53 +0200)]
qemu: Fix alignment in qemuFirmwareMappingFlashFormat()

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
2 years agoqemu: Simplify handling of virTristateBool values
Andrea Bolognani [Thu, 9 Jun 2022 17:09:31 +0000 (19:09 +0200)]
qemu: Simplify handling of virTristateBool values

We explicitly check whether the value is YES or NO, which makes
it unnecessary to make sure it's not ABSENT beforehand.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Fix virDomainDefOSValidate()
Andrea Bolognani [Thu, 9 Jun 2022 17:26:16 +0000 (19:26 +0200)]
conf: Fix virDomainDefOSValidate()

Even when the os.loader element is absent, we still have to
validate that the user is not attempting to use firmware
autoselection with a driver that doesn't implement the feature.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovmx: Declare support for firmware autoselection
Andrea Bolognani [Fri, 10 Jun 2022 08:05:01 +0000 (10:05 +0200)]
vmx: Declare support for firmware autoselection

The feature was implemented in commits b4e34d1083bc and
9bb6e4e739fa but the corresponding feature flag was not set in
the driver, so other parts of of libvirt wouldn't be able to
know about it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: virtiofs: format --thread-pool-size
Ján Tomko [Fri, 10 Jun 2022 13:25:00 +0000 (15:25 +0200)]
qemu: virtiofs: format --thread-pool-size

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agoconf: virtiofs: add thread_pool element
Ján Tomko [Fri, 10 Jun 2022 13:10:29 +0000 (15:10 +0200)]
conf: virtiofs: add thread_pool element

Add an element to configure the thread pool size:

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

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

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2 years agodocs: formatdomain: update hostdev interface section a bit
Yalan Zhang [Thu, 16 Jun 2022 05:11:42 +0000 (13:11 +0800)]
docs: formatdomain: update hostdev interface section a bit

Update the default "driver" value for hostdev interface since
the default is not "KVM" anymore (refer to "Host device
asssignment" part and by test results). And update the mac
address in one xml example.

Signed-off-by: Yalan Zhang <yalzhang@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agolxc: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:14 +0000 (20:13 +0800)]
lxc: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotests: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:13 +0000 (20:13 +0800)]
tests: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotools: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:12 +0000 (20:13 +0800)]
tools: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agotest_driver: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:11 +0000 (20:13 +0800)]
test_driver: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovmx: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:10 +0000 (20:13 +0800)]
vmx: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovmware: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:09 +0000 (20:13 +0800)]
vmware: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovbox: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:08 +0000 (20:13 +0800)]
vbox: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoutil: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:07 +0000 (20:13 +0800)]
util: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agostorage: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:06 +0000 (20:13 +0800)]
storage: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agorpc: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:05 +0000 (20:13 +0800)]
rpc: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoremote: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:04 +0000 (20:13 +0800)]
remote: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoqemu: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:03 +0000 (20:13 +0800)]
qemu: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoopenvz: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:02 +0000 (20:13 +0800)]
openvz: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agonode_device: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:01 +0000 (20:13 +0800)]
node_device: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agonetwork: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:13:00 +0000 (20:13 +0800)]
network: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agologging: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:59 +0000 (20:12 +0800)]
logging: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agolocking: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:58 +0000 (20:12 +0800)]
locking: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agolibxl: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:57 +0000 (20:12 +0800)]
libxl: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agohypvervisor: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:56 +0000 (20:12 +0800)]
hypvervisor: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agohyperv: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:55 +0000 (20:12 +0800)]
hyperv: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoesx: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:54 +0000 (20:12 +0800)]
esx: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agocpu: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:53 +0000 (20:12 +0800)]
cpu: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoconf: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:52 +0000 (20:12 +0800)]
conf: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoch: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:51 +0000 (20:12 +0800)]
ch: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoadmin: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:50 +0000 (20:12 +0800)]
admin: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoaccess: Remove unused includes
Peng Liang [Wed, 8 Jun 2022 12:12:49 +0000 (20:12 +0800)]
access: Remove unused includes

Signed-off-by: Peng Liang <tcx4c70@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Wed, 15 Jun 2022 15:18:53 +0000 (17:18 +0200)]
Translated using Weblate (Swedish)

Currently translated at 35.2% (3681 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoTranslated using Weblate (Russian)
Sergey A [Wed, 15 Jun 2022 15:18:52 +0000 (17:18 +0200)]
Translated using Weblate (Russian)

Currently translated at 91.8% (9582 of 10431 strings)

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

Co-authored-by: Sergey A <sw@atrus.ru>
Signed-off-by: Sergey A. <sw@atrus.ru>
2 years agovirDomainDiskTranslateSourcePool: Fix check of 'startupPolicy' definition
Peter Krempa [Tue, 14 Jun 2022 12:21:33 +0000 (14:21 +0200)]
virDomainDiskTranslateSourcePool: Fix check of 'startupPolicy' definition

The check was historically done only for _TYPE_VOLUME disks, but
refactors to allow _TYPE_VOLUME disks in the backing chain caused a
regression where we'd reject startupPolicy also for _TYPE_BLOCK disks
which historically worked well.

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

Fixes: 37f01262eed9f37dd5eb7de8b83edd2fea741054
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2095758
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainDiskDefValidateStartupPolicy: Validate disk type better
Peter Krempa [Tue, 14 Jun 2022 12:07:47 +0000 (14:07 +0200)]
virDomainDiskDefValidateStartupPolicy: Validate disk type better

Our startup policy checkers work only for local paths, so disk sources
such as NVMe, or vhost-user can't be used with startup policy.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agodomain_validate: Split out validation of disk startup policy
Peter Krempa [Tue, 14 Jun 2022 11:23:29 +0000 (13:23 +0200)]
domain_validate: Split out validation of disk startup policy

Move the code into 'virDomainDiskDefValidateStartupPolicy' which will be
later reused in the qemu driver.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainDiskDefValidate: Improve error messages for 'startupPolicy' checks
Peter Krempa [Tue, 14 Jun 2022 11:13:48 +0000 (13:13 +0200)]
virDomainDiskDefValidate: Improve error messages for 'startupPolicy' checks

Remove linebreak and mention the attribute name. Also prepare the error
messages for future by substituting the type of offending access.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2 years agovirDomainHugepagesFormat: Use virXMLFormatElementEmpty
Peter Krempa [Fri, 3 Jun 2022 11:37:00 +0000 (13:37 +0200)]
virDomainHugepagesFormat: Use virXMLFormatElementEmpty

Refactor the function to use modern XML formatting machinery.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoAdd unit tests for new specification of nvram.
Rohit Kumar [Wed, 4 May 2022 16:51:14 +0000 (09:51 -0700)]
Add unit tests for new specification of nvram.

This patch adds unit tests for remote NVRAM.

Examples:

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

and

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

and

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

Signed-off-by: Prerna Saxena <prerna.saxena@nutanix.com>
Signed-off-by: Florian Schmidt <flosch@nutanix.com>
Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoconf: Add support to parse/format <source> for NVRAM
Rohit Kumar [Wed, 4 May 2022 16:51:12 +0000 (09:51 -0700)]
conf: Add support to parse/format <source> for NVRAM

This patch introduces the logic to format and parse remote NVRAM.

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

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

or

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

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

Signed-off-by: Prerna Saxena <prerna.saxena@nutanix.com>
Signed-off-by: Florian Schmidt <flosch@nutanix.com>
Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoconf: Extract formatting of NVRAM out of virDomainLoaderDefFormat
Peter Krempa [Fri, 3 Jun 2022 10:39:38 +0000 (12:39 +0200)]
conf: Extract formatting of NVRAM out of virDomainLoaderDefFormat

Introduce virDomainLoaderDefFormatNvram and extract the code to it so
that it's self-contained in upcoming patches adding more complex logic.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoqemuFirmwareFillDomain: Don't fill in firmware for network backed nvram
Peter Krempa [Fri, 3 Jun 2022 11:22:42 +0000 (13:22 +0200)]
qemuFirmwareFillDomain: Don't fill in firmware for network backed nvram

Prepare for network backed nvram by refusing the reset of nvram on boot
and don't check whether it exists. We will not support filling it from a
template.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoqemu: validate: Reject virStorageSource features we don't want to support with nvram
Rohit Kumar [Wed, 4 May 2022 16:51:12 +0000 (09:51 -0700)]
qemu: validate: Reject virStorageSource features we don't want to support with nvram

Signed-off-by: Prerna Saxena <prerna.saxena@nutanix.com>
Signed-off-by: Florian Schmidt <flosch@nutanix.com>
Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoqemuDomainInitializePflashStorageSource: Properly and fully initialize nvram source
Peter Krempa [Wed, 1 Jun 2022 12:50:29 +0000 (14:50 +0200)]
qemuDomainInitializePflashStorageSource: Properly and fully initialize nvram source

Setup all fields for use with -blockdev.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoqemuProcessReconnect: Don't re-instantiate pflash storage source
Peter Krempa [Wed, 1 Jun 2022 12:40:19 +0000 (14:40 +0200)]
qemuProcessReconnect: Don't re-instantiate pflash storage source

We don't really use it besides when starting up the VM so when
reconnecting this step is totally pointless.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoqemu: Properly setup the NVRAM virStorageSource
Peter Krempa [Fri, 3 Jun 2022 11:11:08 +0000 (13:11 +0200)]
qemu: Properly setup the NVRAM virStorageSource

Use the designated helpers for virStorageSource instead using the
file-based ones with a check.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoqemu: Use 'def->os.loader->nvram' directly instead of 'priv->pflash1'
Peter Krempa [Wed, 18 May 2022 13:08:36 +0000 (15:08 +0200)]
qemu: Use 'def->os.loader->nvram' directly instead of 'priv->pflash1'

Since we now have a full virStorageSource for storing the nvram path we
don't need the extra dance of transferring the data into the 'pflash1'
variable which was an intermediary solution to use -blockdev.

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

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoconf: Convert def->os.loader->nvram a virStorageSource
Rohit Kumar [Wed, 4 May 2022 16:51:11 +0000 (09:51 -0700)]
conf: Convert def->os.loader->nvram a virStorageSource

Currently, libvirt allows only local filepaths to specify the location
of the 'nvram' image. Changing it to virStorageSource type will allow
supporting remote storage for nvram.

Signed-off-by: Prerna Saxena <prerna.saxena@nutanix.com>
Signed-off-by: Florian Schmidt <flosch@nutanix.com>
Signed-off-by: Rohit Kumar <rohit.kumar3@nutanix.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoqemuBuildPflashBlockdevCommandLine: Take virDomainObj instead of private data
Peter Krempa [Wed, 18 May 2022 12:31:17 +0000 (14:31 +0200)]
qemuBuildPflashBlockdevCommandLine: Take virDomainObj instead of private data

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agoqemuDomainPrepareStorageSourceBlockdev: Add a variant for custom nodename
Peter Krempa [Wed, 1 Jun 2022 12:10:38 +0000 (14:10 +0200)]
qemuDomainPrepareStorageSourceBlockdev: Add a variant for custom nodename

Extract the internals of qemuDomainPrepareStorageSourceBlockdev into
qemuDomainPrepareStorageSourceBlockdevNodename so that we can reuse it
when instantiating the virStorageSource for pflash backing.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Tested-by: Rohit Kumar <rohit.kumar3@nutanix.com>
2 years agopo/LINGUAS: Fix sorting
Peter Krempa [Tue, 14 Jun 2022 12:36:13 +0000 (14:36 +0200)]
po/LINGUAS: Fix sorting

Fixes breakage of 'sc_linguas_sorting'.

Fixes: c886a40cfcbceb2efa57930b64f758d3e263d759
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2 years agoTranslated using Weblate (Korean)
김인수 [Mon, 13 Jun 2022 12:12:02 +0000 (14:12 +0200)]
Translated using Weblate (Korean)

Currently translated at 100.0% (10431 of 10431 strings)

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

Co-authored-by: 김인수 <simmon@nplob.com>
Signed-off-by: 김인수 <simmon@nplob.com>
2 years agoAdded translation using Weblate (Georgian)
Temuri Doghonadze [Mon, 13 Jun 2022 12:12:01 +0000 (14:12 +0200)]
Added translation using Weblate (Georgian)

Co-authored-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
Signed-off-by: Temuri Doghonadze <temuri.doghonadze@gmail.com>
2 years agoTranslated using Weblate (Swedish)
Göran Uddeborg [Mon, 13 Jun 2022 12:12:01 +0000 (14:12 +0200)]
Translated using Weblate (Swedish)

Currently translated at 35.0% (3661 of 10431 strings)

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

Translated using Weblate (Swedish)

Currently translated at 34.9% (3641 of 10431 strings)

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

Translated using Weblate (Swedish)

Currently translated at 34.7% (3621 of 10431 strings)

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

Co-authored-by: Göran Uddeborg <goeran@uddeborg.se>
Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2 years agoFix incorrect uses of g_clear_pointer() introduced in 8.1.0
Mark Mielke [Sun, 12 Jun 2022 19:16:50 +0000 (15:16 -0400)]
Fix incorrect uses of g_clear_pointer() introduced in 8.1.0

This is a partial revert of 87a43a907f0ad4897a28ad7c216bc70f37270b93

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

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

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

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

Signed-off-by: Mark Mielke <mark.mielke@gmail.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
2 years agokbase: launch_security_sev: Break up overly long line
Peter Krempa [Mon, 13 Jun 2022 14:08:09 +0000 (16:08 +0200)]
kbase: launch_security_sev: Break up overly long line

Standard text is aligned to 80 colums in all .rst files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
2 years agoqemuBuildInterfaceConnect: Initialize @tapfd array
Michal Privoznik [Mon, 13 Jun 2022 12:33:36 +0000 (14:33 +0200)]
qemuBuildInterfaceConnect: Initialize @tapfd array

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

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2075383#c18
Fixes: 7a38d3946bc1a7ef0206f36dfe3dbf422fb8d578
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agovirNetDevSaveNetConfig: Pass mode to virFileWriteStr()
Michal Privoznik [Mon, 13 Jun 2022 12:20:06 +0000 (14:20 +0200)]
virNetDevSaveNetConfig: Pass mode to virFileWriteStr()

For some types of SRIOV interfaces we create a temporary file
where the state of the interface is saved before we start
modifying it. The file is used then to restore the original
configuration when the interface is no longer associated with any
guest. For writing the file virFileWriteStr() is used. However,
it's given wrong argument: the last argument is supposed to be
mode to create the file with but virNetDevSaveNetConfig() passes
open(2) flags (O_CREAT|O_TRUNC|O_WRONLY). We need the file to be
writable and readable by root only (0600). Therefore, pass that
mode instead of gibberish.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2 years agodocs: kbase/launch_security_sev: QEMU 6.0+ sets iommu=on for us
Cole Robinson [Sat, 11 Jun 2022 16:42:34 +0000 (12:42 -0400)]
docs: kbase/launch_security_sev: QEMU 6.0+ sets iommu=on for us

Reviewed-by: Erik Skultety <eskultet@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>