Re: [Qemu-block] [Qemu-devel] [PATCH] block/mirror: Sleep periodically during bitmap scanning

2015-05-12 Thread Fam Zheng
On Wed, 05/13 13:17, Wen Congyang wrote: > On 05/13/2015 11:11 AM, Fam Zheng wrote: > > Before, we only yield after initializing dirty bitmap, where the QMP > > command would return. That may take very long, and guest IO will be > > blocked. > > Do you have such case to reproduce it? If the disk i

[Qemu-block] [PATCH v7 3/3] qemu-iotests: Test unaligned sub-block zero write

2015-05-12 Thread Fam Zheng
Test zero write in byte range 512~1024 for 4k alignment. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf --- tests/qemu-iotests/033 | 13 + tests/qemu-iotests/033.out | 30 ++ 2 files changed, 43 insertions(+) diff --gi

Re: [Qemu-block] [Qemu-devel] [PATCH] block/mirror: Sleep periodically during bitmap scanning

2015-05-12 Thread Wen Congyang
On 05/13/2015 11:11 AM, Fam Zheng wrote: > Before, we only yield after initializing dirty bitmap, where the QMP > command would return. That may take very long, and guest IO will be > blocked. Do you have such case to reproduce it? If the disk image is too larger, and I think qemu doesn't cache al

[Qemu-block] [PATCH v7 2/3] block: Fix NULL deference for unaligned write if qiov is NULL

2015-05-12 Thread Fam Zheng
For zero write, callers pass in NULL qiov (qemu-io "write -z" or scsi-disk "write same"). Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler fix would be in bdrv_co_do_pwritev which is the NULL dereference poi

[Qemu-block] [PATCH v7 0/3] block: Fix unaligned bdrv_aio_write_zeroes

2015-05-12 Thread Fam Zheng
v7: Add Kevin's rev-by in patch 1 and 3. Address Stefan's and Kevin's comments on patch 2: - Don't duplicate tracked_request_begin and tracked_request_end; - Don't forget to remove debug printf; - Call qemu_vfree unconditionally; - Don't serialize aligned part of the zero write

[Qemu-block] [PATCH v7 1/3] Revert "block: Fix unaligned zero write"

2015-05-12 Thread Fam Zheng
This reverts commit fc3959e4669a1c2149b91ccb05101cfc7ae1fc05. The core write code already handles the case, so remove this duplication. Because commit 61007b316 moved the touched code from block.c to block/io.c, the change is manually reverted. Signed-off-by: Fam Zheng Reviewed-by: Stefan Hajno

Re: [Qemu-block] [PATCH v6 2/3] block: Fix NULL deference for unaligned write if qiov is NULL

2015-05-12 Thread Fam Zheng
On Tue, 05/12 13:52, Kevin Wolf wrote: > Am 12.05.2015 um 08:09 hat Fam Zheng geschrieben: > > For zero write, callers pass in NULL qiov (qemu-io "write -z" or > > scsi-disk "write same"). > > > > Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case > > for this bug, but it still

Re: [Qemu-block] [PATCH v6 2/3] block: Fix NULL deference for unaligned write if qiov is NULL

