Commit Graph
53672 Commits
Author SHA1 Message Date
Andrea Bolognani 83679d7338 qemu_firmware: Parse host-uefi-vars firmware feature
When present in a firmware descriptor, this feature indicates that
the corresponding executable expects to access variable storage
through the uefi-vars QEMU device.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani 38c4c3f654 tests: Add firmware-auto-efi-enrolled-keys-aarch64
This test case demonstrates how to automatically configure an
aarch64 guest so that Secure Boot support is available and only
signed operating systems are allowed to boot.

It currently fails because there is no firmware descriptor that
describes a suitable firmware build yet. That will change in a
future commit.

In addition to the latest version, the test case is also executed
against QEMU 8.2.0 specifically. This version of the test case is
intended to fail, because the uefi-vars device that we need to
support Secure Boot on aarch64 was not yet available in that
version of QEMU. The exact error message will change down the
line.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani 0653a2eae2 tests: Add firmware-auto-efi-varstore-aarch64
This test case demonstrates how to explicitly opt into using
the uefi-vars device for an aarch64 guest.

Normally the firmware autoselection process will pick a UEFI
build that is loaded via pflash, but by including the <varstore>
element in the input XML we can tell the QEMU driver that we
want want the uefi-vars device to be used instead.

Currently this results in an error, because the firmware
autoselection algorithm doesn't yet know how to properly handle
the scenario. A future commit will address this and make things
work as expected.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani d8e0e9c3ce tests: Add firmware-auto-efi-varstore-q35
This test case demonstrates how to explicitly opt into using
the uefi-vars device for an x86_64 guest.

Normally the firmware autoselection process will pick a UEFI
build that is loaded via pflash, but by including the <varstore>
element in the input XML we can tell the QEMU driver that we
want want the uefi-vars device to be used instead.

Currently this results in an error, because the firmware
autoselection algorithm doesn't yet know how to properly handle
the scenario. A future commit will address this and make things
work as expected.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani 71d6399068 tests: Add firmware-manual-efi-varstore-aarch64
This test case demonstrates how to manually configure an aarch64
guest to use the uefi-vars device.

It currently fails because the QEMU driver does not yet recognize
the firmware type as EFI, and so rejects the attempt to use ACPI
together with it. That will change in a future commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani 77b44120c5 tests: Add firmware-manual-efi-varstore-q35
This test case demonstrates how to manually configure an x86_64
guest to use the uefi-vars device.

It fails when using an older version of QEMU which didn't have
the device, and succeeds when using the latest version. The
relevant bits of the QEMU command line are not generated yet,
but that will come in a later commit.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani bd35046517 qemu: Validate presence of uefi-vars device
The use of varstore requires the uefi-vars device to be present
in the QEMU binary.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani 12cdd61383 qemu_capabilities: Introduce QEMU_CAPS_DEVICE_UEFI_VARS
This capability indicates the availability of the uefi-vars
device.

The actual name of the QEMU device varies slightly depending on
the architecture: it's uefi-vars-x64 on x86_64, uefi-vars-sysbus
on other UEFI architectures (aarch64, riscv64, loongarch64).

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani 1c2dbdf3ac conf: Update validation to consider varstore element
The code is reworked quite significantly, but most of the
existing checks are preserved. Those that aren't, notably the
one that allowed pflash as the only acceptable non-stateless
firmware type, are intentionally removed because they will no
longer reflect reality once support for the uefi-vars QEMU
device is introduced.

As a side effect, reworking the function in this fashion
resolves a subtle bug: due to the early exits that were being
performed when the loader element was missing, the checks at
the bottom of the function (related to the shim and kernel
elements) were effectively never performed. This is no longer
the case.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani 3feee6d0ab conf: Parse and format varstore element
This will be used to configure the backing storage used by the
uefi-vars QEMU device.

