+Tue Oct 21 19:18:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
+ * src/storage_conf.c: Make sure to set errors on paths where
+ ->formatToString() or ->formatFromString() fail.
+
Tue Oct 21 19:13:00 CEST 2008 Chris Lalancette <clalance@redhat.com>
* src/qemu_driver.c src/storage_conf.c src/network_driver.c
src/storage_driver.c: Shore up the uses of virGetLastError() so that
if (options->formatFromString) {
char *format = virXPathString(conn, "string(/pool/source/format/@type)", ctxt);
if ((ret->source.format = (options->formatFromString)(format)) < 0) {
+ virStorageReportError(conn, VIR_ERR_XML_ERROR,
+ _("unknown pool format type %s"), format);
VIR_FREE(format);
goto cleanup;
}
if (options->formatToString) {
const char *format = (options->formatToString)(def->source.format);
- if (!format)
+ if (!format) {
+ virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unknown pool format number %d"),
+ def->source.format);
goto cleanup;
+ }
virBufferVSprintf(&buf," <format type='%s'/>\n", format);
}
if (options->formatFromString) {
char *format = virXPathString(conn, "string(/volume/target/format/@type)", ctxt);
if ((ret->target.format = (options->formatFromString)(format)) < 0) {
+ virStorageReportError(conn, VIR_ERR_XML_ERROR,
+ _("unknown volume format type %s"), format);
VIR_FREE(format);
goto cleanup;
}
if (options->formatToString) {
const char *format = (options->formatToString)(def->target.format);
- if (!format)
+ if (!format) {
+ virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unknown volume format number %d"),
+ def->target.format);
goto cleanup;
+ }
virBufferVSprintf(&buf," <format type='%s'/>\n", format);
}