qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Max Reitz <mreitz@redhat.com>
Subject: [Qemu-devel] [PULL v2 61/65] qemu-io: Remove "growable" option
Date: Mon, 16 Feb 2015 15:46:26 +0000	[thread overview]
Message-ID: <1424101590-7627-62-git-send-email-stefanha@redhat.com> (raw)
In-Reply-To: <1424101590-7627-1-git-send-email-stefanha@redhat.com>

From: Max Reitz <mreitz@redhat.com>

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>
---
 qemu-io.c                  | 23 +++------------
 tests/qemu-iotests/016     | 73 ----------------------------------------------
 tests/qemu-iotests/016.out | 23 ---------------
 tests/qemu-iotests/group   |  2 +-
 4 files changed, 5 insertions(+), 116 deletions(-)
 delete mode 100755 tests/qemu-iotests/016
 delete mode 100644 tests/qemu-iotests/016.out

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 @@ static const cmdinfo_t close_cmd = {
     .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 @@ static int openfile(char *name, int flags, int growable, QDict *opts)
         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 @@ static void open_help(void)
 " -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 @@ static int open_f(BlockDriverState *bs, int argc, char **argv)
 {
     int flags = 0;
     int readonly = 0;
-    int growable = 0;
     int c;
     QemuOpts *qopts;
     QDict *opts;
@@ -140,9 +134,6 @@ static int open_f(BlockDriverState *bs, int argc, char **argv)
         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 @@ static int open_f(BlockDriverState *bs, int argc, char **argv)
     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 @@ static void usage(const char *name)
 "  -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 @@ static void reenable_tty_echo(void)
 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 @@ int main(int argc, char **argv)
         { "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 @@ int main(int argc, char **argv)
         case 'm':
             qemuio_misalign = true;
             break;
-        case 'g':
-            growable = 1;
-            break;
         case 'k':
             flags |= BDRV_O_NATIVE_AIO;
             break;
@@ -483,7 +468,7 @@ int main(int argc, char **argv)
     }
 
     if ((argc - optind) == 1) {
-        openfile(argv[optind], flags, growable, opts);
+        openfile(argv[optind], flags, opts);
     }
     command_loop();
 
diff --git a/tests/qemu-iotests/016 b/tests/qemu-iotests/016
deleted file mode 100755
index 52397aa..0000000
--- a/tests/qemu-iotests/016
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-#
-# Test I/O after EOF for growable images.
-#
-# Copyright (C) 2009 Red Hat, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-
-# creator
-owner=hch@lst.de
-
-seq=`basename $0`
-echo "QA output created by $seq"
-
-here=`pwd`
-tmp=/tmp/$$
-status=1	# failure is the default!
-
-_cleanup()
-{
-	_cleanup_test_img
-}
-trap "_cleanup; exit \$status" 0 1 2 3 15
-
-# get standard environment, filters and checks
-. ./common.rc
-. ./common.filter
-
-_supported_fmt raw
-_supported_proto file sheepdog nfs
-_supported_os Linux
-
-
-# No -f, use probing for the protocol driver
-QEMU_IO_PROTO="$QEMU_IO_PROG -g --cache $CACHEMODE"
-
-size=128M
-_make_test_img $size
-
-echo
-echo "== reading at EOF =="
-$QEMU_IO_PROTO -c "read -P 0 $size 512" "$TEST_IMG" | _filter_qemu_io
-
-echo
-echo "== reading far past EOF =="
-$QEMU_IO_PROTO -c "read -P 0 256M 512" "$TEST_IMG" | _filter_qemu_io
-
-echo
-echo "== writing at EOF =="
-$QEMU_IO_PROTO -c "write -P 66 $size 512" "$TEST_IMG" | _filter_qemu_io
-$QEMU_IO -c "read -P 66 $size 512" "$TEST_IMG" | _filter_qemu_io
-
-echo
-echo "== writing far past EOF =="
-$QEMU_IO_PROTO -c "write -P 66 256M 512" "$TEST_IMG" | _filter_qemu_io
-$QEMU_IO -c "read -P 66 256M 512" "$TEST_IMG" | _filter_qemu_io
-
-# success, all done
-echo "*** done"
-rm -f $seq.full
-status=0
diff --git a/tests/qemu-iotests/016.out b/tests/qemu-iotests/016.out
deleted file mode 100644
index acbd60b..0000000
--- a/tests/qemu-iotests/016.out
+++ /dev/null
@@ -1,23 +0,0 @@
-QA output created by 016
-Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728
-
-== reading at EOF ==
-read 512/512 bytes at offset 134217728
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-
-== reading far past EOF ==
-read 512/512 bytes at offset 268435456
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-
-== writing at EOF ==
-wrote 512/512 bytes at offset 134217728
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 512/512 bytes at offset 134217728
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-
-== writing far past EOF ==
-wrote 512/512 bytes at offset 268435456
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-read 512/512 bytes at offset 268435456
-512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-*** done
diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
index 86f072e..0d3b95c 100644
--- a/tests/qemu-iotests/group
+++ b/tests/qemu-iotests/group
@@ -22,7 +22,7 @@
 013 rw auto
 014 rw auto
 015 rw snapshot auto
-016 rw auto quick
+# 016 was removed, do not reuse
 017 rw backing auto quick
 018 rw backing auto quick
 019 rw backing auto quick
-- 
2.1.0

  parent reply	other threads:[~2015-02-16 15:48 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-16 15:45 [Qemu-devel] [PULL v2 00/65] Block patches Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 01/65] nbd: Drop BDS backpointer Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 02/65] iotests: Add "wait" functionality to _cleanup_qemu Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 03/65] iotests: Add test for drive-mirror with NBD target Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 04/65] libqos: Split apart pc_alloc_init Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 05/65] qtest/ahci: Create ahci.h Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 06/65] libqos: create libqos.c Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 07/65] libqos: add qtest_vboot Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 08/65] libqos: add alloc_init_flags Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 09/65] libqos: Update QGuestAllocator to be opaque Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 10/65] libqos: add pc specific interface Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 11/65] qtest/ahci: Store hba_base in AHCIQState Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 12/65] qtest/ahci: finalize AHCIQState consolidation Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 13/65] qtest/ahci: remove pcibus global Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 14/65] qtest/ahci: remove guest_malloc global Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 15/65] libqos/ahci: Functional register helpers Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 16/65] qtest/ahci: remove getter/setter macros Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 17/65] qtest/ahci: Bookmark FB and CLB pointers Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 18/65] libqos/ahci: create libqos/ahci.c Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 19/65] dataplane: endianness-aware accesses Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 20/65] libqos/ahci: Add ahci_port_select helper Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 21/65] libqos/ahci: Add ahci_port_clear helper Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 22/65] qtest/ahci: rename 'Command' to 'CommandHeader' Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 23/65] libqos/ahci: Add command header helpers Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 24/65] libqos/ahci: Add ahci_port_check_error helper Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 25/65] libqos/ahci: Add ahci_port_check_interrupts helper Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 26/65] libqos/ahci: Add port_check_nonbusy helper Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 27/65] libqos/ahci: Add cmd response sanity check helpers Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 28/65] qtest/ahci: Demagic ahci tests Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 29/65] qtest/ahci: add ahci_write_fis Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 30/65] libqos/ahci: Add ide cmd properties Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 31/65] libqos/ahci: add ahci command functions Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 32/65] libqos/ahci: add ahci command verify Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 33/65] libqos/ahci: add ahci command size setters Stefan Hajnoczi
