qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 12/15] blockdev: Keep track of monitor-owned


From: Alberto Garcia
Subject: Re: [Qemu-devel] [PATCH v6 12/15] blockdev: Keep track of monitor-owned BDS
Date: Mon, 09 Nov 2015 16:05:35 +0100
User-agent: Notmuch/0.13.2 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu)

On Wed 04 Nov 2015 07:57:44 PM CET, Max Reitz wrote:
> @@ -3519,11 +3537,18 @@ void qmp_x_blockdev_del(bool has_id, const char *id,
>                         bdrv_get_device_or_node_name(bs));
>              goto out;
>          }
> +
> +        if (!blk && !bs->monitor_list.tqe_prev) {
> +            error_setg(errp, "Node %s is not owned by the monitor",
> +                       bs->node_name);
> +            goto out;
> +        }
>      }
>  
>      if (blk) {
>          blk_unref(blk);
>      } else {
> +        QTAILQ_REMOVE(&monitor_bdrv_states, bs, monitor_list);
>          bdrv_unref(bs);
>      }

blk_unref(blk) will also unref the BDS (if there's any), so you also
need to update monitor_bdrv_states in that case, don't you?

Anyway, wouldn't it make more sense to do this in bdrv_delete() ?

Berto



reply via email to

[Prev in Thread] Current Thread [Next in Thread]