[libvirt] [PATCHv2 01/16] storage: list more file types

Eric Blake eblake at redhat.com
Tue Oct 16 17:06:58 UTC 2012


On 10/13/2012 03:59 PM, Eric Blake wrote:
> When an image has no backing file, using VIR_STORAGE_FILE_AUTO
> for its type is a bit confusing.  Additionally, a future patch
> would like to reserve a default value for the case of no file
> type specified in the XML, but different from the current use
> of -1 to imply probing, since probing is not always safe.
> 
> Also, a couple of file types were missing compared to supported
> code: libxl supports 'vhd', and qemu supports 'fat' for directories
> passed through as a file system.
> 
> +++ b/src/util/storage_file.c

> @@ -335,8 +351,12 @@ qcowXGetBackingStore(char **res,
>       * between the end of the header (QCOW2_HDR_TOTAL_SIZE)
>       * and the start of the backingStoreName (offset)
>       */
> -    if (isQCow2 && format)
> -        qcow2GetBackingStoreFormat(format, buf, buf_size, QCOW2_HDR_TOTAL_SIZE, offset);
> +    if (isQCow2 && format) {
> +        qcow2GetBackingStoreFormat(format, buf, buf_size, QCOW2_HDR_TOTAL_SIZE,
> +                                   offset);
> +        if (*format <= VIR_STORAGE_FILE_NONE)
> +            return BACKING_STORE_INVALID;
> +    }

This breaks the case where a qcow2 file has a backing file but did not
specify a format, and libvirt is set to allow probing (for example, if
you use 'qemu-img rebase -u -b blah file' without '-F format').  I'm
working on a fix.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121016/a896f292/attachment-0001.sig>


More information about the libvir-list mailing list