mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemuDomainDeviceDefPostParse: add USB controller model check
To sync with virDomainControllerModelUSB, we add two models in qemuControllerModelUSB 'qusb1' and 'qusb2', but those models are not supported in qemu driver. So add check in device post parse to report errors if 'qusb1' and 'qusb2' are specified. Signed-off-by: Chunyan Liu <cyliu@suse.com>
This commit is contained in:
parent
9a361bbba8
commit
c6f0e177a3
@ -2484,6 +2484,19 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
||||
ARCH_IS_S390(def->os.arch))
|
||||
dev->data.controller->model = VIR_DOMAIN_CONTROLLER_MODEL_USB_NONE;
|
||||
|
||||
/* forbid usb model 'qusb1' and 'qusb2' in this kind of hyperviosr */
|
||||
if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER &&
|
||||
dev->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_USB &&
|
||||
(dev->data.controller->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB1 ||
|
||||
dev->data.controller->model == VIR_DOMAIN_CONTROLLER_MODEL_USB_QUSB2)) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("USB controller model type 'qusb1' or 'qusb2' "
|
||||
"is not supported in %s"),
|
||||
virDomainVirtTypeToString(def->virtType));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
||||
/* set the default SCSI controller model for S390 arches */
|
||||
if (dev->type == VIR_DOMAIN_DEVICE_CONTROLLER &&
|
||||
dev->data.controller->type == VIR_DOMAIN_CONTROLLER_TYPE_SCSI &&
|
||||
|
Loading…
x
Reference in New Issue
Block a user