Commit Graph

50853 Commits

Author SHA1 Message Date
Peter Krempa
0082148420 virsh: cmdList: Revert to script-friendly output for 'virsh list --uuid'
Commit 271940223c which strived to add
support to use '--uuid' in the table output of 'virsh list' went too far
and also allowed the default table view to be enabled when just '--uuid'
is specified.

This broke the script-friendly output which previously had this format:

 $ virsh list --uuid
 b6d03c07-86f8-4a57-8719-172a5d0359bb

to this script-unfriendly output:

 $ virsh list --uuid
  Id   Name   State     UUID
 -------------------------------------------------------------
  1    ha     running   b6d03c07-86f8-4a57-8719-172a5d0359bb

Using the human friendly output will still be possible by using:

 $ virsh list --table --uuid

Fixes: 271940223c
Closes: https://gitlab.com/libvirt/libvirt/-/issues/666
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-09-05 15:24:55 +02:00
Peter Krempa
a35a355b09 tests: qemucapabilitiesdata: Add caps for 'caps_9.1.0_riscv64' (captured on x86_64)
Add a capability dump for 'riscv64' with 'qemu-9.1' release captured
on a x86_64 host as I don't have hardware.

The last dump for riscv64 was done with qemu-8.0 which didn't manifest
the newest features such as CPU type selection and ACPI support.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-09-05 15:24:55 +02:00
Peter Krempa
712b2c8f01 tests: qemucapabilities: Update 'caps_9.1.0_x86_64' for final release
QEMU-9.1 was released so update the capabilities to the final state.

Notable changes:

 - Machine types 'pc-q35-6.1' and 'pc-i440fx-6.1' were deprecated

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-09-05 15:24:55 +02:00
Peter Krempa
61c8a7180e qemuProcessSetupRawIO: Refactor return value and remove useless #ifdef
The function can return directly rather than setting 'ret' as there's no
cleanup.

It also doesn't make sense to conditionally compile out the 'break'
statement when checking whether a disk has rawio enabled if
'CAP_SYS_RAWIO' is _not_ defined as the function will still behave the
same.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-09-05 15:24:55 +02:00
Peter Krempa
d02a77c2ff spec: Demote 'nfs-utils' as a weak dependency of 'daemon-driver-storage-core'
The 'nfs-utils' package provides 'showmount' used to detect NFS-based
storage pool sources. As the lookup of storage pool sources can fail
gracefully and does so e.g. if the gluster backend is not installed we
can do the same for NFS.

Apart from allowing a tighter footprint when installing libvirt, this
also allows installation of the storage driver core in cases when a
security policy prohibits use of NFS.

Resolves: https://issues.redhat.com/browse/RHEL-56611
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-05 15:24:55 +02:00
Peter Krempa
ce1c9bb8ea storage: fs: Remove build-time detection of 'showmount' program
With the new virCommand infrastructure which can find the program in
path automatically we no longer need the build-time detection.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2024-09-05 15:24:55 +02:00
Cole Robinson
6f10d15ca1 spec: Fix dtrace BuildRequires on fedora 41+
/usr/bin/dtrace has been split from `systemtap-sdt-devel` into
`systemtap-sdt-dtrace`

It's forward and backward compatible to require the dtrace binary
directly.

We still need the latter dep though, for sdt.h in generated
libvirt_probes.h

Reviewed-by: Ján Tomko <jtomko@redhat.com>
Signed-off-by: Cole Robinson <crobinso@redhat.com>
2024-09-04 11:37:38 -04:00
Martin Kletzander
f6fb097e11 virnetdevtap: Add better error message for a possible common user error
When users pre-create a tap device to use with multiqueue interface that
has `managed="no"`, change the error so that it does not indicate we are
trying to create the device, and on top of that hint at the most
probable error cause.

