Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
{
struct cpuArchDriver *driver;
+ if (models == NULL && nmodels != 0) {
+ virCPUReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("nonzero nmodels doesn't match with NULL models"));
+ return -1;
+ }
+
if (cpu == NULL) {
virCPUReportError(conn, VIR_ERR_INTERNAL_ERROR,
"%s", _("invalid CPU definition"));
if (data == NULL || (map = x86LoadMap()) == NULL)
return -1;
- if (models == NULL && nmodels != 0)
- return -1;
-
candidate = map->models;
while (candidate != NULL) {
bool allowed = (models == NULL);