qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 04/21] block: Add bdrv_close_all() handlers


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH 04/21] block: Add bdrv_close_all() handlers
Date: Wed, 28 Jan 2015 15:44:38 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 01/26/2015 12:27 PM, Max Reitz wrote:
> Every time a reference to a BlockBackend is taken, a notifier for
> bdrv_close_all() has to be deposited so the reference holder can
> relinquish its reference when bdrv_close_all() is called. That notifier
> should be revoked on a bdrv_unref() call.
> 

In addition to the design question about whether NBD exports should be
their own new BB,

> @@ -198,8 +207,12 @@ void blk_ref(BlockBackend *blk)
>   * If this drops it to zero, destroy @blk.
>   * For convenience, do nothing if @blk is null.
>   */
> -void blk_unref(BlockBackend *blk)
> +void blk_unref(BlockBackend *blk, Notifier *close_all_notifier)
>  {
> +    if (close_all_notifier) {
> +        notifier_remove(close_all_notifier);
> +    }
> +
>      if (blk) {

Does removing a notifier when blk is NULL make sense?

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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