Resolves: https://issues.redhat.com/browse/RHEL-55749
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-09-04 12:21:20 +02:00
Martin Kletzander
4ce9196dc4 virnetdevtap: Do (not) use NULLSTR consistently
The function generates *ifname from the get go and most functions do not
wrap the string in a NULLSTR as it is not necessary.  The few leftovers
are outliers that are changed to fit the theme better.

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-09-04 12:21:19 +02:00
Göran Uddeborg
a16bd55819 Translated using Weblate (Swedish)
Currently translated at 85.3% (8978 of 10521 strings)

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

Signed-off-by: Göran Uddeborg <goeran@uddeborg.se>
2024-09-03 14:01:58 +02:00
Andrea Bolognani
ad92468924 qemu: Use pvpanic by default on aarch64
pvpanic-pci is the only reasonable implementation of a panic
device for aarch64/virt guests. Right now we're asking users to
provide the model name manually, but we can be more helpful and
fill it in automatically instead.

With this change, the aarch64-panic-no-model test no longer
fails and so it's no longer useful to us. Instead, we can amend
the aarch64-virt-default-models test case to include panic
coverage, something that until now wasn't possible.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-09-03 14:08:34 +02:00
Andrea Bolognani
6d92185a49 qemu: Sometimes the default panic model doesn't exist
Right now the fallback behavior is to use MODEL_ISA if we
haven't been able to find a better match, but that's not very
useful as we're still going to hit an error later, when
QEMU_CAPS_DEVICE_PANIC is not found at Validate time.

Instead of doing that, allow MODEL_DEFAULT to get all the
way to Validate and report an error upon encountering it.

The reported error changes slightly, but other than that the
set of configurations that are allowed and blocked remains
the same.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-09-03 14:07:47 +02:00
Andrea Bolognani
9e1970efa5 qemu: Refactor default panic model
Perform decisions based on the architecture and machine type
in a single place instead of duplicating them.