2015-02-16 15:45 ` [Qemu-devel] [PULL v2 34/65] libqos/ahci: Add ahci_guest_io Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 35/65] libqos/ahci: add ahci_io Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 36/65] libqos/ahci: Add ahci_clean_mem Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 37/65] qtest/ahci: Assert sector size in identify test Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 38/65] qtest/ahci: Adding simple dma read-write test Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 39/65] nbd: fix the co_queue multi-adding bug Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 40/65] savevm: Improve error message for blocked migration Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 41/65] block: vmdk - fixed sizeof() error Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 42/65] qtest: Fix deadloop by running main loop AIO context's timers Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 43/65] qemu-io: Account IO by aio_read and aio_write Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 44/65] qtest: Add scripts/qtest.py Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 45/65] qemu-iotests: Add VM method qtest() to iotests.py Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 46/65] qemu-iotests: Allow caller to disable underscore convertion for qmp Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 47/65] qemu-iotests: Add 093 for IO throttling Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 48/65] qemu-img: Fix qemu-img convert -n Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 49/65] iotests: Add test for qemu-img convert to NBD Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 50/65] block: Lift some BDS functions to the BlockBackend Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 51/65] block: Add blk_new_open() Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 52/65] block: Add Error parameter to bdrv_find_protocol() Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 53/65] iotests: Add test for driver=qcow2, format=qcow2 Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 54/65] blockdev: Use blk_new_open() in blockdev_init() Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 55/65] block/xen: Use blk_new_open() in blk_connect() Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 56/65] qemu-img: Use blk_new_open() in img_open() Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 57/65] qemu-img: Use blk_new_open() in img_rebase() Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 58/65] qemu-img: Use BlockBackend as far as possible Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 59/65] qemu-nbd: Use blk_new_open() in main() Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 60/65] qemu-io: Use blk_new_open() in openfile() Stefan Hajnoczi
2015-02-16 15:46 ` Stefan Hajnoczi [this message]
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 62/65] qemu-io: Use BlockBackend Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 63/65] block: Clamp BlockBackend requests Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 64/65] block: Remove "growable" from BDS Stefan Hajnoczi
2015-02-16 15:46 ` [Qemu-devel] [PULL v2 65/65] block: Keep bdrv_check*_request()'s return value Stefan Hajnoczi
2015-02-24 13:57 ` [Qemu-devel] [PULL v2 00/65] Block patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424101590-7627-62-git-send-email-stefanha@redhat.com \
    --to=stefanha@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).