mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
qemu_command.c: move QEMU_CAPS_DEVICE_USB_KBD check to qemu_validate.c
Reviewed-by: Michal Privoznik <mprivozn@redhat.com> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
This commit is contained in:
parent
31ac666454
commit
03e4e4b21e
@ -3823,12 +3823,6 @@ 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)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("usb keyboard is not supported by this "
|
||||
"QEMU binary"));
|
||||
return NULL;
|
||||
}
|
||||
virBufferAsprintf(&buf, "usb-kbd,id=%s", dev->info.alias);
|
||||
break;
|
||||
}
|
||||
|
@ -3990,6 +3990,15 @@ qemuValidateDomainDeviceDefInput(const virDomainInputDef *input,
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (input->bus == VIR_DOMAIN_INPUT_BUS_USB &&
|
||||
input->type == VIR_DOMAIN_INPUT_TYPE_KBD &&
|
||||
!virQEMUCapsGet(qemuCaps, QEMU_CAPS_DEVICE_USB_KBD)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||
_("usb keyboard is not supported by this "
|
||||
"QEMU binary"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (input->bus != VIR_DOMAIN_INPUT_BUS_VIRTIO)
|
||||
return 0;
|
||||
|
||||
|
@ -89,6 +89,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
|
||||
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SPICE_FILE_XFER_DISABLE);
|
||||
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_PR_MANAGER_HELPER);
|
||||
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_SCSI_BLOCK);
|
||||
virQEMUCapsSet(priv->qemuCaps, QEMU_CAPS_DEVICE_USB_KBD);
|
||||
|
||||
if (qemuTestCapsCacheInsert(driver.qemuCapsCache, priv->qemuCaps) < 0)
|
||||
return -1;
|
||||
|
Loading…
Reference in New Issue
Block a user