[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 28/48] qemu-img: Expand all BDRV_O_FLAGS uses
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 28/48] qemu-img: Expand all BDRV_O_FLAGS uses |
Date: |
Tue, 29 Mar 2016 17:08:28 +0200 |
It always only set the BDRV_O_CACHE_WB flag, which is going to go away.
In order to make the next changes more local for better reviewability
this patches expands the macro.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
qemu-img.c | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/qemu-img.c b/qemu-img.c
index 681cb70..4da54a8 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -58,8 +58,7 @@ typedef enum OutputFormat {
OFORMAT_HUMAN,
} OutputFormat;
-/* Default to cache=writeback as data integrity is not important for qemu-tcg.
*/
-#define BDRV_O_FLAGS BDRV_O_CACHE_WB
+/* Default to cache=writeback as data integrity is not important for qemu-img
*/
#define BDRV_DEFAULT_CACHE "writeback"
static void format_print(void *opaque, const char *name)
@@ -461,7 +460,7 @@ static int img_create(int argc, char **argv)
}
bdrv_img_create(filename, fmt, base_filename, base_fmt,
- options, img_size, BDRV_O_FLAGS, &local_err, quiet);
+ options, img_size, BDRV_O_CACHE_WB, &local_err, quiet);
if (local_err) {
error_reportf_err(local_err, "%s: ", filename);
goto fail;
@@ -591,7 +590,7 @@ static int img_check(int argc, char **argv)
BlockBackend *blk;
BlockDriverState *bs;
int fix = 0;
- int flags = BDRV_O_FLAGS | BDRV_O_CHECK;
+ int flags = BDRV_O_CACHE_WB | BDRV_O_CHECK;
ImageCheck *check;
bool quiet = false;
Error *local_err = NULL;
@@ -1203,7 +1202,7 @@ static int img_compare(int argc, char **argv)
/* Initialize before goto out */
qemu_progress_init(progress, 2.0);
- flags = BDRV_O_FLAGS;
+ flags = BDRV_O_CACHE_WB;
ret = bdrv_parse_cache_flags(cache, &flags);
if (ret < 0) {
error_report("Invalid source cache option: %s", cache);
@@ -1883,7 +1882,7 @@ static int img_convert(int argc, char **argv)
goto out;
}
- src_flags = BDRV_O_FLAGS;
+ src_flags = BDRV_O_CACHE_WB;
ret = bdrv_parse_cache_flags(src_cache, &src_flags);
if (ret < 0) {
error_report("Invalid source cache option: %s", src_cache);
@@ -2236,7 +2235,7 @@ static ImageInfoList *collect_image_info_list(bool
image_opts,
g_hash_table_insert(filenames, (gpointer)filename, NULL);
blk = img_open(image_opts, filename, fmt,
- BDRV_O_FLAGS | BDRV_O_NO_BACKING | BDRV_O_NO_IO,
+ BDRV_O_CACHE_WB | BDRV_O_NO_BACKING | BDRV_O_NO_IO,
false);
if (!blk) {
goto err;
@@ -2567,7 +2566,7 @@ static int img_map(int argc, char **argv)
return 1;
}
- blk = img_open(image_opts, filename, fmt, BDRV_O_FLAGS, false);
+ blk = img_open(image_opts, filename, fmt, BDRV_O_CACHE_WB, false);
if (!blk) {
return 1;
}
@@ -2631,7 +2630,7 @@ static int img_snapshot(int argc, char **argv)
Error *err = NULL;
bool image_opts = false;
- bdrv_oflags = BDRV_O_FLAGS | BDRV_O_RDWR;
+ bdrv_oflags = BDRV_O_CACHE_WB | BDRV_O_RDWR;
/* Parse commandline parameters */
for(;;) {
static const struct option long_options[] = {
@@ -2870,7 +2869,7 @@ static int img_rebase(int argc, char **argv)
goto out;
}
- src_flags = BDRV_O_FLAGS;
+ src_flags = BDRV_O_CACHE_WB;
ret = bdrv_parse_cache_flags(src_cache, &src_flags);
if (ret < 0) {
error_report("Invalid source cache option: %s", src_cache);
@@ -3221,7 +3220,7 @@ static int img_resize(int argc, char **argv)
qemu_opts_del(param);
blk = img_open(image_opts, filename, fmt,
- BDRV_O_FLAGS | BDRV_O_RDWR, quiet);
+ BDRV_O_CACHE_WB | BDRV_O_RDWR, quiet);
if (!blk) {
ret = -1;
goto out;
@@ -3373,7 +3372,7 @@ static int img_amend(int argc, char **argv)
goto out;
}
- flags = BDRV_O_FLAGS | BDRV_O_RDWR;
+ flags = BDRV_O_CACHE_WB | BDRV_O_RDWR;
ret = bdrv_parse_cache_flags(cache, &flags);
if (ret < 0) {
error_report("Invalid cache option: %s", cache);
--
1.8.3.1
- [Qemu-devel] [PULL 15/48] tests: redirect stderr to stdout for iotests, (continued)
- [Qemu-devel] [PULL 15/48] tests: redirect stderr to stdout for iotests, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 16/48] tests: refactor python I/O tests helper main method, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 17/48] tests: add output filter to python I/O tests helper, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 18/48] block: add generic full disk encryption driver, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 23/48] replay: fix error message, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 19/48] block: move encryption deprecation warning into qcow code, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 21/48] block: add flush callback, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 25/48] block: Add bdrv_parse_cache_mode(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 22/48] replay: bh scheduling fix, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 26/48] qemu-nbd: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 28/48] qemu-img: Expand all BDRV_O_FLAGS uses,
Kevin Wolf <=
- [Qemu-devel] [PULL 29/48] qemu-img: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 27/48] qemu-io: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 24/48] replay: introduce block devices record/replay, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 30/48] xen_disk: Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 33/48] block: Handle flush error in bdrv_pwrite_sync(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 31/48] block: blockdev_init(): Call blk_set_enable_write_cache() explicitly, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 34/48] block: Move enable_write_cache to BB level, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 37/48] iscsi: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 32/48] block: Always set writeback mode in blk_new_open(), Kevin Wolf, 2016/03/29
- [Qemu-devel] [PULL 39/48] raw: Support BDRV_REQ_FUA, Kevin Wolf, 2016/03/29