aboutsummaryrefslogtreecommitdiff
path: root/qemu-io.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-02-26 07:44:39 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-26 07:44:39 -0600
commit864a556e9a800116a305f10fbb714268ca7e9bc3 (patch)
treec9e5fdc33d2a1be16446c7504106b4f128e3d0cd /qemu-io.c
parent9a1d7f00efd4b69f051d4223a70ca91af0ccb19d (diff)
parentbf3caa3dc17552b323cec6831301a22cfc98ecd5 (diff)
Merge remote-tracking branch 'kwolf/for-anthony' into staging
# By Paolo Bonzini (7) and others # Via Kevin Wolf * kwolf/for-anthony: (22 commits) pc: add compatibility machine types for 1.4 blockdev: enable discard by default qemu-nbd: add --discard option blockdev: add discard suboption to -drive block: implement BDRV_O_UNMAP block: complete all IOs before .bdrv_truncate coroutine: trim down nesting level in perf_nesting test coroutine: move pooling to common code qemu-iotests: Test qcow2 image creation options qemu-iotests: Add qemu-img compare test qemu-img: Add compare subcommand qemu-img: Add "Quiet mode" option block: Add synchronous wrapper for bdrv_co_is_allocated_above block: refuse negative iops and bps values block: use Error in do_check_io_limits() qcow2: support compressed clusters in BlockFragInfo qemu-img: add compressed clusters to BlockFragInfo qemu-img: fix missing space in qemu-img check output qcow2: record fragmentation statistics during check qcow2: introduce check_refcounts_l1/l2() flags ...
Diffstat (limited to 'qemu-io.c')
-rw-r--r--qemu-io.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/qemu-io.c b/qemu-io.c
index 61880932b3..7b3de42773 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -1899,7 +1899,7 @@ int main(int argc, char **argv)
{
int readonly = 0;
int growable = 0;
- const char *sopt = "hVc:rsnmgkt:T:";
+ const char *sopt = "hVc:d:rsnmgkt:T:";
const struct option lopt[] = {
{ "help", 0, NULL, 'h' },
{ "version", 0, NULL, 'V' },
@@ -1911,13 +1911,14 @@ int main(int argc, char **argv)
{ "misalign", 0, NULL, 'm' },
{ "growable", 0, NULL, 'g' },
{ "native-aio", 0, NULL, 'k' },
+ { "discard", 1, NULL, 'd' },
{ "cache", 1, NULL, 't' },
{ "trace", 1, NULL, 'T' },
{ NULL, 0, NULL, 0 }
};
int c;
int opt_index = 0;
- int flags = 0;
+ int flags = BDRV_O_UNMAP;
progname = basename(argv[0]);
@@ -1929,6 +1930,12 @@ int main(int argc, char **argv)
case 'n':
flags |= BDRV_O_NOCACHE | BDRV_O_CACHE_WB;
break;
+ case 'd':
+ if (bdrv_parse_discard_flags(optarg, &flags) < 0) {
+ error_report("Invalid discard option: %s", optarg);
+ exit(1);
+ }
+ break;
case 'c':
add_user_command(optarg);
break;