[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 3/8] block: Let bdrv_open_inherit() return the s
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH 3/8] block: Let bdrv_open_inherit() return the snapshot |
Date: |
Wed, 2 Dec 2015 18:26:27 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 |
On 01.12.2015 15:35, Alberto Garcia wrote:
> On Tue 10 Nov 2015 04:44:18 AM CET, Max Reitz wrote:
>> -int bdrv_append_temp_snapshot(BlockDriverState *bs, int flags, Error **errp)
>> +static BlockDriverState *bdrv_append_temp_snapshot(BlockDriverState *bs,
>> + int flags, Error **errp)
>> {
>> /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
>> char *tmp_filename = g_malloc0(PATH_MAX + 1);
>> @@ -1354,11 +1355,15 @@ int bdrv_append_temp_snapshot(BlockDriverState *bs,
>> int flags, Error **errp)
>> goto out;
>> }
>>
>> + bdrv_ref(bs_snapshot);
>> bdrv_append(bs_snapshot, bs);
>>
>> + g_free(tmp_filename);
>> + return bs_snapshot;
>> +
>> out:
>> g_free(tmp_filename);
>> - return ret;
>> + return NULL;
>> }
>
> If I'm not wrong, now that you're not returning 'ret' anymore there's a
> "ret = total_size" line earlier in this function that is useless now.
Yes, indeed, thanks for finding that. Will fix.
Max
> Other than that,
>
> Reviewed-by: Alberto Garcia <address@hidden>
>
> Berto
>
signature.asc
Description: OpenPGP digital signature