Commit Graph

50760 Commits

Author SHA1 Message Date
Purna Pavan Chandra
3e41cd5e82 ch: Pass net ids explicitly during vm creation
Pass "net_<index>" as net id to CH. This is to have better control over
the network configs. This id can be further used in performing
operations like restore etc.

Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-09 15:03:07 +02:00
Purna Pavan Chandra
fa66343ef9 ch: report response message instead of just code
The response message from CH for vm.add-net api will be more helpful in
debugging. Hence, log the message instead of just response code.

Signed-off-by: Purna Pavan Chandra <paekkaladevi@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-09 15:03:07 +02:00
Peter Krempa
14ca8ef256 qemucapabilitiesdata: Update data for qemu-9.1 dev cycle on x86_64
Update to v9.1.0-rc0-121-g75c7f57403.

Notable changes:
  - removed machine types:
     - i440fx: 2.0 - 2.3

  - deprecated machine types
     - q35 + i440fx: 2.4 - 6.0

  - GUEST_PVSHUTDOWN event added

  - migration
     - 'postcopy-recover-setup' state added
     - 'direct-io' parameter added

  - 'memory-backend-shm' qom object type added

  - 'emmc' device added

  - iommufd infrastructure added: 'host-iommu-device-iommufd-vfio',
    'host-iommu-device-legacy-vfio', 'vfio-iommu-iommufd',
    'vfio-iommu-legacy'

  - 'in_order' and 'x-pcie-pm-no-soft-reset' property added for various
    virtio-based devices

  - changed type of 'legacy-vm-type' field for 'sev-guest' object from
    boolean to 'on/off/auto'

  - 'memory-hotplug-support' property of 'ICH9-LPC' removed

  - 'migrate-emulated-scsi-request' property of 'scsi-hd' added

  - 'x-device-dirty-page-tracking' property of 'vfio-pci' added

  - 'cxl-add-dynamic-capacity' and 'cxl-release-dynamic-capacity'
     commands added (unstable for now)

  - 'x-query-interrupt-controllers' command added (unstable)

  - dropped unused 'detached-header' infra from 'blockdev-create' for 'luks'

  - design of 'deprecated-props' arg/value of 'query-cpu-model-expansion'
    cleaned up

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-09 14:42:07 +02:00
Peter Krempa
022457e748 qemuxmlconftest: Don't use soon-to-be-removed machine types
Latest qemu will be dropping some very old machine types (2.0 - 2.3) and
some of our tests use them. As in none of the cases the test actually
needs given machine type, switch them to 'pc' instead.

In one case 'numavcpus-topology-mismatch' this caused switch to a more
modern syntax for NUMA memory specification, but the test is testing a
different aspect, thus we can modernize this.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-09 14:42:07 +02:00
Peter Krempa
c122aa1021 qemuxmlconftest: Add test for old-style NUMA memory specification
This excercises the old-style NUMA memory commandline used with 5.0 and
older machine types:

 -smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
 -numa node,nodeid=0,cpus=0-7,mem=107 \
 -numa node,nodeid=1,cpus=8-15,mem=107 \

in contrast to the modern syntax:

  -smp 16,sockets=2,dies=1,clusters=1,cores=4,threads=2 \
 -object '{"qom-type":"memory-backend-ram","id":"ram-node0","size":112197632}' \
 -numa node,nodeid=0,cpus=0-7,memdev=ram-node0 \
 -object '{"qom-type":"memory-backend-ram","id":"ram-node1","size":112197632}' \
 -numa node,nodeid=1,cpus=8-15,memdev=ram-node1 \

which is tested by the 'cpu-numa1' test case where this was copied from.

This test is added so that other irrelevant test can be modernized.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-09 14:42:07 +02:00
Sandesh Patel
6d7dd09e8a qemu: format dma-translation on intel-iommu command line
Add dma-translation attribute to qemu command line if specified in
domain conf.

Signed-off-by: Sandesh Patel <sandesh.patel@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-09 10:05:56 +02:00
Sandesh Patel
6866f958c1 conf: add dma_translation attribute to iommu
Add dma_translation attribute to iommu to enable/disable dma traslation
for intel-iommu