2015-05-12 Thread Fam Zheng
On Tue, 05/12 13:18, Stefan Hajnoczi wrote: > On Tue, May 12, 2015 at 02:09:31PM +0800, Fam Zheng wrote: > > +static int coroutine_fn bdrv_co_do_zero_pwritev(BlockDriverState *bs, > > +int64_t offset, > > +

[Qemu-block] [PATCH] block/mirror: Sleep periodically during bitmap scanning

2015-05-12 Thread Fam Zheng
Before, we only yield after initializing dirty bitmap, where the QMP command would return. That may take very long, and guest IO will be blocked. Add sleep points like the later mirror iterations. Signed-off-by: Fam Zheng --- block/mirror.c | 13 - 1 file changed, 12 insertions(+),

Re: [Qemu-block] [Qemu-devel] [PATCH 21/34] block: Consider all block layer options in append_open_options

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > The code already special-cased "node-name", which is currently the only > option passed in the QDict that isn't driver-specific. Generalise the > code to take all general block layer options into consideration. > > Signed-off-by: Kevin Wolf > --- > blo

Re: [Qemu-block] [Qemu-devel] [PATCH 20/34] qcow2: Support updating driver-specific options in reopen

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, 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 u

Re: [Qemu-block] [Qemu-devel] [PATCH 19/34] qcow2: Make qcow2_update_options() suitable for transactions

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > 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 > --- > block/qcow2.c | 101 > ++

Re: [Qemu-block] [Qemu-devel] [PATCH 18/34] qcow2: Fix memory leak in qcow2_update_options() error path

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 12 ++-- > 1 file changed, 10 insertions(+), 2 deletions(-) > Reviewed-by: Eric Blake -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org

Re: [Qemu-block] [Qemu-devel] [PATCH 17/34] qcow2: Leave s unchanged on qcow2_update_options() failure

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > On return, either all new options should be applied to BDRVQcowState (on > success), or all of the old setting should be preserved (on failure). s/setting/settings/ > > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 52

Re: [Qemu-block] [Qemu-devel] [PATCH 16/34] qcow2: Move rest of option handling to qcow2_update_options()

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > 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 > --- > block/qcow2.c | 109 > +-

Re: [Qemu-block] [Qemu-devel] [PATCH 15/34] qcow2: Move qcow2_update_options() call up

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > 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(). > >

Re: [Qemu-block] [Qemu-devel] [PATCH 14/34] qcow2: Factor out qcow2_update_options()

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > 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 > --- > block/qcow2.c | 135 > +++

Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] tests: add test case for encrypted qcow2 read/write

2015-05-12 Thread John Snow
On 05/12/2015 03:52 PM, Eric Blake wrote: > On 05/12/2015 01:06 PM, John Snow wrote: tests/qemu-iotests/131 | 69 ++ tests/qemu-iotests/131.out | 46 +++ > >> >> Fam Zheng already has a patch on-list

Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] tests: add test case for encrypted qcow2 read/write

2015-05-12 Thread Eric Blake
On 05/12/2015 01:06 PM, John Snow wrote: >>> tests/qemu-iotests/131 | 69 >>> ++ >>> tests/qemu-iotests/131.out | 46 +++ > > Fam Zheng already has a patch on-list that uses test 131, and I think > his patch was submitted

Re: [Qemu-block] [PATCH 05/34] block: Use macro for cache option names

2015-05-12 Thread Jeff Cody
On Fri, May 08, 2015 at 07:21:37PM +0200, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > blockdev.c| 24 > include/block/block.h | 8 > 2 files changed, 20 insertions(+), 12 deletions(-) > > diff --git a/blockdev.c b/blockdev.c > index 5eaf77

Re: [Qemu-block] [PATCH 04/34] vmdk: Use bdrv_open_image()

2015-05-12 Thread Jeff Cody
On Fri, May 08, 2015 at 07:21:36PM +0200, Kevin Wolf wrote: > Besides standardising on a single interface for opening child nodes, > this patch allows the user to specify options to individual extent > nodes. Overriding file names isn't possible with this yet, so it's of > limited usefulness, but s

Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] tests: add test case for encrypted qcow2 read/write

2015-05-12 Thread John Snow
On 05/12/2015 02:35 PM, Eric Blake wrote: > On 05/12/2015 10:09 AM, Daniel P. Berrange wrote: >> Add a simple test case for qemu-iotests that covers read/write >> with encrypted qcow2 files. >> >> Signed-off-by: Daniel P. Berrange --- >> tests/qemu-iotests/131 | 69 >>

Re: [Qemu-block] [PATCH 03/34] quorum: Use bdrv_open_image()

2015-05-12 Thread Jeff Cody
On Fri, May 08, 2015 at 07:21:35PM +0200, Kevin Wolf wrote: > Besides standardising on a single interface for opening child nodes, > this simplifies the .bdrv_open() implementation of the quorum block > driver by using block layer functionality for handling BlockdevRefs. > > Signed-off-by: Kevin W

Re: [Qemu-block] [Qemu-devel] [PATCH 5/5] tests: add test case for encrypted qcow2 read/write

