Re: [Qemu-block] [Qemu-devel] [PATCH v11 18/28] qerror: more error_setg() usage

2015-11-11 Thread Markus Armbruster
Eric Blake writes: > A few uses of error_set(ERROR_CLASS_GENERIC_ERROR) have snuck in > since c6bd8c706. Nuke them. Doesn't really belong to this series, but that's okay. > Signed-off-by: Eric Blake > > --- > v11: new patch > --- > block.c

Re: [Qemu-block] [Qemu-devel] [PATCH v11 21/28] qapi: Convert qtype_code into qapi enum type

2015-11-11 Thread Eric Blake
On 11/11/2015 09:42 AM, Markus Armbruster wrote: > Eric Blake writes: > >> What's more meta than using qapi to define qapi? :) >> >> Convert qtype_code into a full-fledged[*] builtin qapi enum type, >> so that a subsequent patch can then use it as the discriminator >> type of

Re: [Qemu-block] [Qemu-devel] [PATCH v11 18/28] qerror: more error_setg() usage

2015-11-11 Thread Eric Blake
On 11/11/2015 10:31 AM, Markus Armbruster wrote: > Eric Blake writes: > >> On 11/11/2015 07:21 AM, Markus Armbruster wrote: >>> Eric Blake writes: >>> A few uses of error_set(ERROR_CLASS_GENERIC_ERROR) have snuck in since c6bd8c706. Nuke them.

Re: [Qemu-block] [Qemu-devel] [PULL v3 00/41] Block layer patches

2015-11-11 Thread Peter Maydell
On 11 November 2015 at 16:08, Kevin Wolf <kw...@redhat.com> wrote: > The following changes since commit 3c07587d49458341510360557c849e93e9afaf59: > > Merge remote-tracking branch 'remotes/dgibson/tags/ppc-next-2015' into > staging (2015-11-11 09:34:18 +) > >

[Qemu-block] [PULL 0/1] Block patches

2015-11-11 Thread Jeff Cody
The following changes since commit 3c07587d49458341510360557c849e93e9afaf59: Merge remote-tracking branch 'remotes/dgibson/tags/ppc-next-2015' into staging (2015-11-11 09:34:18 +) are available in the git repository at: g...@github.com:codyprime/qemu-kvm-jtc.git tags/block-pull

Re: [Qemu-block] [Qemu-devel] [PATCH v11 19/28] qapi: Change munging of CamelCase enum values

