- Jan 24, 2014
-
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Reviewed-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Benoît Canet authored
Signed-off-by:
Benoit Canet <benoit@irqsave.net> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Benoît Canet authored
Add the minimum of code to prepare for the following patches. Signed-off-by:
Benoit Canet <benoit@irqsave.net> Reviewed-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Fam Zheng authored
Currently there is no way to query BlockStats of the backing chain. This adds "backing" field into BlockStats to make it possible. The comment of "parent" is reworded. Signed-off-by:
Fam Zheng <famz@redhat.com> Reviewed-by:
Benoit Canet <benoit@irqsave.net> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Fam Zheng authored
Previously the field is wrong: $ ./qemu-img create -f vmdk -o subformat=streamOptimized /tmp/a.vmdk 1G $ ./qemu-img info /tmp/a.vmdk image: /tmp/a.vmdk file format: vmdk virtual size: 1.0G (1073741824 bytes) disk size: 12K Format specific information: cid: 1390460459 parent cid: 4294967295 >>> create type: monolithicSparse <snip> Signed-off-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Zhang Min authored
In the function mirror_iteration() -> qemu_iovec_init(), it allocates memory for op->qiov.iov, when the write request calls back, but in the function mirror_iteration_done(), it only frees the op, not free the op->qiov.iov, so this causes memory leak. It should use qemu_iovec_destroy() to free op->qiov. Signed-off-by:
Zhang Min <rudy.zhangmin@huawei.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Liu Yuan authored
It was muted in the previous commit 4bc74be9. Let's revive it since nothing prevents us to do it. With this patch, following command will work as other formats: $ qemu-img map sheepdog:image Cc: qemu-devel@nongnu.org Cc: Kevin Wolf <kwolf@redhat.com> Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Liu Yuan <namei.unix@gmail.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Kevin Wolf authored
Document the SIGUSR1 behaviour of qemu-img. Also, added compare to the list of subcommands that support -p. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Benoit Canet <benoit@irqsave.net>
-
Kevin Wolf authored
Since commit a7aae221 ('Switch SIG_IPI to SIGUSR1'), SIGUSR1 is blocked during startup, breaking the progress report in tools. This patch reenables the signal when initialising a progress report. Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Benoit Canet <benoit@irqsave.net>
-
Kevin Wolf authored
Signed-off-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Benoit Canet <benoit@irqsave.net>
-
Fam Zheng authored
Report an error if file size is even smaller than metadata. Signed-off-by:
Fam Zheng <famz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hu Tao authored
Accoring to qcow spec, the offset fields in l1e, l2e and ref table entry start at bit 9. The offset is cluster offset, and the smallest possible cluster size is 512 bytes. Signed-off-by:
Hu Tao <hutao@cn.fujitsu.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
- Jan 22, 2014
-
-
Stefan Hajnoczi authored
Propagate the error return value from get_indirect(). This bug was introduced in commit 4d684832 ("vring: create a common function to parse descriptors"). Reviewed-by:
Markus Armbruster <armbru@redhat.com> Reviewed-by:
Peter Maydell <peter.maydell@linaro.org> Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Peter Feiner authored
When a backing file is opened such that (1) a protocol is directly used as the block driver and (2) the block driver has bdrv_file_open, bdrv_open_backing_file segfaults. The problem arises because bdrv_open_common returns without setting bd->backing_hd->file. To effect (1), you seem to have to use the -F flag in qemu-img. There are several block drivers that satisfy (2), such as "file" and "nbd". Here are some concrete examples: #!/bin/bash echo Test file format ./qemu-img create -f file base.file 1m ./qemu-img create -f qcow2 -F file -o backing_file=base.file\ file-overlay.qcow2 ./qemu-img convert -O raw file-overlay.qcow2 file-convert.raw echo Test nbd format SOCK=$PWD/nbd.sock ./qemu-img create -f raw base.raw 1m ./qemu-nbd -t -k $SOCK base.raw & trap "kill $!" EXIT while ! test -e $SOCK; do sleep 1; done ./qemu-img create -f qcow2 -F nbd -o backing_file=nbd:unix:$SOCK\ nbd-overlay.qcow2 ./qemu-img convert -O raw nbd-overlay.qcow2 nbd-convert.raw Without this patch, the two qemu-img convert commands segfault. This is a regression that was introduced in v1.7 by dbecebdd. Signed-off-by:
Peter Feiner <peter@gridcentric.ca> Reviewed-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Add a test for nested image formats. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Add a test for the new blkdebug/blkverify interface. This test is not written in Python, although it uses QMP. This is because it invokes the qemu-io HMP command, which outputs errors to stderr instead of returning them through QMP. Filtering and testing that output is easier in a shell script than with the Python infrastructure. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Add a test case for qdict_flatten() in tests/check-qdict.c. This test case covers the flattening of subordinate QLists as well. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Add a test case for qdict_array_split() in tests/check-qdict.c. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
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 <mreitz@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Add structures to support blkdebug and blkverify in blockdev-add. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Using "errno" directly as an identifier results in various syntax errors; therefore it should be added to the list of polluted words. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
If the filename is not prefixed by "blkverify:" in blkverify_parse_filename(), the blkverify driver was not selected through that protocol prefix, but by an explicit command line (or QMP) option (like driver=blkverify). If blkverify_parse_filename() has been called, a filename has been given. If it is not prefixed, it is probably really just a plain filename. This is no problem, since we can use it as the test image filename and rely on the user to specify the raw image filename through the new corresponding option. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Introduce the "test" and "raw" options for specifying images. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Introduce the "image" option as an alternative to specifying the image through the filename. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Specifying the image filename through the "file" option is a legacy option and should not be supported by blockdev-add (in that case, giving a string for "file" references an existing block device). Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
It should be possible to use a format as a driver for a file which in turn requires another file, i.e., nesting file formats. Allowing nested file formats results in e.g. qcow2 BlockDriverStates never being directly passed to bdrv_open_common() from bdrv_file_open(), but instead being handed through bdrv_open(). This changes the error message when trying to give a filename to qcow2, i.e. trying to use it as a driver for the protocol level. Therefore, change the reference output of I/O test 051 accordingly. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Using bdrv_open_image() instead of bdrv_file_open() directly in bdrv_open() is easier. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Add a common function for opening images to be used for block drivers specified through BlockdevRefs in an option QDict. The difference from bdrv_file_open() is that this function may invoke bdrv_open() instead, allowing auto-detection of the driver to be used; and second, it automatically extracts the BlockdevRef from the option QDict. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
blkdebug and blkverify will, in order to retain compatibility, not support the field "file" implicitly through bdrv_open(). In order to be able to use those drivers without giving a filename anyway, it is necessary to be able to have block devices without files implicitly opened by bdrv_open(). This is the case, if there was neither a file name, a reference to an existing block device to use as a file nor options specific to the file. Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
With that now being possible, bdrv_open() should try to extract a block device reference from the options and pass it to bdrv_file_open(). Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
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 <mreitz@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Use qemu_config_parse_qdict() to parse the command-line options in addition to the config file. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Move the check whether there actually is a config file into the read_config() function. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
This function basically parses command-line options given as a QDict replacing a config file. For instance, the QDict {"section.opt1": 42, "section.opt2": 23} corresponds to the config file: [section] opt1 = 42 opt2 = 23 It is possible to specify multiple sections and also multiple sections of the same type. On the command line, this looks like the following: inject-error.0.event=reftable_load,\ inject-error.1.event=l2_load,\ set-state.event=l1_update This would correspond to the following config file: [inject-error "inject-error.0"] event = reftable_load [inject-error "inject-error.1"] event = l2_load [set-state] event = l1_update Signed-off-by:
Max Reitz <mreitz@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Reversing qdict_array_split(), qdict_flatten() should flatten QLists as well by interpreting them as QDicts where every entry's key is its index. This allows bringing QDicts with QLists from QMP commands to the same form as they would be given as command-line options, thereby allowing them to be parsed the same way. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
This function splits a QDict consisting of entries prefixed by incrementally enumerated indices into a QList of QDicts. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
If the filename is not prefixed by "blkdebug:" in blkdebug_parse_filename(), the blkdebug driver was not selected through that protocol prefix, but by an explicit command line option (file.driver=blkdebug or something similar). Contrary to the current reaction, this is not a problem at all; we just need to store the filename (in the x-image option) and can go on; the user just has to manually specify the config option. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Hanna Reitz authored
Use an Error variable in the read_config() function. Signed-off-by:
Max Reitz <mreitz@redhat.com> Reviewed-by:
Kevin Wolf <kwolf@redhat.com> Reviewed-by:
Eric Blake <eblake@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Stefan Hajnoczi authored
Autocomplete qemu-io commands at the interactive prompt. Note this only completes command names and not their options. Signed-off-by:
Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-
Stefan Hajnoczi authored
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 <stefanha@redhat.com> Signed-off-by:
Kevin Wolf <kwolf@redhat.com>
-