Dealing with the element itself is trivial, however we have to
refactor the existing code which deals with the loader and nvram
elements slightly: in particular, we can no longer perform an
early exit if those elements are absent.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani b5da97c5b9 schema: Introduce osnvram define
This moves the definition of the <nvram> element out of the
fairly complex oshvm define and will make it easier to later
add the <varstore> element without making things unmanageable.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani ccdff699ac tests: Rename custom JSON firmware descriptors
Most of the JSON firmware descriptors in our test suite come from
the Fedora package for edk2, but there are a few additional ones
that we have created ourselves to ensure coverage of uncommon or
problematic scenarios.

In order to make sure that such descriptors are clearly marked as
custom, rename them to include the string "libvirt" in the path.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani 1504b7f687 conf: Move type=rom default for loader to drivers
Right now we set this default in the common parsing code, which
is not a big problem per se but would get in the way of some
upcoming changes.

Leave this choice to individual drivers instead. Only the QEMU
and Xen drivers use the value for anything, so we can limit the
amount of code duplication this change causes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani 375c82a0f8 qemu_firmware: Only set format for custom loader if path is present
We only set the template format if the template path is present,
and we should be consistent with that. The format on its own is
not very interesting anyway.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:06 +01:00
Andrea Bolognani a03a820572 docs: Improvement related to firmware selection
Recommend that users take advantage of firmware autoselection
and discourage providing paths manually.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:29:00 +01:00
Andrea Bolognani 38379f59c0 docs: Rename "BIOS bootloader" section to "guest firmware"
The new name is much more accurate since the documentation is
applicable to firmware other than BIOS, notably UEFI.

An empty container is used to keep old links working.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2026-02-24 11:28:56 +01:00
Jonathon Jongsma 4d0c5bc5be hyperv: Add basic domainGetBlockInfo() API implementation
This adds initial support for virDomainGetBlockInfo() for the hyperv
driver. It currently supports:
 - physical disk drives that are assigned to a vm
 - virtual disk drives backed by a .VHD file that are local to the host
 - other drives backed by local files (e.g. cdrom with a .iso)

It will fail to get allocation and physical values for any drives backed
by files that are not local to the host (e.g. on network shares)

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 12:08:44 -06:00
Jonathon Jongsma 95d8909283 hyperv: Add resource subtype definitions
Rather than using raw strings, create definitions for each subtype
string so that they can be re-used without needing to know the exact
string format.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 12:08:41 -06:00
Jonathon Jongsma 331a392b96 conf: support windows paths in virDomainDiskByName()
With the hyperv driver, disks might have windows paths like
"c:\path\to\disk.vhdx". Currently, this function supports paths, but
only if they're in unix format.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 12:08:13 -06:00
Jonathon Jongsma 9b5831910f hyperv: add support for secure boot configuration
When getting the xml description of a guest, check if secure boot is
enabled and set firmware features accordingly.

Also support firmware autoselection and honor the secure boot setting
when defining new vms from xml.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 12:07:59 -06:00
Jonathon Jongsma 82ccd68755 hyperv: Clean up unnecessary header includes
Remove some unused or over-broad includes from headers, push some
includes down to .c files when the only user is the implementation.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 10:40:32 -06:00
Peter Krempa c07b4e91e3 qemu: saveimage: Use 'virFileWrapperFd' when loading non-sparse saveimage
Always instantiate a 'virFileWrapperFd' (iohelper) to wrap the saveimage
file descriptor of a non-'sparse' format saveimage.

For 'sparse' images we also need to ensure that the FD returned when
opening the save image is an actual file FD (thus not the FD from the
helper process used to bypass root-squashed NFS) as qemu requires an
actual file in those cases.

This patch reworks 'qemuSaveImageOpen' to create the wrapper process
based on whether the 'wrapperFd' variable is non-NULL rather than
based on a combination of 'sparse' and 'bypass_cache' flags. The caller
will then based on the image format and the need for the wrapper use the
appropriate settings.

As with this patch all non-sparse images will always pass a pipe instead
of a file to qemu it also fixes problems with qemu-11.0 where the 'fd'
migration protocol rejects FDs which point to a file.