Signed-off-by: Sandesh Patel <sandesh.patel@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-09 10:05:56 +02:00
Sandesh Patel
b2cc19e5fd qemu_capabilities: Introduce QEMU_CAPS_INTEL_IOMMU_DMA_TRANSLATION
This capability tracks whether intel-iommu device has
dma-translation attribute.

Signed-off-by: Sandesh Patel <sandesh.patel@nutanix.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-09 10:05:56 +02:00
Jiri Denemark
11f6773f19 qemu: Avoid false failure when resuming post-copy migration
Depending on timing between QEMU and libvirt an attempt to resume failed
post-copy migration could immediately report a failure in post-copy
phase again even though the migration actually resumed and is
progressing just fine.

This is caused by QEMU reporting the original migration state (i.e.,
postcopy-paused) until migration is successfully resumed and QEMU
switches to postcopy-active. QEMU 9.1 introduced a new
postcopy-recover-setup migration state which is entered immediately
after requesting migration to be resumed and we can reliably wait for
the migration to either continue or fail without being confused by the
old state.

https://issues.redhat.com/browse/RHEL-22166

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-08 16:27:13 +02:00
Jiri Denemark
79e0b50bb6 qemu: Add support for postcopy-recover-setup migration state
This patch adds support for recognizing the new migration state reported
by QEMU when post-copy recovery is requested. It is not actually used
for anything yet.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-08 16:27:13 +02:00
Michal Privoznik
18fd4899f3 vsh: Allow vshReadlineInit() to be called multiple times
Thing about vshReadlineInit() is - it's called multiple times.
The first time from vshInit(), when @ctl was filled only
partially (most notably, before any argv parsing is done, hence
ctl->imode is set to false). The second time after argv parsing,
from virshInit() -> vshInitReload(). In here, ctl->imode might
have changed and thus vshReadlineInit() can't exit early - it
needs to set up stuff for interactive mode (history basically).

To allow vshReadlineInit() to be called again,
vshReadlineDeinit() must set @autoCompleteOpaque to NULL.

