diff mbox

block: use bdrv_add_before_write_notifier

Message ID 1475570983-16182-1-git-send-email-pbonzini@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Oct. 4, 2016, 8:49 a.m. UTC
Register the notifier using the specific API for block devices.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block/write-threshold.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Eric Blake Oct. 4, 2016, 8:03 p.m. UTC | #1
On 10/04/2016 03:49 AM, Paolo Bonzini wrote:
> Register the notifier using the specific API for block devices.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block/write-threshold.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/block/write-threshold.c b/block/write-threshold.c
> index cc2ca71..0bd1a01 100644
> --- a/block/write-threshold.c
> +++ b/block/write-threshold.c
> @@ -76,8 +76,7 @@ static int coroutine_fn before_write_notify(NotifierWithReturn *notifier,
>  static void write_threshold_register_notifier(BlockDriverState *bs)
>  {
>      bs->write_threshold_notifier.notify = before_write_notify;
> -    notifier_with_return_list_add(&bs->before_write_notifiers,
> -                                  &bs->write_threshold_notifier);
> +    bdrv_add_before_write_notifier(bs, &bs->write_threshold_notifier);
>  }
>  
>  static void write_threshold_update(BlockDriverState *bs,
>
Kevin Wolf Oct. 5, 2016, 9:44 a.m. UTC | #2
Am 04.10.2016 um 10:49 hat Paolo Bonzini geschrieben:
> Register the notifier using the specific API for block devices.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Thanks, applied to the block branch.

Kevin
Stefan Hajnoczi Oct. 5, 2016, 1:58 p.m. UTC | #3
On Tue, Oct 04, 2016 at 10:49:43AM +0200, Paolo Bonzini wrote:
> Register the notifier using the specific API for block devices.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block/write-threshold.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
diff mbox

Patch

diff --git a/block/write-threshold.c b/block/write-threshold.c
index cc2ca71..0bd1a01 100644
--- a/block/write-threshold.c
+++ b/block/write-threshold.c
@@ -76,8 +76,7 @@  static int coroutine_fn before_write_notify(NotifierWithReturn *notifier,
 static void write_threshold_register_notifier(BlockDriverState *bs)
 {
     bs->write_threshold_notifier.notify = before_write_notify;
-    notifier_with_return_list_add(&bs->before_write_notifiers,
-                                  &bs->write_threshold_notifier);
+    bdrv_add_before_write_notifier(bs, &bs->write_threshold_notifier);
 }
 
 static void write_threshold_update(BlockDriverState *bs,