Resolves: https://issues.redhat.com/browse/RHEL-76301
Closes: https://gitlab.com/libvirt/libvirt/-/issues/850
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 14:04:37 +01:00
Peter Krempa 0e2ab42778 qemu: driver: Merge 'qemuDomainRestoreInternal' and 'qemuDomainObjRestore'
The two functions are for reverting a save image. They differ only on
what domain object is used (new one vs existing one). Merge the code
paths for existing VMs (for managed save restore) into
'qemuDomainRestoreInternal' and reuse it instead of
'qemuDomainObjRestore'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 14:04:37 +01:00
Peter Krempa 72a65c6944 qemuSaveImageCreateFd: Handle case when 'virQEMUFileOpenAs' doesn't return a file fd for 'sparse' format
The 'sparse' uses a mode in qemu which requires direct access to the
file descriptior of the file itself. If we reside on root-squashed NFS
the FD from 'virQEMUFileOpenAs' may not actually be a file which would
not work with qemu.

Reject such a config with a better error message and add documentation
outlining the quirk.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 14:04:37 +01:00
Peter Krempa 6a2a77b747 virfile: Introduce 'virFileFDIsRegular'
Similarly to 'virFileIsRegular' return if the FD is a regular file.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 14:04:37 +01:00
Peter Krempa 19d684706d qemuMonitorMigrateToFdSet: Drop 'flags' argument
The only caller doesn't use it.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 14:04:37 +01:00
Peter Krempa 0d3290d152 qemuSaveImageOpen: Remove wrong ATTRIBUTE_NONNULL
After commit 517248e239 removed the previously-4th argument the
ATTRIBUTE_NONNULL(4) annotation no longer makes sense.

Fixes: 517248e239

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-23 14:04:36 +01:00
Michal Privoznik e9b931d3e4 virpci: Report an error if virPCIGetVirtualFunctionIndex() fails
Either an error should be returned in all error paths in a
function or in none (leaving it up to caller). Well,
virPCIGetVirtualFunctionIndex() breaks this pattern. Fix it.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
2026-02-20 10:57:44 +01:00
Roman Bogorodskiy edb3350c64 bhyve: implement domainGetVcpuPinInfo
Implement domainGetVcpuPinInfo for querying vcpu pinning information.
Also, implement a couple of other APIs this one depends on:
domainGetVcpusFlags and domainGetMaxVcpus.

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-19 18:52:48 +01:00
Roman Bogorodskiy 387543c57f bhyve: support vcpu pinning
Bhyve supports vcpu pinning using the `-p vcpu:hostcpu`
argument. This argument can be specified multiple times for the same
vcpu to pin it to multiple hostcpu's.

Bhyve currently does not allow to change vcpu pinning configuration for
the VM that is already running.

Use this to support domain's vcpupin configuration such as:

  <cputune>
    <vcpupin vcpu="0" cpuset="1,2,3"/>
  </cputune>

Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-19 18:51:23 +01:00
Jiri Denemark 3ea0a44f7a qemu: Report error aborting stopped postcopy migration
When virDomainAbortJob is called with VIR_DOMAIN_ABORT_JOB_POSTCOPY flag
and the post-copy migration of the domain is already stopped (either
because of a failure or previous call to virDomainAbortJob), the
migrate-pause QMP command fails with "migrate-pause is currently only
supported during postcopy-active or postcopy-recover state". Such error
might be confusing to end users especially when we mark it as an
internal error. Let's not call the QMP command at all and report a
clear error message instead.

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-19 14:19:30 +01:00
Michal Privoznik 6c2c9e21ac virstorageobj: Make virStoragePoolObjAddVol() report an error on failure
Adding a storage volume into a pool is done by calling
virStoragePoolObjAddVol(). This function may fail if another
volume already exists with the same key/name/target. In some
cases the storage driver does check for duplicates before calling
the function. But in some cases (e.g. when refreshing an RBD pool
in virStorageBackendRBDRefreshPool()) it doesn't.

The problem here is that the function reports no error upon
failure and leaves it as an exercise for caller. Well, no caller
does that.

Therefore, make the function report an error. The advantage of
this approach is - the function can report more accurate error
message than any caller ever could.

NB¸ this stems from a discussion on the users list [1], and while
this does NOT solve the original issue, it fixes one of the
symptoms.

