[PATCH 0/8] Add multitouch input device support
This patch series implements support for multitouch input devices in libvirt, addressing the multitouch feature request in [1]. Currently, libvirt supports various input devices including mouse, tablet, and keyboard, but lacks support for multitouch devices. This limitation prevents users from configuring VMs with proper multitouch capabilities, which is increasingly important for modern applications and touch-enabled displays. This series adds comprehensive multitouch support by: 1. Introducing the necessary data structures and enumerations to represent multitouch devices in the domain configuration 2. Extending the domain XML schema to allow users to specify multitouch input devices in their VM definitions 3. Implementing QEMU driver support to properly map multitouch devices to the virtio-input-host-multitouch QEMU device 4. Adding capability detection to identify when QEMU supports multitouch devices 5. Updating all relevant enumerations and mappings throughout the codebase to handle the new device type 6. Including test coverage to validate the XML parsing and QEMU command line generation After this series, users will be able to configure multitouch input devices in their domain XML like: <input type='multitouch' bus='virtio'/>. [1] https://gitlab.com/libvirt/libvirt/-/issues/808 Julio Faracco (8): conf: Add multitouch input type enum conf: Update the type name mapping in the VIR_ENUM_IMPL macro schemas: Update domain schema to support multitouch qemu: Add the multitouch case to map to the QEMU virtio device qemu: Add device properties for multitouch input qemu: Add the multitouch device capability Complete remaining enums with multitouch input type tests: Add multitouch support to virtio-input tests src/conf/domain_audit.c | 1 + src/conf/domain_conf.c | 2 ++ src/conf/domain_conf.h | 1 + src/conf/domain_validate.c | 1 + src/conf/schemas/domaincommon.rng | 1 + src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_command.c | 8 ++++++++ src/qemu/qemu_validate.c | 5 +++++ src/security/security_dac.c | 2 ++ src/security/security_selinux.c | 2 ++ tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml | 1 + tests/qemuxmlconfdata/virtio-input.x86_64-latest.args | 1 + tests/qemuxmlconfdata/virtio-input.x86_64-latest.xml | 3 +++ tests/qemuxmlconfdata/virtio-input.xml | 1 + 15 files changed, 33 insertions(+) -- 2.52.0
This commit introduces the VIR_DOMAIN_INPUT_TYPE_MULTITOUCH enum value to the virDomainInputType enumeration, laying the groundwork for multitouch input device support in libvirt. The new enum value is added to src/conf/domain_conf.h following the existing input types (mouse, tablet, keyboard, passthrough, evdev). This establishes the fundamental type definition that will be used throughout the codebase to identify and handle multitouch input devices. This is the first step in implementing support for QEMU's virtio-multitouch device, which was introduced in QEMU 8.1.0 and enables emulation of multitouch events via the libvirt API. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/conf/domain_conf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cb35ff06bd..4c448bd010 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1554,6 +1554,7 @@ typedef enum { VIR_DOMAIN_INPUT_TYPE_KBD, VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH, VIR_DOMAIN_INPUT_TYPE_EVDEV, + VIR_DOMAIN_INPUT_TYPE_MULTITOUCH, VIR_DOMAIN_INPUT_TYPE_LAST } virDomainInputType; -- 2.52.0
On Thu, Jan 15, 2026 at 23:52:29 -0300, Julio Faracco wrote:
This commit introduces the VIR_DOMAIN_INPUT_TYPE_MULTITOUCH enum value to the virDomainInputType enumeration, laying the groundwork for multitouch input device support in libvirt.
The new enum value is added to src/conf/domain_conf.h following the existing input types (mouse, tablet, keyboard, passthrough, evdev). This establishes the fundamental type definition that will be used throughout the codebase to identify and handle multitouch input devices.
This is the first step in implementing support for QEMU's virtio-multitouch device, which was introduced in QEMU 8.1.0 and enables emulation of multitouch events via the libvirt API.
Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/conf/domain_conf.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cb35ff06bd..4c448bd010 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1554,6 +1554,7 @@ typedef enum { VIR_DOMAIN_INPUT_TYPE_KBD, VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH, VIR_DOMAIN_INPUT_TYPE_EVDEV, + VIR_DOMAIN_INPUT_TYPE_MULTITOUCH,
We require that the build passes cleanly after each patch. This obviously won't work with this since you fix up enums later. See contributor guildelines: https://www.libvirt.org/hacking.html#preparing-patches "If you're going to submit multiple patches, the automated tests must pass after each patch, not just after the last one." Multiple of your commit messages and especially 7/8 also have a strong LLM vibe. Note that we don't allow AI contributions: https://www.libvirt.org/hacking.html#use-of-ai-content-generators "Current libvirt project policy is to DECLINE any contributions which are believed to include or derive from AI generated content. This includes ChatGPT, Claude, Copilot, Llama and similar tools." Specifically paragraph: "These additions ensure that multitouch devices are fully integrated with libvirt's security, auditing, and validation infrastructure. Without these changes, multitouch devices would trigger warnings about unhandled enum values or potentially cause security labeling failures. strikes as AI. Because it's overly verbose and half of the things that are mentioned are not even true (e.g. it adds no-op code to the selinux driver), the other half is trying to justify fix for build failures from previous patches.
Em sex., 16 de jan. de 2026 às 02:33, Peter Krempa <pkrempa@redhat.com> escreveu:
On Thu, Jan 15, 2026 at 23:52:29 -0300, Julio Faracco wrote:
This commit introduces the VIR_DOMAIN_INPUT_TYPE_MULTITOUCH enum value to the virDomainInputType enumeration, laying the groundwork for multitouch input device support in libvirt.
The new enum value is added to src/conf/domain_conf.h following the existing input types (mouse, tablet, keyboard, passthrough, evdev). This establishes the fundamental type definition that will be used throughout the codebase to identify and handle multitouch input devices.
This is the first step in implementing support for QEMU's virtio-multitouch device, which was introduced in QEMU 8.1.0 and enables emulation of multitouch events via the libvirt API.
Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/conf/domain_conf.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cb35ff06bd..4c448bd010 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1554,6 +1554,7 @@ typedef enum { VIR_DOMAIN_INPUT_TYPE_KBD, VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH, VIR_DOMAIN_INPUT_TYPE_EVDEV, + VIR_DOMAIN_INPUT_TYPE_MULTITOUCH,
We require that the build passes cleanly after each patch. This obviously won't work with this since you fix up enums later. See contributor guildelines:
https://www.libvirt.org/hacking.html#preparing-patches
"If you're going to submit multiple patches, the automated tests must pass after each patch, not just after the last one."
Oh, I missed that. Thanks for remembering me. It's been a long time since my last contribution.
Multiple of your commit messages and especially 7/8 also have a strong LLM vibe. Note that we don't allow AI contributions:
https://www.libvirt.org/hacking.html#use-of-ai-content-generators
"Current libvirt project policy is to DECLINE any contributions which are believed to include or derive from AI generated content. This includes ChatGPT, Claude, Copilot, Llama and similar tools."
Specifically paragraph:
"These additions ensure that multitouch devices are fully integrated with libvirt's security, auditing, and validation infrastructure. Without these changes, multitouch devices would trigger warnings about unhandled enum values or potentially cause security labeling failures.
strikes as AI. Because it's overly verbose and half of the things that are mentioned are not even true (e.g. it adds no-op code to the selinux driver), the other half is trying to justify fix for build failures from previous patches.
I DO NOT use AI agents to generate code obviously, but I do to improve the quality of the commit message/cover letter. Let me resend the patch to fix the compilation issues and use my own words then. Thanks, Peter
On Fri, Jan 16, 2026 at 09:50:51 -0300, Julio Faracco wrote:
Em sex., 16 de jan. de 2026 às 02:33, Peter Krempa <pkrempa@redhat.com> escreveu:
[...]
Specifically paragraph:
"These additions ensure that multitouch devices are fully integrated with libvirt's security, auditing, and validation infrastructure. Without these changes, multitouch devices would trigger warnings about unhandled enum values or potentially cause security labeling failures.
strikes as AI. Because it's overly verbose and half of the things that are mentioned are not even true (e.g. it adds no-op code to the selinux driver), the other half is trying to justify fix for build failures from previous patches.
I DO NOT use AI agents to generate code obviously, but I do to improve the quality of the commit message/cover letter.
What you did definitely *DID NOT* improve the quality. It did the exact oposite! Commit messages are part of the contribution, and putting AI slop there (and what you've sent is slop because it's overly verbose, misleading and with basically 0 value) is actively bad for the project. When I read a commit message I do that so that I gain understanding why something happened or understand some detail which may not be obvious from the code. Putting 3 paragraphs of basically useless garbage description for a 1 line change wastes time and shows total disrespect to anyone who'd want to understand what's going on. That's especially the case for the wrong/misleading description of the addition to the security driver and possibly others. Commit messages don't need to be novels/pages full of text, but rather need to contain detail not present in the code. And also make sure to consider that people *do* read them, they are not just for decoration.
Let me resend the patch to fix the compilation issues and use my own words then.
If you didn't use AI to generate the code then just get rid of all the slop from the commit messages.
On Fri, Jan 16, 2026 at 09:50:51AM -0300, Julio Faracco wrote:
Em sex., 16 de jan. de 2026 às 02:33, Peter Krempa <pkrempa@redhat.com> escreveu:
On Thu, Jan 15, 2026 at 23:52:29 -0300, Julio Faracco wrote:
This commit introduces the VIR_DOMAIN_INPUT_TYPE_MULTITOUCH enum value to the virDomainInputType enumeration, laying the groundwork for multitouch input device support in libvirt.
The new enum value is added to src/conf/domain_conf.h following the existing input types (mouse, tablet, keyboard, passthrough, evdev). This establishes the fundamental type definition that will be used throughout the codebase to identify and handle multitouch input devices.
This is the first step in implementing support for QEMU's virtio-multitouch device, which was introduced in QEMU 8.1.0 and enables emulation of multitouch events via the libvirt API.
Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/conf/domain_conf.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cb35ff06bd..4c448bd010 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1554,6 +1554,7 @@ typedef enum { VIR_DOMAIN_INPUT_TYPE_KBD, VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH, VIR_DOMAIN_INPUT_TYPE_EVDEV, + VIR_DOMAIN_INPUT_TYPE_MULTITOUCH,
We require that the build passes cleanly after each patch. This obviously won't work with this since you fix up enums later. See contributor guildelines:
https://www.libvirt.org/hacking.html#preparing-patches
"If you're going to submit multiple patches, the automated tests must pass after each patch, not just after the last one."
Oh, I missed that. Thanks for remembering me. It's been a long time since my last contribution.
Multiple of your commit messages and especially 7/8 also have a strong LLM vibe. Note that we don't allow AI contributions:
https://www.libvirt.org/hacking.html#use-of-ai-content-generators
"Current libvirt project policy is to DECLINE any contributions which are believed to include or derive from AI generated content. This includes ChatGPT, Claude, Copilot, Llama and similar tools."
Specifically paragraph:
"These additions ensure that multitouch devices are fully integrated with libvirt's security, auditing, and validation infrastructure. Without these changes, multitouch devices would trigger warnings about unhandled enum values or potentially cause security labeling failures.
strikes as AI. Because it's overly verbose and half of the things that are mentioned are not even true (e.g. it adds no-op code to the selinux driver), the other half is trying to justify fix for build failures from previous patches.
I DO NOT use AI agents to generate code obviously, but I do to improve the quality of the commit message/cover letter. Let me resend the patch to fix the compilation issues and use my own words then.
Using an AI agent to improve commit messages *is* permitted under policy. Whether written by a human or LLM, the overriding expectation is that the commit messages are providing an appropriate level of detail for the type of change being made and that they are accurate of course. Given AI agents tendancy to be ridiculously verbose LLM generated commit messages are quite likely to need significant editting to reduce verbosity, aside from vetting that it is accurate. IMHO that suggests LLMs are not especially beneficial for writing commit messages, but contributors can make that decision for themselves, as long as the result is accurate & appropriately verbose for the change. With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Em sex., 16 de jan. de 2026 às 10:06, Daniel P. Berrangé <berrange@redhat.com> escreveu:
On Fri, Jan 16, 2026 at 09:50:51AM -0300, Julio Faracco wrote:
Em sex., 16 de jan. de 2026 às 02:33, Peter Krempa <pkrempa@redhat.com> escreveu:
On Thu, Jan 15, 2026 at 23:52:29 -0300, Julio Faracco wrote:
This commit introduces the VIR_DOMAIN_INPUT_TYPE_MULTITOUCH enum value to the virDomainInputType enumeration, laying the groundwork for multitouch input device support in libvirt.
The new enum value is added to src/conf/domain_conf.h following the existing input types (mouse, tablet, keyboard, passthrough, evdev). This establishes the fundamental type definition that will be used throughout the codebase to identify and handle multitouch input devices.
This is the first step in implementing support for QEMU's virtio-multitouch device, which was introduced in QEMU 8.1.0 and enables emulation of multitouch events via the libvirt API.
Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/conf/domain_conf.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index cb35ff06bd..4c448bd010 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -1554,6 +1554,7 @@ typedef enum { VIR_DOMAIN_INPUT_TYPE_KBD, VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH, VIR_DOMAIN_INPUT_TYPE_EVDEV, + VIR_DOMAIN_INPUT_TYPE_MULTITOUCH,
We require that the build passes cleanly after each patch. This obviously won't work with this since you fix up enums later. See contributor guildelines:
https://www.libvirt.org/hacking.html#preparing-patches
"If you're going to submit multiple patches, the automated tests must pass after each patch, not just after the last one."
Oh, I missed that. Thanks for remembering me. It's been a long time since my last contribution.
Multiple of your commit messages and especially 7/8 also have a strong LLM vibe. Note that we don't allow AI contributions:
https://www.libvirt.org/hacking.html#use-of-ai-content-generators
"Current libvirt project policy is to DECLINE any contributions which are believed to include or derive from AI generated content. This includes ChatGPT, Claude, Copilot, Llama and similar tools."
Specifically paragraph:
"These additions ensure that multitouch devices are fully integrated with libvirt's security, auditing, and validation infrastructure. Without these changes, multitouch devices would trigger warnings about unhandled enum values or potentially cause security labeling failures.
strikes as AI. Because it's overly verbose and half of the things that are mentioned are not even true (e.g. it adds no-op code to the selinux driver), the other half is trying to justify fix for build failures from previous patches.
I DO NOT use AI agents to generate code obviously, but I do to improve the quality of the commit message/cover letter. Let me resend the patch to fix the compilation issues and use my own words then.
Using an AI agent to improve commit messages *is* permitted under policy.
Whether written by a human or LLM, the overriding expectation is that the commit messages are providing an appropriate level of detail for the type of change being made and that they are accurate of course.
Given AI agents tendancy to be ridiculously verbose LLM generated commit messages are quite likely to need significant editting to reduce verbosity, aside from vetting that it is accurate.
IMHO that suggests LLMs are not especially beneficial for writing commit messages, but contributors can make that decision for themselves, as long as the result is accurate & appropriately verbose for the change.
What I have tried to say is exactly that: before sending the patches I just ask LLMs to review the commit messages of my patches and make improvements. But yes, it tends to increase the verbosity significantly. Well, I understood the feedback. Let me fix the patchset and resubmit using my own words only. (Perhaps one good adjustment is just using LLMs to fix orthography and typos)
With regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
Thanks! -- Julio Faracco
This commit adds the string-to-enum mapping for "multitouch" in the VIR_ENUM_IMPL macro within src/conf/domain_conf.c. This mapping is essential for XML parsing and serialization, enabling libvirt to recognize "multitouch" as a valid value for the type attribute in input device definitions. When users specify type='multitouch' in their domain XML, this mapping allows libvirt to convert the string to the VIR_DOMAIN_INPUT_TYPE_MULTITOUCH enum value internally. Without this mapping, libvirt would reject domain XML containing multitouch input devices as invalid. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/conf/domain_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 9ca5c2450c..aeb81fc42f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -916,6 +916,7 @@ VIR_ENUM_IMPL(virDomainInput, "keyboard", "passthrough", "evdev", + "multitouch", ); VIR_ENUM_IMPL(virDomainInputBus, -- 2.52.0
This commit extends the domain schema (domaincommon.rng) to include "multitouch" as a valid input device type in domain XML definitions. By adding "multitouch" to the allowed input types, we enable users to define multitouch input devices in their VM configurations: <devices> ... <input type='multitouch' bus='virtio'/> ... </devices> Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/conf/schemas/domaincommon.rng | 1 + 1 file changed, 1 insertion(+) diff --git a/src/conf/schemas/domaincommon.rng b/src/conf/schemas/domaincommon.rng index 114dd3f96f..d8fdc8c240 100644 --- a/src/conf/schemas/domaincommon.rng +++ b/src/conf/schemas/domaincommon.rng @@ -6359,6 +6359,7 @@ <value>tablet</value> <value>mouse</value> <value>keyboard</value> + <value>multitouch</value> </choice> </attribute> <optional> -- 2.52.0
This commit implements the QEMU command-line generation logic for multitouch input devices in src/qemu/qemu_command.c. When a domain configuration includes a multitouch input device, libvirt needs to translate this into the appropriate QEMU command-line argument. This commit adds the VIR_DOMAIN_INPUT_TYPE_MULTITOUCH case to the switch statement that maps libvirt input types to QEMU device models. The mapping follows the established pattern for other virtio input devices: - For PCI bus: virtio-multitouch-pci - For MMIO bus: virtio-multitouch-device This enables libvirt to generate command-line arguments like: -device virtio-multitouch-pci,id=input0 which instructs QEMU to create a virtio-based multitouch input device for the virtual machine. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/qemu/qemu_command.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0de0a79b46..705cc43cb9 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -929,6 +929,10 @@ qemuBuildVirtioDevGetConfigDev(const virDomainDeviceDef *device, *baseName = "virtio-input-host"; break; + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: + *baseName = "virtio-multitouch"; + break; + case VIR_DOMAIN_INPUT_TYPE_EVDEV: case VIR_DOMAIN_INPUT_TYPE_LAST: default: -- 2.52.0
This commit adds device property configuration for multitouch input devices in the QEMU command builder (src/qemu/qemu_command.c). When constructing QEMU command-line arguments for multitouch devices, certain device-specific properties may need to be configured. This commit extends the command generation logic to handle these properties, ensuring that multitouch devices are configured with the appropriate attributes when added to the virtual machine. The properties follow the same pattern used for other virtio input devices, maintaining consistency with the existing virtio input device infrastructure in libvirt's QEMU driver. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/qemu/qemu_command.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 705cc43cb9..4e4e0e52ef 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4309,6 +4309,7 @@ qemuBuildInputVirtioDevProps(const virDomainDef *def, case VIR_DOMAIN_INPUT_TYPE_MOUSE: case VIR_DOMAIN_INPUT_TYPE_TABLET: case VIR_DOMAIN_INPUT_TYPE_KBD: + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: break; case VIR_DOMAIN_INPUT_TYPE_EVDEV: @@ -4354,6 +4355,9 @@ qemuBuildInputUSBDevProps(const virDomainDef *def, case VIR_DOMAIN_INPUT_TYPE_KBD: driver = "usb-kbd"; break; + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: + driver = "usb-multitouch"; + break; } if (virJSONValueObjectAdd(&props, -- 2.52.0
This commit introduces QEMU capability detection and validation for virtio-multitouch devices. 1. Capability flag (QEMU_CAPS_VIRTIO_MULTITOUCH): A new capability flag is defined in src/qemu/qemu_capabilities.h to track whether the QEMU binary supports virtio-multitouch devices. 2. Device detection (src/qemu/qemu_capabilities.c): The capability probing code is updated to detect the presence of "virtio-multitouch-device" and "virtio-multitouch-pci" device types when querying QEMU. This allows libvirt to determine at runtime whether the installed QEMU version supports multitouch devices (available since QEMU 8.1.0). 3. Validation (src/qemu/qemu_validate.c): Validation logic is added to ensure that multitouch devices are only used when QEMU supports them. If a domain configuration specifies a multitouch device but QEMU lacks support, libvirt will reject the configuration with a clear error message rather than generating invalid command-line arguments. This capability-based approach ensures that libvirt gracefully handles different QEMU versions, allowing multitouch devices on newer QEMU while preventing configuration errors on older versions. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/qemu/qemu_capabilities.c | 3 +++ src/qemu/qemu_capabilities.h | 1 + src/qemu/qemu_validate.c | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 92b863a826..bc19aa1a5d 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -755,6 +755,7 @@ VIR_ENUM_IMPL(virQEMUCaps, "disk-timed-stats", /* QEMU_CAPS_DISK_TIMED_STATS */ "query-accelerators", /* QEMU_CAPS_QUERY_ACCELERATORS */ "mshv", /* QEMU_CAPS_MSHV */ + "virtio-multitouch", /* QEMU_CAPS_VIRTIO_MULTITOUCH */ ); @@ -1345,6 +1346,8 @@ struct virQEMUCapsStringFlags virQEMUCapsObjectTypes[] = { { "virtio-keyboard-pci", QEMU_CAPS_VIRTIO_KEYBOARD }, { "virtio-mouse-device", QEMU_CAPS_VIRTIO_MOUSE }, { "virtio-mouse-pci", QEMU_CAPS_VIRTIO_MOUSE }, + { "virtio-multitouch-device", QEMU_CAPS_VIRTIO_MULTITOUCH }, + { "virtio-multitouch-pci", QEMU_CAPS_VIRTIO_MULTITOUCH }, { "virtio-tablet-device", QEMU_CAPS_VIRTIO_TABLET }, { "virtio-tablet-pci", QEMU_CAPS_VIRTIO_TABLET }, { "virtio-input-host-device", QEMU_CAPS_VIRTIO_INPUT_HOST }, diff --git a/src/qemu/qemu_capabilities.h b/src/qemu/qemu_capabilities.h index f180844e66..44a3350cf9 100644 --- a/src/qemu/qemu_capabilities.h +++ b/src/qemu/qemu_capabilities.h @@ -730,6 +730,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */ QEMU_CAPS_DISK_TIMED_STATS, /* timed stats support ('stats-intervals' property of disk frontends) */ QEMU_CAPS_QUERY_ACCELERATORS, /* query-accelerators command */ QEMU_CAPS_MSHV, /* -accel mshv */ + QEMU_CAPS_VIRTIO_MULTITOUCH, /* -device virtio-multitouch-{device,pci} */ QEMU_CAPS_LAST /* this must always be the last item */ } virQEMUCapsFlags; diff --git a/src/qemu/qemu_validate.c b/src/qemu/qemu_validate.c index 184c23d307..6589939290 100644 --- a/src/qemu/qemu_validate.c +++ b/src/qemu/qemu_validate.c @@ -5485,6 +5485,11 @@ qemuValidateDomainDeviceDefInput(const virDomainInputDef *input, cap = QEMU_CAPS_VIRTIO_INPUT_HOST; ccwCap = QEMU_CAPS_LAST; break; + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: + baseName = "virtio-multitouch"; + cap = QEMU_CAPS_VIRTIO_MULTITOUCH; + ccwCap = QEMU_CAPS_LAST; + break; case VIR_DOMAIN_INPUT_TYPE_EVDEV: baseName = "input-linux"; cap = QEMU_CAPS_INPUT_LINUX; -- 2.52.0
This commit completes the multitouch integration by adding the VIR_DOMAIN_INPUT_TYPE_MULTITOUCH case to all remaining enum switch statements throughout the codebase. Updated files: - src/conf/domain_audit.c - src/conf/domain_conf.c - src/conf/domain_validate.c - src/security/security_dac.c - src/security/security_selinux.c These additions ensure that multitouch devices are fully integrated with libvirt's security, auditing, and validation infrastructure. Without these changes, multitouch devices would trigger warnings about unhandled enum values or potentially cause security labeling failures. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- src/conf/domain_audit.c | 1 + src/conf/domain_conf.c | 1 + src/conf/domain_validate.c | 1 + src/security/security_dac.c | 2 ++ src/security/security_selinux.c | 2 ++ 5 files changed, 7 insertions(+) diff --git a/src/conf/domain_audit.c b/src/conf/domain_audit.c index 7a6bb02203..1dee7d76fc 100644 --- a/src/conf/domain_audit.c +++ b/src/conf/domain_audit.c @@ -922,6 +922,7 @@ virDomainAuditInput(virDomainObj *vm, case VIR_DOMAIN_INPUT_TYPE_MOUSE: case VIR_DOMAIN_INPUT_TYPE_TABLET: case VIR_DOMAIN_INPUT_TYPE_KBD: + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: break; case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH: diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index aeb81fc42f..84496478b0 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2080,6 +2080,7 @@ const char *virDomainInputDefGetPath(virDomainInputDef *input) case VIR_DOMAIN_INPUT_TYPE_MOUSE: case VIR_DOMAIN_INPUT_TYPE_TABLET: case VIR_DOMAIN_INPUT_TYPE_KBD: + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: case VIR_DOMAIN_INPUT_TYPE_LAST: return NULL; diff --git a/src/conf/domain_validate.c b/src/conf/domain_validate.c index 7346a61731..e36927985e 100644 --- a/src/conf/domain_validate.c +++ b/src/conf/domain_validate.c @@ -2877,6 +2877,7 @@ virDomainInputDefValidate(const virDomainInputDef *input, case VIR_DOMAIN_INPUT_TYPE_MOUSE: case VIR_DOMAIN_INPUT_TYPE_TABLET: case VIR_DOMAIN_INPUT_TYPE_KBD: + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: if (input->source.evdev) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("setting source evdev path only supported for passthrough input devices")); diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 2f788b872a..44038e194f 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -1841,6 +1841,7 @@ virSecurityDACSetInputLabel(virSecurityManager *mgr, case VIR_DOMAIN_INPUT_TYPE_MOUSE: case VIR_DOMAIN_INPUT_TYPE_TABLET: case VIR_DOMAIN_INPUT_TYPE_KBD: + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: case VIR_DOMAIN_INPUT_TYPE_LAST: ret = 0; break; @@ -1865,6 +1866,7 @@ virSecurityDACRestoreInputLabel(virSecurityManager *mgr, case VIR_DOMAIN_INPUT_TYPE_MOUSE: case VIR_DOMAIN_INPUT_TYPE_TABLET: case VIR_DOMAIN_INPUT_TYPE_KBD: + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: case VIR_DOMAIN_INPUT_TYPE_LAST: ret = 0; break; diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 2f3cc274a5..5177b38be0 100644 --- a/src/security/security_selinux.c +++ b/src/security/security_selinux.c @@ -1605,6 +1605,7 @@ virSecuritySELinuxSetInputLabel(virSecurityManager *mgr, case VIR_DOMAIN_INPUT_TYPE_MOUSE: case VIR_DOMAIN_INPUT_TYPE_TABLET: case VIR_DOMAIN_INPUT_TYPE_KBD: + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: case VIR_DOMAIN_INPUT_TYPE_LAST: break; } @@ -1632,6 +1633,7 @@ virSecuritySELinuxRestoreInputLabel(virSecurityManager *mgr, case VIR_DOMAIN_INPUT_TYPE_MOUSE: case VIR_DOMAIN_INPUT_TYPE_TABLET: case VIR_DOMAIN_INPUT_TYPE_KBD: + case VIR_DOMAIN_INPUT_TYPE_MULTITOUCH: case VIR_DOMAIN_INPUT_TYPE_LAST: break; } -- 2.52.0
This commit adds test coverage for the multitouch input device feature. Updated test files to get this new capability working with other input devices: - tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml: Adds the QEMU_CAPS_VIRTIO_MULTITOUCH capability to the QEMU 10.2.0 capability test data, indicating that this QEMU version supports multitouch devices. - tests/qemuxmlconfdata/virtio-input.xml: Adds a multitouch input device definition to the virtio-input test case, providing an example of proper XML syntax. - tests/qemuxmlconfdata/virtio-input.x86_64-latest.xml: Updates the expected parsed XML output to include the multitouch device configuration. - tests/qemuxmlconfdata/virtio-input.x86_64-latest.args: Updates the expected QEMU command-line arguments to include the virtio-multitouch-pci device, validating that libvirt correctly translates the XML into QEMU arguments. Signed-off-by: Julio Faracco <jcfaracco@gmail.com> --- tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml | 1 + tests/qemuxmlconfdata/virtio-input.x86_64-latest.args | 1 + tests/qemuxmlconfdata/virtio-input.x86_64-latest.xml | 3 +++ tests/qemuxmlconfdata/virtio-input.xml | 1 + 4 files changed, 6 insertions(+) diff --git a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml b/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml index 06f7bf784d..d718aec43a 100644 --- a/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml +++ b/tests/qemucapabilitiesdata/caps_10.2.0_x86_64.xml @@ -64,6 +64,7 @@ <flag name='virtio-keyboard'/> <flag name='virtio-mouse'/> <flag name='virtio-tablet'/> + <flag name='virtio-multitouch'/> <flag name='virtio-input-host'/> <flag name='virtio-balloon-pci.deflate-on-oom'/> <flag name='mptsas1068'/> diff --git a/tests/qemuxmlconfdata/virtio-input.x86_64-latest.args b/tests/qemuxmlconfdata/virtio-input.x86_64-latest.args index 20439c7de1..9f1747f509 100644 --- a/tests/qemuxmlconfdata/virtio-input.x86_64-latest.args +++ b/tests/qemuxmlconfdata/virtio-input.x86_64-latest.args @@ -30,6 +30,7 @@ XDG_CONFIG_HOME=/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ -device '{"driver":"virtio-mouse-pci","id":"input0","bus":"pci.0","addr":"0x3"}' \ -device '{"driver":"virtio-keyboard-pci","id":"input1","bus":"pci.0","addr":"0xa"}' \ -device '{"driver":"virtio-tablet-pci","id":"input2","bus":"pci.0","addr":"0x4"}' \ +-device '{"driver":"virtio-multitouch-pci","id":"input3","bus":"pci.0","addr":"0x5"}' \ -audiodev '{"id":"audio1","driver":"none"}' \ -device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","addr":"0x2"}' \ -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny \ diff --git a/tests/qemuxmlconfdata/virtio-input.x86_64-latest.xml b/tests/qemuxmlconfdata/virtio-input.x86_64-latest.xml index e9c7a3676c..ff7b142cdd 100644 --- a/tests/qemuxmlconfdata/virtio-input.x86_64-latest.xml +++ b/tests/qemuxmlconfdata/virtio-input.x86_64-latest.xml @@ -30,6 +30,9 @@ <input type='tablet' bus='virtio'> <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/> </input> + <input type='multitouch' bus='virtio'> + <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/> + </input> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <audio id='1' type='none'/> diff --git a/tests/qemuxmlconfdata/virtio-input.xml b/tests/qemuxmlconfdata/virtio-input.xml index 6f07f7b8df..0c9a854243 100644 --- a/tests/qemuxmlconfdata/virtio-input.xml +++ b/tests/qemuxmlconfdata/virtio-input.xml @@ -21,6 +21,7 @@ <address type='pci' domain='0x0000' bus='0x00' slot='0x0a' function='0x0'/> </input> <input type='tablet' bus='virtio'/> + <input type='multitouch' bus='virtio'/> <input type='mouse' bus='ps2'/> <input type='keyboard' bus='ps2'/> <memballoon model='virtio'/> -- 2.52.0
participants (3)
-
Daniel P. Berrangé -
Julio Faracco -
Peter Krempa