]> xenbits.xensource.com Git - libvirt.git/commit
Extract the backing store format as well as name, if available
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 14 Jun 2010 14:53:59 +0000 (15:53 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 19 Jul 2010 14:51:02 +0000 (15:51 +0100)
commita93402d48b2996e5300754d299ef0d3f646aa098
tree9a7803d23ee7797748bedb91fad3c90df3566e64
parentc567853089a2764c964002dd752e09e318524a38
Extract the backing store format as well as name, if available

When QEMU opens a backing store for a QCow2 file, it will
normally auto-probe for the format of the backing store,
rather than assuming it has the same format as the referencing
file. There is a QCow2 extension that allows an explicit format
for the backing store to be embedded in the referencing file.
This closes the auto-probing security hole in QEMU.

This backing store format can be useful for libvirt users
of virStorageFileGetMetadata, so extract this data and report
it.

QEMU does not require disk image backing store files to be in
the same format the file linkee. It will auto-probe the disk
format for the backing store when opening it. If the backing
store was intended to be a raw file this could be a security
hole, because a guest may have written data into its disk that
then makes the backing store look like a qcow2 file. If it can
trick QEMU into thinking the raw file is a qcow2 file, it can
access arbitrary files on the host by adding further backing
store links.

To address this, callers of virStorageFileGetMeta need to be
told of the backing store format. If no format is declared,
they can make a decision whether to allow format probing or
not.
src/util/storage_file.c
src/util/storage_file.h