mirror of https://gitee.com/openkylin/libvirt.git
conf: Remove a redundant model/address-type check in mdev post parse
It's pointless to check the same thing multiple times. Fix the indentation along the way too. Signed-off-by: Erik Skultety <eskultet@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
e11515ef8d
commit
57e78a9ebb
|
@ -4524,20 +4524,10 @@ virDomainHostdevDefPostParse(virDomainHostdevDefPtr dev,
|
|||
if (dev->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_NONE)
|
||||
return 0;
|
||||
|
||||
if (model == VIR_MDEV_MODEL_TYPE_VFIO_PCI &&
|
||||
dev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
_("Unsupported address type '%s' with mediated "
|
||||
"device model '%s'"),
|
||||
virDomainDeviceAddressTypeToString(dev->info->type),
|
||||
virMediatedDeviceModelTypeToString(model));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((model == VIR_MDEV_MODEL_TYPE_VFIO_PCI &&
|
||||
dev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) ||
|
||||
dev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_PCI) ||
|
||||
(model == VIR_MDEV_MODEL_TYPE_VFIO_CCW &&
|
||||
dev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) {
|
||||
dev->info->type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_CCW)) {
|
||||
virReportError(VIR_ERR_XML_ERROR,
|
||||
_("Unsupported address type '%s' with mediated "
|
||||
"device model '%s'"),
|
||||
|
|
Loading…
Reference in New Issue