[libvirt] [PATCH 4/4] Support for probing qed image metadata

Eric Blake eblake at redhat.com
Fri Nov 19 23:54:39 UTC 2010


On 11/19/2010 09:18 AM, Adam Litke wrote:
> Implement getBackingStore() for QED images.  The header format is defined in
> the QED spec: http://wiki.qemu.org/Features/QED .
> 

> +    if (offset + size > buf_size || offset + size < offset)
> +        return BACKING_STORE_INVALID;

As currently coded, buf_size is at most STORAGE_MAX_HEAD (20*512).
QED does not appear to have any maximum header size (other than the fact
that header size is a multiple of cluster size), and permits a cluster
size of 2**26.

I don't see anything on the QED file format that requires the
backing_filename to occur within the header clusters (that is, shouldn't
QED add a file format restriction that
backing_filename_offset+backing_filename_size must be less than the
start of the first regular cluster?).

More worrying, I don't see anything in QED that requires the filename to
occur within the first 10K bytes.  Do we need to add another enum value
to libvirt's backing store callback routine, to be used when the header
requests data that lies beyond buf_size but is still feasibly valid, for
the case where QED designates a backing store location that is beyond
10k but still before the start of the first cluster, rather than the
current approach of just treating it as BACKING_STORE_INVALID?

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list