Skip to contentSkip to conversation

block: use bdrv_add_before_write_notifier

PATCH Applied Paolo Bonzini 4 participants 4 messages Oct 4, 2016 – Oct 5, 2016 Block layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 block: use bdrv_add_before_write_notifier

Register the notifier using the specific API for block devices.

---
 block/write-threshold.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
block/write-threshold.c +1 -2
index cc2ca71..0bd1a01 100644
@@ -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,
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Paolo Bonzini

Register the notifier using the specific API for block devices.

---
 block/write-threshold.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 16 lines
block/write-threshold.c +1 -2
index cc2ca71..0bd1a01 100644
@@ -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,
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org