[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 16/20] block: Use bdrv_parse_cache_mode() in driv
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH v2 16/20] block: Use bdrv_parse_cache_mode() in drive_init() |
Date: |
Tue, 29 Mar 2016 15:30:53 +0200 |
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
blockdev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/blockdev.c b/blockdev.c
index 27c9b59..c2dd584 100644
--- a/blockdev.c
+++ b/blockdev.c
@@ -897,8 +897,9 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType
block_default_type)
value = qemu_opt_get(all_opts, "cache");
if (value) {
int flags = 0;
+ bool writethrough;
- if (bdrv_parse_cache_flags(value, &flags) != 0) {
+ if (bdrv_parse_cache_mode(value, &flags, &writethrough) != 0) {
error_report("invalid cache option");
return NULL;
}
@@ -906,7 +907,7 @@ DriveInfo *drive_new(QemuOpts *all_opts, BlockInterfaceType
block_default_type)
/* Specific options take precedence */
if (!qemu_opt_get(all_opts, BDRV_OPT_CACHE_WB)) {
qemu_opt_set_bool(all_opts, BDRV_OPT_CACHE_WB,
- !!(flags & BDRV_O_CACHE_WB), &error_abort);
+ !writethrough, &error_abort);
}
if (!qemu_opt_get(all_opts, BDRV_OPT_CACHE_DIRECT)) {
qemu_opt_set_bool(all_opts, BDRV_OPT_CACHE_DIRECT,
--
1.8.3.1
- [Qemu-devel] [PATCH v2 01/20] block: Add bdrv_parse_cache_mode(), (continued)
- [Qemu-devel] [PATCH v2 01/20] block: Add bdrv_parse_cache_mode(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 04/20] qemu-img: Expand all BDRV_O_FLAGS uses, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 02/20] qemu-nbd: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 03/20] qemu-io: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 07/20] block: blockdev_init(): Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 05/20] qemu-img: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 06/20] xen_disk: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 14/20] nbd: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 11/20] block/qapi: Use blk_enable_write_cache(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 16/20] block: Use bdrv_parse_cache_mode() in drive_init(),
Kevin Wolf <=
- [Qemu-devel] [PATCH v2 10/20] block: Move enable_write_cache to BB level, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 09/20] block: Handle flush error in bdrv_pwrite_sync(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 08/20] block: Always set writeback mode in blk_new_open(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 12/20] block: Introduce bdrv_co_writev_flags(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 15/20] raw: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 17/20] qemu-io: Use bdrv_parse_cache_mode() in reopen_f(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 18/20] block: Remove bdrv_parse_cache_flags(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PATCH v2 20/20] block: Remove bdrv_(set_)enable_write_cache(), Kevin Wolf, 2016/03/29