提交 971f5f22 编写于 作者: J Ján Tomko

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
上级 1c00dcd6
......@@ -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;
}
......
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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册