[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 29/41] block: Use bdrv_reopen_set_read_only() in bdrv
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 29/41] block: Use bdrv_reopen_set_read_only() in bdrv_commit() |
Date: |
Wed, 12 Dec 2018 14:27:23 +0100 |
From: Alberto Garcia <address@hidden>
This patch replaces the bdrv_reopen() calls that set and remove the
BDRV_O_RDWR flag with the new bdrv_reopen_set_read_only() function.
Signed-off-by: Alberto Garcia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/commit.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/block/commit.c b/block/commit.c
index a53c2d04b0..53148e610b 100644
--- a/block/commit.c
+++ b/block/commit.c
@@ -391,7 +391,7 @@ int bdrv_commit(BlockDriverState *bs)
BlockDriverState *commit_top_bs = NULL;
BlockDriver *drv = bs->drv;
int64_t offset, length, backing_length;
- int ro, open_flags;
+ int ro;
int64_t n;
int ret = 0;
uint8_t *buf = NULL;
@@ -410,10 +410,9 @@ int bdrv_commit(BlockDriverState *bs)
}
ro = bs->backing->bs->read_only;
- open_flags = bs->backing->bs->open_flags;
if (ro) {
- if (bdrv_reopen(bs->backing->bs, open_flags | BDRV_O_RDWR, NULL)) {
+ if (bdrv_reopen_set_read_only(bs->backing->bs, false, NULL)) {
return -EACCES;
}
}
@@ -523,7 +522,7 @@ ro_cleanup:
if (ro) {
/* ignoring error return here */
- bdrv_reopen(bs->backing->bs, open_flags & ~BDRV_O_RDWR, NULL);
+ bdrv_reopen_set_read_only(bs->backing->bs, true, NULL);
}
return ret;
--
2.19.2
- [Qemu-block] [PULL 19/41] file-posix: Avoid aio_worker() for QEMU_AIO_DISCARD, (continued)
- [Qemu-block] [PULL 19/41] file-posix: Avoid aio_worker() for QEMU_AIO_DISCARD, Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 21/41] file-posix: Move read/write operation logic out of aio_worker(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 22/41] file-posix: Avoid aio_worker() for QEMU_AIO_READ/WRITE, Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 24/41] file-posix: Switch to .bdrv_co_ioctl, Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 23/41] file-posix: Remove paio_submit_co(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 26/41] block: Add bdrv_reopen_set_read_only(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 25/41] file-posix: Avoid aio_worker() for QEMU_AIO_IOCTL, Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 27/41] block: Use bdrv_reopen_set_read_only() in bdrv_backing_update_filename(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 28/41] block: Use bdrv_reopen_set_read_only() in commit_start/complete(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 30/41] block: Use bdrv_reopen_set_read_only() in stream_start/complete(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 29/41] block: Use bdrv_reopen_set_read_only() in bdrv_commit(),
Kevin Wolf <=
- [Qemu-block] [PULL 31/41] block: Use bdrv_reopen_set_read_only() in qmp_change_backing_file(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 32/41] block: Use bdrv_reopen_set_read_only() in external_snapshot_commit(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 33/41] block: Use bdrv_reopen_set_read_only() in the mirror driver, Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 34/41] block: Drop bdrv_reopen(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 36/41] block: Clean up reopen_backing_file() in block/replication.c, Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 35/41] qemu-io: Put flag changes in the options QDict in reopen_f(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 37/41] block: Remove flags parameter from bdrv_reopen_queue(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 38/41] block: Stop passing flags to bdrv_reopen_queue_child(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 39/41] block: Remove assertions from update_flags_from_options(), Kevin Wolf, 2018/12/12
- [Qemu-block] [PULL 41/41] iotests: make 235 work on s390 (and others), Kevin Wolf, 2018/12/12