size_t i;
if (!(interfacesJSON = virJSONValueObjectGetArray(doc, "interface-types"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to get interface-types from '%1$s'"),
- path);
+ VIR_DEBUG("failed to get interface-types from '%s'", path);
return -1;
}
int tmp;
if ((tmp = qemuFirmwareOSInterfaceTypeFromString(tmpStr)) <= 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown interface type: '%1$s'"),
- tmpStr);
+ VIR_DEBUG("unknown interface type: '%s'", tmpStr);
return -1;
}
const char *format;
if (!(filename = virJSONValueObjectGetString(doc, "filename"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing 'filename' in '%1$s'"),
- path);
+ VIR_DEBUG("missing 'filename' in '%s'", path);
return -1;
}
flash->filename = g_strdup(filename);
if (!(format = virJSONValueObjectGetString(doc, "format"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing 'format' in '%1$s'"),
- path);
+ VIR_DEBUG("missing 'format' in '%s'", path);
return -1;
}
const char *modestr = virJSONValueGetString(mode);
int modeval;
if (!modestr) {
- virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
- _("Firmware flash mode value was malformed"));
+ VIR_DEBUG("Firmware flash mode value was malformed");
return -1;
}
modeval = qemuFirmwareFlashModeTypeFromString(modestr);
if (modeval < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Firmware flash mode value '%1$s' unexpected"),
- modestr);
+ VIR_DEBUG("Firmware flash mode value '%s' unexpected", modestr);
return -1;
}
flash->mode = modeval;
}
if (!(executable = virJSONValueObjectGet(doc, "executable"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing 'executable' in '%1$s'"),
- path);
+ VIR_DEBUG("missing 'executable' in '%s'", path);
return -1;
}
if (flash->mode == QEMU_FIRMWARE_FLASH_MODE_SPLIT) {
if (!(nvram_template = virJSONValueObjectGet(doc, "nvram-template"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing 'nvram-template' in '%1$s'"),
- path);
+ VIR_DEBUG("missing 'nvram-template' in '%s'", path);
return -1;
}
const char *filename;
if (!(filename = virJSONValueObjectGetString(doc, "filename"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing 'filename' in '%1$s'"),
- path);
+ VIR_DEBUG("missing 'filename' in '%s'", path);
return -1;
}
const char *filename;
if (!(filename = virJSONValueObjectGetString(doc, "filename"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing 'filename' in '%1$s'"),
- path);
+ VIR_DEBUG("missing 'filename' in '%s'", path);
return -1;
}
int tmp;
if (!(mapping = virJSONValueObjectGet(doc, "mapping"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing mapping in '%1$s'"),
- path);
+ VIR_DEBUG("missing mapping in '%s'", path);
return -1;
}
if (!(deviceStr = virJSONValueObjectGetString(mapping, "device"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing device type in '%1$s'"),
- path);
+ VIR_DEBUG("missing device type in '%s'", path);
return -1;
}
if ((tmp = qemuFirmwareDeviceTypeFromString(deviceStr)) <= 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown device type in '%1$s'"),
- path);
+ VIR_DEBUG("unknown device type in '%s'", path);
return -1;
}
int ret = -1;
if (!(targetsJSON = virJSONValueObjectGetArray(doc, "targets"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to get targets from '%1$s'"),
- path);
+ VIR_DEBUG("failed to get targets from '%s'", path);
return -1;
}
t = g_new0(qemuFirmwareTarget, 1);
if (!(architectureStr = virJSONValueObjectGetString(item, "architecture"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing 'architecture' in '%1$s'"),
- path);
+ VIR_DEBUG("missing 'architecture' in '%s'", path);
goto cleanup;
}
if ((t->architecture = virQEMUCapsArchFromString(architectureStr)) == VIR_ARCH_NONE) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unknown architecture '%1$s'"),
- architectureStr);
+ VIR_DEBUG("unknown architecture '%s'", architectureStr);
goto cleanup;
}
if (!(machines = virJSONValueObjectGetArray(item, "machines"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("missing 'machines' in '%1$s'"),
- path);
+ VIR_DEBUG("missing 'machines' in '%s'", path);
goto cleanup;
}
size_t i;
if (!(featuresJSON = virJSONValueObjectGetArray(doc, "features"))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("failed to get features from '%1$s'"),
- path);
+ VIR_DEBUG("failed to get features from '%s'", path);
return -1;
}
return NULL;
if (!(doc = virJSONValueFromString(cont))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("unable to parse json file '%1$s'"),
- path);
+ VIR_DEBUG("unable to parse json file '%s'", path);
return NULL;
}
qemuFirmware *firmware = qemuFirmwareParse(*currentPath);
if (!firmware)
- goto error;
+ continue;
VIR_APPEND_ELEMENT(firmwares, nfirmwares, firmware);
}
return nfirmwares;
-
- error:
- while (nfirmwares > 0)
- qemuFirmwareFree(firmwares[--nfirmwares]);
- VIR_FREE(firmwares);
- while (npaths > 0)
- VIR_FREE(paths[--npaths]);
- VIR_FREE(paths);
- return -1;
}