[Top][All Lists]
[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
- [Qemu-devel] [PATCH 0/2] qcow2: Simplify image creation code, Kevin Wolf, 2010/06/14
- [Qemu-devel] [PATCH 1/2] qcow2: Simplify image creation, Kevin Wolf, 2010/06/14
- Re: [Qemu-devel] [PATCH 1/2] qcow2: Simplify image creation,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [PATCH 1/2] qcow2: Simplify image creation, Kevin Wolf, 2010/06/15
- [Qemu-devel] [PATCH v2 1/2] qcow2: Simplify image creation, Kevin Wolf, 2010/06/15
- [Qemu-devel] Re: [PATCH v2 1/2] qcow2: Simplify image creation, Stefan Hajnoczi, 2010/06/15
- Re: [Qemu-devel] Re: [PATCH v2 1/2] qcow2: Simplify image creation, Kevin Wolf, 2010/06/15
- Re: [Qemu-devel] Re: [PATCH v2 1/2] qcow2: Simplify image creation, Stefan Hajnoczi, 2010/06/15
[Qemu-devel] [PATCH 2/2] qcow2: Remove old image creation function, Kevin Wolf, 2010/06/14