[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: |
Kevin Wolf |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] qcow2: Simplify image creation |
Date: |
Tue, 15 Jun 2010 12:31:00 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100430 Fedora/3.0.4-2.fc12 Thunderbird/3.0.4 |
Am 15.06.2010 12:14, schrieb Stefan Hajnoczi:
> 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.
Right, will fix the missing bdrv_delete here and in other cases.
> Also, this function will leave a
> partially created file on disk if it fails.
As did the old one, and the bdrv_create functions of most other formats
behave the same. We could implement a bdrv_remove to remove that file
again, but it would be ununsed except for these very unlikely error
cases. If you can't access the disk, usually the bdrv_create_file would
fail already.
Kevin
[Qemu-devel] [PATCH 2/2] qcow2: Remove old image creation function, Kevin Wolf, 2010/06/14