For conversion of '-device' we'll try to avoid usage of arrays if
possible, so for now if the array coversion function is not provided the
convertor will error out.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
return -1;
}
- if (!arrayFunc || arrayFunc(key, value, buf, skipKey) < 0) {
+ if (!arrayFunc) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("JSON array -> commandline conversion function not provided"));
+ return -1;
+ }
+
+ if (arrayFunc(key, value, buf, skipKey) < 0) {
/* fallback, treat the array as a non-bitmap, adding the key
* for each member */
for (i = 0; i < virJSONValueArraySize(value); i++) {