Re: [Qemu-block] [Qemu-devel] [PATCH v4 13/14] block: Switch blk_write_zeroes() to byte interface

2016-04-29 Thread Eric Blake
On 04/29/2016 02:08 PM, Eric Blake wrote: > Sector-based blk_write() should die; convert the one-off > variant blk_write_zeroes(). > > Signed-off-by: Eric Blake > Acked-by: Denis V. Lunev > --- > +++ b/include/sysemu/block-backend.h > @@ -96,8 +96,8 @@ int blk_pread_unthrottled(BlockBackend *bl

[Qemu-block] [PATCH v4 11/14] qemu-io: Switch to byte-based block access

2016-04-29 Thread Eric Blake
blk_write() and blk_read() are now very simple wrappers around blk_pwrite() and blk_pread(). There's no reason to require the user to pass in aligned numbers. Keep 'read -p' and 'write -p' so that I don't have to hunt down and update all users of qemu-io, but make the default 'read' and 'write' n

[Qemu-block] [PATCH v4 10/14] qemu-img: Switch to byte-based block access

2016-04-29 Thread Eric Blake
Sector-based blk_write() should die; switch to byte-based blk_pwrite() instead. Likewise for blk_read(). Signed-off-by: Eric Blake --- qemu-img.c | 28 +++- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 46f2a6d..c19f9d4 1006

[Qemu-block] [PATCH v4 04/14] onenand: Switch to byte-based block access

2016-04-29 Thread Eric Blake
Sector-based blk_write() should die; switch to byte-based blk_pwrite() instead. Likewise for blk_read(). Signed-off-by: Eric Blake --- Not compile tested - I'm not sure what else I'd need in my environment to actually test this one. I have: Fedora 23, dnf builddep qemu ./configure --enable-kvm

[Qemu-block] [PATCH v4 01/14] block: Allow BDRV_REQ_FUA through blk_pwrite()

2016-04-29 Thread Eric Blake
We have several block drivers that understand BDRV_REQ_FUA, and emulate it in the block layer for the rest by a full flush. But without a way to actually request BDRV_REQ_FUA during a pass-through blk_pwrite(), FUA-aware block drivers like NBD are forced to repeat the emulation logic of a full flus

[Qemu-block] [PATCH v4 05/14] pflash: Switch to byte-based block access

2016-04-29 Thread Eric Blake
Sector-based blk_write() should die; switch to byte-based blk_pwrite() instead. Likewise for blk_read(). Signed-off-by: Eric Blake --- hw/block/pflash_cfi01.c | 12 ++-- hw/block/pflash_cfi02.c | 12 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/block/

[Qemu-block] [PATCH v4 07/14] m25p80: Switch to byte-based block access

2016-04-29 Thread Eric Blake
Sector-based blk_read() should die; switch to byte-based blk_pread() instead. Signed-off-by: Eric Blake --- Not compile tested - I'm not sure what else I'd need in my environment to actually test this one. I have: Fedora 23, dnf builddep qemu ./configure --enable-kvm --enable-system --disable-u

[Qemu-block] [PATCH v4 13/14] block: Switch blk_write_zeroes() to byte interface

2016-04-29 Thread Eric Blake
Sector-based blk_write() should die; convert the one-off variant blk_write_zeroes(). Signed-off-by: Eric Blake Acked-by: Denis V. Lunev --- include/sysemu/block-backend.h | 4 ++-- block/block-backend.c | 8 block/parallels.c | 3 ++- qemu-img.c

[Qemu-block] [PATCH v4 14/14] block: Kill blk_write(), blk_read()

2016-04-29 Thread Eric Blake
Now that there are no remaining clients, we can drop these functions, to ensure that all future users get the byte-based interfaces. Sadly, there are still remaining sector-based interfaces, such as blk_aio_writev; those will have to wait for another day. Signed-off-by: Eric Blake --- include/s

[Qemu-block] [PATCH v4 02/14] fdc: Switch to byte-based block access

2016-04-29 Thread Eric Blake
Sector-based blk_write() should die; switch to byte-based blk_pwrite() instead. Likewise for blk_read(). Signed-off-by: Eric Blake --- hw/block/fdc.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/hw/block/fdc.c b/hw/block/fdc.c index 3722275..f73

[Qemu-block] [PATCH v4 03/14] nand: Switch to byte-based block access

2016-04-29 Thread Eric Blake
Sector-based blk_write() should die; switch to byte-based blk_pwrite() instead. Likewise for blk_read(). This file is doing some complex computations to map various flash page sizes (256, 512, and 2048) atop generic uses of 512-byte sector operations. Perhaps someone will want to tidy up the fil

[Qemu-block] [PATCH v4 12/14] block: Switch blk_read_unthrottled() to byte interface

2016-04-29 Thread Eric Blake
Sector-based blk_read() should die; convert the one-off variant blk_read_unthrottled(). Signed-off-by: Eric Blake --- include/sysemu/block-backend.h | 4 ++-- block/block-backend.c | 8 hw/block/hd-geometry.c | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) dif

