qemu-io: Remove "growable" option
Remove "growable" option from the "open" command and from the qemu-io
command line. qemu-io is about to be converted to BlockBackend which
will make sure that no request exceeds the image size, so the only way
to keep "growable" would be to use BlockBackend if it is not given and
to directly access the BDS if it is.
qemu-io is a debugging tool, therefore removing a rarely used option
will have only a very small impact, if any. There was only one
qemu-iotest which used the option; since it is not critical, this patch
just removes it.
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-id: 1423162705-32065-13-git-send-email-mreitz@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
diff --git a/qemu-io.c b/qemu-io.c
index fa072df..a85522a 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -51,7 +51,7 @@
.oneline = "close the current open file",
};
-static int openfile(char *name, int flags, int growable, QDict *opts)
+static int openfile(char *name, int flags, QDict *opts)
{
Error *local_err = NULL;
@@ -61,10 +61,6 @@
return 1;
}
- if (growable) {
- flags |= BDRV_O_PROTOCOL;
- }
-
qemuio_blk = blk_new_open("hda", name, NULL, opts, flags, &local_err);
if (!qemuio_blk) {
fprintf(stderr, "%s: can't open%s%s: %s\n", progname,
@@ -91,7 +87,6 @@
" -r, -- open file read-only\n"
" -s, -- use snapshot file\n"
" -n, -- disable host cache\n"
-" -g, -- allow file to grow (only applies to protocols)\n"
" -o, -- options to be given to the block driver"
"\n");
}
@@ -124,7 +119,6 @@
{
int flags = 0;
int readonly = 0;
- int growable = 0;
int c;
QemuOpts *qopts;
QDict *opts;
@@ -140,9 +134,6 @@
case 'r':
readonly = 1;
break;
- case 'g':
- growable = 1;
- break;
case 'o':
if (!qemu_opts_parse(&empty_opts, optarg, 0)) {
printf("could not parse option list -- %s\n", optarg);
@@ -165,9 +156,9 @@
qemu_opts_reset(&empty_opts);
if (optind == argc - 1) {
- return openfile(argv[optind], flags, growable, opts);
+ return openfile(argv[optind], flags, opts);
} else if (optind == argc) {
- return openfile(NULL, flags, growable, opts);
+ return openfile(NULL, flags, opts);
} else {
QDECREF(opts);
return qemuio_command_usage(&open_cmd);
@@ -201,7 +192,6 @@
" -r, --read-only export read-only\n"
" -s, --snapshot use snapshot file\n"
" -n, --nocache disable host cache\n"
-" -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"
@@ -360,7 +350,6 @@
int main(int argc, char **argv)
{
int readonly = 0;
- int growable = 0;
const char *sopt = "hVc:d:f:rsnmgkt:T:";
const struct option lopt[] = {
{ "help", 0, NULL, 'h' },
@@ -372,7 +361,6 @@
{ "snapshot", 0, NULL, 's' },
{ "nocache", 0, NULL, 'n' },
{ "misalign", 0, NULL, 'm' },
- { "growable", 0, NULL, 'g' },
{ "native-aio", 0, NULL, 'k' },
{ "discard", 1, NULL, 'd' },
{ "cache", 1, NULL, 't' },
@@ -423,9 +411,6 @@
case 'm':
qemuio_misalign = true;
break;
- case 'g':
- growable = 1;
- break;
case 'k':
flags |= BDRV_O_NATIVE_AIO;
break;
@@ -483,7 +468,7 @@
}
if ((argc - optind) == 1) {
- openfile(argv[optind], flags, growable, opts);
+ openfile(argv[optind], flags, opts);
}
command_loop();