aboutsummaryrefslogtreecommitdiff
path: root/qemu-io-cmds.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-05-16 10:43:01 -0600
committerMax Reitz <mreitz@redhat.com>2016-05-19 16:56:58 +0200
commit4ca1d3401b834662efddd12bd62ad80f5ef1ef05 (patch)
treeaf5644b7cb800760d47f4227f952b01dfe765e2a /qemu-io-cmds.c
parent3a3086b72ab723de9e0ffd705d01b82a8a9f3e49 (diff)
qemu-io: Fix recent UI updates
Commit 770e0e0e [*] tried to add 'writev -f', but didn't tweak the getopt() call to actually let it work. Likewise, commit c2e001c missed implementing 'aio_write -u -z'. The latter commit also introduced a leak of ctx. [*] does it sound "ech0e" in here? :) Signed-off-by: Eric Blake <eblake@redhat.com> Message-id: 1463416983-28318-2-git-send-email-eblake@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'qemu-io-cmds.c')
-rw-r--r--qemu-io-cmds.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 22f2ecf6e5..b5dbc676aa 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -1107,7 +1107,7 @@ static int writev_f(BlockBackend *blk, int argc, char **argv)
int pattern = 0xcd;
QEMUIOVector qiov;
- while ((c = getopt(argc, argv, "CqP:")) != -1) {
+ while ((c = getopt(argc, argv, "CfqP:")) != -1) {
switch (c) {
case 'C':
Cflag = true;
@@ -1393,7 +1393,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
int flags = 0;
ctx->blk = blk;
- while ((c = getopt(argc, argv, "CfqP:z")) != -1) {
+ while ((c = getopt(argc, argv, "CfqP:uz")) != -1) {
switch (c) {
case 'C':
ctx->Cflag = true;
@@ -1436,6 +1436,7 @@ static int aio_write_f(BlockBackend *blk, int argc, char **argv)
if ((flags & BDRV_REQ_MAY_UNMAP) && !ctx->zflag) {
printf("-u requires -z to be specified\n");
+ g_free(ctx);
return 0;
}