[Qemu-block] [PATCH for-2.10? v2 2/2] file-posix: Do runtime check for ofd lock API

2017-08-11 Thread Fam Zheng
e <ebl...@redhat.com> Signed-off-by: Fam Zheng <f...@redhat.com> --- block/file-posix.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index f4de022ae0..cb3bfce147 100644 --- a/block/file-posix.c +++ b/

[Qemu-block] [PATCH for-2.10? v2 0/2] block: Do OFD lock check at runtime

2017-08-11 Thread Fam Zheng
for Linux considering it's possible to run QEMU which is built against a new glibc on an old kernel that doesn't have OFD API. Convert to runtime check to cope with that. Fam Zheng (2): osdep: Add runtime OFD lock detection file-posix: Do runtime check for ofd lock API block/file-posix.c

[Qemu-block] [PATCH for-2.11 v2] file-posix: Clear out first sector in hdev_create

2017-08-11 Thread Fam Zheng
out the first sector to make sure the stale qcow2 header doesn't cause such confusion. Signed-off-by: Fam Zheng <f...@redhat.com> --- v2: Use stack allocated buffer. [Eric] Fix return value. (Keep qemu_write_full instead of switching to qemu_pwritev because the former handles short w

Re: [Qemu-block] [Qemu-devel] [PATCH] file-posix: Clear out first sector in hdev_create

2017-08-11 Thread Fam Zheng
On Fri, 08/11 15:44, Xie Changlong wrote: > 在 8/10/2017 4:01 PM, Fam Zheng 写道: > > People get surprised when, after "qemu-imc create -f raw /dev/sdX", they > > s/qemu-imc/qemu-img/ Thanks, will fix in v2. Fam

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10?] file-posix: Clear out first sector in hdev_create

2017-08-11 Thread Fam Zheng
On Fri, 08/11 15:28, Fam Zheng wrote: > On Thu, 08/10 08:58, Eric Blake wrote: > > On 08/10/2017 03:01 AM, Fam Zheng wrote: > > > +if (total_size) { > > > +int64_t zero_size = MIN(BDRV_SECTOR_SIZE, total_size); > > > +uint8_t *buf; >

Re: [Qemu-block] [Qemu-devel] [PATCH for-2.10?] file-posix: Clear out first sector in hdev_create

2017-08-11 Thread Fam Zheng
On Thu, 08/10 08:58, Eric Blake wrote: > On 08/10/2017 03:01 AM, Fam Zheng wrote: > > People get surprised when, after "qemu-imc create -f raw /dev/sdX", they > > still see qcow2 with "qemu-img info", if previously the bdev had a qcow2 > > header. While

[Qemu-block] [PATCH] file-posix: Clear out first sector in hdev_create

2017-08-10 Thread Fam Zheng
out the first sector to make sure the stale qcow2 header doesn't cause such a confusion. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/file-posix.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/block/file-posix.c b/block/file-posix.c index f4de022ae0..1d8ef6f873 10064

Re: [Qemu-block] [Qemu-devel] [PATCH] virtio-blk: handle blk_getlength() errors

2017-08-08 Thread Fam Zheng
; +length = blk_getlength(s->blk); > +if (length > 0 && length / conf->heads / conf->secs % blk_size) { > blkcfg.geometry.sectors = conf->secs & ~s->sector_mask; > } else { > blkcfg.geometry.sectors = conf->secs; > -- > 2.13.3 > > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH] block: document semanatics of bdrv_co_preadv|pwritev

2017-08-07 Thread Fam Zheng
On Fri, 08/04 16:49, Daniel P. Berrange wrote: > This is odd. In the bdrv_aligned_readv() it looks very much like > we'll reference qiov->niov, if bytes != 0, so if qiov was NULL we > would crash. It doesn't make sense if read doesn't have an iov, where should the data be placed? :) > > In

[Qemu-block] [PATCH for-2.10] vmdk: Fix error handling/reporting of vmdk_check

2017-08-04 Thread Fam Zheng
Errors from the callees must be captured and propagated to our caller, ensure this for both find_extent() and bdrv_getlength(). Reported-by: Markus Armbruster <arm...@redhat.com> Signed-off-by: Fam Zheng <f...@redhat.com> --- block/vmdk.c | 26 ++ 1 file

[Qemu-block] [PATCH v2] qemu-img: Clarify about relative backing file options

2017-08-04 Thread Fam Zheng
this explicitly, so that users don't have to learn from mistakes. Signed-off-by: Fam Zheng <f...@redhat.com> --- v2: Improve wording. [Eric] --- qemu-img.texi | 9 + 1 file changed, 9 insertions(+) diff --git a/qemu-img.texi b/qemu-img.texi index 72dabd6b3e..90c7eab4a8 100644 ---

Re: [Qemu-block] [PATCH] qemu-img: Clarify about relative backing file options

2017-08-04 Thread Fam Zheng
On Fri, 08/04 09:23, Eric Blake wrote: > > +If a relative path name is given, the backing file is looked up against > > +@var{filename}, rather than the current working directory. > > Maybe better as: > the backing file is looked up relative to the directory containing > @var{filename} Sounds

[Qemu-block] [PATCH] qemu-img: Clarify about relative backing file options

2017-08-04 Thread Fam Zheng
this explicitly, so that users don't have to learn from mistakes. Signed-off-by: Fam Zheng <f...@redhat.com> --- qemu-img.texi | 9 + 1 file changed, 9 insertions(+) diff --git a/qemu-img.texi b/qemu-img.texi index 72dabd6b3e..cf079f90e2 100644 --- a/qemu-img.texi +++ b/qemu-im

Re: [Qemu-block] Is the use of bdrv_getlength() in vmdk_check() kosher?

2017-08-04 Thread Fam Zheng
On Fri, 08/04 15:28, Markus Armbruster wrote: > Have a look at vmdk_check(): > > if (ret == VMDK_OK && > cluster_offset >= bdrv_getlength(extent->file->bs)) > > bdrv_getlength() can fail. Does it do the right thing then? For what > it's worth, the comparison of its value is

Re: [Qemu-block] [PATCH 40/47] MAINTAINERS: add missing entry for AIO

2017-07-28 Thread Fam Zheng
AINTAINERS > +++ b/MAINTAINERS > @@ -1253,6 +1253,7 @@ F: util/aio-*.c > F: block/io.c > F: migration/block* > F: include/block/aio.h > +F: scripts/qemugdb/aio.py > T: git git://github.com/stefanha/qemu.git block > > Block Jobs > -- > 2.13.3 > Acked-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH 38/47] MAINTAINERS: update docs/interop/ entries

2017-07-28 Thread Fam Zheng
git bitmaps > T: git git://github.com/jnsnow/qemu.git bitmaps > > @@ -1852,7 +1852,7 @@ M: Denis V. Lunev <d...@openvz.org> > L: qemu-block@nongnu.org > S: Supported > F: block/parallels.c > -F: docs/specs/parallels.txt > +F: docs/interop/parallels.txt > >

Re: [Qemu-block] [Qemu-devel] [PATCH v7 0/8] Optimize VMDK I/O by allocating multiple clusters

2017-07-27 Thread Fam Zheng
There is a minor regression as I replied inline, otherwise: Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v7 6/8] vmdk: New functions to assist allocating multiple clusters