1: https://lists.libvirt.org/archives/list/users@lists.libvirt.org/message/BALVNCRQM4KBKGV4RQ7BMKSX7UIJKLQH/
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2026-02-19 12:31:02 +01:00
Lucas Amaral dbdaf22b63 virsh: report "unknown" for autostart when API query fails
When virStoragePoolGetAutostart(), virNetworkGetAutostart(), or
virNodeDeviceGetAutostart() fails, the respective info commands
report "no autostart". This is incorrect: the API failure means
we cannot determine the autostart state, not that autostart is
disabled.

The persistent field in the same functions already correctly
reports "unknown" on API failure. Apply the same pattern to the
autostart field for consistency and correctness.

Signed-off-by: Lucas Amaral <lucaaamaral@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-18 12:38:13 +01:00
Lucas Amaral da815a6a7b virsh: return failure exit code when UUID fetch fails
The domuuid, net-uuid, and pool-uuid commands call vshError() when
GetUUIDString() fails, but unconditionally return true, which
vshCommandRun() maps to EXIT_SUCCESS. This means scripts checking
$? see success despite the error.

Return false on failure so the exit code correctly reflects the
error, consistent with other virsh commands.

Signed-off-by: Lucas Amaral <lucaaamaral@gmail.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-18 12:38:08 +01:00
Andrea Bolognani f09d02bf0f news: Mention firmwareFeatures element for domaincaps
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-17 13:51:39 +01:00
Andrea Bolognani cf4dfcf795 docs: Document firmwareFeature element for domaincaps
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-17 13:51:39 +01:00
Andrea Bolognani 87c072c08b qemu: Fill in firmwareFeature element for domaincaps
On architectures that support neither UEFI nor BIOS as firmware,
such as ppc64 and s390x, the enums end up empty. This correctly
indicates that filtering by firmware feature is not possible, and
is consistent with the fact that the existing "firmware" enum is
also empty in those cases, meaning that firmware autoselection
itself is just not applicable.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-17 13:51:39 +01:00
Andrea Bolognani 928bdc3e67 conf: Add firmwareFeatures element for domaincaps
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-17 13:51:39 +01:00
Andrea Bolognani 463322ec48 schema: Add firmwareFeatures element for domaincaps
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-17 13:51:39 +01:00
Pavel Hrdina f335c578d1 tests: fix mocking on macOS
On macOS we use flat namespace so we cannot have multiple mocks for the
same function.

Fixes: 63434db800
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-17 13:14:58 +01:00
Pavel Hrdina f37e14119c iommufd: fix FD leak in case of error
Reported-by: coverity
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2026-02-17 10:47:41 +01:00
Pavel Hrdina 75db232f90 tests: properly mock VFIO and IOMMU checks
Fixes: 63434db800
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
2026-02-16 16:53:57 +01:00
Pavel Hrdina 63434db800 qemu: Fill iommufd domain capability
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-16 15:50:39 +01:00
Pavel Hrdina 855f8fe9e2 conf: Introduce iommufd enum for domaincaps
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-16 15:50:39 +01:00
Pavel Hrdina 5d16bef1a6 qemu_hotplug: Add support to hotplug host device with IOMMUFD
For first host device we need to add iommufd object as well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-16 15:50:39 +01:00
Pavel Hrdina 3f7ad3a8a5 qemu_command: Extract building IOMMUFD props to function
This will be reused by hotplug code.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-16 15:50:39 +01:00
Pavel Hrdina 300ebf01b8 qemu_hotplug: Remove iommufd object if no longer needed
When removing last host device using IOMMUFD remove the iommufd object
as well.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-16 15:50:39 +01:00
Pavel Hrdina b21b6dcc72 qemu: Save IOMMUFD state into status XML
We need to track if iommufd object was added to the VM when we add
hotplug support.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-16 15:50:39 +01:00
Pavel Hrdina f67e4ac4d0 qemu_command: Don't use host property if IOMMUFD is used
They should not be used at the same time.

Fixes: f623080472
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-16 15:50:39 +01:00
Pavel Hrdina 4611f227c7 qemu: Convert vfioDeviceFd to qemuFDPassDirect
This cleans up creating QEMU command line and makes it easier when
adding hotplug support.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2026-02-16 15:50:39 +01:00