[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [Qemu-block] [PATCH 3/8] block: Let bdrv_open_inherit()
From: |
Alberto Garcia |
Subject: |
Re: [Qemu-devel] [Qemu-block] [PATCH 3/8] block: Let bdrv_open_inherit() return the snapshot |
Date: |
Tue, 01 Dec 2015 15:35:13 +0100 |
User-agent: |
Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) |
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.
Other than that,
Reviewed-by: Alberto Garcia <address@hidden>
Berto
- Re: [Qemu-devel] [Qemu-block] [PATCH 3/8] block: Let bdrv_open_inherit() return the snapshot,
Alberto Garcia <=