qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] qcow2: Simplify image creation


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/2] qcow2: Simplify image creation
Date: Tue, 15 Jun 2010 11:14:42 +0100

On Mon, Jun 14, 2010 at 3:43 PM, Kevin Wolf <address@hidden> wrote:
> Instead of doing lots of magic for setting up initial refcount blocks and 
> stuff
> create a minimal (inconsistent) image, open it and initialize the rest with
> regular qcow2 functions.

Nice idea.

> +    ret = bdrv_pwrite(bs, 0, &header, sizeof(header));
> +    if (ret < 0) {
> +        return ret;
> +    }

The bs is not closed on error.  Also, this function will leave a
partially created file on disk if it fails.

> +    /* And if we're supposed to preallocate metadata, do that now */
> +    if (prealloc) {
> +        preallocate(bs);
> +    }
> +
> +    return 0;
> +}

The bs is leaked when the function succeeds.

Stefan



reply via email to

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