]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
conf: Remove a redundant model/address-type check in mdev post parse
authorErik Skultety <eskultet@redhat.com>
Fri, 25 May 2018 07:47:03 +0000 (09:47 +0200)
committerErik Skultety <eskultet@redhat.com>
Mon, 9 Jul 2018 15:45:19 +0000 (17:45 +0200)
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>
src/conf/domain_conf.c

index f4e59f6c9101f8140f10c409b3e60d356ce524a5..77aae06d598ccc48cb97d5752bc944b6a36e6519 100644 (file)
@@ -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'"),