mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 06:25:19 +00:00
qemu: Introduce qemuDomainDeviceDefValidateController
Introduce the bare bones helper to validate whether the controller definition is valid.
This commit is contained in:
parent
ac0fb44afa
commit
3ba921869a
@ -3892,6 +3892,26 @@ qemuDomainDeviceDefValidateDisk(const virDomainDiskDef *disk)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainDeviceDefValidateController(const virDomainControllerDef *controller)
|
||||
{
|
||||
switch ((virDomainControllerType) controller->type) {
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_FDC:
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_SCSI:
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_SATA:
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_VIRTIO_SERIAL:
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_CCID:
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_USB:
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_PCI:
|
||||
case VIR_DOMAIN_CONTROLLER_TYPE_LAST:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
|
||||
const virDomainDef *def,
|
||||
@ -3936,11 +3956,14 @@ qemuDomainDeviceDefValidate(const virDomainDeviceDef *dev,
|
||||
ret = qemuDomainDeviceDefValidateDisk(dev->data.disk);
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_DEVICE_CONTROLLER:
|
||||
ret = qemuDomainDeviceDefValidateController(dev->data.controller);
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_DEVICE_LEASE:
|
||||
case VIR_DOMAIN_DEVICE_FS:
|
||||
case VIR_DOMAIN_DEVICE_INPUT:
|
||||
case VIR_DOMAIN_DEVICE_SOUND:
|
||||
case VIR_DOMAIN_DEVICE_CONTROLLER:
|
||||
case VIR_DOMAIN_DEVICE_GRAPHICS:
|
||||
case VIR_DOMAIN_DEVICE_HUB:
|
||||
case VIR_DOMAIN_DEVICE_MEMBALLOON:
|
||||
|
Loading…
Reference in New Issue
Block a user