2017-07-27 Thread Fam Zheng
On Thu, 06/29 14:53, Ashijeet Acharya wrote: > +/* > + * vmdk_handle_alloc > + * > + * Allocate new clusters for an area that either is yet unallocated or needs > a > + * copy on write. > + * > + * Returns: > + * VMDK_OK: if new clusters were allocated, *bytes may be decreased > if > + *

[Qemu-block] [PATCH 2/2] file-posix: Do runtime check for ofd lock API

2017-07-21 Thread Fam Zheng
Let's do a runtime check to cope with that. Reported-by: Andrew Baumann <andrew.baum...@microsoft.com> Signed-off-by: Fam Zheng <f...@redhat.com> --- block/file-posix.c | 19 --- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/block/file-posix.c b/block/

[Qemu-block] [PATCH 0/2] block: Do OFD lock check at runtime

2017-07-21 Thread Fam Zheng
o lock > byte 100 It appears to be that the binary is built for Linux targets, but the WSL runtime doesn't recognize the ops (-EINVAL). Convert to runtime check to cope with that. Fam Zheng (2): osdep: Add runtime OFD lock detection file-posix: Do runtime check for ofd lock API block/file-posix.c

[Qemu-block] [PATCH 1/2] osdep: Add runtime OFD lock detection

2017-07-21 Thread Fam Zheng
Build time check of OFD lock is not sufficient and can cause image open errors when the runtime environment doesn't support it. Add a helper function to probe it at runtime, additionally. Also provide a qemu_has_ofd_lock() for callers to check the status. Signed-off-by: Fam Zheng &l

Re: [Qemu-block] [Qemu-devel] [PATCH 08/11] qed: introduce bdrv_qed_init_state

2017-07-16 Thread Fam Zheng
On Thu, 06/29 15:27, Paolo Bonzini wrote: > diff --git a/block/qed.c b/block/qed.c > index db390efdbd..8228a50f68 100644 > --- a/block/qed.c > +++ b/block/qed.c > @@ -363,6 +363,15 @@ static void coroutine_fn > bdrv_qed_co_drain(BlockDriverState *bs) > } > } > > +static void

Re: [Qemu-block] [Qemu-devel] qcow2 not cleaning up during image create failure

2017-07-14 Thread Fam Zheng
On Fri, 07/14 12:00, Daniel P. Berrange wrote: > I've just been looking at the qcow2 image creation code, and found that > if any method in qcow2_create2() returns an error, then we'll report that, > but leave the newly created image file on disk in some partially initialized > state. A user may

Re: [Qemu-block] [PATCH v3 2/6] block: Add VFIO based NVMe driver

2017-07-11 Thread Fam Zheng
On Mon, 07/10 15:55, Stefan Hajnoczi wrote: > On Wed, Jul 05, 2017 at 09:36:31PM +0800, Fam Zheng wrote: > > +static bool nvme_identify(BlockDriverState *bs, int namespace, Error > > **errp) > > +{ > > +BDRVNVMeState *s = bs->opaque; > > +uint8_t *res

Re: [Qemu-block] [PATCH v3 3/6] block: Introduce bdrv_dma_map and bdrv_dma_unmap

2017-07-11 Thread Fam Zheng
On Tue, 07/11 12:28, Paolo Bonzini wrote: > On 11/07/2017 12:05, Stefan Hajnoczi wrote: > > On Mon, Jul 10, 2017 at 05:08:56PM +0200, Paolo Bonzini wrote: > >> On 10/07/2017 17:07, Stefan Hajnoczi wrote: > >>> On Wed, Jul 05, 2017 at 09:36:32PM +0800, Fam Zheng wr

Re: [Qemu-block] [Qemu-devel] [PATCH v4 0/4] Add shrink image for qcow2

2017-07-11 Thread Fam Zheng
On Tue, 07/11 16:35, Pavel Butsykin wrote: > On 11.07.2017 16:14, no-re...@patchew.org wrote: > > Hi, > > > > This series failed build test on s390x host. Please find the details below. > > > > Type: series > > Subject: [Qemu-devel] [PATCH v4 0/4] Add shrink image for qcow2 > > Message-id:

Re: [Qemu-block] [Qemu-devel] [PATCH v2 00/11] Block layer thread-safety, part 2

2017-07-10 Thread Fam Zheng
On Thu, 06/29 15:27, Paolo Bonzini wrote: > This part takes care of drivers and devices, making sure that they can > accept concurrent I/O from multiple AioContext. > > The following drivers are thread-safe without using any QemuMutex/CoMutex: > crypto, gluster, null, rbd, win32-aio. NBD has

Re: [Qemu-block] [Qemu-devel] [PATCH 04/11] vpc: make it thread-safe

2017-07-10 Thread Fam Zheng
On Thu, 06/29 15:27, Paolo Bonzini wrote: > Reviewed-by: Eric Blake > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Paolo Bonzini > --- > block/vpc.c | 20 ++-- > 1 file changed, 10 insertions(+), 10 deletions(-) > >

Re: [Qemu-block] [Qemu-devel] [PATCH] MAINTAINERS: Promote NBD to supported, with new maintainer

2017-07-10 Thread Fam Zheng
On Fri, 07/07 13:21, Eric Blake wrote: > We are promising more than just odd fixes, and Paolo is hoping > to offload the pull requests to me. Also, enough of NBD is related > to the block layer that it is worth including qemu-block on patches. Cool! > > Signed-off-by: Eric Blake

Re: [Qemu-block] [Qemu-devel] [PATCH 1/1] block: fix possible return code clobbering in bdrv_co_pdiscard

2017-07-10 Thread Fam Zheng
On Mon, 07/10 11:35, Denis V. Lunev wrote: > Signed-off-by: Denis V. Lunev <d...@openvz.org> > CC: Stefan Hajnoczi <stefa...@redhat.com> (supporter:Block I/O path) > CC: Fam Zheng <f...@redhat.com> (supporter:Block I/O path) Maybe use "--noroles"? The

Re: [Qemu-block] [PATCH] block/vmdk: Report failures in vmdk_read_cid()

2017-07-09 Thread Fam Zheng
ropriately. > > This fixes in passing a Coverity-spotted issue (CID 1350038) where > we weren't checking the return value from sscanf(). > > Signed-off-by: Peter Maydell <peter.mayd...@linaro.org> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 00/11] Block layer thread-safety, next part

2017-07-06 Thread Fam Zheng
On Thu, 07/06 16:48, no-re...@patchew.org wrote: > fatal: Cannot update paths and switch to branch 'test' at the same time. > Did you intend to checkout > 'origin/patchew/20170706163828.24082-1-pbonz...@redhat.com' which can not be > resolved as commit? > Traceback (most recent call last): >

Re: [Qemu-block] [Qemu-devel] [PATCH v2 00/11] Block layer thread-safety, part 2

2017-07-06 Thread Fam Zheng
On Thu, 07/06 16:50, no-re...@patchew.org wrote: > Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 > fatal: Cannot update paths and switch to branch 'test' at the same time. > Did you intend to checkout > 'origin/patchew/20170629132749.997-1-pbonz...@redhat.com' which can not be > resolved as

Re: [Qemu-block] [Qemu-devel] [RFC v1 0/4] Windows runtime improvements

2017-07-06 Thread Fam Zheng
On Thu, 07/06 16:48, no-re...@patchew.org wrote: > Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 > fatal: Cannot update paths and switch to branch 'test' at the same time. > Did you intend to checkout > 'origin/patchew/cover.1498607452.git.alistair.fran...@xilinx.com' which can > not be

Re: [Qemu-block] [Qemu-devel] [PATCH] block: fix bs->file leak in bdrv_new_open_driver()

2017-07-06 Thread Fam Zheng
On Thu, 07/06 16:49, no-re...@patchew.org wrote: > Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 > fatal: Cannot update paths and switch to branch 'test' at the same time. > Did you intend to checkout > 'origin/patchew/20170629060300.29869-1-el13...@mail.ntua.gr' which can not be > resolved

Re: [Qemu-block] [Qemu-devel] [PATCH V2 0/8] add Qcow2 compress format extension

2017-07-06 Thread Fam Zheng
On Thu, 07/06 16:49, no-re...@patchew.org wrote: > Hi, > > This series seems to have some coding style problems. See output below for > more information: > > Subject: [Qemu-devel] [PATCH V2 0/8] add Qcow2 compress format extension > Message-id: 1498733831-15254-1-git-send-email...@kamp.de >

Re: [Qemu-block] [Qemu-devel] [PATCH v2] docs: add qemu-block-drivers(7) man page

2017-07-06 Thread Fam Zheng
On Thu, 07/06 16:48, no-re...@patchew.org wrote: > Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 > fatal: unable to access 'https://github.com/patchew-project/qemu/': Could not > resolve host: github.com > error: Could not fetch 3c8cf5a9c21ff8782164d1def7f44bd888713384 > Traceback (most

Re: [Qemu-block] [PATCH v3 2/6] block: Add VFIO based NVMe driver

2017-07-06 Thread Fam Zheng
On Thu, 07/06 13:38, Keith Busch wrote: > On Wed, Jul 05, 2017 at 09:36:31PM +0800, Fam Zheng wrote: > > This is a new protocol driver that exclusively opens a host NVMe > > controller through VFIO. It achieves better latency than linux-aio by > > completely bypassing host k

Re: [Qemu-block] [Qemu-devel] [PATCH v3 0/6] block: Add VFIO based driver for NVMe device

2017-07-06 Thread Fam Zheng
On Thu, 07/06 16:22, Paolo Bonzini wrote: > > > On 06/07/2017 16:06, no-re...@patchew.org wrote: > > ERROR: Use of volatile is usually wrong: see > > Documentation/volatile-considered-harmful.txt > > #843: FILE: block/nvme.c:40: > > +volatile uint32_t *doorbell; > > > > ERROR: Use of

Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated()

2017-07-05 Thread Fam Zheng
On Wed, 07/05 09:01, Eric Blake wrote: > On 07/05/2017 07:07 AM, Fam Zheng wrote: > >>> > >>> Sorry for bikeshedding. > >> > >> Not a problem, I also had some double-takes in writing my own code > >> trying to remember which way I wanted

[Qemu-block] [PATCH v3 5/6] qemu-img: Map bench buffer

2017-07-05 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- qemu-img.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 91ad6be..fea156c 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -3875,6 +3875,7 @@ static int img_bench(int argc, char

[Qemu-block] [PATCH v3 6/6] block: Move NVMe spec definitions to a separate header

2017-07-05 Thread Fam Zheng
Signed-off-by: Fam Zheng <f...@redhat.com> --- block/nvme.c| 7 +- block/nvme.h| 700 hw/block/nvme.h | 698 +-- 3 files changed, 702 insertions(+), 703 deletions(-) creat

[Qemu-block] [PATCH v3 4/6] block/nvme: Implement .bdrv_dma_map and .bdrv_dma_unmap

2017-07-05 Thread Fam Zheng
Forward these two calls to the IOVA manager. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/nvme.c | 17 + 1 file changed, 17 insertions(+) diff --git a/block/nvme.c b/block/nvme.c index eb999a1..7913017 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1056,6 +1

[Qemu-block] [PATCH v3 2/6] block: Add VFIO based NVMe driver

2017-07-05 Thread Fam Zheng
8269 8851 randread-512k-1 584 610 randwrite-4k-128601 34649 randwrite-512k-1 1809 1975 The driver also integrates with the polling mechanism of iothread. This patch is co-authored by Paolo and me. Signed-off-by: Fam Zheng <f...@redhat.

[Qemu-block] [PATCH v3 3/6] block: Introduce bdrv_dma_map and bdrv_dma_unmap

2017-07-05 Thread Fam Zheng
Allow block driver to map and unmap a buffer for later I/O, as a performance hint. Signed-off-by: Fam Zheng <f...@redhat.com> --- block/block-backend.c | 10 ++ block/io.c | 24 include/block/block.h | 2 ++ include

[Qemu-block] [PATCH v3 0/6] block: Add VFIO based driver for NVMe device

2017-07-05 Thread Fam Zheng
version. - Tests one: qemu-img bench, fio, bonnie++ and installation of ubuntu/fedora/rhel on QEMU emulated nvme and a Intel P3700 card. Fam Zheng (6): stubs: Add stubs for ram block API block: Add VFIO based NVMe driver block: Introduce bdrv_dma_map and bdrv_dma_unmap block

[Qemu-block] [PATCH v3 1/6] stubs: Add stubs for ram block API

2017-07-05 Thread Fam Zheng
These functions will be wanted by block-obj-y but the actual definition is in obj-y, so stub them to keep the linker happy. Signed-off-by: Fam Zheng <f...@redhat.com> Acked-by: Paolo Bonzini <pbonz...@redhat.com> --- stubs/Makefile.objs | 1 + stubs/ram-block.c | 16 +

Re: [Qemu-block] [PATCH v2 14/15] block: Align block status requests

2017-07-05 Thread Fam Zheng
On Wed, 07/05 07:01, Eric Blake wrote: > On 07/04/2017 04:44 AM, Fam Zheng wrote: > > On Mon, 07/03 17:14, Eric Blake wrote: > >> Any device that has request_alignment greater than 512 should be > >> unable to report status at a finer granularity; it may also be &g

Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated()

2017-07-05 Thread Fam Zheng
On Wed, 07/05 06:56, Eric Blake wrote: > On 07/04/2017 02:06 AM, Fam Zheng wrote: > > On Mon, 07/03 17:14, Eric Blake wrote: > >> @@ -1717,6 +1718,10 @@ int64_t coroutine_fn > >> bdrv_co_get_block_status_from_backing(BlockDriverState *bs, > >> * Driver

Re: [Qemu-block] [RFC PATCH v2 16/15] block: Add .bdrv_co_block_status() callback

2017-07-04 Thread Fam Zheng
On Mon, 07/03 17:20, Eric Blake wrote: > We are gradually moving away from sector-based interfaces, towards > byte-based. Now that the block layer exposes byte-based allocation, > it's time to tackle the drivers. Add a new callback that operates > on as small as byte boundaries. Subsequent

Re: [Qemu-block] [Qemu-devel] [PATCH v2 15/15] qemu-io: Relax 'alloc' now that block-status doesn't assert

2017-07-04 Thread Fam Zheng
atus at > unaligned boundaries, which also required tweaking the image > prep to leave an unallocated portion to the image under test. > > Signed-off-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v2 14/15] block: Align block status requests

2017-07-04 Thread Fam Zheng
On Mon, 07/03 17:14, Eric Blake wrote: > Any device that has request_alignment greater than 512 should be > unable to report status at a finer granularity; it may also be > simpler for such devices to be guaranteed that the block layer > has rounded things out to the granularity boundary (the way

Re: [Qemu-block] [Qemu-devel] [PATCH v2 13/15] block: Convert bdrv_get_block_status_above() to bytes

2017-07-04 Thread Fam Zheng
k_status(). But some > code, particularly bdrv_block_status(), gets a lot simpler because > it no longer has to mess with sectors. > > For ease of review, bdrv_get_block_status() was tackled separately. > > Signed-off-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 12/15] block: Switch bdrv_co_get_block_status_above() to byte-based

2017-07-04 Thread Fam Zheng
igned-off-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 10/15] block: Switch BdrvCoGetBlockStatusData to byte-based

2017-07-04 Thread Fam Zheng
igned-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 11/15] block: Switch bdrv_common_block_status_above() to byte-based

2017-07-04 Thread Fam Zheng
On Mon, 07/03 17:14, 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 <ebl...@redhat.com> > R

Re: [Qemu-block] [Qemu-devel] [PATCH v2 09/15] block: Switch bdrv_co_get_block_status() to byte-based

2017-07-04 Thread Fam Zheng
ccording to the driver's > request_alignment then touch up the result handed back to the > caller, to start permitting a caller to pass unaligned offsets. > > Signed-off-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 08/15] block: Convert bdrv_get_block_status() to bytes

2017-07-04 Thread Fam Zheng
the callers followed by inverse scaling at bdrv_block_status(). But > some code, particularly bdrv_is_allocated(), gets a lot simpler because > it no longer has to mess with sectors. > > For ease of review, bdrv_get_block_status_above() will be tackled > separately. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 07/15] qemu-img: Switch get_block_status() to byte-based

2017-07-04 Thread Fam Zheng
y: Eric Blake <ebl...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 04/15] block: Make bdrv_round_to_clusters() signature more useful

2017-07-04 Thread Fam Zheng
d type, then adjust clients > according to the required fallout. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 05/15] qcow2: Switch is_zero_sectors() to byte-based

2017-07-04 Thread Fam Zheng
y: Eric Blake <ebl...@redhat.com> > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 06/15] block: Switch bdrv_make_zero() to byte-based

2017-07-04 Thread Fam Zheng
t we iterate by steps > that are sector-aligned). > > Signed-off-by: Eric Blake <ebl...@redhat.com> > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 02/15] block: Allow NULL file for bdrv_get_block_status()

2017-07-04 Thread Fam Zheng
e full length of known-allocated data. > > Signed-off-by: Eric Blake <ebl...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 01/15] block: add default implementations for bdrv_co_get_block_status()

2017-07-04 Thread Fam Zheng
n recurse > to them. Future block drivers won't have to duplicate code to implement > this. > > Reviewed-by: Stefan Hajnoczi <stefa...@redhat.com> > Signed-off-by: Manos Pitsidianakis <el13...@mail.ntua.gr> > Message-Id: <20170629184320.7151-4-el13...@mail.ntua.gr> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH v2 03/15] block: Add flag to avoid wasted work in bdrv_is_allocated()

2017-07-04 Thread Fam Zheng
On Mon, 07/03 17:14, Eric Blake wrote: > @@ -1717,6 +1718,10 @@ int64_t coroutine_fn > bdrv_co_get_block_status_from_backing(BlockDriverState *bs, > * Drivers not implementing the functionality are assumed to not support > * backing files, hence all their sectors are reported as allocated. >

Re: [Qemu-block] [RFC v1 4/4] util/oslib-win32: Recursivly pass the timeout

2017-06-29 Thread Fam Zheng
On Tue, 06/27 16:57, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/oslib-win32.c | 21 + > 1 file changed, 17 insertions(+), 4 deletions(-) > > diff --git

Re: [Qemu-block] [RFC v1 3/4] util/oslib-win32: Fix up if conditional

2017-06-29 Thread Fam Zheng
) { > handles[i-1] = handles[i]; > } > -- > 2.11.0 > Reviewed-by: Fam Zheng <f...@redhat.com>

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

2017-06-29 Thread Fam Zheng
; -if (timeout != 0 || nhandles == 0) { > +if (timeout != 0) { > return 1; > } > > -- > 2.11.0 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [RFC v1 1/4] util/aio-win32: Only select on what we are actually waiting for

2017-06-29 Thread Fam Zheng
On Tue, 06/27 16:57, Alistair Francis wrote: > Signed-off-by: Alistair Francis > Acked-by: Edgar E. Iglesias > --- > > util/aio-win32.c | 13 ++--- > 1 file changed, 10 insertions(+), 3 deletions(-) > > diff --git

Re: [Qemu-block] [Qemu-devel] [PATCH 6/6] virtio-pci: use ioeventfd even when KVM is disabled

2017-06-29 Thread Fam Zheng
redhat.com> > Reviewed-by: Michael S. Tsirkin <m...@redhat.com> > Message-id: 20170615163813.7255-2-stefa...@redhat.com > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH 5/6] tests: fix virtio-net-test ISR dependence

2017-06-29 Thread Fam Zheng
On Wed, 06/28 19:47, Stefan Hajnoczi wrote: > Use the new used ring APIs instead of assuming ISR being set means the > request has completed. > > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH 4/6] tests: fix virtio-blk-test ISR dependence

2017-06-29 Thread Fam Zheng
On Wed, 06/28 19:47, Stefan Hajnoczi wrote: > Use the new used ring APIs instead of assuming ISR being set means the > request has completed. > > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> Reviewed-by: Fam Zheng <f...@redhat.com>

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

2017-06-27 Thread Fam Zheng
On Tue, 06/27 07:43, no-re...@patchew.org wrote: > Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 > Traceback (most recent call last): > File "./patchew-cli", line 430, in test_one > git_clone_repo(clone, r["repo"], r["head"], logf) > File "./patchew-cli", line 48, in git_clone_repo >

Re: [Qemu-block] [Qemu-devel] [RFC PATCH 0/2] Enhance block status when crossing EOF

2017-06-27 Thread Fam Zheng
On Thu, 05/04 21:14, Eric Blake wrote: > Thus, this is a followup to that series, but I'm also okay if we > think it is too much maintenance compared to the potential gains, > and decide to drop it after all. The comments are good enough and I like how this makes the function interface a bit more

Re: [Qemu-block] [PATCH v6 8/8] vmdk: Make vmdk_get_cluster_offset() return cluster offset only

2017-06-27 Thread Fam Zheng
, > + ret = vmdk_get_cluster_offset(bs, extent, >sector_num << BDRV_SECTOR_BITS, > - false, _offset, 0, 0); > + _offset); > if (ret == VMDK_ERROR) { > fprintf(stderr, > "ERROR: could not get cluster_offset for sector %" > -- > 2.6.2 > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v6 7/8] vmdk: Update metadata for multiple clusters

2017-06-27 Thread Fam Zheng
On Mon, 06/05 13:22, Ashijeet Acharya wrote: > Include a next pointer in VmdkMetaData struct to point to the previous > allocated L2 table. Modify vmdk_L2update to start updating metadata for > allocation of multiple clusters at once. > > Signed-off-by: Ashijeet Acharya

Re: [Qemu-block] [PATCH v6 7/8] vmdk: Update metadata for multiple clusters

2017-06-27 Thread Fam Zheng
On Mon, 06/05 13:22, Ashijeet Acharya wrote: > @@ -1876,6 +1942,13 @@ static int vmdk_pwritev(BlockDriverState *bs, uint64_t > offset, > offset += n_bytes; > bytes_done += n_bytes; > > +while (m_data->next != NULL) { If you do while (m_data) { > +

Re: [Qemu-block] [PATCH v6 6/8] vmdk: New functions to assist allocating multiple clusters

2017-06-27 Thread Fam Zheng
On Mon, 06/05 13:22, Ashijeet Acharya wrote: > +/* > + * vmdk_handle_alloc > + * > + * Allocate new clusters for an area that either is yet unallocated or needs > a > + * copy on write. If *cluster_offset is non_zero, clusters are only > allocated if > + * the new allocation can match the

Re: [Qemu-block] [Qemu-devel] [PATCH v2] util: remove the obsolete non-blocking connect

2017-06-16 Thread Fam Zheng
On Fri, 06/16 15:31, Mao Zhongyi wrote: > From: Cao jin > > The non-blocking connect mechanism is obsolete, and it doesn't > work well in inet connection, because it will call getaddrinfo > first and getaddrinfo will blocks on DNS lookups. Since commit > e65c67e4 &

Re: [Qemu-block] [Qemu-devel] [PATCH] virtio-blk: trace vdev so devices can be distinguished

2017-06-15 Thread Fam Zheng
tors %zu" > +virtio_blk_handle_read(void *vdev, void *req, uint64_t sector, size_t > nsectors) "vdev %p req %p sector %"PRIu64" nsectors %zu" > +virtio_blk_submit_multireq(void *vdev, void *mrb, int start, int num_reqs, > uint64_t offset, size_t size, bool is_write) "vdev %p mrb %p start %d > num_reqs %d offset %"PRIu64" size %zu is_write %d" > > # hw/block/hd-geometry.c > hd_geometry_lchs_guess(void *blk, int cyls, int heads, int secs) "blk %p > LCHS %d %d %d" > -- > 2.9.4 > > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [Qemu-devel] [PATCH] util: remove the obsolete non-blocking connect

2017-06-15 Thread Fam Zheng
On Thu, 06/15 11:08, Mao Zhongyi wrote: > From: Cao jin > > The non-blocking connect mechanism is obsolete, and it doesn't > work well in inet connection, because it will call getaddrinfo > first and getaddrinfo will blocks on DNS lookups. Since commit > e65c67e4 &

Re: [Qemu-block] [Qemu-devel] [PATCH v21 00/30] qcow2: persistent dirty bitmaps

2017-06-14 Thread Fam Zheng
On Tue, 06/13 18:08, Max Reitz wrote: > On 2017-06-13 17:03, Vladimir Sementsov-Ogievskiy wrote: > > Looks weird. > > I see the same reply to other series, so it very likely isn't your fault. It's on master, so all patches cannot compile. Please ignore this error for now. Fam

Re: [Qemu-block] null-co undefined read behavior

2017-06-13 Thread Fam Zheng
On Tue, 06/13 10:47, Kevin Wolf wrote: > Am 13.06.2017 um 10:43 hat Fam Zheng geschrieben: > > On Tue, 06/13 09:52, Kevin Wolf wrote: > > > (6) Make read-zeroes=on the default. Gives people worse performance if > > > they expect that null-co:// without any o

Re: [Qemu-block] null-co undefined read behavior

2017-06-13 Thread Fam Zheng
On Tue, 06/13 09:52, Kevin Wolf wrote: > (6) Make read-zeroes=on the default. Gives people worse performance if > they expect that null-co:// without any options is the fastest thing > possible, but it has defined behaviour by default which seems good. Not that it really matters, but null-co://

Re: [Qemu-block] null-co undefined read behavior

2017-06-12 Thread Fam Zheng
On Mon, 06/12 17:20, John Snow wrote: > I noticed while debugging an unrelated test that our use of the null > driver has a habit of making functions like find_image_format trigger a > lot of uninitialized memory errors in valgrind, because it will return a > successful read without actually

Re: [Qemu-block] [Qemu-devel] [PATCH v3 06/16] backup: Request BLK_PERM_AIO_CONTEXT_CHANGE on target

2017-06-07 Thread Fam Zheng
On Wed, 05/24 10:52, Fam Zheng wrote: > What's done in the source's context change notifier is moving the > target's context to follow the new one, so we request this permission > here. > > Signed-off-by: Fam Zheng <f...@redhat.com> > --- > block/backup.c | 2 +- >

Re: [Qemu-block] [Qemu-devel] [PATCH v3 11/16] virtio-scsi: Request BLK_PERM_AIO_CONTEXT_CHANGE for dataplane

2017-06-07 Thread Fam Zheng
On Wed, 05/24 10:52, Fam Zheng wrote: > blk_set_aio_context is audited by perm API, so follow the protocol and > request for permission first. > > Signed-off-by: Fam Zheng <f...@redhat.com> > --- > hw/scsi/virtio-scsi.c | 4 > 1 file changed, 4 insertions(+) >

Re: [Qemu-block] [Qemu-devel] [PATCH v4 3/4] block: Simplify use of BDRV_BLOCK_RAW

2017-06-05 Thread Fam Zheng
a/block/vpc.c b/block/vpc.c > index 4240ba9..b313c68 100644 > --- a/block/vpc.c > +++ b/block/vpc.c > @@ -701,7 +701,7 @@ static int64_t coroutine_fn > vpc_co_get_block_status(BlockDriverState *bs, > if (be32_to_cpu(footer->type) == VHD_FIXED) { > *pnum = nb_sectors; > *file = bs->file->bs; > -return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | BDRV_BLOCK_DATA | > +return BDRV_BLOCK_RAW | BDRV_BLOCK_OFFSET_VALID | > (sector_num << BDRV_SECTOR_BITS); > } > > -- > 2.9.4 > > Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v5 6/8] vmdk: New functions to assist allocating multiple clusters

2017-06-05 Thread Fam Zheng
On Mon, 06/05 11:37, Ashijeet Acharya wrote: > On Mon, Jun 5, 2017 at 11:23 AM, Ashijeet Acharya > wrote: > > Introduce two new helper functions handle_alloc() and > > vmdk_alloc_cluster_offset(). handle_alloc() helps to allocate multiple > > clusters at once starting

Re: [Qemu-block] [Qemu-devel] [PATCH v4 0/8] Optimize VMDK I/O by allocating multiple clusters

2017-06-01 Thread Fam Zheng
On Sat, 04/22 10:43, Ashijeet Acharya wrote: > Changes in v4: > - fix commit message in patch 1 (fam) > - drop size_to_clusters() function (fam) > - fix grammatical errors in function documentations (fam) > - factor out metadata loading coding in a separate patch (patch 4) (fam) > - rename

Re: [Qemu-block] [Qemu-devel] [PATCH v4 7/8] vmdk: Update metadata for multiple clusters

2017-06-01 Thread Fam Zheng
On Sat, 04/22 10:43, Ashijeet Acharya wrote: > Include a next pointer in VmdkMetaData struct to point to the previous > allocated L2 table. Modify vmdk_L2update to start updating metadata for > allocation of multiple clusters at once. > > Signed-off-by: Ashijeet Acharya

Re: [Qemu-block] [Qemu-devel] [PATCH v4 6/8] vmdk: New functions to assist allocating multiple clusters

2017-06-01 Thread Fam Zheng
On Sat, 04/22 10:43, Ashijeet Acharya wrote: > Introduce two new helper functions handle_alloc() and > vmdk_alloc_cluster_offset(). handle_alloc() helps to allocate multiple > clusters at once starting from a given offset on disk and performs COW > if necessary for first and last allocated

Re: [Qemu-block] [PATCH v4 5/8] vmdk: Set maximum bytes allocated in one cycle

2017-06-01 Thread Fam Zheng
m COW > */ > +if (offset_in_cluster > 0) { > +n_bytes = MIN(bytes, extent->cluster_sectors * BDRV_SECTOR_SIZE > + - offset_in_cluster); > +} else { > +n_bytes = MIN(bytes, extent_end - offset); > +} > > re

