Add a error message in case we fail to parse a qdev property.
Also make qemu not abort() in case setting a global property can't be
set. This used to be a clear programming error. The introduction of
the -global switch changed that though, so better exit instead (after
printing the new error message).
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
dev->info->name, name);
return -1;
}
- return prop->info->parse(dev, prop, value);
+ if (prop->info->parse(dev, prop, value) != 0) {
+ fprintf(stderr, "property \"%s.%s\": failed to parse \"%s\"\n",
+ dev->info->name, name, value);
+ return -1;
+ }
+ return 0;
}
void qdev_prop_set(DeviceState *dev, const char *name, void *src, enum PropertyType type)
continue;
}
if (qdev_prop_parse(dev, prop->property, prop->value) != 0) {
- abort();
+ exit(1);
}
}
}