Re: [Qemu-block] [Qemu-devel] [PATCH v2 01/49] opts: produce valid command line in qemu_opts_print

2015-09-04 Thread Eric Blake
On 08/21/2015 09:36 AM, Kővágó, Zoltán wrote: > This will let us print options in a format that the user would actually > write it on the command line (foo=bar,baz=asd,etc=def), without > prepending a spurious comma at the beginning of the list, or quoting > values unnecessarily. This patch provid

[Qemu-block] [PULL 13/16] qcow2: add option to clean unused cache entries after some time

2015-09-04 Thread Kevin Wolf
From: Alberto Garcia This adds a new 'cache-clean-interval' option that cleans all qcow2 cache entries that haven't been used in a certain interval, given in seconds. This allows setting a large L2 cache size so it can handle scenarios with lots of I/O and at the same time use little memory duri

[Qemu-block] [PULL 14/16] docs: document how to configure the qcow2 L2/refcount caches

2015-09-04 Thread Kevin Wolf
From: Alberto Garcia QEMU has options to configure the size of the L2 and refcount caches for the qcow2 format. However, choosing the right sizes for a particular disk image is not a straightforward operation since the ratio between the cache size and the allocated disk space is not obvious and d

[Qemu-block] [PULL 15/16] qcow2: reorder fields in Qcow2CachedTable to reduce padding

2015-09-04 Thread Kevin Wolf
From: Alberto Garcia Changing the current ordering saves 8 bytes per cache entry in x86_64. Signed-off-by: Alberto Garcia Reviewed-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Message-id: 0bd55291211df3dfb514d0e7d2031dd5c4f9f807.1438690126.git.be...@igalia.com Signed-off-by

[Qemu-block] [PULL 16/16] quorum: validate vote threshold against num_children even if read-pattern is fifo

2015-09-04 Thread Kevin Wolf
From: Wen Congyang We need to use threshold to check if too many write operation fails. If threshold is larger than num children, we always get write error event even if all write operations success. Signed-off-by: Wen Congyang Message-id: 55962f72.3060...@cn.fujitsu.com Reviewed-by: Alberto Ga

[Qemu-block] [PULL 10/16] iotests: Do not suppress segfaults in bash tests

2015-09-04 Thread Kevin Wolf
From: Max Reitz Currently, if a qemu/qemu-io/qemu-img/qemu-nbd invocation receives a segmentation fault, that message is invisible in most cases since the output is generally filtered and bash suppresses the segmentation fault notice for any but the last element of a pipe. Most of the time, the

[Qemu-block] [PULL 11/16] iotests: Warn if python subprocess is killed

2015-09-04 Thread Kevin Wolf
From: Max Reitz Currently, if a subprocess of a python test (i.e. qemu-io, qemu-img, or qemu) receives a signal and is subsequently aborted, this is not logged. This patch makes python tests always check the exit code of these subprocesses, and emit a message if they have been killed. Signed-of

[Qemu-block] [PULL 12/16] qcow2: mark the memory as no longer needed after qcow2_cache_empty()

2015-09-04 Thread Kevin Wolf
From: Alberto Garcia After having emptied the cache, the data in the cache tables is no longer useful, so we can tell the kernel that we are done with it. In Linux this frees the resources associated with it. The effect of this can be seen in the HMP commit operation: it moves data from the top

[Qemu-block] [PULL 09/16] iotests: Respect -nodefaults in tests 41 and 55

2015-09-04 Thread Kevin Wolf
From: Max Reitz While -nodefaults is set in $QEMU_OPTIONS, this is currently (wrongly) ignored for Python iotests. In order to be prepared for when this is fixed, we should explicitly add an IDE CD-ROM drive instead of relying on it being created automatically. Signed-off-by: Max Reitz Reviewed

[Qemu-block] [PULL 06/16] block/raw-posix: Use raw_normalize_devicepath()

