[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] block: make bdrv_drop_intermediate() less wrong
From: |
Alberto Garcia |
Subject: |
Re: [PATCH 1/2] block: make bdrv_drop_intermediate() less wrong |
Date: |
Thu, 05 Nov 2020 16:03:08 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Sat 31 Oct 2020 01:35:01 PM CET, Vladimir Sementsov-Ogievskiy wrote:
> @@ -4958,36 +4958,30 @@ int bdrv_drop_intermediate(BlockDriverState *top,
> BlockDriverState *base,
> backing_file_str = base->filename;
> }
>
> - QLIST_FOREACH_SAFE(c, &top->parents, next_parent, next) {
> - /* Check whether we are allowed to switch c from top to base */
> - GSList *ignore_children = g_slist_prepend(NULL, c);
> - ret = bdrv_check_update_perm(base, NULL, c->perm, c->shared_perm,
> - ignore_children, NULL, &local_err);
> - g_slist_free(ignore_children);
> - if (ret < 0) {
> - error_report_err(local_err);
> - goto exit;
> - }
> + bdrv_replace_node(top, base, &local_err);
> + if (local_err) {
> + error_report_err(local_err);
> + goto exit;
> + }
At the beginning of this function there's a check for c->frozen. I think
you can remove it safely because you also have it in bdrv_replace_node()
Berto