Fixes: cab1e71f01
Resolves: https://issues.redhat.com/browse/RHEL-53560
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-08-08 15:45:37 +02:00
Göran Uddeborg
376e0424d8 Translated using Weblate (Swedish)
Currently translated at 83.9% (8819 of 10508 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-08-08 12:31:48 +02:00
Göran Uddeborg
b6f6b45f7b Translated using Weblate (Swedish)
Currently translated at 83.7% (8799 of 10508 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-08-08 12:31:48 +02:00
Adam Julis
f3e670ee6b network: fix crashing "modify" option for hostname
The original condition caused (after adding modify option)
possibly access to not allocated memory. For consistency added
new check for multiple same records.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/654
Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-08 12:36:36 +02:00
Adam Julis
959ecee474 network: NULL check for "modify" DNS-txt records
The "modify" command allowed to replace an existing record, now
checks for the NULL string in the new value and throw error if
found.

Resolves: https://gitlab.com/libvirt/libvirt/-/issues/655
Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-08 12:33:40 +02:00
Andrea Bolognani
0caacf47d7 apparmor: Allow more paths for qemu-bridge-helper
The QEMU package in Debian has recently moved the
qemu-bridge-helper binary under /usr/libexec/qemu. Update the
AppArmor profile accordingly.

https://bugs.debian.org/1077915

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Jim Fehlig <jfehlig@suse.com>
2024-08-07 13:03:20 +02:00
Danny Sauer
2be2fb9a9f Allow unmounting some things libvirt mounted
Signed-off-by: Danny Sauer <github@dannysauer.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2024-08-07 13:02:53 +02:00
Peter Krempa
432e442ca8 qemuxmlconftest: Add tests for the ACPI stripping hack on s390
Replace the 'misc-acpi' case by testing a bunch of architectures for how
ACPI is handled including a test for the s390 ACPI strip hack added in
previous commit.

The input files are adapted from the corresponding '-minimal.xml' files.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2024-08-06 15:12:14 +02:00
Peter Krempa
4ba4f659e4 qemu_domain: Strip <acpi/> from s390(x) definitions
The s390(x) machines never supported ACPI. That didn't stop users
enabling ACPI in their config. As of libvirt-9.2 (98c4e3d073) with new
enough qemu we reject configs which require ACPI, but qemu can't satisfy
it.

This breaks migration of existing VMs with the old wrong configs to new
libvirt installations.

To address this introduce a post-parse fixup removing the ACPI flag
specifically for s390 machines which do enable it in the definition.

The advantage of doing it in post-parse, rather than simply relaxing the
ABI stability check to allow users providing an fixed XML when migrating
(allowing change of the ACPI flag for s390 in ABI stability check, as it
 doesn't impact ABI), is that only the destination installation needs to
be patched in order to preserve migration.

To mitigate the disadvantage of simply stripping it from all s390(x)
configs the hack is not applied when defining or starting a new domain
from the XML, to preserve the error about unsupported configuration.

Resolves: https://issues.redhat.com/browse/RHEL-49516
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2024-08-06 15:12:14 +02:00
Göran Uddeborg
ee84b85a17 Translated using Weblate (Swedish)
Currently translated at 83.5% (8779 of 10508 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-08-06 01:47:18 +02:00
Jiri Denemark
049846497b Post-release version bump to 10.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-08-05 13:16:50 +02:00
Jiri Denemark
a33190e717 Release of libvirt-10.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-08-05 13:07:41 +02:00
Göran Uddeborg
b2de9720f4 Translated using Weblate (Swedish)
Currently translated at 83.3% (8759 of 10508 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-08-05 11:36:22 +02:00
Adam Julis
30a71fd6a0 Revert "network: allow "modify" option for DNS-Srv records"
This reverts commit cf934c87cc.

The matching logic is flawed and it would complicate support of
this command.

Signed-off-by: Adam Julis <ajulis@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2024-08-05 11:42:35 +02:00
Göran Uddeborg
49433d41e4 Translated using Weblate (Swedish)
Currently translated at 83.1% (8739 of 10508 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-08-03 21:38:46 +02:00
Göran Uddeborg
6b521fef8c Translated using Weblate (Swedish)
Currently translated at 82.7% (8699 of 10508 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-08-01 22:41:53 +02:00
Michal Privoznik
ac0b669c56 security: Allow RW access to pstore device
The whole point of pstore device is that the guest writes crash
dumps into it. But the way SELinux label is set on the
corresponding file warrants RO access only. This is due to a
copy-paste from code around: kernel/initrd/DTB/SLIC - these are
RO indeed, but pstore MUST be writable too. In a sense it's
closer to NVRAM/disks - hence set imagelabel on it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2024-07-31 14:15:59 +02:00
Michal Privoznik
d913f204e0 qemu: Pre-create pstore device file
So far we are relying on QEMU or sysadmin to create the file for
pstore. This is suboptimal as in the case of the former we can
not set proper seclabels (there's nothing to set seclabels on
until QEMU is started).

Therefore, make sure the file is created before launching QEMU
and that it has the correct size.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2024-07-31 14:15:48 +02:00
김인수
3033a9380f Translated using Weblate (Korean)
Currently translated at 100.0% (10508 of 10508 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>
2024-07-30 17:41:10 +01:00
Göran Uddeborg
a0ecbb46e4 Translated using Weblate (Swedish)
Currently translated at 82.3% (8663 of 10516 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>
2024-07-30 17:41:10 +01:00
Weblate
106a87aec8 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>
2024-07-30 17:41:10 +01:00
Göran Uddeborg
87789cbcbf Translated using Weblate (Swedish)
Currently translated at 82.5% (8679 of 10508 strings)

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

Translated using Weblate (Swedish)

Currently translated at 82.3% (8663 of 10516 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>
2024-07-30 17:41:09 +01:00
Michal Privoznik
aec390df81 NEWS: Document features/improvements/bug fixes I've participated in
There are some features/improvements/bug fixes I've either
contributed or reviewed/merged. Document them for upcoming
release.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
2024-07-30 17:42:24 +02:00
Michal Privoznik
de355b7873 qemu: Autofill pstore path if missing
Introduced only a couple of commits ago (in
v10.5.0-84-g90e50e67c6) the pstore device acts as a nonvolatile
storage, where guest kernel can store information about crashes.
This device, however, expects a file in the host from which the
crash data is read. So far, we expected users to provide a path,
but we can autogenerate one if missing. Just put it next to
per-domain's NVRAM stores.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2024-07-30 17:22:00 +02:00
Jiri Denemark
7428738597 po: Refresh potfile for v10.6.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-07-29 10:53:12 +02:00
Göran Uddeborg
d842afb88f Translated using Weblate (Swedish)
Currently translated at 82.1% (8643 of 10516 strings)

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

Translated using Weblate (Swedish)

Currently translated at 81.8% (8603 of 10516 strings)

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

Translated using Weblate (Swedish)

Currently translated at 81.6% (8583 of 10516 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>
2024-07-27 12:38:46 +02:00
Andi Chandler
c33a4d0a2f Translated using Weblate (English (United Kingdom))
Currently translated at 47.9% (5032 of 10497 strings)

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

Co-authored-by: Andi Chandler <andi@gowling.com>
Signed-off-by: Andi Chandler <andi@gowling.com>
2024-07-27 12:38:45 +02:00
Michal Privoznik
bd11c753f3 virsysinfo: Calculate OEM string index better
As can be seen in earlier commits, there can be two OEM strings
with the same index. But since our parser
(virSysinfoParseOEMStrings()) doesn't expect that, it increments
index in each run and thus skips over these strings.
Fortunately, we have the right index at hand - we're just
skipping over it in a loop. Just reconstruct the index back
inside the loop.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-07-25 16:51:17 +02:00
Michal Privoznik
5bb4540dbb virsysinfo: Be more forgiving when decoding OEM strings
On some systems, there are two or even more 'OEM Strings'
sections in DMI table. Here's an example of dmidecode output on
such system:

  # dmidecode -q -t 11
  OEM Strings
          String 1: Default string

  OEM Strings
          String 1: ThunderX2 System
          String 2: cavium.com
          String 3: Comanche

Now, this poses a problem, because when one tries to obtain
individual strings, they get:

  # dmidecode -q --oem-string 1
  Default string
  ThunderX2 System

  # dmidecode -q --oem-string 2
  No OEM string number 2
  cavium.com

NB, the "No OEM string number 2" is printed onto stderr and
everything else onto stdout. Oh, and trying to get OEM strings
from just one section doesn't fly:

  # dmidecode -q -H 0x1d --oem-string 2
  Options --string, --type, --handle and --dump-bin are mutually exclusive

This means two things:

1) we have no way of distinguishing OEM strings at the same index
   but in different sections,

2) because of how virSysinfoDMIDecodeOEMString() is written, we
   fail in querying OEM string that exists in one section but not
   in the others (for instance string #2 from example above).

While there's not much we can do about 1), there is something
that can be done about 2) - refine the error condition and make
the function return an error iff there's nothing on stdout and
there's something on stderr.

Resolves: https://issues.redhat.com/browse/RHEL-45952
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-07-25 16:50:47 +02:00
Michal Privoznik
98a9dc532d tests: Add HPE Apollo test case to sysinfotest
Introduce a test case for sysinfotest. The data was obtained by
running dmidecode as libvirt would run it:

   dmidecode -q -t 0,1,2,3,4,11,17

Now, the expected output fits almost perfectly, except for OEM
strings where the third string looks nothing like in the
dmidecode output. This is because of testDMIDecodeDryRun() which
overwrites the third OEM string (see v6.5.0-rc1~214 for more
info). But that's okay for now.

Speaking of OEM strings, it's worth noticing two 'OEM Strings'
sections in the dmidecode output. This is causing some troubles
and will be fixed in next commit.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-07-25 16:49:45 +02:00
Michal Privoznik
185065b645 virsysinfo: Trim newline when decoding OEM strings
dmidecode always puts a newline character at the end of each
OEM string it prints. It's the dmi_oem_strings() function [1] that
iterates over strings and calls pr_attr() over each one which
puts "\n" at the end, unconditionally [2[.

Since it's not part of the string though, trim it.

1: https://git.savannah.nongnu.org/cgit/dmidecode.git/tree/dmidecode.c#n2431
2: https://git.savannah.nongnu.org/cgit/dmidecode.git/tree/dmioutput.c#n63

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-07-25 16:49:27 +02:00
Michal Privoznik
b103200bf3 vircommand: Initialize dryRunStatus to portable EXIT_SUCCESS instead of 0
If dry run of a command was requested (virCommandSetDryRun())
then a specified callback is called instead of running actual
command. This is meant to be used in tests. To mimic running the
command as closely as possible the callback can also set exit
status of the command it's implementing. To save some lines
though, the exit status is initialized to 0 so that callback has
to set it only on failures. Now, 0 is not exactly portable value
- that's why stdlib.h has EXIT_SUCCESS (and EXIT_FAILURE) values.
Initialize the exit status (held in dryRunStatus) to EXIT_SUCCESS
then.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-07-25 16:47:55 +02:00
Michal Privoznik
716243f1f7 NEWS: Document pstore device addition
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2024-07-25 16:04:50 +02:00
Michal Privoznik
9faa615384 security: Set seclabels for pstore device
The acpi-erst backend for pstore device exposes a path in the
host accessible to the guest and as such we must set seclabels on
it to grant QEMU RW access.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2024-07-25 16:04:50 +02:00
Michal Privoznik
3cfe4caa0a qemu: Build cmd line for pstore device
Nothing special going on here.

Resolves: https://issues.redhat.com/browse/RHEL-24746
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2024-07-25 16:04:50 +02:00
Michal Privoznik
90e50e67c6 conf: Introduce pstore device
The aim of pstore device is to provide a bit of NVRAM storage for
guest kernel to record oops/panic logs just before the it
crashes. Typical usage includes usage in combination with a
watchdog so that the logs can be inspected after the watchdog
rebooted the machine. While Linux kernel (and possibly Windows
too) support many backends, in QEMU there's just 'acpi-erst'
device so stick with that for now. The device must be attached to
a PCI bus and needs two additional values (well, corresponding
memory-backend-file needs them): size and path. Despite using
memory-backend-file this does NOT add any additional RAM to the
guest and thus I've decided to expose it as another device type
instead of memory model.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2024-07-25 16:04:50 +02:00
Michal Privoznik
4a9c2d9bbe qemu_capabilities: Introduce QEMU_CAPS_DEVICE_ACPI_ERST
This capability tracks whether QEMU has acpi-erst device.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Kristina Hanicova <khanicov@redhat.com>
2024-07-25 16:04:50 +02:00
Ján Tomko
8d3b239737 qemu: virtiofs: cache: use 'never' instead of 'none'
The new option style renamed one of the cache modes.

https://issues.redhat.com/browse/RHEL-50329

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-07-25 13:41:46 +02:00
Boris Fiuczynski
e62c26a20d qemu: add a monitor to /proc/$pid when killing times out
In cases when a QEMU process takes longer than the time sigterm and
sigkill are issued to kill the process do not simply fail and leave the
VM in state VIR_DOMAIN_SHUTDOWN until the daemon stops. Instead set up
an fd on /proc/$pid and get notified when the QEMU process finally has
terminated to cleanup the VM state.

Resolves: https://issues.redhat.com/browse/RHEL-28819
Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-07-24 13:16:02 +02:00
Kristina Hanicova
e5eb64e9fd qemu_hotplug: Do not allow absent values in rom settings
If there are absent values in an already existing element
specifying rom settings, we simply use the old ones. This
behaviour is not desired, as users might think that deleting the
element from XML would delete the setting (because the hotplug
succeeds) - which does not happen. Because of that, we should not
accept an interface without elements that cannot be changed.

Therefore, we should not allow absent values for already existing
rom setting during hotplug.

Resolves: https://issues.redhat.com/browse/RHEL-7109
Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-07-24 13:07:20 +02:00