[Top][All Lists]

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

[Qemu-devel] [PULL 12/20] block: process before_write_notifiers in bdrv_

From: Stefan Hajnoczi
Subject: [Qemu-devel] [PULL 12/20] block: process before_write_notifiers in bdrv_co_discard
Date: Mon, 20 Jun 2016 15:05:23 +0100

From: "Denis V. Lunev" <address@hidden>

This is mandatory for correct backup creation. In the other case the
content under this area would be lost.

Dirty bits are set exactly like in bdrv_aligned_pwritev, i.e. they are set
even if notifier has returned a error.

Signed-off-by: Denis V. Lunev <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy<address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-id: address@hidden
CC: Fam Zheng <address@hidden>
CC: Stefan Hajnoczi <address@hidden>
CC: Kevin Wolf <address@hidden>
CC: Max Reitz <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
 block/io.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/block/io.c b/block/io.c
index 8ab6f95..7cf3645 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2350,6 +2350,11 @@ int coroutine_fn bdrv_co_discard(BlockDriverState *bs, 
int64_t sector_num,
     tracked_request_begin(&req, bs, sector_num << BDRV_SECTOR_BITS,
                           nb_sectors << BDRV_SECTOR_BITS, 
+    ret = notifier_with_return_list_notify(&bs->before_write_notifiers, &req);
+    if (ret < 0) {
+        goto out;
+    }
     max_discard = MIN_NON_ZERO(bs->bl.max_discard, BDRV_REQUEST_MAX_SECTORS);
     while (nb_sectors > 0) {
         int ret;

reply via email to

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