[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/38] qemu-io: Add command line switch for cache mo
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH 06/38] qemu-io: Add command line switch for cache mode |
Date: |
Fri, 20 Apr 2012 19:01:12 +0200 |
To be used as in 'qemu-io -t writeback test.img'
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
---
qemu-io.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/qemu-io.c b/qemu-io.c
index e6fcd77..3095a22 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -1784,6 +1784,7 @@ static void usage(const char *name)
" -g, --growable allow file to grow (only applies to protocols)\n"
" -m, --misalign misalign allocations for O_DIRECT\n"
" -k, --native-aio use kernel AIO implementation (on Linux only)\n"
+" -t, --cache=MODE use the given cache mode for the image\n"
" -T, --trace FILE enable trace events listed in the given file\n"
" -h, --help display this help and exit\n"
" -V, --version output version information and exit\n"
@@ -1796,7 +1797,7 @@ int main(int argc, char **argv)
{
int readonly = 0;
int growable = 0;
- const char *sopt = "hVc:rsnmgkT:";
+ const char *sopt = "hVc:rsnmgkt:T:";
const struct option lopt[] = {
{ "help", 0, NULL, 'h' },
{ "version", 0, NULL, 'V' },
@@ -1808,6 +1809,7 @@ int main(int argc, char **argv)
{ "misalign", 0, NULL, 'm' },
{ "growable", 0, NULL, 'g' },
{ "native-aio", 0, NULL, 'k' },
+ { "cache", 1, NULL, 't' },
{ "trace", 1, NULL, 'T' },
{ NULL, 0, NULL, 0 }
};
@@ -1840,6 +1842,12 @@ int main(int argc, char **argv)
case 'k':
flags |= BDRV_O_NATIVE_AIO;
break;
+ case 't':
+ if (bdrv_parse_cache_flags(optarg, &flags) < 0) {
+ error_report("Invalid cache option: %s", optarg);
+ exit(1);
+ }
+ break;
case 'T':
if (!trace_backend_init(optarg, NULL)) {
exit(1); /* error message will have been printed */
--
1.7.6.5
- [Qemu-devel] [PULL 00/38] Block patches, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 03/38] block: Drain requests in bdrv_close, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 02/38] qemu-iotests: Test bdrv_close while AIO is in flight, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 01/38] qemu-iotests: Always filter cluster_size out in _make_test_img, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 06/38] qemu-io: Add command line switch for cache mode,
Kevin Wolf <=
- [Qemu-devel] [PATCH 05/38] block: Fix spelling in comment (ineffcient -> inefficient), Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 04/38] iotests: fix error in 005, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 07/38] ide: convert ide_sector_read() to asynchronous I/O, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 10/38] qcow2: Fix return value of alloc_refcount_block, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 09/38] qcow2: Fix error handling in qcow2_alloc_cluster_offset, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 08/38] ide: convert ide_sector_write() to asynchronous I/O, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 12/38] qemu-io: use main_loop_wait, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 13/38] qemu-tool: map vm_clock to rt_clock, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 11/38] block: allow interrupting a co_sleep_ns, Kevin Wolf, 2012/04/20
- [Qemu-devel] [PATCH 17/38] aio: simplify qemu_aio_wait, Kevin Wolf, 2012/04/20