Re: [Qemu-block] [PATCH v4 4/8] vmdk: Factor out metadata loading code out of vmdk_get_cluster_offset()

2017-06-01 Thread Fam Zheng
)l2_offset * 512, > - l2_table, > -extent->l2_size * sizeof(uint32_t) > -) != extent->l2_size * sizeof(uint32_t)) { > -return VMDK_ERROR; > +ret = get_cluster_table(extent, offset, _index, _offset, > +_index, _table); > +if (ret < 0) { > +return ret; > } > > -extent->l2_cache_offsets[min_index] = l2_offset; > -extent->l2_cache_counts[min_index] = 1; > - found: > -l2_index = ((offset >> 9) / extent->cluster_sectors) % extent->l2_size; > cluster_sector = le32_to_cpu(l2_table[l2_index]); > - > if (extent->has_zero_grain && cluster_sector == VMDK_GTE_ZEROED) { > zeroed = true; > } > -- > 2.6.2 > Apart from the cosmetic nits: Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v4 3/8] vmdk: Rename get_cluster_offset() to vmdk_get_cluster_offset()

2017-06-01 Thread Fam Zheng
On Sat, 04/22 10:43, Ashijeet Acharya wrote: > Rename the existing get_cluster_offset() to vmdk_get_cluster_offset() > and update name in all the callers accordingly. > > Signed-off-by: Ashijeet Acharya <ashijeetacha...@gmail.com> Reviewed-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v3 00/16] block: Protect AIO context change with perm API