This technically adds new behavior for MODEL_ISA in
qemuDomainDefAddDefaultDevices(), but it doesn't make any
difference functionally since we don't set addPanicDevice
outside of ppc64(le) and s390(x). If we did, the lack of
handling for that value would be a latent bug.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-09-03 14:06:11 +02:00
Andrea Bolognani
f22583c6c4 tests: Add coverage for panic on riscv64
It merely duplicates the existing aarch64 coverage right now,
but it will become actually useful with the upcoming changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-09-03 14:06:08 +02:00
Martin Kletzander
ac05dc8d4f qemu_driver: Fix indentation
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
2024-09-03 13:13:58 +02:00
Jiri Denemark
3a4a26f53e Post-release version bump to 10.8.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-09-02 11:50:18 +02:00
Jiri Denemark
7d72b18017 Release of libvirt-10.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-09-02 11:47:19 +02:00
Peter Krempa
d9eac9bb54 NEWS: Mention fix for CVE-2024-8235
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-09-02 09:06:34 +02:00
Andi Chandler
f4ebbb1dcb Translated using Weblate (English (United Kingdom))
Currently translated at 48.8% (5138 of 10521 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
2024-09-01 23:38:41 +02:00
Kamil Szczęk
76f6caee3c qemu: Fix a few comments
Fixes: d292c5ba17
Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2024-08-29 13:52:12 +02:00
Yuri Chornoivan
479b9b1325 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (10521 of 10521 strings)

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

Signed-off-by: Yuri Chornoivan <yurchor@ukr.net>
2024-08-29 10:33:20 +02:00
김인수
f582acfcb5 Translated using Weblate (Korean)
Currently translated at 100.0% (10521 of 10521 strings)

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

Signed-off-by: 김인수 <simmon@nplob.com>
2024-08-29 10:33:20 +02:00
Peter Krempa
8dfb12cb77 udevListInterfaces: Honour array length for zero-length NULL arrays (CVE-2024-8235)
The refactor of 'udevListInterfacesByStatus()' which attempted to make
it usable as backend for 'udevNumOfInterfacesByStatus()' neglected to
consider the corner case of 'g_new0(..., 0)' returning NULL if the user
actually requests 0 elements.

As the code was modified to report the full number of interfaces in the
system when the list of names is NULL, the RPC code would be asked to
serialize a NULL-list of interface names with declared lenth of 1+
causing a crash.

To fix this corner case we make callers pass '-1' as @names_len (it's
conveniently an 'int' due to RPC type usage) if they don't wish to fetch
the actual list and convert all decisions to be done on @names_len being
non-negative instead of @names being non-NULL.

CVE-2024-8235

Fixes: bc596f2751
Resolves: https://issues.redhat.com/browse/RHEL-55373
Reported-by: Yanqiu Zhang  <yanqzhan@redhat.com>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2024-08-29 10:38:40 +02:00
Andrea Bolognani
3284b0d8cd docs: Document presence of PS/2 feature in domcaps
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-29 09:44:54 +02:00
Andrea Bolognani
725afb4e7b qemu: Expose availability of PS/2 feature in domcaps
This advertises the feature only for the architectures and
machine types where it can actually be used.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-29 09:44:53 +02:00
Andrea Bolognani
e0e496d90c qemu: Change signature for virQEMUCapsSupportsI8042Toggle()
We will soon need to use it in a context where we don't have
a virDomainDef handy.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-29 09:44:51 +02:00
Andrea Bolognani
d292c5ba17 qemu: Export a few functions
We're going to need them in a minute.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-29 09:44:46 +02:00
Praveen K Paladugu
21562c4df6 NEWS: Add an entry for network support in ch driver.
Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-28 13:36:14 +02:00
Praveen K Paladugu
d9be0beb4c ch: Enable bridge network mode
Tested with following interface config:

 <interface type='bridge'>
    <mac address='52:54:00:71:b9:b6'/>
    <source bridge='clhbr0'/>
    <model type='virtio'/>
 </interface>

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-28 13:36:14 +02:00
Pavel Hrdina
8a44f78625 ch: interface: correctly update nicindexes
Originally nicindexes were updated only for VIR_DOMAIN_NET_TYPE_BRIDGE
and VIR_DOMAIN_NET_TYPE_DIRECT. The mentioned commit adds support for
NAT network mode and changes the code to update nicindexes for
VIR_DOMAIN_NET_TYPE_ETHERNET and VIR_DOMAIN_NET_TYPE_NETWORK as well.

It doesn't work as intended and after the change nicindexes are updated
only for VIR_DOMAIN_NET_TYPE_ETHERNET and VIR_DOMAIN_NET_TYPE_NETWORK.

Fixes: aa64209073
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-28 10:45:58 +02:00
Michal Privoznik
4d8ebbfee8 virschematest: Replace g_lstat() with virFileIsLink()
Inside of virschematest.c there's testSchemaDir() which iterates
over dentries in given directory but skips some files: those
without ".xml" suffix, hidden files, symlinks, etc.

Now, symlinks are detected as g_lstat() + S_ISLNK() combo which
works, except it fails to compile on mingw where is no concept of
symlinks. Replace the combo with a call to virFileIsLink() which
at least allows us to compile cleanly on mingw.

Fixes: f997fcca71
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-08-28 08:46:16 +02:00
Weblate
48bdeaf2fa 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/

Signed-off-by: Fedora Weblate Translation <i18n@lists.fedoraproject.org>
2024-08-27 11:33:21 +02:00
Sergey Dyasli
87c3fa1cde conf: check for migration job during domain start
It's possible to hit the following situation during qemu p2p live
migration:

1. qemu has live migrated and exited (making virDomainObjIsActive()
   return false)

2. the live migration job is still in progress, waiting for a
   confirmation from the remote libvirt daemon. This may last for
   a while with a presence of networking issues (up to keepalive
   timeout).

Any attempt to start the domain again would fail with "domain is already
being started" message which is misleading in this situation as it
doesn't reflect what's really happening.

Add a check for the migration job and report a different error message
if the migration job is still running.

Signed-off-by: Sergey Dyasli <sergey.dyasli@nutanix.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2024-08-27 10:44:58 +02:00
Jiri Denemark
cabb0dda0e po: Refresh potfile for v10.7.0
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
2024-08-27 10:32:53 +02:00
jianqing yan
1819dcbebc Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 95.8% (10072 of 10508 strings)

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

Signed-off-by: jianqing yan <yanjianqing@kylinos.cn>
2024-08-27 09:58:46 +02:00
Andi Chandler
38fddf2250 Translated using Weblate (English (United Kingdom))
Currently translated at 48.8% (5132 of 10508 strings)

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

Signed-off-by: Andi Chandler <andi@gowling.com>
2024-08-27 09:58:46 +02:00
Peter Krempa
805f66d7ca hypervisor: interface: Stub out virDomainCreateInBridgePortWithHelper using 'socketpair' on win32
Mingw build failed after commit af87ee7927
as 'socketpair()' is not available on that platform.

Stub out the function to return failure.

Fixes: af87ee7927
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
2024-08-27 10:06:31 +02:00
aokblast
1b815465d9 remoteDispatchConnectOpen: Fix check for 'BHYVE' connection type
'bhyveConnectGetType' (which is called from 'virConnectGetType') returns
'BHYVE' as the type, but the code in 'remoteDispatchConnectOpen'
responsible for selecting the sub-driver URIs in modular deployment
checks for 'bhyve' and thus would not properly fill the URIs to the
sub-daemons.

Signed-off-by: aokblast <aokblast@FreeBSD.org>
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
2024-08-26 18:23:10 +02:00
Praveen K Paladugu
aa64209073 ch: Enable NAT Network mode support
From: Praveen K Paladugu <prapal@linux.microsoft.com>

enable VIR_DOMAIN_NET_TYPE_NETWORK network support for ch guests.
Tested with following config:

  <interface type='network'>
      <source network="default" bridge='virbr0'/>
      <model type='virtio'/>
      <driver queues="1"/>
  </interface>

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-26 16:13:23 +02:00
Praveen K Paladugu
af87ee7927 hypervisor: Move domain interface mgmt methods
From: Praveen K Paladugu <prapal@linux.microsoft.com>

Move methods to connect domain interfaces to host bridges to hypervisor.
This is to allow reuse between qemu and ch drivers.

Signed-off-by: Praveen K Paladugu <praveenkpaladugu@gmail.com>
Signed-off-by: Praveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-26 16:10:04 +02:00
Tim Wiederhake
7b6702d516 hyperv: Support hv-xmm-input enlightenment
qemu supports this enlightenment since version 7.10.

From the qemu commit:
    Hyper-V specification allows to pass parameters for certain hypercalls
    using XMM registers ("XMM Fast Hypercall Input"). When the feature is
    in use, it allows for faster hypercalls processing as KVM can avoid
    reading guest's memory.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2024-08-26 11:48:15 +02:00
Tim Wiederhake
0313a500a9 hyperv: Support hv-emsr-bitmap enlightenment
qemu supports this enlightenment since version 7.10.

From the qemu commit:
    The newly introduced enlightenment allow L0 (KVM) and L1 (Hyper-V)
    hypervisors to collaborate to avoid unnecessary updates to L2
    MSR-Bitmap upon vmexits.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
2024-08-26 11:48:15 +02:00
jianqing yan
d543c4e753 Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 95.8% (10072 of 10508 strings)

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

Signed-off-by: jianqing yan <yanjianqing@kylinos.cn>
2024-08-23 15:38:38 +02:00
Michal Privoznik
0888784f38 qemu: Use virEventThreadStop() in qemuProcessStop()
Currently, qemuProcessStop() unlocks given domain object right in
the middle of cleanup process. This is dangerous because there
might be another thread which is executing virDomainObjListAdd().
And since the domain object is on the list of domain objects AND
by the time qemuProcessStop() unlocks it the object is also
marked as inactive, the other thread acquires the lock and
switches vm->def pointer.

The unlocking of domain object is needed though, to allow even
processing thread finish its queue. Well, the processing can be
done before any cleanup is attempted.

Therefore, use freshly introduced virEventThreadStop() to join
the event thread and drop lock/unlock from the middle of
qemuProcessStop().

Now, there's a comment being removed that mentions
qemuDomainObjStopWorker() and why it has to be called only after
the domain is marked as dead. This comment is no longed
applicable because call to qemuDomainObjStopWorker() is removed
also. Moreover, priv->beingDestroyed is set to true before
unlocking the domain object, thus any event processing callback
is going to see the domain being destroyed and can chose to
either exit early or finish processing event.

Fixes: 3865410e7f
Resolves: https://issues.redhat.com/browse/RHEL-49607
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-08-22 13:33:09 +02:00
Michal Privoznik
7aca235d8d vireventthread: Introduce virEventThreadStop
The aim is to move parts of vir_event_thread_finalize() that MAY
block into a separate function, so that unrefing the a
virEventThread no longer blocks (or require releasing and
subsequent re-acquiring of a mutex).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
2024-08-22 13:33:06 +02:00
Kamil Szczęk
bec195607c NEWS: Mention the new 'ps2' feature
Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-21 17:10:51 +02:00
Kamil Szczęk
825516e6e3 qemuxmlconftest: Add test cases for the new 'ps2' feature
Introduce tests to verify that the 'ps2' feature is correctly parsed
when given either 'dirty' XML from a user or 'clean' canonical XML,
as produced by libvirt. This also tests the transformation from libvirt's
internal state to the aforementioned canonical form and to a QEMU
command line.

As a bonus, we also test some known bad configurations:
- When user explicitly adds ps2 bus inputs, but also explicitly disables
the 'ps2' feature.
- When user explicitly enables the 'vmport' feature, but also explicitly
disables the 'ps2' feature. This is not supported by QEMU and will
result in vmport device not being created without emitting any warning
or error.

Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-21 17:10:51 +02:00
Kamil Szczęk
a9a5f8ef39 qemu: Introduce the 'ps2' feature
This introduces a new 'ps2' feature which, when disabled, results in
no implicit PS/2 bus input devices being automatically added to the
domain and addition of the 'i8042=off' machine option to the QEMU
command-line.

A notable side effect of disabling the i8042 controller in QEMU is that
the vmport device won't be created. For this reason we will not allow
setting the vmport feature if the ps2 feature is explicitly disabled.

Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-21 17:10:51 +02:00
Kamil Szczęk
9eb3c28323 qemu_capabilities: Introduce QEMU_CAPS_MACHINE_I8042_OPT
This capability tells us whether given QEMU binary supports the
'-machine xxx,i8042=on/off' toggle used to enable/disable PS/2
controller emulation.

A few facts:
- This option was introduced in QEMU 7.0 and defaults to 'on'
- QEMU versions before 7.0 enabled i8042 controller emulation implicitly
- This option (and i8042 controller emulation itself) is only supported
by descendants of the generic PC machine type (e.g. i440fx, q35, etc.)

Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-21 17:10:51 +02:00
Kamil Szczęk
51521d13a8 qemu: Improve PS/2 controller detection
Up until now, we've assumed that all x86 machines have a PS/2
controller built-in. This assumption was correct until QEMU v4.2
introduced a new x86-based machine type - microvm.

Due to this assumption, a pair of unnecessary PS/2 inputs are implicitly
added to all microvm domains. This patch fixes that by whitelisting
machine types which are known to include the i8042 PS/2 controller.

Signed-off-by: Kamil Szczęk <kamil@szczek.dev>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2024-08-21 17:10:51 +02:00