qemu: command: Add virReportEnumRangeError to BuildHostdevCommandline

Adding the 'default' case to our enum-typecasted switches is the current
safety trend, so add it here for mdevs too.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Erik Skultety 2018-06-08 13:47:31 +02:00
parent afc107c20f
commit 9f26814afd

View File

@ -5413,10 +5413,10 @@ qemuBuildHostdevCommandLine(virCommandPtr cmd,
}
break;
case VIR_MDEV_MODEL_TYPE_LAST:
virReportError(VIR_ERR_INTERNAL_ERROR,
_("unexpected vfio type '%d'"), subsys->u.mdev.model);
default:
virReportEnumRangeError(virMediatedDeviceModelType,
subsys->u.mdev.model);
return -1;
break;
}
virCommandAddArg(cmd, "-device");