[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 02/12] migration: Don't lose errno across aio con
From: |
Eric Blake |
Subject: |
[Qemu-block] [PATCH v2 02/12] migration: Don't lose errno across aio context changes |
Date: |
Tue, 16 May 2017 15:47:14 -0500 |
set_dirty_tracking() was assuming that the errno value set by
bdrv_create_dirty_bitmap() would not be corrupted by either
blk_get_aio_context() or aio_context_release(). Rather than
audit whether this assumption is safe, rewrite the code to just
grab the value of errno sooner.
CC: address@hidden
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
---
v2: fix commit message typo, no code change
---
migration/block.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/migration/block.c b/migration/block.c
index 8d79d84..ecc838a 100644
--- a/migration/block.c
+++ b/migration/block.c
@@ -350,9 +350,9 @@ static int set_dirty_tracking(void)
aio_context_acquire(blk_get_aio_context(bmds->blk));
bmds->dirty_bitmap = bdrv_create_dirty_bitmap(blk_bs(bmds->blk),
BLOCK_SIZE, NULL, NULL);
+ ret = -errno;
aio_context_release(blk_get_aio_context(bmds->blk));
if (!bmds->dirty_bitmap) {
- ret = -errno;
goto fail;
}
}
--
2.9.4
- [Qemu-block] [PATCH v2 00/12] make dirty-bitmap byte-based, Eric Blake, 2017/05/16
- [Qemu-block] [PATCH v2 01/12] dirty-bitmap: Report BlockDirtyInfo.count in bytes, as documented, Eric Blake, 2017/05/16
- [Qemu-block] [PATCH v2 02/12] migration: Don't lose errno across aio context changes,
Eric Blake <=
- [Qemu-block] [PATCH v2 03/12] dirty-bitmap: Drop unused functions, Eric Blake, 2017/05/16
- [Qemu-block] [PATCH v2 05/12] dirty-bitmap: Set iterator start by offset, not sector, Eric Blake, 2017/05/16
- [Qemu-block] [PATCH v2 04/12] dirty-bitmap: Track size in bytes, Eric Blake, 2017/05/16
- [Qemu-block] [PATCH v2 07/12] dirty-bitmap: Change bdrv_get_dirty_count() to report bytes, Eric Blake, 2017/05/16
- [Qemu-block] [PATCH v2 06/12] dirty-bitmap: Change bdrv_dirty_iter_next() to report byte offset, Eric Blake, 2017/05/16
- [Qemu-block] [PATCH v2 08/12] dirty-bitmap: Change bdrv_get_dirty() to take bytes, Eric Blake, 2017/05/16
- [Qemu-block] [PATCH v2 11/12] dirty-bitmap: Switch bdrv_set_dirty() to bytes, Eric Blake, 2017/05/16
- [Qemu-block] [PATCH v2 09/12] dirty-bitmap: Change bdrv_[re]set_dirty_bitmap() to use bytes, Eric Blake, 2017/05/16