2015-05-12 Thread Eric Blake
On 05/12/2015 10:09 AM, Daniel P. Berrange wrote: > Add a simple test case for qemu-iotests that covers read/write > with encrypted qcow2 files. > > Signed-off-by: Daniel P. Berrange > --- > tests/qemu-iotests/131 | 69 > ++ > tests/qemu-iotests/1

Re: [Qemu-block] [Qemu-devel] [PATCH 4/5] qemu-io: prompt for encryption keys when required

2015-05-12 Thread Eric Blake
On 05/12/2015 10:09 AM, Daniel P. Berrange wrote: > The qemu-io tool does not check if the image is encrypted so > historically would silently corrupt the sectors by writing > plain text data into them instead of cipher text. The earlier > commit turns this mistake into a fatal abort, so check for

Re: [Qemu-block] [Qemu-devel] [PATCH 3/5] util: allow \n to terminate password input

2015-05-12 Thread Eric Blake
On 05/12/2015 10:09 AM, Daniel P. Berrange wrote: > The qemu_read_password() method looks for \r to terminate the > reading of the a password. This is what will be seen when > reading the password from a TTY. When scripting though, it is > useful to be able to send the password via a pipe, in which

Re: [Qemu-block] [Qemu-devel] [PATCH 2/5] util: move read_password method out of qemu-img into osdep/oslib

2015-05-12 Thread Eric Blake
On 05/12/2015 10:09 AM, Daniel P. Berrange wrote: > The qemu-img.c file has a read_password() method impl that is > used to prompt for passwords on the console, with impls for > POSIX and Windows. This will be needed by qemu-io.c too, so > move it into the QEMU osdep/oslib files where it can be sha

Re: [Qemu-block] [Qemu-devel] [PATCH 1/5] qcow2/qcow: protect against uninitialized encryption key

2015-05-12 Thread Eric Blake
On 05/12/2015 10:09 AM, Daniel P. Berrange wrote: > When a qcow[2] file is opened, if the header reports an > encryption method, this is used to set the 'crypt_method_header' > field on the BDRVQcow[2]State struct, and the 'encrypted' flag > in the BDRVState struct. > > When doing I/O operations,

[Qemu-block] [PATCH 4/5] qemu-io: prompt for encryption keys when required

2015-05-12 Thread Daniel P. Berrange
The qemu-io tool does not check if the image is encrypted so historically would silently corrupt the sectors by writing plain text data into them instead of cipher text. The earlier commit turns this mistake into a fatal abort, so check for encryption and prompt for key when required. This enables

[Qemu-block] [PATCH 0/5] Misc fixes and testing of qcow[2] encryption

2015-05-12 Thread Daniel P. Berrange
I realize that qcow[2] encryption is a feature we have deprecated and will remove support for running it with the QEMU system emulators in this cycle. We do still need to make sure it continues to work for the sake of letting people run qemu-img convert to retrieve their data though. Some of the o

[Qemu-block] [PATCH 2/5] util: move read_password method out of qemu-img into osdep/oslib

2015-05-12 Thread Daniel P. Berrange
The qemu-img.c file has a read_password() method impl that is used to prompt for passwords on the console, with impls for POSIX and Windows. This will be needed by qemu-io.c too, so move it into the QEMU osdep/oslib files where it can be shared without code duplication Signed-off-by: Daniel P. Ber

[Qemu-block] [PATCH 5/5] tests: add test case for encrypted qcow2 read/write

2015-05-12 Thread Daniel P. Berrange
Add a simple test case for qemu-iotests that covers read/write with encrypted qcow2 files. Signed-off-by: Daniel P. Berrange --- tests/qemu-iotests/131 | 69 ++ tests/qemu-iotests/131.out | 46 +++ tests/qemu-iotests/gro

[Qemu-block] [PATCH 1/5] qcow2/qcow: protect against uninitialized encryption key

2015-05-12 Thread Daniel P. Berrange
When a qcow[2] file is opened, if the header reports an encryption method, this is used to set the 'crypt_method_header' field on the BDRVQcow[2]State struct, and the 'encrypted' flag in the BDRVState struct. When doing I/O operations, the 'crypt_method' field on the BDRVQcow[2]State struct is che

