| Branch: | Revision:

root / qemu-io.c @ feature-archipelago

History | View | Annotate | Download (11.6 kB)

# Date Author Comment
e7a1d6c5 02/25/2014 12:50 pm Peter Maydell

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block patches

  1. gpg: Signature made Fri 21 Feb 2014 21:42:24 GMT using RSA key ID C88F2FD6
  2. gpg: Good signature from "Kevin Wolf <>"
  • remotes/kevin/tags/for-upstream: (54 commits)...
ddf5636d 02/21/2014 10:02 pm Max Reitz

block: Add reference parameter to bdrv_open()

Allow bdrv_open() to handle references to existing block devices just as
bdrv_file_open() is already capable of.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

2e40134b 02/21/2014 10:02 pm Max Reitz

block: Make bdrv_file_open() static

Add the bdrv_open() option BDRV_O_PROTOCOL which results in passing the
call to bdrv_file_open(). Additionally, make bdrv_file_open() static and
therefore bdrv_open() the only way to call it.

Consequently, all existing calls to bdrv_file_open() have to be adjusted...

f67503e5 02/21/2014 10:02 pm Max Reitz

block: Change BDS parameter of bdrv_open() to **

Make bdrv_open() take a pointer to a BDS pointer, similarly to
bdrv_file_open(). If a pointer to a NULL pointer is given, bdrv_open()
will create a new BDS with an empty name; if the BDS pointer is not
NULL, that existing BDS will be reused (in the same way as bdrv_open()...

10f5bff6 02/20/2014 02:12 pm Fam Zheng

util: Split out exec_dir from os_find_datadir

With this change, main() calls qemu_init_exec_dir and uses argv0 to
init exec_dir. The saved value can be retrieved with
qemu_get_exec_dir later. It will be reused by module loading.

Signed-off-by: Fam Zheng <>...

d5d1507b 02/01/2014 11:46 am Stefan Weil

readline: Add missing GCC_FMT_ATTR

This fixes a compiler warning with -Werror=missing-format-attribute
and allows improved compiler checks for variable argument lists.

Signed-off-by: Stefan Weil <>
Reviewed-by: Stefan Hajnoczi <>...

fd0fee34 01/22/2014 01:07 pm Max Reitz

qemu-io: Make filename optional

Giving a filename is actually not essential, since it can be specified
through the options as well - on the contrary: Sometimes a filename must
not be given.

Signed-off-by: Max Reitz <>
Reviewed-by: Kevin Wolf <>...

0cf17e18 01/22/2014 01:07 pm Stefan Hajnoczi

qemu-io: use readline.c

Use readline.c for command-line history. There was support for GNU
Readline and BSD Editline but it was never compiled in. Since QEMU has
its own readline.c, just use that when qemu-io runs with stdin attached
to a terminal.

Signed-off-by: Stefan Hajnoczi <>...

4694020d 01/22/2014 01:07 pm Stefan Hajnoczi

qemu-io: add command completion

Autocomplete qemu-io commands at the interactive prompt.

Note this only completes command names and not their options.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

72daa72e 01/22/2014 01:07 pm Max Reitz

block: Allow reference for bdrv_file_open()

Allow specifying a reference to an existing block device (by name) for
bdrv_file_open() instead of a filename and/or options.

Signed-off-by: Max Reitz <>
Reviewed-by: Kevin Wolf <>...

b543c5cd 10/11/2013 05:50 pm Max Reitz

qemu-io: Let "open" pass options to block driver

Add an option to the open command to specify runtime options for the
block driver used.

Signed-off-by: Max Reitz <>
Signed-off-by: Kevin Wolf <>

34b5d2c6 09/12/2013 11:12 am Max Reitz

block: Error parameter for open functions

Add an Error ** parameter to bdrv_open, bdrv_file_open and associated
functions to allow more specific error messages.

Signed-off-by: Max Reitz <>

4f6fd349 09/06/2013 04:25 pm Fam Zheng

block: make bdrv_delete() static

Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is no
longer public and should be called by bdrv_unref() if refcnt is
decreased to 0.

This is an identical change because effectively, there's no multiple
reference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets...

526eda14 08/06/2013 11:41 am MORITA Kazutaka

ignore SIGPIPE in qemu-img and qemu-io

This prevents the tools from being stopped when they write data to a
closed connection in the other side.

Signed-off-by: MORITA Kazutaka <>
Reviewed-by: Paolo Bonzini <>...

c2cdf5c5 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Move functions for registering and running commands

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>
Signed-off-by: Stefan Hajnoczi <>

d1174f13 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Move command_loop() and friends

Signed-off-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

3d21994f 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Interface cleanup

Signed-off-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

02da386a 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Use the qemu version for -V

Always printing 0.0.1 and never updating the version number wasn't very
useful. qemu-io is released with qemu, so using the same version number
makes most sense.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

734c3b85 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Don't use global bs in command implementations

Pass in the BlockDriverState to the command handlers instead of using
the global variable. This is an important step to make the commands
usable outside of qemu-io.

Signed-off-by: Kevin Wolf <>...

797ac58c 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Split off commands to qemu-io-cmds.c

This is the implementation of all qemu-io commands that make sense to be
called from the qemu monitor, i.e. everything except open, close and

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>...

e681be7e 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Move 'quit' function

This one only makes sense in the context of the qemu-io tool, so move it
to qemu-io.c. Adapt coding style and register it like other commands.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>...

a23818f4 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Remove unused args_command

The original intention seems to be something with handling multiple
images at once, but this has never been implemented and the only
function ever registered is implemented to make everything behave like a
"global" command. Just do that unconditionally now....

b6e356aa 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Make cvtnum() a wrapper around strtosz_suffix()

No reason to implement the same thing multiple times. A nice side effect
is that fractional numbers like 0.5M can be used in qemu-io now.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>...

cf49a6a0 06/06/2013 12:27 pm Kevin Wolf

qemu-io: Handle cvtnum() errors in 'alloc'

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>
Signed-off-by: Stefan Hajnoczi <>

a00e81e9 05/24/2013 05:17 pm Kevin Wolf

qemu-io: Fix 'map' output

The output of the 'map' command in qemu-io used to directly resemble
bdrv_is_allocated() and could contain many lines for small chunks that
all have the same allocation status. After this patch, they will be
coalesced into a single output line for a large chunk....

787e4a85 03/22/2013 06:51 pm Kevin Wolf

block: Add options QDict to bdrv_file_open() prototypes

The new parameter is unused yet.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>

de9c0cec 03/15/2013 05:07 pm Kevin Wolf

block: Add options QDict to bdrv_open() prototype

It doesn't do anything yet except storing the options QDict in the

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>
Reviewed-by: Stefan Hajnoczi <>...

9e8f1835 02/22/2013 10:29 pm Paolo Bonzini

block: implement BDRV_O_UNMAP

It is better to present homogeneous hardware independent of the storage
technology that is chosen on the host, hence we make discard a host
parameter; the user can choose whether to pass it down to the image
format and protocol, or to ignore it....

1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

737e150e 12/19/2012 09:31 am Paolo Bonzini

block: move include files to include/block/

Signed-off-by: Paolo Bonzini <>

41c695c7 12/12/2012 01:33 pm Kevin Wolf

qemu-io: Add AIO debugging commands

This makes the blkdebug suspend/resume functionality available in
qemu-io. Use it like this:

$ ./qemu-io blkdebug::/tmp/test.qcow2
qemu-io> break write_aio req_a
qemu-io> aio_write 0 4k
qemu-io> blkdebug: Suspended request 'req_a'...
791bfa35 12/11/2012 12:05 pm Kevin Wolf

qemu-io: Implement write -c for compressed clusters

This makes it easier to create images with both compressed and
uncompressed clusters for testing.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Stefan Hajnoczi <>

e7c8b094 11/14/2012 07:20 pm Kevin Wolf

qemu-io: Use bdrv_drain_all instead of qemu_aio_flush

This is harmless as of today because I/O throttling is not used in
qemu-io, however as soon as .bdrv_drain handlers will be introduced,
qemu-io must be sure to call bdrv_drain_all().

Signed-off-by: Kevin Wolf <>

2592c59a 11/06/2012 02:37 am Paolo Bonzini

tools: initialize main loop before block layer

Tools were broken because they initialized the block layer while
qemu_aio_context was still NULL.

Reported-by: malc <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: malc <>

e01c30d3 08/06/2012 11:39 pm Stefan Hajnoczi

qemu-io: add "abort" command to simulate program crash

Avoiding data loss and corruption is the top requirement for image file
formats. The qemu-io "abort" command makes it possible to simulate
program crashes and does not give the image format a chance to cleanly...

9e559533 07/17/2012 05:48 pm Kevin Wolf

qemu-io: Fix memory leaks

Almost all callers of create_iovec() forgot to destroy the qiov when the
request has completed.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

cc785c34 05/10/2012 11:32 am Paolo Bonzini

qemu-io: fix the alloc command

Because sector_num is not updated, the loop would either go on
forever or return garbage.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

a5a5238e 04/19/2012 05:29 pm Paolo Bonzini

qemu-io: use main_loop_wait

This will let timers run during aio_read and aio_write commands,
though not during synchronous commands.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

592fa070 04/19/2012 05:03 pm Kevin Wolf

qemu-io: Add command line switch for cache mode

To be used as in 'qemu-io -t writeback test.img'

Signed-off-by: Kevin Wolf <>
Reviewed-by: Paolo Bonzini <>

d7bb72c8 04/05/2012 03:54 pm Stefan Hajnoczi

qemu-io: add option to enable tracing

It can be useful to enable QEMU tracing when trying out block layer
interfaces via qemu-io. Tracing can be enabled using the new -T FILE
option where the given file contains a list of trace events to enable
(just like the qemu --trace events=FILE option)....

a57d1143 02/29/2012 05:05 pm Zhi Yong Wu

qemu-io: fix segment fault when the image format is qed

[root@f15 qemu]# qemu-io -c info /home/zwu/work/misc/rh6.img
format name: qed
cluster size: 64 KiB
vm state offset: 0.000000 bytes
Segmentation fault (core dumped)

This reason is same as the former patch...

71b58b82 02/09/2012 05:17 pm Stefan Hajnoczi

qemu-io: add write -z option for bdrv_co_write_zeroes

Extend the qemu-io write command with the -z option to call
bdrv_co_write_zeroes(). Exposing the zero write interface from qemu-io
allows us to write tests that exercise this new block layer interface....

21fe5bc6 01/27/2012 04:58 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

  • kwolf/for-anthony: (22 commits)
    scsi: Guard against buflen exceeding req->cmd.xfer in scsi_disk_emulate_command
    qcow: Use bdrv functions to replace file operation
    qcow: Return real error code in qcow_open...
96bab41d 01/27/2012 08:28 am Laszlo Ersek

qemu-io: end aio help text sentences with periods

Signed-off-by: Laszlo Ersek <>
Signed-off-by: Stefan Hajnoczi <>

031380d8 01/26/2012 12:39 pm Stefan Hajnoczi

block: replace unchecked strdup/malloc/calloc with glib

Most of the codebase as been converted to use glib memory allocation
functions. There are still a few instances of malloc/calloc in the
block layer and qemu-io. Replace them, especially since they do not...

ad54ae80 12/15/2011 01:40 pm Paolo Bonzini

block: bdrv_aio_* do not return NULL

Initially done with the following semantic patch:

expression E;
statement S;
E =
bdrv_aio_readv | bdrv_aio_writev | bdrv_aio_flush | bdrv_aio_discard | bdrv_aio_ioctl
- if (E == NULL) { ... }...

eb5d5bea 12/05/2011 05:39 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

922453bc 12/05/2011 03:56 pm Stefan Hajnoczi

block: convert qemu_aio_flush() calls to bdrv_drain_all()

Many places in QEMU call qemu_aio_flush() to complete all pending
asynchronous I/O. Most of these places actually want to drain all block
requests but there is no block layer API to do so.

This patch introduces the bdrv_drain_all() API to wait for requests...

07f35073 12/02/2011 12:50 pm Dong Xu Wang

fix spelling in main directory

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

67403dbb 11/04/2011 03:23 pm Kevin Wolf

qemu-io: Fix multiwrite_f error handling

Without this fix, some qiovs can be leaked if an error occurs. Also a semicolon
at the end of the command line would make the code walk beyond the end of argv.

Signed-off-by: Kevin Wolf <>

f2360620 11/04/2011 03:23 pm Kevin Wolf

qemu-io: Handle create_iovec errors

Callers of create_iovec() didn't check for failure and continued with
uninitialised data in error cases. This patch adds checks to each call.

Signed-off-by: Kevin Wolf <>

b4657855 10/28/2011 08:25 pm Stefan Hajnoczi

qemu-io: delete bs instead of leaking it

Using bdrv_close() is not enough to free a BlockDriverState. Since we
explicitly create it with bdrv_new(), use bdrv_delete() to close and
delete it.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

b1b1dad3 10/21/2011 06:34 pm Alex Jia

fix memory leak in aio_write_f

Haven't released memory of 'ctx' before return.

Signed-off-by: Alex Jia <>
Signed-off-by: Kevin Wolf <>

b2bedb21 09/16/2011 04:25 pm Stefan Weil

Remove blanks before \n in output strings

Those blanks violate the coding conventions, see

Blanks missing after colons in the changed lines were added.

This patch does not try to fix tabs, long lines and other
problems in the changed lines, therefore reports...

84c8c656 09/10/2011 05:46 pm Blue Swirl

qemu-io: remove unnecessary assignment

Remove an unnecessary assignment, spotted by clang analyzer:
/src/qemu/qemu-io.c:995:9: warning: Value stored to 'offset' is never read
offset += reqs[i].qiov->size;

Acked-by: Kevin Wolf <>
Signed-off-by: Blue Swirl <>

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

5afc8b3d 07/18/2011 05:06 pm Devin Nakamura

qemu-io: Fix if scoping bug

Fix a bug caused by lack of braces in if statement

Lack of braces means that if(count & 0x1ff) is never reached

Signed-off-by: Devin Nakamura <>
Signed-off-by: Kevin Wolf <>

43642b38 07/18/2011 05:06 pm Devin Nakamura

qemu-io: Fix formatting

Replaced tabs with spaces, 8 space indentations with 4 space
indentation, and other fixes to better adhere to CODING_STYLE

Signed-off-by: Devin Nakamura <>
Signed-off-by: Kevin Wolf <>

a6599793 06/08/2011 11:39 am Christoph Hellwig

block: clarify the meaning of BDRV_O_NOCACHE

Change BDRV_O_NOCACHE to only imply bypassing the host OS file cache,
but no writeback semantics. All existing callers are changed to also
specify BDRV_O_CACHE_WB to give them writeback semantics.

Signed-off-by: Christoph Hellwig <>...

a9c49a6b 01/31/2011 11:03 am Kevin Wolf

qemu-io: Fix discard command

qemu-io passed bytes where it's supposed to pass sectors, so discard requests
were off.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Stefan Hajnoczi <>

1afec913 01/12/2011 09:48 pm Blue Swirl

qemu-io: fix a memory leak

Fix a memory leak, reported by cppcheck:
[/src/qemu/qemu-io.c:1135]: (error) Memory leak: ctx

Signed-off-by: Blue Swirl <>

ad717139 12/17/2010 05:11 pm Kevin Wolf

Remove NULL checks for bdrv_new return value

It's an indirect call to qemu_malloc, which never returns an error.

Signed-off-by: Kevin Wolf <>

edff5db1 12/17/2010 05:11 pm Stefan Hajnoczi

qemu-io: Add discard command

discard [-Cq] off len -- discards a number of bytes at a specified

discards a range of bytes from the given offset
'discard 512 1k' - discards 1 kilobyte from 512 bytes into the file
Discards a segment of the currently open file....
095343ad 12/17/2010 05:11 pm Kevin Wolf

qemu-io: Fix typo in help texts

Signed-off-by: Kevin Wolf <>

191c2890 10/22/2010 03:49 pm Kevin Wolf

qemu-io: New command map

The new map command in qemu-io lists all allocated/unallocated areas in an
image file.

Signed-off-by: Kevin Wolf <>

72aef731 09/21/2010 04:39 pm Christoph Hellwig

use qemu_blockalign consistently

Use qemu_blockalign for all allocations in the block layer. This allows
increasing the required alignment, which is need to support O_DIRECT on
devices with large block sizes.

Signed-off-by: Christoph Hellwig <>...

b407a81e 09/08/2010 01:39 pm Stefan Hajnoczi

qemu-io: Make alloc output useful when nb_sectors=1

There is no indication whether or not the sector is allocated when

sector allocated at offset 64 KiB

This message is produced whether or not the sector is allocated.

Simply use the same message as the plural case, I don't think the...

ca1d6ac6 07/31/2010 12:05 am Joel Schopp

fix variable type in qemu-io.c

The variable len can get a negative return value from cvtnum,
which we check for, but which is impossible with the current
unsigned variable type. Currently the if(len < 0) check is
pointless. This patch fixes that.

Signed-off-by: Joel Schopp <>...

0923c577 06/04/2010 12:43 pm Kevin Wolf

qemu-io: Fix error messages

The truncate and getlength commands passed a negative error number to strerror.
They also happen to be the two functions that are lacking a newline at the end
of their error message.

Signed-off-by: Kevin Wolf <>

776cbbbd 05/28/2010 02:14 pm Kevin Wolf

qemu-io: Add multiwrite command

The new multiwrite commands allows to use qemu-io for testing

Signed-off-by: Kevin Wolf <>

0bfcd599 05/22/2010 11:02 am Blue Swirl

Fix %lld or %llx printf format use

Signed-off-by: Blue Swirl <>

d6e9098e 04/23/2010 05:08 pm Kevin Wolf

Replace calls of old bdrv_open

What is known today as bdrv_open2 becomes the new bdrv_open. All remaining
callers of the old function are converted to the new one. In some places they
even know the right format, so they should have used bdrv_open2 from the...

6db95603 04/23/2010 05:08 pm Christoph Hellwig

block: get rid of the BDRV_O_FILE flag

BDRV_O_FILE is only used to communicate between bdrv_file_open and bdrv_open.
It affects two things: first bdrv_open only searches for protocols using
find_protocol instead of all image formats and host drivers. We can easily...

e432cef9 03/28/2010 05:42 pm Christoph Hellwig

qemu-io: fix aio help texts

Fix a few typos in the help texts for the various aio commands.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Aurelien Jarno <>

06b611c4 03/27/2010 03:02 pm Ryota Ozaki

qemu-io: Fix return value handling of bdrv_open

bdrv_open may return -errno so we have to check
if the return value is '< 0', not '== -1'.

Signed-off-by: Ryota Ozaki <>
Signed-off-by: Aurelien Jarno <>

9a2d77ad 01/26/2010 11:42 pm Christoph Hellwig

block: kill BDRV_O_CREAT

The BDRV_O_CREAT option is unused inside qemu and partially duplicates
the bdrv_create method. Remove it, and the -C option to qemu-io which
isn't used in qemu-iotests anyway.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Anthony Liguori <>

f5edb014 01/20/2010 04:25 pm Naphtali Sprei

Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE.

Instead of using the field 'readonly' of the BlockDriverState struct for passing the request,...

6474bd69 12/23/2009 05:35 pm Blue Swirl

qemu-io: suppress a warning with gcc 4.0.2

Signed-off-by: Blue Swirl <>

40a0d7c3 12/18/2009 07:26 pm Kevin Wolf

qemu-io: Fix memory leak

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>

b32bb952 12/13/2009 05:41 pm Blue Swirl

qemu-io: add 'const'

Signed-off-by: Blue Swirl <>

22a2bdcb 11/21/2009 11:06 am Blue Swirl

Fix OpenBSD build of qemu-io

GCC 3.3.5 generates warnings for static forward declarations of data, so
rearrange code to use static forward declarations of functions instead.

Use <getopt.h> for optind instead of local definition.

Signed-off-by: Blue Swirl <>

c32d766a 09/09/2009 10:57 pm Stefan Weil

qemu-io: Improve portability (win32 now supported).

  • Add missing include for struct timeval.
  • Replace non-portable strsep by local qemu_strsep.
  • Use POSIX basename by including libgen.h.

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

5c6c3a6c 08/28/2009 04:30 am Christoph Hellwig

raw-posix: add Linux native AIO support

Now that do have a nicer interface to work against we can add Linux native
AIO support. It's an extremly thing layer just setting up an iocb for
the io_submit system call in the submission path, and registering an...

660f11be 08/01/2009 12:16 am Blue Swirl

Fix Sparse warnings: "Using plain integer as NULL pointer"

Signed-off-by: Blue Swirl <>

a7824a88 07/22/2009 06:58 pm Kevin Wolf

qemu-io: Rework alloc command

The alloc command in qemu-io is mostly useless currently. Instead of doing a
single call to bdrv_is_allocated, we must call bdrv_is_allocated in a loop
until we have found out for each requested sector if it is allocated or not...

cf070d7e 07/22/2009 06:58 pm Christoph Hellwig

qemu-io: reject invalid pattern

Replace the use of atoi which is used for pattern parsing currently with
strtol. Atoi won't parse sedecimal pattern values (it always returns 0),
but qemu-iotests use such pattern values. Also reject every pattern
that is not a unsigned char as we pass the pattern to memset which...

ca94dbc7 07/17/2009 01:28 am Kevin Wolf

qemu-io: Implement bdrv_load_vmstate/bdrv_save_vmstate

The load_vmstate and save_vmstate functions are implemented as a
variation of the normal read/write operation, enabled by the -b option.
This is the same mechanism as is used to switch from read/write to...

1db6947d 07/17/2009 01:28 am Christoph Hellwig

qemu-io: use BDRV_O_FILE to implement the growable open option

Instead of doing our own check for protocols which fails because raw isn't
formally a protocol but special cased in find_protocol specify the BDRV_O_FILE
option to use the same code as bdrv_file_open does....

230d4fa4 07/10/2009 08:25 pm Christoph Hellwig

qemu-io: small cleanups for the aio code

Address a couple of review comments from Kevin.

Signed-off-by: Christoph Hellwig <>

cf57298a 07/10/2009 08:25 pm Christoph Hellwig

qemu-io: better input validation for vector-based commands

Fix up a couple of issues with validating the input of the various
length arguments for the vectored I/O commands:

- do the alignment check on each length instead the always 0 count argument
- use a long long varibale for the cvtnum return value so that we can check...
9c4bab26 07/10/2009 08:25 pm Christoph Hellwig

qemu-io: add flag to mark files growable

Add a -g flag to the open command and the main qemu-io command line to
allow opening a file growable. This is only allowed for protocols,
mirroring the limitation exposed through bdrv_file_open.

Signed-off-by: Christoph Hellwig <>...

7d8abfcb 07/10/2009 08:25 pm Kevin Wolf

qemu-io: fix memory leak

qemu-io leaks the request buffer whenever the read or write function isn't
executed completely down the "normal" code path.

[hch: also fix the aio and vectored variants the same way]

Signed-off-by: Kevin Wolf <>...

3abcdf49 06/24/2009 05:09 pm Stefan Weil

Fix dump output in qemu-io.

The dump output was not nicely formatted for bytes
larger than 0x7f, because signed values expanded to
sizeof(int) bytes. So for example 0xab did not print
as "ab", but as "ffffffab".

I also cleaned the function prototype, which avoids...

84844a20 06/24/2009 05:09 pm Stefan Weil

qemu-io: Fix spelling in help message.

excerciser -> exerciser

Signed-off-by: Stefan Weil <>
Signed-off-by: Anthony Liguori <>

95533d5f 06/24/2009 05:09 pm Christoph Hellwig

qemu-io: add aio read/write/flush commands

Add commands to exercise asynchronous reads/writes and to flush all
outstanding aio commands. Commands to exercise aio cancellations will
follow in a separate patch.

Signed-off-by: Christoph Hellwig <>...

d4ec5228 05/10/2009 01:22 am Paul Brook

Workaround compiler warnings at -O1

Signed-off-by: Paul Brook <>

d9654a58 05/01/2009 05:44 pm Kevin Wolf

qemu-io: Optionally verify only part of read data

There are reasonable test cases where a read must span areas that are not
uniformly filled with one pattern but contains several parts. This makes -P
useless for them currently.

Introducing additional options which determine the part of the read data that...

c48101ae 04/18/2009 06:36 pm aliguori

qemu-io: Verify read data by patterns (Kevin Wolf)

This patch adds a -P option to read and readv which allows to compare the read
data to a given pattern. This can be used to verify data written by write -P.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>...

838ab728 04/18/2009 06:36 pm aliguori

qemu-io: Fix handling of bdrv_is_allocated() return value (Kevin Wolf)

bdrv_is_allocated() returns a boolean which indicates if the offset is
allocated, not 0 on success and everything else is an error.

Signed-off-by: Kevin Wolf <>
Signed-off-by: Anthony Liguori <>...

7e9bbc9f 04/18/2009 06:36 pm aliguori

a couple of qemu-io fixes (Christoph Hellwig)

Fix two stupid bugs that I forgot to push out:

- qiov->size already is in bytes, no need to shift it
- actually use the supplied patter in the writev command

Signed-off-by: Christoph Hellwig <>...