mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
qemu: Validate spapr-vio addresses
According to sPAPR, addresses are 32-bit rather than 64-bit. Update qemuDomainDeviceDefValidateAddress() accordingly. https://bugzilla.redhat.com/show_bug.cgi?id=1598657 Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
ad9b36efcd
commit
89afb9f594
@ -6204,11 +6204,24 @@ qemuDomainDeviceDefValidateAddress(const virDomainDeviceDef *dev,
|
||||
* didn't specify one themselves */
|
||||
break;
|
||||
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO: {
|
||||
virDomainDeviceSpaprVioAddressPtr addr = &(info->addr.spaprvio);
|
||||
|
||||
if (addr->has_reg && addr->reg > 0xffffffff) {
|
||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||
_("spapr-vio reg='0x%llx' exceeds maximum "
|
||||
"possible value (0xffffffff)"),
|
||||
addr->reg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE:
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_SERIAL:
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCID:
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_USB:
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_SPAPRVIO:
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_S390:
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW:
|
||||
case VIR_DOMAIN_DEVICE_ADDRESS_TYPE_VIRTIO_MMIO:
|
||||
|
Loading…
Reference in New Issue
Block a user