On 10/12/2012 08:09 AM, Stefan Hajnoczi wrote:
> The qemu-img info --backing-chain option enumerates the backing file
> chain.  For example, for base.qcow2 <- snap1.qcow2 <- snap2.qcow2 the
> output becomes:
> 

> +    do {
> +        bs = bdrv_new_open(filename, fmt, BDRV_O_FLAGS | BDRV_O_NO_BACKING,
> +                           false);
> +        if (!bs) {
> +            goto err;
> +        }

> +    } while (filename);

Eww - infinite loop if presented with malicious data where someone has
used 'qemu-img rebase -u' to create a cycle.  I think you need a
followup patch that hashes which files have been opened to date, and
abort the loop once a cycle is detected.

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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to