mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: build command line for virtio-input-host device
<input type='passthrough' bus='virtio'> <source evdev='/dev/input/event1234'/> </input> results in: -device virtio-input-host-pci,id=input0,evdev=/dev/input/event1234 https://bugzilla.redhat.com/show_bug.cgi?id=1231114
This commit is contained in:
parent
1c00dcd665
commit
971f5f229d
@ -5778,7 +5778,14 @@ qemuBuildVirtioInputDevStr(virDomainDefPtr def,
|
||||
virBufferAsprintf(&buf, "virtio-keyboard%s,id=%s", suffix, dev->info.alias);
|
||||
break;
|
||||
case VIR_DOMAIN_INPUT_TYPE_PASSTHROUGH:
|
||||
/* TBD */
|
||||
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_VIRTIO_INPUT_HOST)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("virtio-input-host is not supported by this QEMU binary"));
|
||||
goto error;
|
||||
}
|
||||
virBufferAsprintf(&buf, "virtio-input-host%s,id=%s,evdev=", suffix, dev->info.alias);
|
||||
virBufferEscape(&buf, ',', ",", "%s", dev->source.evdev);
|
||||
break;
|
||||
case VIR_DOMAIN_INPUT_TYPE_LAST:
|
||||
break;
|
||||
}
|
||||
|
@ -0,0 +1,22 @@
|
||||
LC_ALL=C \
|
||||
PATH=/bin \
|
||||
HOME=/home/test \
|
||||
USER=test \
|
||||
LOGNAME=test \
|
||||
QEMU_AUDIO_DRV=none \
|
||||
/usr/bin/qemu \
|
||||
-name QEMUGuest1 \
|
||||
-S \
|
||||
-M pc \
|
||||
-m 214 \
|
||||
-smp 1 \
|
||||
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
|
||||
-nographic \
|
||||
-nodefaults \
|
||||
-monitor unix:/tmp/test-monitor,server,nowait \
|
||||
-no-acpi \
|
||||
-boot c \
|
||||
-usb \
|
||||
-device virtio-input-host-pci,id=input0,evdev=/dev/input/event1234,bus=pci.0,\
|
||||
addr=0x4 \
|
||||
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
@ -1760,6 +1760,7 @@ mymain(void)
|
||||
|
||||
DO_TEST("virtio-input", QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_KEYBOARD,
|
||||
QEMU_CAPS_VIRTIO_MOUSE, QEMU_CAPS_VIRTIO_TABLET);
|
||||
DO_TEST("virtio-input-passthrough", QEMU_CAPS_DEVICE, QEMU_CAPS_VIRTIO_INPUT_HOST);
|
||||
|
||||
qemuTestDriverFree(&driver);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user