[Qemu-block] [PATCH v4 08/14] atapi: Switch to byte-based block access

2016-04-29 Thread Eric Blake
Sector-based blk_read() should die; switch to byte-based blk_pread() instead. Add new defines ATAPI_SECTOR_BITS and ATAPI_SECTOR_SIZE to use anywhere we were previously scaling BDRV_SECTOR_* by 4, for better legibility. Signed-off-by: Eric Blake --- v4: add new defines for use in more places [j

Re: [Qemu-block] [PATCH v9 07/11] block: Add QMP support for streaming to an intermediate layer

2016-04-29 Thread Eric Blake
On 04/04/2016 07:43 AM, Alberto Garcia wrote: > This patch makes the 'device' parameter of the 'block-stream' command > accept a node name as well as a device name. > > In addition to that, operation blockers will be checked in all > intermediate nodes between the top and the base node. > > Since

Re: [Qemu-block] [PATCH v9 05/11] block: allow block jobs in any arbitrary node

2016-04-29 Thread Eric Blake
On 04/04/2016 07:43 AM, Alberto Garcia wrote: > Currently, block jobs can only be owned by root nodes. This patch > allows block jobs to be in any arbitrary node, by making the following > changes: > > - Block jobs can now be identified by the node name of their > BlockDriverState in addition to

Re: [Qemu-block] [PATCH v9 07/11] block: Add QMP support for streaming to an intermediate layer

2016-04-29 Thread Kevin Wolf
Am 28.04.2016 um 14:20 hat Alberto Garcia geschrieben: > On Wed 27 Apr 2016 03:34:19 PM CEST, Max Reitz wrote: > >> +/* Look for the top-level node that contains 'bs' in its chain */ > >> +active = NULL; > >> +do { > >> +active = bdrv_next(active); > >> +} while (active &&

Re: [Qemu-block] [PATCH v9 07/11] block: Add QMP support for streaming to an intermediate layer

2016-04-29 Thread Kevin Wolf
Am 04.04.2016 um 15:43 hat Alberto Garcia geschrieben: > This patch makes the 'device' parameter of the 'block-stream' command > accept a node name as well as a device name. > > In addition to that, operation blockers will be checked in all > intermediate nodes between the top and the base node. >

Re: [Qemu-block] [PATCH v9 06/11] block: Support streaming to an intermediate layer

2016-04-29 Thread Kevin Wolf
Am 04.04.2016 um 15:43 hat Alberto Garcia geschrieben: > This makes sure that the image we are steaming into is open in s/steaming/streaming/ > read-write mode during the operation. > > The block job is created on the destination image, but operation > blockers are also set on the active layer.

Re: [Qemu-block] [PATCH v9 05/11] block: allow block jobs in any arbitrary node

2016-04-29 Thread Kevin Wolf
Am 04.04.2016 um 15:43 hat Alberto Garcia geschrieben: > Currently, block jobs can only be owned by root nodes. This patch > allows block jobs to be in any arbitrary node, by making the following > changes: > > - Block jobs can now be identified by the node name of their > BlockDriverState in ad

Re: [Qemu-block] [PATCH v9 04/11] block: use the block job list in bdrv_close()

2016-04-29 Thread Kevin Wolf
Am 04.04.2016 um 15:43 hat Alberto Garcia geschrieben: > bdrv_close_all() cancels all block jobs by iterating over all > BlockDriverStates. This patch simplifies the code by iterating > directly over the block jobs using block_job_next(). > > Signed-off-by: Alberto Garcia This is essentially the

Re: [Qemu-block] [PATCH v9 03/11] block: use the block job list in qmp_query_block_jobs()

2016-04-29 Thread Kevin Wolf
Am 04.04.2016 um 15:43 hat Alberto Garcia geschrieben: > qmp_query_block_jobs() uses bdrv_next() to look for block jobs, but > this function can only find those in top-level BlockDriverStates. > > This patch uses block_job_next() instead. > > Signed-off-by: Alberto Garcia Reviewed-by: Kevin Wol

Re: [Qemu-block] [PATCH v9 02/11] block: use the block job list in bdrv_drain_all()

2016-04-29 Thread Kevin Wolf
Am 04.04.2016 um 15:43 hat Alberto Garcia geschrieben: > bdrv_drain_all() pauses all block jobs by using bdrv_next() to iterate > over all top-level BlockDriverStates. Therefore the code is unable to > find block jobs in other nodes. > > This patch uses block_job_next() to iterate over all block j

Re: [Qemu-block] [PATCH v9 01/11] block: keep a list of block jobs

2016-04-29 Thread Kevin Wolf
Am 04.04.2016 um 15:43 hat Alberto Garcia geschrieben: > The current way to obtain the list of existing block jobs is to > iterate over all root nodes and check which ones own a job. > > Since we want to be able to support block jobs in other nodes as well, > this patch keeps a list of jobs that i

Re: [Qemu-block] [Qemu-devel] [PATCH v2 13/17] vmdk: Implement .bdrv_co_pwritev() interface

2016-04-29 Thread Pavel Butsykin
On 29.04.2016 06:08, Fam Zheng wrote: On Thu, 04/28 15:16, Kevin Wolf wrote: +typedef struct VmdkWriteCompressedCo { +BlockDriverState *bs; +int64_t sector_num; +const uint8_t *buf; +int nb_sectors; +int ret; +} VmdkWriteCompressedCo; + +static void vmdk_co_write_compressed(v

[Qemu-block] [PATCH v2] block: always compile-check debug prints

2016-04-29 Thread Zhou Jie
Files with conditional debug statements should ensure that the printf is always compiled. This prevents bitrot of the format string of the debug statement. Signed-off-by: Zhou Jie --- block/curl.c | 10 -- block/sheepdog.c | 13 - 2 files changed, 16 insertions(+), 7 dele

[Qemu-block] [PATCH v3] block: always compile-check debug prints

2016-04-29 Thread Zhou Jie
Files with conditional debug statements should ensure that the printf is always compiled. This prevents bitrot of the format string of the debug statement. Signed-off-by: Zhou Jie Reviewed-by: Eric Blake --- v1 -> v2: * Keep the user-visible witness as defined/undefined, and create a seconda

Re: [Qemu-block] [Qemu-devel] [PATCH v2 13/17] vmdk: Implement .bdrv_co_pwritev() interface

2016-04-29 Thread Pavel Butsykin
On 29.04.2016 12:49, Kevin Wolf wrote: Am 29.04.2016 um 10:49 hat Pavel Butsykin geschrieben: On 29.04.2016 06:08, Fam Zheng wrote: On Thu, 04/28 15:16, Kevin Wolf wrote: static int vmdk_write_compressed(BlockDriverState *bs, int64_t sector_num,

[Qemu-block] [PATCH v4] block: always compile-check debug prints

2016-04-29 Thread Zhou Jie
Files with conditional debug statements should ensure that the printf is always compiled. This prevents bitrot of the format string of the debug statement. And switch debug output to stderr. Signed-off-by: Zhou Jie Reviewed-by: Eric Blake --- v3 -> v4: * Alter commit message to add "And switch

Re: [Qemu-block] [PULL 0/2] vvfat fixes for 2.6.0-rc4

2016-04-29 Thread Peter Maydell
On 29 April 2016 at 10:55, Kevin Wolf wrote: > The following changes since commit 0d48dfedc5c2beb418ad4c08b78de14e794bb199: > > slirp: fix guest network access with darwin host (2016-04-28 18:12:08 +0100) > > are available in the git repository at: > > git://repo.or.cz/qemu/kevin.git tags/for-

Re: [Qemu-block] [PATCH v2 00/13] block: Move I/O throttling to BlockBackend

2016-04-29 Thread Alberto Garcia
On Fri 29 Apr 2016 12:01:08 PM CEST, Kevin Wolf wrote: >> This is another feature that was "logically" part of the >> BlockBackend, but implemented as a BlockDriverState feature. It was >> always kept on top using swap_feature_fields(). >> >> This series moves it to be actually implemented in the

Re: [Qemu-block] [Qemu-devel] [PATCH v2 13/17] vmdk: Implement .bdrv_co_pwritev() interface

2016-04-29 Thread Kevin Wolf
Am 29.04.2016 um 10:49 hat Pavel Butsykin geschrieben: > On 29.04.2016 06:08, Fam Zheng wrote: > >On Thu, 04/28 15:16, Kevin Wolf wrote: > >> static int vmdk_write_compressed(BlockDriverState *bs, > >> int64_t sector_num, > >> con

[Qemu-block] [PULL 2/2] vvfat: Fix default volume label

2016-04-29 Thread Kevin Wolf
Commit d5941dd documented that it leaves the default volume name as it was ("QEMU VVFAT"), but it doesn't actually implement this. You get an empty name (eleven space characters) instead. This fixes the implementation to apply the advertised default. Cc: qemu-sta...@nongnu.org Signed-off-by: Kevi

Re: [Qemu-block] [PATCH v2 00/13] block: Move I/O throttling to BlockBackend

2016-04-29 Thread Kevin Wolf
Am 22.04.2016 um 19:42 hat Kevin Wolf geschrieben: > This is another feature that was "logically" part of the BlockBackend, but > implemented as a BlockDriverState feature. It was always kept on top using > swap_feature_fields(). > > This series moves it to be actually implemented in the BlockBack

[Qemu-block] [PULL 0/2] vvfat fixes for 2.6.0-rc4

2016-04-29 Thread Kevin Wolf
The following changes since commit 0d48dfedc5c2beb418ad4c08b78de14e794bb199: slirp: fix guest network access with darwin host (2016-04-28 18:12:08 +0100) are available in the git repository at: git://repo.or.cz/qemu/kevin.git tags/for-upstream for you to fetch changes up to d208c50d9dbf98c0

Re: [Qemu-block] [PATCH v2 00/17] block: Convert .bdrv_read/write to .bdrv_preadv/pwritev

2016-04-29 Thread Kevin Wolf
Am 28.04.2016 um 15:16 hat Kevin Wolf geschrieben: > This series introduces a new BlockDriver interface, which will hopefully be > the > final one, or at least good enough for another few years: > .bdrv_preadv/pwritev. > It is based on coroutines, vectored, has flags and uses a byte granularity.

[Qemu-block] [PULL 1/2] vvfat: Fix volume name assertion

2016-04-29 Thread Kevin Wolf
Commit d5941dd made the volume name configurable, but it didn't consider that the rw code compares the volume name string to assert that the first directory entry is the volume name. This made vvfat crash in rw mode. This fixes the assertion to compare with the configured volume name instead of a

Re: [Qemu-block] [PATCH v2 1/2] vvfat: Fix volume name assertion

2016-04-29 Thread Stefan Hajnoczi
On Thu, Apr 28, 2016 at 01:36:05PM +0200, Kevin Wolf wrote: > Commit d5941dd made the volume name configurable, but it didn't consider > that the rw code compares the volume name string to assert that the > first directory entry is the volume name. This made vvfat crash in rw > mode. > > This fixe

Re: [Qemu-block] [PATCH v2 2/2] vvfat: Fix default volume label

2016-04-29 Thread Stefan Hajnoczi
On Thu, Apr 28, 2016 at 01:36:06PM +0200, Kevin Wolf wrote: > Commit d5941dd documented that it leaves the default volume name as it > was ("QEMU VVFAT"), but it doesn't actually implement this. You get an > empty name (eleven space characters) instead. > > This fixes the implementation to apply t

Re: [Qemu-block] [PATCH v2 13/17] vmdk: Implement .bdrv_co_pwritev() interface

2016-04-29 Thread Kevin Wolf
Am 29.04.2016 um 05:08 hat Fam Zheng geschrieben: > On Thu, 04/28 15:16, Kevin Wolf wrote: > > +typedef struct VmdkWriteCompressedCo { > > +BlockDriverState *bs; > > +int64_t sector_num; > > +const uint8_t *buf; > > +int nb_sectors; > > +int ret; > > +} VmdkWriteCompressedCo; >