[Qemu-block] [PATCH 3/5] util: allow \n to terminate password input

2015-05-12 Thread Daniel P. Berrange
The qemu_read_password() method looks for \r to terminate the reading of the a password. This is what will be seen when reading the password from a TTY. When scripting though, it is useful to be able to send the password via a pipe, in which case we must look for \n to terminate password input. Si

Re: [Qemu-block] [PATCH] qemu-io: Use getopt() correctly

2015-05-12 Thread Alberto Garcia
On Tue 12 May 2015 05:10:56 PM CEST, Eric Blake wrote: > POSIX says getopt() returns -1 on completion. While Linux happens > to define EOF as -1, this definition is not required by POSIX, and > there may be platforms where checking for EOF instead of -1 would > lead to an infinite loop. > > Sign

[Qemu-block] [PATCH] qemu-io: Use getopt() correctly

2015-05-12 Thread Eric Blake
POSIX says getopt() returns -1 on completion. While Linux happens to define EOF as -1, this definition is not required by POSIX, and there may be platforms where checking for EOF instead of -1 would lead to an infinite loop. Signed-off-by: Eric Blake --- qemu-io-cmds.c | 16 qe

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

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > qemu-io-cmds.c | 71 > ++ > 1 file changed, 71 insertions(+) > > + > +while ((c = getopt(argc, argv, "c:o:r")) != EOF) { POSIX says getopt() returns -1 at

Re: [Qemu-block] [Qemu-devel] [PATCH 12/34] block: Allow specifying driver-specific options to reopen

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > Signed-off-by: Kevin Wolf > --- > block.c | 42 +++--- > block/commit.c| 4 ++-- > include/block/block.h | 4 +++- > 3 files changed, 44 insertions(+), 6 deletions(-) > > diff --git a/block.c

Re: [Qemu-block] [Qemu-devel] [PATCH 11/34] block: Allow references for backing files

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > For bs->file, using references to existing BDSes has been possible for a > while already. This patch enables the same for bs->backing_hd. > > Signed-off-by: Kevin Wolf > --- > block.c | 42 -- > blo

Re: [Qemu-block] [Qemu-devel] [PATCH 10/34] block: Fix reopen flag inheritance

2015-05-12 Thread Eric Blake
On 05/08/2015 11:21 AM, Kevin Wolf wrote: > When reopening an image, the block layer already takes care to reopen > bs->file as well with recalculated inherited flags. The same must happen > for any other child (most notably missing before this patch: backing > files). > > If bs->file (or any othe

[Qemu-block] [PATCH v8 0/2] block: enforce minimal 4096 alignment in qemu_blockalign

2015-05-12 Thread Denis V. Lunev
I have used the following program to test #define _GNU_SOURCE #include #include #include #include #include #include int main(int argc, char *argv[]) { int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); void *buf; int i = 0, align = atoi(argv[2]); do { buf =

[Qemu-block] [PATCH 1/2] block: minimal bounce buffer alignment

2015-05-12 Thread Denis V. Lunev
The patch introduces new concept: minimal memory alignment for bounce buffers. Original so called "optimal" value is actually minimal required value for aligment. It should be used for validation that the IOVec is properly aligned and bounce buffer is not required. Though, from the performance poi

[Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Denis V. Lunev
The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i < 10; i++) write(fd, buf, 4096); performs 5% better if buf is aligned to 4096 bytes. The difference is quite reliable. On the other hand we do not want at the moment to enforce

Re: [Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Denis V. Lunev
On 12/05/15 17:26, Kevin Wolf wrote: Am 12.05.2015 um 16:20 hat Denis V. Lunev geschrieben: On 12/05/15 17:08, Kevin Wolf wrote: Am 12.05.2015 um 15:41 hat Denis V. Lunev geschrieben: The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i < 10

Re: [Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Kevin Wolf
Am 12.05.2015 um 16:20 hat Denis V. Lunev geschrieben: > On 12/05/15 17:08, Kevin Wolf wrote: > >Am 12.05.2015 um 15:41 hat Denis V. Lunev geschrieben: > >>The following sequence > >> int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); > >> for (i = 0; i < 10; i++) > >>

Re: [Qemu-block] [PATCH 08/34] block: Add list of children to BlockDriverState

2015-05-12 Thread Kevin Wolf
Am 11.05.2015 um 17:45 hat Max Reitz geschrieben: > On 08.05.2015 19:21, Kevin Wolf wrote: > >This allows iterating over all children of a given BDS, not only > >including bs->file and bs->backing_hd, but also driver-specific > >ones like VMDK extents or Quorum children. > > > >Signed-off-by: Kevin

Re: [Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Denis V. Lunev
On 12/05/15 17:08, Kevin Wolf wrote: Am 12.05.2015 um 15:41 hat Denis V. Lunev geschrieben: The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i < 10; i++) write(fd, buf, 4096); performs 5% better if buf is aligned to 4096 byt

Re: [Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Kevin Wolf
Am 12.05.2015 um 15:41 hat Denis V. Lunev geschrieben: > The following sequence > int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); > for (i = 0; i < 10; i++) > write(fd, buf, 4096); > performs 5% better if buf is aligned to 4096 bytes. > > The difference is quite

[Qemu-block] [PATCH v7 0/2] block: enforce minimal 4096 alignment in qemu_blockalign

2015-05-12 Thread Denis V. Lunev
I have used the following program to test #define _GNU_SOURCE #include #include #include #include #include #include int main(int argc, char *argv[]) { int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); void *buf; int i = 0, align = atoi(argv[2]); do { buf =

[Qemu-block] [PATCH 1/2] block: minimal bounce buffer alignment

2015-05-12 Thread Denis V. Lunev
The patch introduces new concept: minimal memory alignment for bounce buffers. Original so called "optimal" value is actually minimal required value for aligment. It should be used for validation that the IOVec is properly aligned and bounce buffer is not required. Though, from the performance poi

[Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Denis V. Lunev
The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i < 10; i++) write(fd, buf, 4096); performs 5% better if buf is aligned to 4096 bytes. The difference is quite reliable. On the other hand we do not want at the moment to enforce

Re: [Qemu-block] [PATCH 07/34] block: Move flag inheritance to bdrv_open_inherited()

2015-05-12 Thread Kevin Wolf
Am 11.05.2015 um 17:20 hat Max Reitz geschrieben: > On 08.05.2015 19:21, Kevin Wolf wrote: > >Instead of letting every caller of bdrv_open() determine the right flags > >for its child node manually and pass them to the function, pass the > >parent node and the role of the newly opened child (like b

Re: [Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Denis V. Lunev
On 12/05/15 16:08, Kevin Wolf wrote: Am 12.05.2015 um 12:36 hat Denis V. Lunev geschrieben: On 12/05/15 13:27, Kevin Wolf wrote: Am 12.05.2015 um 07:47 hat Denis V. Lunev geschrieben: The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i < 10

Re: [Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Kevin Wolf
Am 12.05.2015 um 12:36 hat Denis V. Lunev geschrieben: > On 12/05/15 13:27, Kevin Wolf wrote: > >Am 12.05.2015 um 07:47 hat Denis V. Lunev geschrieben: > >>The following sequence > >> int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); > >> for (i = 0; i < 10; i++) > >>

Re: [Qemu-block] [PATCH v6 2/3] block: Fix NULL deference for unaligned write if qiov is NULL

2015-05-12 Thread Stefan Hajnoczi
On Tue, May 12, 2015 at 02:09:31PM +0800, Fam Zheng wrote: > +static int coroutine_fn bdrv_co_do_zero_pwritev(BlockDriverState *bs, > +int64_t offset, > +unsigned int bytes, > +

[Qemu-block] [PATCH 1/1] docs: document how to configure the qcow2 L2/refcount caches

2015-05-12 Thread 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 depends on the size of t

[Qemu-block] [PATCH v2 0/1] Document how to configure the qcow2 L2/refcount caches

2015-05-12 Thread Alberto Garcia
Kevin applied all other patches from this series, so this is the only one left. Thanks to Max for all the feedback. v2: - Add copyright notice - Document refcount_bits and its effects v1: https://lists.gnu.org/archive/html/qemu-devel/2015-05/msg01891.html Regards, Berto Alberto Garcia (1):

Re: [Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Denis V. Lunev
On 12/05/15 13:27, Kevin Wolf wrote: Am 12.05.2015 um 07:47 hat Denis V. Lunev geschrieben: The following sequence int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); for (i = 0; i < 10; i++) write(fd, buf, 4096); performs 5% better if buf is aligned to 4096 byt

Re: [Qemu-block] [PATCH v6 3/3] qemu-iotests: Test unaligned sub-block zero write

2015-05-12 Thread Kevin Wolf
Am 12.05.2015 um 08:09 hat Fam Zheng geschrieben: > Test zero write in byte range 512~1024 for 4k alignment. > > Signed-off-by: Fam Zheng > Reviewed-by: Stefan Hajnoczi Reviewed-by: Kevin Wolf

[Qemu-block] [PATCH v3 4/6] qemu-iotests: Make block job methods common

2015-05-12 Thread Fam Zheng
Signed-off-by: Fam Zheng Reviewed-by: John Snow --- tests/qemu-iotests/041| 66 ++- tests/qemu-iotests/iotests.py | 28 ++ 2 files changed, 43 insertions(+), 51 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/

Re: [Qemu-block] [PATCH v6 2/3] block: Fix NULL deference for unaligned write if qiov is NULL

2015-05-12 Thread Kevin Wolf
Am 12.05.2015 um 08:09 hat Fam Zheng geschrieben: > For zero write, callers pass in NULL qiov (qemu-io "write -z" or > scsi-disk "write same"). > > Commit fc3959e466 fixed bdrv_co_write_zeroes which is the common case > for this bug, but it still exists in bdrv_aio_write_zeroes. A simpler > fix wo

Re: [Qemu-block] [PATCH v6 1/3] Revert "block: Fix unaligned zero write"

2015-05-12 Thread Kevin Wolf
Am 12.05.2015 um 08:09 hat Fam Zheng geschrieben: > This reverts commit fc3959e4669a1c2149b91ccb05101cfc7ae1fc05. > > The core write code already handles the case, so remove this > duplication. > > Because commit 61007b316 moved the touched code from block.c to > block/io.c, the change is manuall

[Qemu-block] [PATCH v3 6/6] iotests: Use event_wait in wait_ready

2015-05-12 Thread Fam Zheng
Only poll the specific type of event we are interested in, to avoid stealing events that should be consumed by someone else. Suggested-by: John Snow Signed-off-by: Fam Zheng Reviewed-by: John Snow --- tests/qemu-iotests/iotests.py | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-)

[Qemu-block] [PATCH v3 5/6] qemu-iotests: Add test case for mirror with unmap

2015-05-12 Thread Fam Zheng
This checks that the discard on mirror source that effectively zeroes data is also reflected by the data of target. Signed-off-by: Fam Zheng Reviewed-by: John Snow --- tests/qemu-iotests/131 | 59 ++ tests/qemu-iotests/131.out | 5 tests/qem

[Qemu-block] [PATCH v3 3/6] block: Remove bdrv_reset_dirty

2015-05-12 Thread Fam Zheng
Using this function would always be wrong because a dirty bitmap must have a specific owner that consumes the dirty bits and calls bdrv_reset_dirty_bitmap(). Remove the unused function to avoid future misuse. Reviewed-by: Eric Blake Signed-off-by: Fam Zheng Reviewed-by: John Snow --- block.c

[Qemu-block] [PATCH v3 2/6] block: Fix dirty bitmap in bdrv_co_discard

2015-05-12 Thread Fam Zheng
Unsetting dirty globally with discard is not very correct. The discard may zero out sectors (depending on can_write_zeroes_with_unmap), we should replicate this change to destinition side to make sure that the guest sees the same data. Calling bdrv_reset_dirty also troubles mirror job because the

[Qemu-block] [PATCH v3 0/6] block: Mirror discarded sectors

2015-05-12 Thread Fam Zheng
v3: Add John's rev-by in patches 3~6. Rewrite patch 1: discard may not suffice, use write zeroes in that case. v2: Fix typo and add Eric's rev-by in patch 3. Add patch 1 to discard target in mirror job. (Paolo) Add patch 6 to improve iotests.wait_ready. (John) This fixes the mirror as

[Qemu-block] [PATCH v3 1/6] mirror: Do zero write on target if sectors not allocated

2015-05-12 Thread Fam Zheng
If guest discards a source cluster during mirror, we would want to skip the read-write steps. Source and target may have different "can_write_zeroes_with_unmap" values and different discard granularity. It's important to replicate the exact zeroing on the destination, so bdrv_aio_discard is only s

Re: [Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Paolo Bonzini
On 12/05/2015 12:27, Kevin Wolf wrote: > I think it would make more sense to keep this specific to the raw-posix > driver. After all, it's only the kernel page cache that we optimise > here. Other backends probably don't take advantage of page alignment. I don't think it makes sense to keep it r

Re: [Qemu-block] [PATCH v5 0/2] block: enforce minimal 4096 alignment in qemu_blockalign

2015-05-12 Thread Paolo Bonzini
On 12/05/2015 12:19, Denis V. Lunev wrote: > > > hades /vol $ strace -f -e pwrite -e raw=write,pwrite qemu-io -n -c > "write -P 0x11 0 64M" ./1.img > Process 19326 attached > [pid 19326] pwrite(0x6, 0x7fac07fff200, 0x400, 0x5) = 0x400 > < 1 GB Write from userspace FWIW this is

Re: [Qemu-block] [PATCH 1/2] block: minimal bounce buffer alignment

2015-05-12 Thread Kevin Wolf
Am 12.05.2015 um 07:47 hat Denis V. Lunev geschrieben: > The patch introduces new concept: minimal memory alignment for bounce > buffers. Original so called "optimal" value is actually minimal required > value for aligment. It should be used for validation that the IOVec > is properly aligned and b

Re: [Qemu-block] [PATCH 2/2] block: align bounce buffers to page

2015-05-12 Thread Kevin Wolf
Am 12.05.2015 um 07:47 hat Denis V. Lunev geschrieben: > The following sequence > int fd = open(argv[1], O_RDWR | O_CREAT | O_DIRECT, 0644); > for (i = 0; i < 10; i++) > write(fd, buf, 4096); > performs 5% better if buf is aligned to 4096 bytes. > > The difference is quite

Re: [Qemu-block] [PATCH v5 0/2] block: enforce minimal 4096 alignment in qemu_blockalign

2015-05-12 Thread Denis V. Lunev
On 12/05/15 13:01, Stefan Hajnoczi wrote: On Mon, May 11, 2015 at 07:47:41PM +0300, Denis V. Lunev wrote: On 11/05/15 19:07, Denis V. Lunev wrote: On 11/05/15 18:08, Stefan Hajnoczi wrote: On Mon, May 04, 2015 at 04:42:22PM +0300, Denis V. Lunev wrote: The difference is quite reliable and the

Re: [Qemu-block] [PATCH v5 0/2] block: enforce minimal 4096 alignment in qemu_blockalign

2015-05-12 Thread Stefan Hajnoczi
On Mon, May 11, 2015 at 07:47:41PM +0300, Denis V. Lunev wrote: > On 11/05/15 19:07, Denis V. Lunev wrote: > >On 11/05/15 18:08, Stefan Hajnoczi wrote: > >>On Mon, May 04, 2015 at 04:42:22PM +0300, Denis V. Lunev wrote: > >>>The difference is quite reliable and the same 5%. > >>> qemu-io -n -c 'w

Re: [Qemu-block] [PATCH v3 0/8] qcow2 L2/refcount cache improvements

2015-05-12 Thread Kevin Wolf
Am 11.05.2015 um 14:54 hat Alberto Garcia geschrieben: > New version of the qcow2 cache patches: > > v3: > - Removed a dead comment in patch #3 > - New document explaining how to configure the cache sizes > > v2: https://lists.nongnu.org/archive/html/qemu-devel/2015-05/msg00833.html > - Don't do