2015-09-04 Thread Kevin Wolf
From: Max Reitz The filename given to qemu_open() in block/raw-posix.c should generally have been processed by raw_normalize_devicepath(); unless we are only probing (in which case the caller often checks whether the file is a block device or not, and this property will be changed by raw_normaliz

[Qemu-block] [PULL 08/16] iotests: More options for VM.add_drive()

2015-09-04 Thread Kevin Wolf
From: Max Reitz This patch allows specifying the interface to be used for the drive, and makes specifying a path optional (if the path is None, the "file" option will be omitted, thus creating an empty drive). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Signed-off-by: Kevin Wolf --- tes

[Qemu-block] [PULL 07/16] qemu-img: Fix crash in amend invocation

2015-09-04 Thread Kevin Wolf
From: Max Reitz Example: $ ./qemu-img create -f qcow2 /tmp/t.qcow2 64M $ ./qemu-img amend -f qcow2 -o backing_file=/tmp/t.qcow2, -o help \ /tmp/t.qcow2 This should not crash. This actually is tested by iotest 082, but not caught due to the segmentation fault being silent (which is something

[Qemu-block] [PULL 05/16] qemu-iotests: s390x: fix test 130

2015-09-04 Thread Kevin Wolf
From: Bo Tu The default device id of hard disk on the s390 platform is "virtio0" which differs to the "ide0-hd0" for the x86 platform. Setting id in the drive definition, ie:"qemu -drive id=testdisk", will be the same on all platforms. Reviewed-by: Max Reitz Signed-off-by: Bo Tu Signed-off-by:

[Qemu-block] [PULL 01/16] qemu-iotests: qemu machine type support

2015-09-04 Thread Kevin Wolf
From: Bo Tu This patch adds qemu machine type support to the io test suite. Based on the qemu default machine type and alias of the default machine type the reference output file can now vary from the default to a machine specific output file if necessary. When using a machine specific reference

[Qemu-block] [PULL 04/16] qemu-iotests: s390x: fix test 049, reject negative sizes in QemuOpts

2015-09-04 Thread Kevin Wolf
From: Bo Tu when creating an image qemu-img enable us specifying the size of the image using -o size=xx options. But when we specify an invalid size such as a negtive size then different platform gives different result. parse_option_size() function in util/qemu-option.c will be called to parse t

[Qemu-block] [PULL 00/16] Block patches

2015-09-04 Thread Kevin Wolf
The following changes since commit b597aa037dbd98014c8dec3d69a5e2240f432533: Merge remote-tracking branch 'remotes/armbru/tags/pull-monitor-2015-09-04' into staging (2015-09-04 17:37:50 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for yo

[Qemu-block] [PULL 02/16] qemu-iotests: disable default qemu devices for cross-platform compatibility

2015-09-04 Thread Kevin Wolf
From: Bo Tu This patch fixes an io test suite issue that was introduced with the commit c88930a6866e74953e931ae749781e98e486e5c8 'qemu-char: Permit only a single "stdio" character device'. The option supresses the creation of default devices such as the floopy and cdrom. Output files for test cas

[Qemu-block] [PULL 03/16] qemu-iotests: s390x: fix test 041 and 055

2015-09-04 Thread Kevin Wolf
From: Bo Tu There is no 'ide-cd' device defined on non-pc platform, so test_medium_not_found() test should be skipped. Reviewed-by: Max Reitz Reviewed-by: Michael Mueller Reviewed-by: Sascha Silbe Signed-off-by: Xiao Guang Chen Signed-off-by: Kevin Wolf --- tests/qemu-iotests/041 | 6 +

Re: [Qemu-block] [PATCH v2 13/13] qemu-iotests: More qcow2 reopen tests

2015-09-04 Thread Max Reitz
On 04.09.2015 19:18, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/137 | 143 > + > tests/qemu-iotests/137.out | 43 ++ > tests/qemu-iotests/group | 1 + > 3 files changed, 187 insertions(+) > create mod

Re: [Qemu-block] [PATCH v2 12/13] qemu-iotests: Reopen qcow2 with lazy-refcounts change

2015-09-04 Thread Max Reitz
On 04.09.2015 19:18, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > tests/qemu-iotests/039 | 27 +++ > tests/qemu-iotests/039.out | 18 ++ > 2 files changed, 45 insertions(+) > > diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039 > ind

Re: [Qemu-block] [PATCH v2 11/13] qcow2: Support updating driver-specific options in reopen

2015-09-04 Thread Max Reitz
On 04.09.2015 19:18, Kevin Wolf wrote: > For updating the cache sizes or disabling lazy refcounts there is a bit > more to do than just changing the variables, but otherwise we're all set > for changing options during bdrv_reopen(). > > Just implement the missing pieces and hook the functions up i

Re: [Qemu-block] [PATCH v2 03/13] qemu-io: Add command 'reopen'

2015-09-04 Thread Max Reitz
On 04.09.2015 19:18, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > qemu-io-cmds.c | 90 > ++ > 1 file changed, 90 insertions(+) Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signature

Re: [Qemu-block] [PATCH v2 04/13] qcow2: Improve error message

2015-09-04 Thread Max Reitz
On 04.09.2015 19:18, Kevin Wolf wrote: > Eric says that "any" sounds better than "either", and my non-native > feeling says the same, so let's change it. > > Suggested-by: Eric Blake > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Revie

Re: [Qemu-block] [PATCH v2 02/13] qemu-io: Remove duplicate 'open' error message

2015-09-04 Thread Max Reitz
On 04.09.2015 19:18, Kevin Wolf wrote: > qemu_opts_parse_noisily() already prints an error message with the exact > reason why the parsing failed. No need to add another less specific one. > > Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz signature.asc Description: OpenPGP digital signatu

[Qemu-block] [PATCH v2 09/13] qcow2: Fix memory leak in qcow2_update_options() error path

2015-09-04 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- block/qcow2.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 9b67334..24acefd 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -549,8 +549,8 @@ st

[Qemu-block] [PATCH v2 13/13] qemu-iotests: More qcow2 reopen tests

2015-09-04 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/qemu-iotests/137 | 143 + tests/qemu-iotests/137.out | 43 ++ tests/qemu-iotests/group | 1 + 3 files changed, 187 insertions(+) create mode 100755 tests/qemu-iotests/137 create mode 100644 test

[Qemu-block] [PATCH v2 12/13] qemu-iotests: Reopen qcow2 with lazy-refcounts change

2015-09-04 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- tests/qemu-iotests/039 | 27 +++ tests/qemu-iotests/039.out | 18 ++ 2 files changed, 45 insertions(+) diff --git a/tests/qemu-iotests/039 b/tests/qemu-iotests/039 index 617f397..9e9b379 100755 --- a/tests/qemu-iotests/039

[Qemu-block] [PATCH v2 11/13] qcow2: Support updating driver-specific options in reopen

2015-09-04 Thread Kevin Wolf
For updating the cache sizes or disabling lazy refcounts there is a bit more to do than just changing the variables, but otherwise we're all set for changing options during bdrv_reopen(). Just implement the missing pieces and hook the functions up in bdrv_reopen(). Signed-off-by: Kevin Wolf ---

[Qemu-block] [PATCH v2 10/13] qcow2: Make qcow2_update_options() suitable for transactions

2015-09-04 Thread Kevin Wolf
Before we can allow updating options at runtime with bdrv_reopen(), we need to split the function into prepare/commit/abort parts. Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- block/qcow2.c | 101 ++ 1 file

[Qemu-block] [PATCH v2 06/13] qcow2: Move qcow2_update_options() call up

2015-09-04 Thread Kevin Wolf
qcow2_update_options() only updates some variables in BDRVQcowState and doesn't really depend on other parts of it being initialised yet, so it can be moved so that it immediately follows the other half of option handling code in qcow2_open(). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Re

[Qemu-block] [PATCH v2 04/13] qcow2: Improve error message

2015-09-04 Thread Kevin Wolf
Eric says that "any" sounds better than "either", and my non-native feeling says the same, so let's change it. Suggested-by: Eric Blake Signed-off-by: Kevin Wolf --- block/qcow2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/qcow2.c b/block/qcow2.c index 76c331b..e1

[Qemu-block] [PATCH v2 08/13] qcow2: Leave s unchanged on qcow2_update_options() failure

2015-09-04 Thread Kevin Wolf
On return, either all new options should be applied to BDRVQcowState (on success), or all of the old settings should be preserved (on failure). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- block/qcow2.c | 52

[Qemu-block] [PATCH v2 05/13] qcow2: Factor out qcow2_update_options()

2015-09-04 Thread Kevin Wolf
Eventually we want to be able to change options at runtime. As a first step towards that goal, separate some option handling code from the general initialisation code in qcow2_open(). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- block/qcow2.c | 135 +

[Qemu-block] [PATCH v2 03/13] qemu-io: Add command 'reopen'

2015-09-04 Thread Kevin Wolf
Signed-off-by: Kevin Wolf --- qemu-io-cmds.c | 90 ++ 1 file changed, 90 insertions(+) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 53477e1..d6572a8 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -1979,6 +1979,95 @@ static const

[Qemu-block] [PATCH v2 07/13] qcow2: Move rest of option handling to qcow2_update_options()

2015-09-04 Thread Kevin Wolf
With this commit, the handling of driver-specific options in qcow2_open() is completely separated out into qcow2_update_options(). Signed-off-by: Kevin Wolf Reviewed-by: Eric Blake Reviewed-by: Max Reitz --- block/qcow2.c | 111 +- 1 file

[Qemu-block] [PATCH v2 01/13] block: Allow specifying driver-specific options to reopen

2015-09-04 Thread Kevin Wolf
Signed-off-by: Kevin Wolf Reviewed-by: Max Reitz --- block.c | 42 +++--- block/commit.c| 4 ++-- include/block/block.h | 4 +++- 3 files changed, 44 insertions(+), 6 deletions(-) diff --git a/block.c b/block.c index 090923c..a2cd9b8 1

[Qemu-block] [PATCH v2 00/13] qcow2: reopen: Change driver-specific runtime options

2015-09-04 Thread Kevin Wolf
This is part two of what I had sent earlier as "[PATCH 00/34] block: Cache mode for children, reopen overhaul and more". Most of the patches were actually already reviewed in v1. Apart from a few addressed review comments, there are no functional changes compared to v1. Some rebasing was necessary

[Qemu-block] [PATCH v2 02/13] qemu-io: Remove duplicate 'open' error message

2015-09-04 Thread Kevin Wolf
qemu_opts_parse_noisily() already prints an error message with the exact reason why the parsing failed. No need to add another less specific one. Signed-off-by: Kevin Wolf --- qemu-io.c | 1 - 1 file changed, 1 deletion(-) diff --git a/qemu-io.c b/qemu-io.c index f1e3a67..269f17c 100644 --- a/q

Re: [Qemu-block] [PATCH v2 2/2] block: add a 'blockdev-snapshot' QMP command

2015-09-04 Thread Eric Blake
On 09/04/2015 06:37 AM, Alberto Garcia wrote: > One of the limitations of the 'blockdev-snapshot-sync' command is that > it does not allow passing BlockdevOptions to the newly created > snapshots, so they are always opened using the default values. > > Extending the command to allow passing option

Re: [Qemu-block] [PATCH v2 1/2] block: rename BlockdevSnapshot to BlockdevSnapshotSync

2015-09-04 Thread Eric Blake
On 09/04/2015 06:37 AM, Alberto Garcia wrote: > We will introduce the 'blockdev-snapshot' command that will require > its own struct for the parameters, so we need to rename this one in > order to avoid name clashes. > > Signed-off-by: Alberto Garcia > --- > blockdev.c | 2 +- > qapi-s

[Qemu-block] [PATCH v2 2/2] block: add a 'blockdev-snapshot' QMP command

2015-09-04 Thread Alberto Garcia
One of the limitations of the 'blockdev-snapshot-sync' command is that it does not allow passing BlockdevOptions to the newly created snapshots, so they are always opened using the default values. Extending the command to allow passing options is not a practical solution because there is overlap b

[Qemu-block] [PATCH v2 1/2] block: rename BlockdevSnapshot to BlockdevSnapshotSync

2015-09-04 Thread Alberto Garcia
We will introduce the 'blockdev-snapshot' command that will require its own struct for the parameters, so we need to rename this one in order to avoid name clashes. Signed-off-by: Alberto Garcia --- blockdev.c | 2 +- qapi-schema.json | 2 +- qapi/block-core.json | 8 3 fi

[Qemu-block] [PATCH v2 0/2] Add 'blockdev-snapshot' command

2015-09-04 Thread Alberto Garcia
Previous attempt to extend blockdev-snapshot-sync: https://lists.gnu.org/archive/html/qemu-block/2015-08/msg00236.html As discussed in the previous thread, this adds a new command called 'blockdev-snapshot', that simply takes references to two existing block devices. I decided to share most of