2015-11-11 Thread Markus Armbruster
Eric Blake writes: > [hmm, wonder why scripts/get-maintainer.pl didn't loop in Gerd to the > patch itself] > > On 11/11/2015 07:50 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> When munging enum values, the fact that we were passing the entire

[Qemu-block] [PULL 1/1] gluster: allocate GlusterAIOCBs on the stack

2015-11-11 Thread Jeff Cody
From: Paolo Bonzini This is simpler now that the driver has been converted to coroutines. Signed-off-by: Paolo Bonzini Signed-off-by: Jeff Cody Reviewed-by: Kevin Wolf --- block/gluster.c | 86

Re: [Qemu-block] [PATCH for-2.5] block: make 'stats-intervals' a list of integers

2015-11-11 Thread Eric Blake
On 11/11/2015 06:17 AM, Alberto Garcia wrote: > This is the natural JSON representation and prevents us from having to > decode the list manually. > > Signed-off-by: Alberto Garcia > --- > blockdev.c | 64 > ++ >

Re: [Qemu-block] [PATCH v2 2/8] block: Add blk_next_inserted()

2015-11-11 Thread Alberto Garcia
On Tue 10 Nov 2015 04:27:43 AM CET, Max Reitz wrote: > This function skips to the next BlockBackend for which blk_is_inserted() > is true. > > Signed-off-by: Max Reitz > Reviewed-by: Eric Blake Reviewed-by: Alberto Garcia

[Qemu-block] [PULL v3 00/41] Block layer patches

2015-11-11 Thread Kevin Wolf
The following changes since commit 3c07587d49458341510360557c849e93e9afaf59: Merge remote-tracking branch 'remotes/dgibson/tags/ppc-next-2015' into staging (2015-11-11 09:34:18 +) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you

[Qemu-block] [PULL v3 31/41] qemu-io: fix cvtnum lval types

2015-11-11 Thread Kevin Wolf
From: John Snow cvtnum() returns int64_t: we should not be storing this result inside of an int. In a few cases, we need an extra sprinkling of error handling where we expect to pass this number on towards a function that expects something smaller than int64_t. Reported-by:

Re: [Qemu-block] [Qemu-devel] [PULL v2 00/40] Block layer patches

2015-11-11 Thread Kevin Wolf
Am 10.11.2015 um 18:10 hat Peter Maydell geschrieben: > On 10 November 2015 at 14:09, Kevin Wolf wrote: > > The following changes since commit a8b4f9585a0bf5186fca793ce2c5d754cd8ec49a: > > > > Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2015-11-10' > > into

Re: [Qemu-block] [Qemu-devel] [PATCH v11 18/28] qerror: more error_setg() usage

2015-11-11 Thread Eric Blake
On 11/11/2015 07:23 AM, Andreas Färber wrote: > Am 11.11.2015 um 15:21 schrieb Markus Armbruster: >> Eric Blake writes: >> >>> A few uses of error_set(ERROR_CLASS_GENERIC_ERROR) have snuck in >>> since c6bd8c706. Nuke them. >> >> Doesn't really belong to this series, but

Re: [Qemu-block] [Qemu-devel] [PATCH v11 19/28] qapi: Change munging of CamelCase enum values

2015-11-11 Thread Eric Blake
On 11/11/2015 07:50 AM, Markus Armbruster wrote: >> Thankfully, only two enums are affected: ErrorClass and InputButton. [Visiting just ErrorClass in this email] > > By convention (see CODING_STYLE), we use CamelCase for type names, and > nothing else. > > Only enums violating this naming

Re: [Qemu-block] [PATCH v11 18/28] qerror: more error_setg() usage

2015-11-11 Thread Andreas Färber
Am 11.11.2015 um 07:51 schrieb Eric Blake: > A few uses of error_set(ERROR_CLASS_GENERIC_ERROR) have snuck in > since c6bd8c706. Nuke them. > > Signed-off-by: Eric Blake [...] > diff --git a/qom/object.c b/qom/object.c > index fc6e161..c0decb6 100644 > --- a/qom/object.c >

Re: [Qemu-block] [Qemu-devel] [PATCH v11 19/28] qapi: Change munging of CamelCase enum values

2015-11-11 Thread Markus Armbruster
Eric Blake writes: > When munging enum values, the fact that we were passing the entire > prefix + value through camel_to_upper() meant that enum values > spelled with CamelCase could be turned into CAMEL_CASE. However, > this provides a potential collision (both OneTwo and

Re: [Qemu-block] [PATCH] iotests: Check for quorum support in test 139

2015-11-11 Thread Max Reitz
On 10.11.2015 17:28, Alberto Garcia wrote: > The quorum driver is always built in, but it is disabled during > run-time if there's no SHA256 support available (see commit e94867e). > > This patch skips the quorum test in iotest 139 in that case. > > Signed-off-by: Alberto Garcia

Re: [Qemu-block] [PATCH for-2.5] block: make 'stats-intervals' a list of integers

2015-11-11 Thread Alberto Garcia
On Wed 11 Nov 2015 04:32:42 PM CET, Eric Blake wrote: >> -for (i = 0; !error && intervals[i] != NULL; i++) { >> +case QTYPE_QSTRING: { > >> +case QTYPE_QINT: { > > Why are we accepting both string and int here, but typing it as 'int' in > qapi? I guess its due

[Qemu-block] [PULL v3 41/41] iotests: Check for quorum support in test 139

2015-11-11 Thread Kevin Wolf
From: Alberto Garcia The quorum driver is always built in, but it is disabled during run-time if there's no SHA256 support available (see commit e94867e). This patch skips the quorum test in iotest 139 in that case. Signed-off-by: Alberto Garcia Message-id:

[Qemu-block] [PULL v3 14/41] blockdev: read-only-mode for blockdev-change-medium

2015-11-11 Thread Kevin Wolf
From: Max Reitz Add an option to qmp_blockdev_change_medium() which allows changing the read-only status of the block device whose medium is changed. Some drives do not have a inherently fixed read-only status; for instance, floppy disks can be set read-only or writable

Re: [Qemu-block] [Qemu-devel] [PATCH v11 18/28] qerror: more error_setg() usage

2015-11-11 Thread Eric Blake
On 11/11/2015 07:21 AM, Markus Armbruster wrote: > Eric Blake writes: > >> A few uses of error_set(ERROR_CLASS_GENERIC_ERROR) have snuck in >> since c6bd8c706. Nuke them. > > Doesn't really belong to this series, but that's okay. If you're going to modify this for 2.5

Re: [Qemu-block] [Qemu-devel] [PATCH v11 18/28] qerror: more error_setg() usage

2015-11-11 Thread Andreas Färber
Am 11.11.2015 um 15:21 schrieb Markus Armbruster: > Eric Blake writes: > >> A few uses of error_set(ERROR_CLASS_GENERIC_ERROR) have snuck in >> since c6bd8c706. Nuke them. > > Doesn't really belong to this series, but that's okay. It seemed to avoid a GENERIC_ERROR ->

Re: [Qemu-block] [PATCH v11 19/28] qapi: Change munging of CamelCase enum values

2015-11-11 Thread Andreas Färber
Am 11.11.2015 um 07:51 schrieb Eric Blake: > When munging enum values, the fact that we were passing the entire > prefix + value through camel_to_upper() meant that enum values > spelled with CamelCase could be turned into CAMEL_CASE. However, > this provides a potential collision (both OneTwo

[Qemu-block] [PATCH] block: make 'stats-intervals' a list of integers

2015-11-11 Thread Alberto Garcia
This is the natural JSON representation and prevents us from having to decode the list manually. Signed-off-by: Alberto Garcia --- blockdev.c | 64 ++ qapi/block-core.json | 7 +++--- tests/qemu-iotests/136 | 2 +-

[Qemu-block] [PATCH v4] mirror: Rewrite mirror_iteration

2015-11-11 Thread Fam Zheng
The "pnum < nb_sectors" condition in deciding whether to actually copy data is unnecessarily strict, and the qiov initialization is unnecessarily for bdrv_aio_write_zeroes and bdrv_aio_discard. Rewrite mirror_iteration to fix both flaws. Signed-off-by: Fam Zheng ---

Re: [Qemu-block] [Qemu-devel] [PATCH v7 03/24] block: Release dirty bitmaps in bdrv_close()

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > bdrv_delete() is not very happy about deleting BlockDriverStates with > dirty bitmaps still attached to them. In the past, we got around that > very easily by relying on bdrv_close_all() bypassing bdrv_delete(), and > bdrv_close() simply ignoring that

Re: [Qemu-block] [Qemu-devel] [PATCH v7 04/24] iotests: Rename filter_nbd to _filter_nbd in 083

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > In the patch after the next, this function is moved to common.filter. > Therefore, its name should be preceded by an underscore to signify its > global availability. > > To keep the code motion patch clean, we cannot rename it in the same > patch, so we

Re: [Qemu-block] [Qemu-devel] [PATCH v7 05/24] iotests: Change coding style of _filter_nbd in 083

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > In order to be able to move _filter_nbd to common.filter in the next > patch, its coding style needs to be adapted to that of common.filter. > That means, we have to convert tabs to four spaces, adjust the alignment > of the last line (done with spaces

Re: [Qemu-block] [Qemu-devel] [PATCH v7 01/24] blockdev: Add missing bdrv_unref() in drive-backup

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > All error paths after a successful bdrv_open() of target_bs should > contain a bdrv_unref(target_bs). This one did not yet, so add it. > > Signed-off-by: Max Reitz > Reviewed-by: Alberto Garcia > Reviewed-by: Kevin

Re: [Qemu-block] [Qemu-devel] [PATCH v7 02/24] blockjob: Call bdrv_unref() on creation error

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > If block_job_create() fails, it should release its reference to the > job's BDS. Normally, this is done in the callback provided by the > caller, but that callback will not be invoked if the block job failed to > be created. > > Signed-off-by: Max Reitz

Re: [Qemu-block] [Qemu-devel] [PATCH v7 07/24] iotests: Make _filter_nbd drop log lines

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > The NBD log lines ("/your/source/dir/nbd.c:function():line: error") > should not be converted to empty lines but removed altogether. > > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/083.out | 10 -- >

Re: [Qemu-block] [Qemu-devel] [PATCH v7 08/24] iotests: Make _filter_nbd support more URL types

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > This function should support URLs of the "nbd://" format (without > swallowing the export name), and for "nbd:///" URLs it should replace > "?socket=$TEST_DIR" by "?socket=TEST_DIR" because putting the Unix > socket files into the test directory makes sense.

Re: [Qemu-block] [Qemu-devel] [PATCH v7 06/24] iotests: Move _filter_nbd into common.filter

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > _filter_nbd can be useful for other NBD tests, too, therefore it should > reside in common.filter. > > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/083 | 12 > tests/qemu-iotests/common.filter | 12

Re: [Qemu-block] [Qemu-devel] [PATCH v7 19/24] block: Add list of all BlockDriverStates

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > We need this list so that bdrv_close_all() can keep track of which BDSs > are still open after having removed the BDSs from all of the BBs and > having released all monitor BDS references. > > Signed-off-by: Max Reitz > Reviewed-by:

Re: [Qemu-block] [Qemu-devel] [PATCH v7 10/24] iotests: Add test for eject under NBD server

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > This patch adds a test for ejecting the BlockBackend an NBD server is > connected to (the NBD server is supposed to stop). > > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/140 | 92 >

Re: [Qemu-block] [Qemu-devel] [PATCH v7 18/24] block: Make bdrv_close() static

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > There are no users of bdrv_close() left, except for one of bdrv_open()'s > failure paths, bdrv_close_all() and bdrv_delete(), and that is good. > Make bdrv_close() static so nobody makes the mistake of directly using > bdrv_close() again. > > Signed-off-by:

Re: [Qemu-block] [Qemu-devel] [PATCH v7 22/24] block: Rewrite bdrv_close_all()

2015-11-11 Thread Fam Zheng
On Mon, 11/09 23:39, Max Reitz wrote: > This patch rewrites bdrv_close_all(): Until now, all root BDSs have been > force-closed. This is bad because it can lead to cached data not being > flushed to disk. > > Instead, try to make all reference holders relinquish their reference > voluntarily: >

[Qemu-block] [PATCH] iotests: fix race in 030

2015-11-11 Thread John Snow
the stop_test case tests that we can resume a block-stream command after it has stopped/paused due to error. We cannot always reliably query it before it finishes after resume, though, so make this a conditional. The important thing is that we are still testing that it has stopped, and that it

Re: [Qemu-block] [PATCH] iotests: fix race in 030

2015-11-11 Thread Jeff Cody
On Wed, Nov 11, 2015 at 03:27:36PM -0500, John Snow wrote: > the stop_test case tests that we can resume a block-stream > command after it has stopped/paused due to error. We cannot > always reliably query it before it finishes after resume, though, > so make this a conditional. > > The important

Re: [Qemu-block] [Qemu-devel] [PATCH v7 03/24] block: Release dirty bitmaps in bdrv_close()

2015-11-11 Thread John Snow
On 11/09/2015 05:39 PM, Max Reitz wrote: > bdrv_delete() is not very happy about deleting BlockDriverStates with > dirty bitmaps still attached to them. In the past, we got around that > very easily by relying on bdrv_close_all() bypassing bdrv_delete(), and > bdrv_close() simply ignoring that

Re: [Qemu-block] [Qemu-devel] [PATCH v7 10/24] iotests: Add test for eject under NBD server

2015-11-11 Thread John Snow
On 11/09/2015 05:39 PM, Max Reitz wrote: > This patch adds a test for ejecting the BlockBackend an NBD server is > connected to (the NBD server is supposed to stop). > > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/140 | 92 >

[Qemu-block] [RFC] ide: Don't use qemu_hw_version() for firmware revision

2015-11-11 Thread Eduardo Habkost
The IDEState.version field is used for firmware version information returned to the guest. Updating firmware information on QEMU upgrade is supposed to be acceptable, so IDE doesn't need the version compatibility magic of qemu_hw_version() and can use QEMU_VERSION directly. Signed-off-by: Eduardo