提交 3596b1dd 编写于 作者: J Ján Tomko

qemu: report an error if usb keyboards are unsupported

Be nicer to the user and report a proper error instead of:
An error occurred, but the cause is unknown

https://bugzilla.redhat.com/show_bug.cgi?id=1460086
上级 9ea3424a
......@@ -4261,8 +4261,12 @@ qemuBuildUSBInputDevStr(const virDomainDef *def,
virBufferAsprintf(&buf, "usb-tablet,id=%s", dev->info.alias);
break;
case VIR_DOMAIN_INPUT_TYPE_KBD:
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_KBD))
if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_KBD)) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("usb keyboard is not supported by this "
"QEMU binary"));
goto error;
}
virBufferAsprintf(&buf, "usb-kbd,id=%s", dev->info.alias);
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册