qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 12/12] BlockDriver: add bdrv_get_allocated_fi


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH v5 12/12] BlockDriver: add bdrv_get_allocated_file_size() operation
Date: Wed, 29 Jun 2011 16:27:41 +0100

On Tue, Jun 28, 2011 at 2:32 AM, Fam Zheng <address@hidden> wrote:
Please use "block:" as the commit message tag instead of BlockDriver.
Usually the easiest way to find out which tag to use it by doing
git-log(1) on the main file you have modified and looking at previous
commit messages.

> +static int64_t vmdk_get_allocated_file_size(BlockDriverState *bs)
> +{
> +    int i;
> +    int64_t ret = 0;
> +    int64_t r;
> +    BDRVVmdkState *s = bs->opaque;
> +
> +    ret = bdrv_get_allocated_file_size(bs->file);
> +    if (ret < 0) {
> +        return ret;
> +    }
> +    for (i = 0; i < s->num_extents; i++) {
> +        r = bdrv_get_allocated_file_size(s->extents[i].file);
> +        if (r < 0) {
> +            return r;
> +        }
> +        ret += r;
> +    }
> +    return ret;
> +}

Does this count bs->file twice for images without a separate descriptor file?

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]