Re: [Qemu-block] [PATCH v2] tests: Avoid non-portable 'echo -ARG'

2017-06-30 Thread Jeff Cody
On Fri, Jun 30, 2017 at 02:58:31PM -0500, Eric Blake wrote: > POSIX says that backslashes in the arguments to 'echo', as well as > any use of 'echo -n' and 'echo -e', are non-portable; it recommends > people should favor 'printf' instead. This is definitely true where > we do not control which

Re: [Qemu-block] [PATCH v4 1/2] iotests: Use absolute paths for executables

2017-06-30 Thread Jeff Cody
On Fri, Jun 30, 2017 at 02:45:46PM -0500, Eric Blake wrote: > On 06/30/2017 02:41 PM, Eric Blake wrote: > > > +++ 068.out.bad 2017-06-30 14:35:28.720241398 -0500 > > @@ -1,4 +1,5 @@ > > QA output created by 068 > > +realpath: '': No such file or directory > > > > The culprit?

Re: [Qemu-block] [PATCH v3 20/20] block: Make bdrv_is_allocated_above() byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:58PM -0500, Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. In the common case, allocation is unlikely to ever use > values that are not naturally sector-aligned, but it is possible > that byte-based values will

Re: [Qemu-block] [PATCH v3 19/20] block: Minimize raw use of bds->total_sectors

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:57PM -0500, Eric Blake wrote: > bdrv_is_allocated_above() was relying on intermediate->total_sectors, > which is a field that can have stale contents depending on the value > of intermediate->has_variable_length. An audit shows that we are safe > (we were first

Re: [Qemu-block] [PATCH v3 18/20] block: Make bdrv_is_allocated() byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:56PM -0500, Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. In the common case, allocation is unlikely to ever use > values that are not naturally sector-aligned, but it is possible > that byte-based values will

Re: [Qemu-block] [PATCH v3 17/20] backup: Switch backup_run() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:55PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Change the internal > loop iteration of backups to track by bytes instead of sectors > (although we are still guaranteed that

Re: [Qemu-block] [PATCH v3 16/20] backup: Switch backup_do_cow() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:54PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Convert another internal > function (no semantic change). > > Signed-off-by: Eric Blake > Reviewed-by:

Re: [Qemu-block] [PATCH v3 15/20] backup: Switch block_backup.h to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:53PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Continue by converting > the public interface to backup jobs (no semantic change), including > a change to CowRequest to

Re: [Qemu-block] [PATCH v3 14/20] backup: Switch BackupBlockJob to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:52PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Continue by converting an > internal structure (no semantic change), and all references to > tracking progress. Drop a

Re: [Qemu-block] [PATCH v3 13/20] block: Drop unused bdrv_round_sectors_to_clusters()

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:51PM -0500, Eric Blake wrote: > Now that the last user [mirror_iteration()] has converted to using > bytes, we no longer need a function to round sectors to clusters. > > Signed-off-by: Eric Blake > Reviewed-by: John Snow >

Re: [Qemu-block] [PATCH v3 12/20] mirror: Switch mirror_iteration() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:50PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Change the internal > loop iteration of mirroring to track by bytes instead of sectors > (although we are still guaranteed

Re: [Qemu-block] [PATCH v3 11/20] mirror: Switch mirror_do_read() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:49PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Convert another internal > function (no semantic change). > > Signed-off-by: Eric Blake > Reviewed-by:

Re: [Qemu-block] [PATCH v3 10/20] mirror: Switch mirror_cow_align() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:48PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Convert another internal > function (no semantic change), and add mirror_clip_bytes() as a > counterpart to

Re: [Qemu-block] [PATCH v3 09/20] mirror: Update signature of mirror_clip_sectors()

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:47PM -0500, Eric Blake wrote: > Rather than having a void function that modifies its input > in-place as the output, change the signature to reduce a layer > of indirection and return the result. > > Suggested-by: John Snow > Signed-off-by: Eric

Re: [Qemu-block] [PATCH v3 08/20] mirror: Switch mirror_do_zero_or_discard() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:46PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Convert another internal > function (no semantic change). > > Signed-off-by: Eric Blake > Reviewed-by:

Re: [Qemu-block] [PATCH v3 07/20] mirror: Switch MirrorBlockJob to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:45PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Continue by converting an > internal structure (no semantic change), and all references to the > buffer size. > >

Re: [Qemu-block] [PATCH v3 06/20] commit: Switch commit_run() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:44PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Change the internal > loop iteration of committing to track by bytes instead of sectors > (although we are still guaranteed

Re: [Qemu-block] [PATCH v3 05/20] commit: Switch commit_populate() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:43PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Start by converting an > internal function (no semantic change). > > Signed-off-by: Eric Blake >

Re: [Qemu-block] [PATCH v3 04/20] stream: Switch stream_run() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:42PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Change the internal > loop iteration of streaming to track by bytes instead of sectors > (although we are still guaranteed

[Qemu-block] [PATCH v2] tests: Avoid non-portable 'echo -ARG'

2017-06-30 Thread Eric Blake
POSIX says that backslashes in the arguments to 'echo', as well as any use of 'echo -n' and 'echo -e', are non-portable; it recommends people should favor 'printf' instead. This is definitely true where we do not control which shell is running (such as in makefile snippets or in documentation

Re: [Qemu-block] [PATCH v3 03/20] stream: Switch stream_populate() to byte-based

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:41PM -0500, Eric Blake wrote: > We are gradually converting to byte-based interfaces, as they are > easier to reason about than sector-based. Start by converting an > internal function (no semantic change). > > Signed-off-by: Eric Blake >

Re: [Qemu-block] [PATCH v3 02/20] trace: Show blockjob actions via bytes, not sectors

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:40PM -0500, Eric Blake wrote: > Upcoming patches are going to switch to byte-based interfaces > instead of sector-based. Even worse, trace_backup_do_cow_enter() > had a weird mix of cluster and sector indices. > > The trace interface is low enough that there are no

Re: [Qemu-block] [PATCH v4 1/2] iotests: Use absolute paths for executables

2017-06-30 Thread Eric Blake
On 06/30/2017 02:41 PM, Eric Blake wrote: > +++ 068.out.bad 2017-06-30 14:35:28.720241398 -0500 > @@ -1,4 +1,5 @@ > QA output created by 068 > +realpath: '': No such file or directory > > The culprit? $QEMU_VXHS_PROG is empty for me, which means `set_prog_path > qnio_server` found nothing

Re: [Qemu-block] [PATCH v3 01/20] blockjob: Track job ratelimits via bytes, not sectors

2017-06-30 Thread Jeff Cody
On Tue, Jun 27, 2017 at 02:24:39PM -0500, Eric Blake wrote: > The user interface specifies job rate limits in bytes/second. > It's pointless to have our internal representation track things > in sectors/second, particularly since we want to move away from > sector-based interfaces. > > Fix up a

Re: [Qemu-block] [PATCH v4 1/2] iotests: Use absolute paths for executables

2017-06-30 Thread Eric Blake
On 06/29/2017 09:46 PM, Max Reitz wrote: >>> +++ b/tests/qemu-iotests/common.config >>> @@ -103,6 +103,12 @@ if [ -z "$QEMU_VXHS_PROG" ]; then >>> export QEMU_VXHS_PROG="`set_prog_path qnio_server`" >>> fi >>> >>> +export QEMU_PROG=$(realpath -- "$(type -p "$QEMU_PROG")") >> >> ...now

Re: [Qemu-block] [PATCH v22 19/30] qcow2: add persistent dirty bitmaps support

2017-06-30 Thread Eric Blake
On 06/30/2017 12:58 PM, John Snow wrote: >> >> "Structure of a bitmap directory entry: >> ... >> 8 - 11:bitmap_table_size >> Number of entries in the bitmap table of the bitmap." >> > > This is the number of bitmaps stored in the qcow2, not the size of one >

Re: [Qemu-block] [PATCH v22 19/30] qcow2: add persistent dirty bitmaps support

2017-06-30 Thread John Snow
On 06/30/2017 01:47 PM, Eric Blake wrote: > On 06/29/2017 09:23 PM, Max Reitz wrote: >> On 2017-06-30 04:18, Eric Blake wrote: >>> On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote: Store persistent dirty bitmaps in qcow2 image. Signed-off-by: Vladimir Sementsov-Ogievskiy

Re: [Qemu-block] [Qemu-devel] [PATCH v22 06/30] block/dirty-bitmap: add deserialize_ones func

2017-06-30 Thread John Snow
On 06/29/2017 10:01 PM, Eric Blake wrote: > On 06/29/2017 08:55 PM, Eric Blake wrote: >> On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote: >>> Add bdrv_dirty_bitmap_deserialize_ones() function, which is needed for >>> qcow2 bitmap loading, to handle unallocated bitmap parts, marked as

Re: [Qemu-block] [PATCH v22 19/30] qcow2: add persistent dirty bitmaps support

2017-06-30 Thread Eric Blake
On 06/29/2017 09:23 PM, Max Reitz wrote: > On 2017-06-30 04:18, Eric Blake wrote: >> On 06/28/2017 07:05 AM, Vladimir Sementsov-Ogievskiy wrote: >>> Store persistent dirty bitmaps in qcow2 image. >>> >>> Signed-off-by: Vladimir Sementsov-Ogievskiy >>> Reviewed-by: Max

Re: [Qemu-block] [PATCH] tests: Avoid non-portable 'echo -ARG'

2017-06-30 Thread Eric Blake
On 06/30/2017 09:38 AM, Max Reitz wrote: > On 2017-06-28 16:21, Eric Blake wrote: >> POSIX says that backslashes in the arguments to 'echo', as well as >> any use of 'echo -n' and 'echo -e', are non-portable; it recommends >> people should favor 'printf' instead. This is definitely true where >>

Re: [Qemu-block] [PATCH] tests: Avoid non-portable 'echo -ARG'

2017-06-30 Thread Max Reitz
On 2017-06-28 16:21, Eric Blake wrote: > POSIX says that backslashes in the arguments to 'echo', as well as > any use of 'echo -n' and 'echo -e', are non-portable; it recommends > people should favor 'printf' instead. This is definitely true where > we do not control which shell is running (such

Re: [Qemu-block] [RFC] QMP design: Fixing query-block and friends

2017-06-30 Thread Alberto Garcia
On Fri 30 Jun 2017 04:22:11 PM CEST, Kevin Wolf wrote: > Am 30.06.2017 um 15:01 hat Alberto Garcia geschrieben: >> On Tue 27 Jun 2017 06:31:45 PM CEST, Kevin Wolf wrote: >> > * Speaking of recursion: ImageInfo recursively includes information >> > about all images in the backing chain. This is

Re: [Qemu-block] [RFC] QMP design: Fixing query-block and friends

2017-06-30 Thread Kevin Wolf
Am 30.06.2017 um 15:01 hat Alberto Garcia geschrieben: > On Tue 27 Jun 2017 06:31:45 PM CEST, Kevin Wolf wrote: > > * Speaking of recursion: ImageInfo recursively includes information > > about all images in the backing chain. This is what makes the output > > of query-named-block-nodes so

Re: [Qemu-block] [PATCH v6 0/5] Improve I/O tests coverage of LUKS driver

2017-06-30 Thread Max Reitz
On 2017-06-26 14:35, Daniel P. Berrange wrote: > The main goal of this series is to get the I/O tests passing > 100% with LUKS when run with './check -luks'. It also adds a > few more combinations to the LUKS/dmcrypt interoperability > test. > > To make LUKS testing not quite as slow, we drop the

Re: [Qemu-block] [RFC] QMP design: Fixing query-block and friends

2017-06-30 Thread Alberto Garcia
On Tue 27 Jun 2017 06:31:45 PM CEST, Kevin Wolf wrote: > * Speaking of recursion: ImageInfo recursively includes information > about all images in the backing chain. This is what makes the output > of query-named-block-nodes so redundant. It is also inconsistent > because the runtime

Re: [Qemu-block] [PATCH 0/6] virtio: use ioeventfd in TCG and qtest mode

2017-06-30 Thread Stefan Hajnoczi
On Wed, Jun 28, 2017 at 07:47:18PM +0100, Stefan Hajnoczi wrote: > This patch series fixes qemu-iotests 068. Since commit > ea4f3cebc4e0224605ab9dd9724aa4e7768fe372 ("qemu-iotests: 068: test iothread > mode") the test case has attempted to use dataplane without -M accel=kvm. > Although QEMU is

Re: [Qemu-block] [Qemu-devel] [PATCH v1 2/3] util/oslib-win32: Remove invalid check

2017-06-30 Thread Peter Maydell
On 29 June 2017 at 18:16, Alistair Francis wrote: > There is no way nhandles can be zero in this section so that part of the > if statement will always be false. Let's just remove it to make the code > easier to read. > > Signed-off-by: Alistair Francis

Re: [Qemu-block] [PATCH v1 2/3] util/oslib-win32: Remove invalid check

2017-06-30 Thread Paolo Bonzini
On 29/06/2017 19:16, Alistair Francis wrote: > There is no way nhandles can be zero in this section so that part of the > if statement will always be false. Let's just remove it to make the code > easier to read. > > Signed-off-by: Alistair Francis > Acked-by:

Re: [Qemu-block] [PATCH] tests: Avoid non-portable 'echo -ARG'

2017-06-30 Thread Stefan Hajnoczi
On Wed, Jun 28, 2017 at 09:21:37AM -0500, Eric Blake wrote: > POSIX says that backslashes in the arguments to 'echo', as well as > any use of 'echo -n' and 'echo -e', are non-portable; it recommends > people should favor 'printf' instead. This is definitely true where > we do not control which