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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

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:

	<target>
          <path>/var/lib/virt/images/sparse.img</path>
          <format>qcow2</format>
          <permissions>

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;
        else
            ret->target.format = (options->formatFromString)(format);

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

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

	<target>
          <path>/var/lib/virt/images/sparse.img</path>
          <format type='qcow2' />
          <permissions>

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

Thanks,
  ozaki-r

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]