2017-05-31 Thread Fam Zheng
On Wed, 05/31 10:45, Stefan Hajnoczi wrote: > On Wed, May 24, 2017 at 10:52:19AM +0800, Fam Zheng wrote: > > v3: Move blk_set_aio_context to the front of mirror_start_job to avoid > > accessing target without acquiring its aio context. [Stefan] > > Use error_free_

Re: [Qemu-block] [PATCH v2 06/16] backup: Request BLK_PERM_AIO_CONTEXT_CHANGE on target

2017-05-31 Thread Fam Zheng
On Wed, 05/31 10:39, Stefan Hajnoczi wrote: > On Wed, May 24, 2017 at 10:18:44AM +0800, Fam Zheng wrote: > > On Thu, 05/11 15:41, Stefan Hajnoczi wrote: > > > On Wed, Apr 19, 2017 at 05:43:46PM +0800, Fam Zheng wrote: > > > > What's done in the source's con

Re: [Qemu-block] [PATCH v3 00/18] Block layer thread safety, part 1

2017-05-25 Thread Fam Zheng
On Thu, 05/25 18:32, Paolo Bonzini wrote: > Minimal changes to: > - fix compilation (patch 10) > - appease checkpatch (patch 17) > - rename mutex field from "spin" to "lock" (patch 18) Thanks, queued. Fam

Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/5] more blkdebug tweaks

2017-05-25 Thread Fam Zheng
On Wed, 05/24 15:28, Eric Blake wrote: > I found a crasher and some odd behavior while rebasing my > bdrv_get_block_status series, so I figured I'd get these things > fixed first. This is based on top of Max's block branch. For patches 1,2,4,5: Acked-by: Fam Zheng <f...@redhat.com>

Re: [Qemu-block] [PATCH v2 00/18] Block layer thread safety, part 1

2017-05-25 Thread Fam Zheng
On Wed, 05/24 10:32, Paolo Bonzini wrote: > > Ping? > Looks good to me except for the mingw 32bit build failure reported by patchew: http://patchew.org/QEMU/20170511144208.24075-1-pbonz...@redhat.com/ Do you want to fix it? Fam

<    3   4   5   6   7   8   9   10   11   12   >