[libvirt] storage: inconsistent in 'format' scheme between document and implementation

Ryota Ozaki ozaki.ryota at gmail.com
Thu May 21 06:57:28 UTC 2009


I've found a problem that a 'format' element in storage-{pool,vol} XML
doesn't behave as described in the document.

The document says that a format of {pool,vol} is specified as the value of
a format element, like:


However, the implementation doesn't follow this:

    if (options->formatFromString) {
        char *format = virXPathString(conn,
"string(/volume/target/format/@type)", ctxt);
        if (format == NULL)
            ret->target.format = options->defaultFormat;
            ret->target.format = (options->formatFromString)(format);

        if (ret->target.format < 0) {
            virStorageReportError(conn, VIR_ERR_XML_ERROR,
                                  _("unknown volume format type %s"), format);
            goto cleanup;

The implementation assumes that a format of {pool,vol} is specified as
the attribute of a format element, like:

          <format type='qcow2' />

Thus, we need to fix either the document or the implementation.
(I guess the implementation is correct, right?)


More information about the libvir-list mailing list