Re: [Qemu-block] [Qemu-devel] [PATCH] block/vhdx: Use IEC binary prefixes from "qemu/units.h"

2019-03-26 Thread Stefano Garzarella
On Mon, Mar 25, 2019 at 10:56:57PM +0100, Philippe Mathieu-Daudé wrote: > Le lun. 25 mars 2019 21:53, John Snow a écrit : > > On 3/21/19 5:40 AM, Stefano Garzarella wrote: > > > IEC binary prefixes are defined in "qemu/units.h", so we > > > can remove r

Re: [Qemu-block] [Qemu-devel] [PATCH] block/vhdx: Use IEC binary prefixes from "qemu/units.h"

2019-03-26 Thread Stefano Garzarella
On Tue, Mar 26, 2019 at 10:13:54AM +0100, Kevin Wolf wrote: > Am 26.03.2019 um 08:55 hat Stefano Garzarella geschrieben: > > On Mon, Mar 25, 2019 at 10:56:57PM +0100, Philippe Mathieu-Daudé wrote: > > > Le lun. 25 mars 2019 21:53, John Snow a écrit : > > > > On 3/21/

[Qemu-block] [PATCH v2 0/2] block/vhdx: Use IEC binary prefixes from "qemu/units.h"

2019-03-27 Thread Stefano Garzarella
comments in that file doesn't respect the new coding style so I left the comment as is Stefano Garzarella (2): block/vhdx: Remove redundant IEC binary prefixes definition block/vhdx: Use IEC binary prefixes for size constants block/vhdx-log.c | 2 +- block/vhdx.c | 7 --- block/v

[Qemu-block] [PATCH v2 1/2] block/vhdx: Remove redundant IEC binary prefixes definition

2019-03-27 Thread Stefano Garzarella
IEC binary prefixes are already defined in "qemu/units.h", so we can remove redundant definitions in "block/vhdx.h". Signed-off-by: Stefano Garzarella --- block/vhdx.c | 3 ++- block/vhdx.h | 6 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/block/v

[Qemu-block] [PATCH v2 2/2] block/vhdx: Use IEC binary prefixes for size constants

2019-03-27 Thread Stefano Garzarella
Using IEC binary prefixes in order to make the code more readable, with the exception of DEFAULT_LOG_SIZE because it's passed to stringify(). Signed-off-by: Stefano Garzarella --- block/vhdx-log.c | 2 +- block/vhdx.c | 4 ++-- block/vhdx.h | 10 ++ 3 files chang

Re: [Qemu-block] [PATCH v2 1/2] block/vhdx: Remove redundant IEC binary prefixes definition

2019-03-27 Thread Stefano Garzarella
On Wed, Mar 27, 2019 at 01:16:49PM -0400, John Snow wrote: > > > On 3/27/19 5:56 AM, Stefano Garzarella wrote: > > IEC binary prefixes are already defined in "qemu/units.h", > > so we can remove redundant definitions in "block/vhdx.h". &

[Qemu-block] [PATCH RFC] block/gluster: limit the transfer size to 512 MiB

2019-03-28 Thread Stefano Garzarella
Several versions of GlusterFS (3.12? -> 6.0.1) fail when the transfer size is greater or equal to 1024 MiB, so we are limiting the transfer size to 512 MiB to avoid this rare issue. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1691320 Signed-off-by: Stefano Garzarella --- RFC: Shoul

Re: [Qemu-block] [PATCH RFC] block/gluster: limit the transfer size to 512 MiB

2019-03-28 Thread Stefano Garzarella
On Thu, Mar 28, 2019 at 12:59:55PM +0100, Kevin Wolf wrote: > Am 28.03.2019 um 11:52 hat Stefano Garzarella geschrieben: > > Several versions of GlusterFS (3.12? -> 6.0.1) fail when the > > transfer size is greater or equal to 1024 MiB, so we are > > limiting the transfer

Re: [Qemu-block] [PATCH RFC] block/gluster: limit the transfer size to 512 MiB

2019-03-28 Thread Stefano Garzarella
On Thu, Mar 28, 2019 at 03:42:49PM +0100, Kevin Wolf wrote: > Am 28.03.2019 um 14:35 hat Stefano Garzarella geschrieben: > > On Thu, Mar 28, 2019 at 12:59:55PM +0100, Kevin Wolf wrote: > > > Am 28.03.2019 um 11:52 hat Stefano Garzarella geschrieben: > > > > Sever

Re: [Qemu-block] [PATCH v3] block/rbd: implement .bdrv_get_allocated_file_size callback

2019-07-10 Thread Stefano Garzarella
On Tue, Jul 09, 2019 at 09:42:14PM -0400, Jason Dillaman wrote: > On Tue, Jul 9, 2019 at 11:32 AM Max Reitz wrote: > > On 09.07.19 15:09, Stefano Garzarella wrote: > > > > > > Max, Jason, thanks for the details! > > > > > > If you agree, I'll tr

Re: [Qemu-block] [PATCH v3] LUKS: support preallocation

2019-07-11 Thread Stefano Garzarella
On Thu, Jul 11, 2019 at 06:09:40PM +0300, Maxim Levitsky wrote: > preallocation=off and preallocation=metadata > both allocate luks header only, and preallocation=falloc/full > is passed to underlying file. > > Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1534951 > > Signed-off-by: Maxim Le

Re: [Qemu-block] [PATCH] doc: Preallocation does not require writing zeroes

2019-07-12 Thread Stefano Garzarella
On Thu, Jul 11, 2019 at 03:29:35PM +0200, Max Reitz wrote: > When preallocating an encrypted qcow2 image, it just lets the protocol > driver write data and then does not mark the clusters as zero. > Therefore, reading this image will yield effectively random data. > > As such, we have not fulfille

[Qemu-block] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-12 Thread Stefano Garzarella
lready parsed. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1542445 Signed-off-by: Stefano Garzarella --- block/gluster.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/block/gluster.c b/block/gluster.c index 62f8ff2147..26971db1ea 100644 --- a/block/gluster.

Re: [Qemu-block] [PATCH] doc: Preallocation does not require writing zeroes

2019-07-15 Thread Stefano Garzarella
On Fri, Jul 12, 2019 at 08:33:14PM +0200, Max Reitz wrote: > On 12.07.19 12:27, Stefano Garzarella wrote: > > On Thu, Jul 11, 2019 at 03:29:35PM +0200, Max Reitz wrote: > >> When preallocating an encrypted qcow2 image, it just lets the protocol > >> driver write data

Re: [Qemu-block] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-15 Thread Stefano Garzarella
On Fri, Jul 12, 2019 at 08:35:12PM +0200, Max Reitz wrote: > On 12.07.19 12:46, Stefano Garzarella wrote: > > When the backing_file is specified as a JSON object, the > > qemu_gluster_reopen_prepare() fails with this message: > > invalid URI json:{"server.0.host&qu

Re: [Qemu-block] [PATCH v3] LUKS: support preallocation

2019-07-15 Thread Stefano Garzarella
On Sun, Jul 14, 2019 at 05:51:51PM +0300, Maxim Levitsky wrote: > On Thu, 2019-07-11 at 18:27 +0200, Stefano Garzarella wrote: > > On Thu, Jul 11, 2019 at 06:09:40PM +0300, Maxim Levitsky wrote: > > > preallocation=off and preallocation=metadata > > > both all

Re: [Qemu-block] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-15 Thread Stefano Garzarella
On Mon, Jul 15, 2019 at 12:53:57PM +0200, Max Reitz wrote: > On 15.07.19 10:16, Stefano Garzarella wrote: > > On Fri, Jul 12, 2019 at 08:35:12PM +0200, Max Reitz wrote: > >> On 12.07.19 12:46, Stefano Garzarella wrote: > >>> When the backing_file is s

Re: [Qemu-block] [PATCH] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-15 Thread Stefano Garzarella
On Mon, Jul 15, 2019 at 03:00:29PM +0200, Max Reitz wrote: > On 15.07.19 14:50, Stefano Garzarella wrote: > > On Mon, Jul 15, 2019 at 12:53:57PM +0200, Max Reitz wrote: > >> On 15.07.19 10:16, Stefano Garzarella wrote: > >>> On Fri, Jul 12, 2019 at 08:35:12PM +02

[Qemu-block] [PATCH v2] gluster: fix .bdrv_reopen_prepare when backing file is a JSON object

2019-07-15 Thread Stefano Garzarella
lready parsed. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1542445 Signed-off-by: Stefano Garzarella --- v2: - check if 'state->bs->exact_filename' is empty, instead to parse 'state->bs->filename' to check if it contains "json:"

Re: [Qemu-block] [PATCH for-4.1? 0/4] block: Fix three .bdrv_has_zero_init()s

2019-07-15 Thread Stefano Garzarella
; So that leaves three cases to fix, which are the first three patches in > this series. The final patch adds a test case for qcow2. (It’s > difficult to test the other drivers, because that would require a > protocol driver with image creation support and has_zero_init=0, which > is

[Qemu-block] [PATCH v3] block/rbd: add preallocation support

2019-07-23 Thread Stefano Garzarella
This patch adds the support of preallocation (off/full) for the RBD block driver. If rbd_writesame() is available and supports zeroed buffers, we use it to quickly fill the image when full preallocation is required. Signed-off-by: Stefano Garzarella --- v3: - rebased on master - filled with

Re: [Qemu-block] [PATCH v3] block/rbd: add preallocation support

2019-07-25 Thread Stefano Garzarella
On Wed, Jul 24, 2019 at 01:48:42PM -0400, Jason Dillaman wrote: > On Tue, Jul 23, 2019 at 3:13 AM Stefano Garzarella > wrote: > > > > This patch adds the support of preallocation (off/full) for the RBD > > block driver. > > If rbd_writesame() is available and s

Re: [Qemu-block] [PATCH v3] block/rbd: add preallocation support

2019-07-26 Thread Stefano Garzarella
On Thu, Jul 25, 2019 at 09:30:30AM -0400, Jason Dillaman wrote: > On Thu, Jul 25, 2019 at 4:13 AM Stefano Garzarella > wrote: > > > > On Wed, Jul 24, 2019 at 01:48:42PM -0400, Jason Dillaman wrote: > > > On Tue, Jul 23, 2019 at 3:13 AM Stefano Garzarella > > &g

Re: [Qemu-block] [PATCH v2 03/11] block: Add bdrv_has_zero_init_truncate()

2019-07-26 Thread Stefano Garzarella
On Wed, Jul 24, 2019 at 07:12:31PM +0200, Max Reitz wrote: > No .bdrv_has_zero_init() implementation returns 1 if growing the file > would add non-zero areas (at least with PREALLOC_MODE_OFF), so using it > in lieu of this new function was always safe. > > But on the other hand, it is possible tha

Re: [Qemu-block] [PATCH v2 01/11] qemu-img: Fix bdrv_has_zero_init() use in convert

2019-07-26 Thread Stefano Garzarella
target_is_new = !skip_create; > + > flags = s.min_sparse ? (BDRV_O_RDWR | BDRV_O_UNMAP) : BDRV_O_RDWR; > ret = bdrv_parse_cache_mode(cache, &flags, &writethrough); > if (ret < 0) { Make sense! Reviewed-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [PATCH v2 05/11] block: Use bdrv_has_zero_init_truncate()

2019-07-26 Thread Stefano Garzarella
has_zero_init(bs->file->bs) == 0) { > +if (bdrv_has_zero_init_truncate(bs->file->bs) == 0) { > use_zero_buffers = true; > > /* zero fill the front, if any */ > -- > 2.21.0 > What about describing in the commit message why we are using bdrv_has_zero_init_truncate() like in the cover letter? With or without: Reviewed-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [PATCH v2 04/11] block: Implement .bdrv_has_zero_init_truncate()

2019-07-26 Thread Stefano Garzarella
/qed.c| 1 + > block/raw-format.c | 6 ++ > block/rbd.c| 1 + > block/sheepdog.c | 1 + > block/ssh.c| 1 + > 10 files changed, 18 insertions(+) > LGTM. Reviewed-by: Stefano Garzarella Thanks, Stefano > diff --git a/block/file-posix.c b/block/file-posix.

Re: [Qemu-block] [PATCH v2 03/11] block: Add bdrv_has_zero_init_truncate()

2019-07-26 Thread Stefano Garzarella
On Fri, Jul 26, 2019 at 12:58:58PM +0200, Max Reitz wrote: > On 26.07.19 11:04, Stefano Garzarella wrote: > > On Wed, Jul 24, 2019 at 07:12:31PM +0200, Max Reitz wrote: > >> No .bdrv_has_zero_init() implementation returns 1 if growing the file > >> would add no

Re: [Qemu-block] [PATCH v3] block/rbd: add preallocation support

2019-07-29 Thread Stefano Garzarella
On Fri, Jul 26, 2019 at 08:46:56AM -0400, Jason Dillaman wrote: > On Fri, Jul 26, 2019 at 4:48 AM Stefano Garzarella > wrote: > > > > On Thu, Jul 25, 2019 at 09:30:30AM -0400, Jason Dillaman wrote: > > > On Thu, Jul 25, 2019 at 4:13 AM Stefano Garzarella > >

Re: [Qemu-block] [PATCH 0/2] block/file-posix: Reduce xfsctl() use

2019-08-28 Thread Stefano Garzarella
/file-posix: Reduce xfsctl() use" patch and the failure rate is ~30% on my system. With the patch applied the failure rate is 0% :-) Reviewed-by: Stefano Garzarella Tested-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [PATCH 0/2] git.orderfile: Order Python/shell scripts before unordered files

2019-08-29 Thread Stefano Garzarella
; Philippe Mathieu-Daudé (2): > scripts/git.orderfile: Order Python files before unordered ones > scripts/git.orderfile: Order shell scripts before unordered files > > scripts/git.orderfile | 5 + > 1 file changed, 5 insertions(+) Reviewed-by: Stefano Garzarella Thanks, Stefano

Re: [Qemu-block] [Qemu-devel] [PATCH v6 1/4] block: Add zoned device model property

2019-09-06 Thread Stefano Garzarella
On Wed, Sep 04, 2019 at 05:00:57PM -0400, Dmitry Fomichev wrote: > This commit adds Zoned Device Model (as defined in T10 ZBC and > T13 ZAC standards) as a block driver property, along with some > useful access functions. > > A new backend driver permission, BLK_PERM_SUPPORT_HM_ZONED, is also > in

Re: [Qemu-block] [Qemu-devel] [PATCH v6 1/4] block: Add zoned device model property

2019-09-06 Thread Stefano Garzarella
On Fri, Sep 06, 2019 at 04:17:12PM +, Dmitry Fomichev wrote: > On Fri, 2019-09-06 at 10:11 +0200, Stefano Garzarella wrote: > > On Wed, Sep 04, 2019 at 05:00:57PM -0400, Dmitry Fomichev wrote: > > > This commit adds Zoned Device Model (as defined in T10 ZBC and > > &

Re: [Qemu-block] [PATCH v7 1/4] block: Add zoned device model property

2019-09-09 Thread Stefano Garzarella
files changed, 53 insertions(+), 13 deletions(-) > Acked-by: Stefano Garzarella

Re: [Qemu-block] [PATCH] qemu-io: Don't leak pattern file in error path

2019-09-10 Thread Stefano Garzarella
int, but let's do it > anyway in case someone later adds a 'goto error' after closing the file. > > Coverity: CID 1405303 > Fixes: 4d731510d34f280ed45a6de621d016f67a49ea48 > Signed-off-by: Kevin Wolf > --- > qemu-io-cmds.c | 4 > 1 file changed, 4 insertions(+) Reviewed-by: Stefano Garzarella

Re: [PATCH for-5.0] aio-posix: fix test-aio /aio/event/wait with fdmon-io_uring

2020-04-03 Thread Stefano Garzarella
oczi > --- > util/fdmon-io_uring.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) Reviewed-by: Stefano Garzarella Thanks, Stefano > > diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c > index 7e143ef515..b4d6109f20 100644 > --- a/util/fdmon

Re: [PATCH for-5.0] aio-posix: signal-proof fdmon-io_uring

2020-04-08 Thread Stefano Garzarella
ned-off-by: Stefan Hajnoczi > --- > util/fdmon-io_uring.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) The patch LGTM: Reviewed-by: Stefano Garzarella Not related to this patch, looking at block/io_uring.c, should we retry if the io_uring_submit() fails wit

Re: [PATCH for-5.0] aio-posix: signal-proof fdmon-io_uring

2020-04-09 Thread Stefano Garzarella
On Thu, Apr 09, 2020 at 03:57:09PM +0100, Stefan Hajnoczi wrote: > On Wed, Apr 08, 2020 at 12:06:03PM +0200, Stefano Garzarella wrote: > > On Wed, Apr 08, 2020 at 10:11:39AM +0100, Stefan Hajnoczi wrote: > > > The io_uring_enter(2) syscall returns with errno=EINTR when inte

Re: [PATCH] block/nvme: Remove memory leak

2020-04-15 Thread Stefano Garzarella
On Tue, Apr 14, 2020 at 05:17:26PM +0200, Philippe Mathieu-Daudé wrote: > Fixes: bdd6a90a9 ("Add VFIO based NVMe driver") > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/block/nvme.c b/block/nvme.c > index 7b7c0cc5d6..9f3c7ab8

[PATCH] io_uring: retry io_uring_submit() if it fails with errno=EINTR

2020-05-19 Thread Stefano Garzarella
io_uring_submit() when IORING_SETUP_IOPOLL is enabled. We shouldn't have this problem for now, but it's better to prevent it. [1] https://github.com/axboe/liburing/commit/344355ec6619de8f4e64584c9736530b5346e4f4 Signed-off-by: Stefano Garzarella --- block/io_uring.c | 2 +- 1 file

[PATCH] io_uring: use io_uring_cq_ready() to check for ready cqes

2020-05-19 Thread Stefano Garzarella
In qemu_luring_poll_cb() we are not using the cqe peeked from the CQ ring. We are using io_uring_peek_cqe() only to see if there are cqes ready, so we can replace it with io_uring_cq_ready(). Signed-off-by: Stefano Garzarella --- block/io_uring.c | 9 +++-- 1 file changed, 3 insertions

Re: [PATCH] io_uring: use io_uring_cq_ready() to check for ready cqes

2020-05-21 Thread Stefano Garzarella
On Thu, May 21, 2020 at 03:45:34PM +0100, Stefan Hajnoczi wrote: > On Tue, May 19, 2020 at 03:49:42PM +0200, Stefano Garzarella wrote: > > In qemu_luring_poll_cb() we are not using the cqe peeked from the > > CQ ring. We are using io_uring_peek_cqe() only to see if there > >

Re: [PATCH] block/backup: drop dead code from backup_job_create

2019-10-18 Thread Stefano Garzarella
I don't know this code very well, but IIUC only block_job_add_bdrv() could fail after the job creation, but this shouldn't happen because "Required permissions are already taken by backup-top target", so it seems safe for me: Acked-by: Stefano Garzarella Thanks, Stefano &g

Re: [PATCH 1/2] tests/tcg/multiarch: fix code style in function main of test-mmap.c

2019-11-11 Thread Stefano Garzarella
On Tue, Oct 15, 2019 at 11:13:49AM +0800, Wei Yang wrote: > This file uses quite a different code style and changing just one line > would leads to some awkward appearance. > > This is a preparation for the following replacement of > sysconf(_SC_PAGESIZE). > > BTW, to depress ERROR message from c

Re: [PATCH 2/2] core: replace sysconf(_SC_PAGESIZE) with qemu_real_host_page_size

2019-11-11 Thread Stefano Garzarella
main(int argc, char **argv) > if (argc > 1) { > qemu_strtoul(argv[1], NULL, 0, &pagesize); > } else { > - pagesize = sysconf(_SC_PAGESIZE); > +pagesize = qemu_real_host_page_size; > } > > /* Assume pagesize is a power of two. */ The patch LGTM: Reviewed-by: Stefano Garzarella Thanks, Stefano

Re: [PATCH] block/nbd: fix memory leak in nbd_open()

2019-11-28 Thread Stefano Garzarella
On Thu, Nov 28, 2019 at 04:40:10PM +0800, pannengy...@huawei.com wrote: Hi, I don't know nbd code very well, the patch LGTM, but just a comment below: > From: PanNengyuan > > In currently implementation there will be a memory leak when > nbd_client_connect() returns error status. Here is an eas

Re: [PATCH] block/nbd: fix memory leak in nbd_open()

2019-11-28 Thread Stefano Garzarella
't have time, I can do it. Cheers, Stefano > > Thanks. > > On 2019/11/28 17:01, Stefano Garzarella wrote: > > On Thu, Nov 28, 2019 at 04:40:10PM +0800, pannengy...@huawei.com wrote: > > > > Hi, > > I don't know nbd code very well, the patc

Re: [PATCH V2] block/nbd: fix memory leak in nbd_open()

2019-11-28 Thread Stefano Garzarella
nbd_open /mnt/sdb/qemu-4.2.0-rc0/block/nbd.c:1873 > > Reported-by: Euler Robot > Signed-off-by: PanNengyuan > --- > Changes v2 to v1: > - add a new function to do the common cleanups (suggested by Stefano > Garzarella). > --- > block/nbd.c | 26 --

Re: [PATCH v5 1/2] block/nbd: extract the common cleanup code

2019-12-05 Thread Stefano Garzarella
Hi Pan, On Thu, Dec 05, 2019 at 11:45:27AM +0800, pannengy...@huawei.com wrote: > From: Pan Nengyuan > > The BDRVNBDState cleanup code is common in two places, add > nbd_clear_bdrvstate() function to do these cleanups. > > Signed-off-by: Stefano Garzarella I only suggested

Re: [PATCH v5 2/2] block/nbd: fix memory leak in nbd_open()

2019-12-05 Thread Stefano Garzarella
d_open /mnt/sdb/qemu-4.2.0-rc0/block/nbd.c:1873 > > Fixes: 8f071c9db506e03ab > Reported-by: Euler Robot > Signed-off-by: Pan Nengyuan > Reviewed-by: Vladimir Sementsov-Ogievskiy > Cc: qemu-stable > Cc: Vladimir Sementsov-Ogievskiy > --- > Changes v2 to v1: > - add a

Re: [PATCH v3 04/15] block/io_uring: implements interfaces for io_uring

2020-01-13 Thread Stefano Garzarella
M, but I don't have a lot of experience with io_uring until now, so Acked-by: Stefano Garzarella I really interested on it and I'll try to contribute on this new AIO engine. > > diff --git a/MAINTAINERS b/MAINTAINERS > index 740401bcbb..fc7f53b229 100644 > --- a/MAINTAINERS >

Re: [PATCH v3 08/15] block/file-posix.c: extend to use io_uring

2020-01-13 Thread Stefano Garzarella
On Wed, Dec 18, 2019 at 04:32:21PM +, Stefan Hajnoczi wrote: > From: Aarushi Mehta > > Signed-off-by: Aarushi Mehta > Reviewed-by: Maxim Levitsky > Signed-off-by: Stefan Hajnoczi > --- > block/file-posix.c | 95 -- > 1 file changed, 75 insertion

Re: [PATCH v3 00/15] io_uring: add Linux io_uring AIO engine

2020-01-13 Thread Stefano Garzarella
The series LGTM, just some comments on patches 4 and 8. I succefully tried iotests on raw and qcow2 with io_uring, so Acked-by: Stefano Garzarella Thanks, Stefano On Wed, Dec 18, 2019 at 04:32:13PM +, Stefan Hajnoczi wrote: > v12: > * Reword BlockdevAioOptions QAPI schema

Re: [PATCH v2] qcow2: Use a GString in report_unsupported_feature()

2020-01-16 Thread Stefano Garzarella
essage. > > Suggested-by: Philippe Mathieu-Daudé > Signed-off-by: Alberto Garcia > Reviewed-by: Alex Bennée > --- > block/qcow2.c | 23 +++ > 1 file changed, 11 insertions(+), 12 deletions(-) Reviewed-by: Stefano Garzarella > > v2: Use g_autop

Re: [PATCH v2] qemu-img: Explicit number replaced by a constant

2020-08-19 Thread Stefano Garzarella
s.total_sectors * BDRV_SECTOR_SIZE, > &error_abort); > ret = add_old_style_options(out_fmt, opts, out_baseimg, NULL); > if (ret < 0) { > goto out; > -- > 2.25.3 > > > Reviewed-by: Stefano Garzarella

Re: [PATCH v5 01/15] block/nvme: Replace magic value by SCALE_MS definition

2020-08-21 Thread Stefano Garzarella
ertion(+), 1 deletion(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index 374e2689157..2f5e3c2adfa 100644 > --- a/block/nvme.c > +++ b/block/nvme.c > @@ -715,7 +715,7 @@ static int nvme_init(BlockDriverState *bs, const char > *device, int namesp

Re: [PATCH v5 03/15] block/nvme: Let nvme_create_queue_pair() fail gracefully

2020-08-21 Thread Stefano Garzarella
On Thu, Aug 20, 2020 at 06:58:49PM +0200, Philippe Mathieu-Daudé wrote: > As nvme_create_queue_pair() is allowed to fail, replace the > alloc() calls by try_alloc() to avoid aborting QEMU. > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 12 +

Re: [PATCH v5 04/15] block/nvme: Define INDEX macros to ease code review

2020-08-21 Thread Stefano Garzarella
-Daudé > --- > block/nvme.c | 33 +++-- > 1 file changed, 19 insertions(+), 14 deletions(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index e1893b4e792..003809fbd83 100644 > --- a/block/nvme.c > +++ b

Re: [PATCH v5 05/15] block/nvme: Improve error message when IO queue creation failed

2020-08-21 Thread Stefano Garzarella
gt; block/nvme.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index 003809fbd83..53448b7d230 100644 > --- a/block/nvme.c > +++ b/block/nvme.c > @@ -648,7 +648,7 @@ static bool nvm

Re: [PATCH v5 06/15] block/nvme: Use common error path in nvme_add_io_queue()

2020-08-21 Thread Stefano Garzarella
: Philippe Mathieu-Daudé > --- > block/nvme.c | 9 + > 1 file changed, 5 insertions(+), 4 deletions(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index 53448b7d230..3101f1ad55d 100644 > --- a/block/nvme.c > +++ b/bloc

Re: [PATCH v5 07/15] block/nvme: Rename local variable

2020-08-21 Thread Stefano Garzarella
Hajnoczi > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 19 +-- > 1 file changed, 9 insertions(+), 10 deletions(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index 3101f1ad55d..99822d9fd36 100644 >

Re: [PATCH v5 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

2020-08-21 Thread Stefano Garzarella
f (NVME_ID_NS_DLFEAT_WRITE_ZEROES(idns->dlfeat) && > -NVME_ID_NS_DLFEAT_READ_BEHAVIOR(idns->dlfeat) == > +if (NVME_ID_NS_DLFEAT_WRITE_ZEROES(id->ns.dlfeat) && > +NVME_ID_NS_DLFEAT_READ_BEHAVIOR(id->ns.dlfeat) == > NVME_ID_NS_DLFEAT_READ_BEHAVIOR_ZEROES) { > bs->supported_write_flags |= BDRV_REQ_MAY_UNMAP; > } > -- > 2.26.2 > > With or without the new tyoe, the patch looks good to me: Reviewed-by: Stefano Garzarella

Re: [PATCH v5 09/15] block/nvme: Replace qemu_try_blockalign0 by qemu_try_blockalign/memset

2020-08-21 Thread Stefano Garzarella
czi > Signed-off-by: Philippe Mathieu-Daudé > --- > block/nvme.c | 16 +--- > 1 file changed, 9 insertions(+), 7 deletions(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index 2bd1935f951..ac6bb52043d 100644 > --- a/bl

Re: [PATCH v5 10/15] block/nvme: Replace qemu_try_blockalign(bs) by qemu_try_memalign(pg_sz)

2020-08-21 Thread Stefano Garzarella
audé > --- > block/nvme.c | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index ac6bb52043d..f180078e781 100644 > --- a/block/nvme.c > +++ b/block/nvme.c > @@ -174,

Re: [PATCH v5 11/15] block/nvme: Simplify nvme_init_queue() arguments

2020-08-21 Thread Stefano Garzarella
me.c | 7 +++ > 1 file changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index f180078e781..5b69fc75a60 100644 > --- a/block/nvme.c > +++ b/block/nvme.c > @@ -165,10 +165,9 @@ static QemuOptsList runt

Re: [PATCH v5 12/15] block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE

2020-08-21 Thread Stefano Garzarella
ckDriverState *bs, > NVMeQueuePair *q, > } > nvme_submit_command(q, req, cmd, nvme_cmd_sync_cb, &ret); > > -BDRV_POLL_WHILE(bs, ret == -EINPROGRESS); > +AIO_WAIT_WHILE(aio_context, ret == -EINPROGRESS); Maybe I would have: AIO_WAIT_WHILE(bdrv_get_aio_context(

Re: [PATCH v5 13/15] block/nvme: Simplify nvme_create_queue_pair() arguments

2020-08-21 Thread Stefano Garzarella
gt; --- > block/nvme.c | 13 +++-- > 1 file changed, 7 insertions(+), 6 deletions(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index 456fe61f5ea..1f67e888c84 100644 > --- a/block/nvme.c > +++ b/block/nvme.c > @@ -208,12 +20

Re: [PATCH v5 14/15] block/nvme: Extract nvme_poll_queue()

2020-08-21 Thread Stefano Garzarella
t; block/nvme.c | 44 +++- > 1 file changed, 27 insertions(+), 17 deletions(-) Reviewed-by: Stefano Garzarella > > diff --git a/block/nvme.c b/block/nvme.c > index 1f67e888c84..a61e86a83eb 100644 > --- a/block/nvme.c > +++ b/block/nvme.c > @@ -5

Re: [PATCH v5 15/15] block/nvme: Use an array of EventNotifier

2020-08-21 Thread Stefano Garzarella
On Thu, Aug 20, 2020 at 06:59:01PM +0200, Philippe Mathieu-Daudé wrote: > In preparation of using multiple IRQ (thus multiple eventfds) > make BDRVNVMeState::irq_notifier an array (for now of a single > element, the admin queue notifier). > > Reviewed-by: Stefan Hajnoczi > Signed-off-by: Philipp

Re: [PATCH v5 12/15] block/nvme: Replace BDRV_POLL_WHILE by AIO_WAIT_WHILE

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 03:15:58PM +0200, Philippe Mathieu-Daudé wrote: > On 8/21/20 12:15 PM, Stefano Garzarella wrote: > > On Thu, Aug 20, 2020 at 06:58:58PM +0200, Philippe Mathieu-Daudé wrote: > >> BDRV_POLL_WHILE() is defined as: > >> > >>

Re: [PATCH v5 15/15] block/nvme: Use an array of EventNotifier

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 03:09:13PM +0200, Philippe Mathieu-Daudé wrote: > On 8/21/20 12:29 PM, Stefano Garzarella wrote: > > On Thu, Aug 20, 2020 at 06:59:01PM +0200, Philippe Mathieu-Daudé wrote: > >> In preparation of using multiple IRQ (thus multiple eventfds) >

Re: [PATCH v5 08/15] block/nvme: Use union of NvmeIdCtrl / NvmeIdNs structures

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 03:27:15PM +0200, Philippe Mathieu-Daudé wrote: > On 8/21/20 12:03 PM, Stefano Garzarella wrote: > > On Thu, Aug 20, 2020 at 06:58:54PM +0200, Philippe Mathieu-Daudé wrote: > >> We allocate an unique chunk of memory then use it for two > >> dif

Re: [PATCH v5 03/15] block/nvme: Let nvme_create_queue_pair() fail gracefully

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 03:36:47PM +0200, Philippe Mathieu-Daudé wrote: > On 8/21/20 11:44 AM, Stefano Garzarella wrote: > > On Thu, Aug 20, 2020 at 06:58:49PM +0200, Philippe Mathieu-Daudé wrote: > >> As nvme_create_queue_pair() is allowed to fail, replace the > >>

[PATCH] util/meson.build: fix fdmon-io_uring build

2020-08-21 Thread Stefano Garzarella
ing_destroy': qemu/build/../util/fdmon-io_uring.c:343: undefined reference to `io_uring_queue_exit' collect2: error: ld returned 1 exit status This patch fix the issue adding 'linux_io_uring' dependency for fdmon-io_uring.c Fixes: a81df1b68b ("libqemuutil, qapi, trace:

Re: [PATCH] util/meson.build: fix fdmon-io_uring build

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 06:12:45PM +0200, Philippe Mathieu-Daudé wrote: > Hi Stefano, > > On 8/21/20 5:48 PM, Stefano Garzarella wrote: > > libqemuutil.a build fails with this error: > > > > /usr/bin/ld: libqemuutil.a(util_fdmon-io_uring.c.o): in function >

Re: [PATCH] util/meson.build: fix fdmon-io_uring build

2020-08-21 Thread Stefano Garzarella
On Fri, Aug 21, 2020 at 06:46:15PM +0200, Philippe Mathieu-Daudé wrote: > On 8/21/20 6:23 PM, Stefano Garzarella wrote: > > On Fri, Aug 21, 2020 at 06:12:45PM +0200, Philippe Mathieu-Daudé wrote: > >> Hi Stefano, > >> > >> On 8/21/20 5:48 PM, Stefano Garzare

Re: [PATCH v2 0/2] util/hexdump: Cleanup qemu_hexdump()

2020-08-28 Thread Stefano Garzarella
t.c| 2 +- > net/colo-compare.c | 24 > net/net.c| 2 +- > util/hexdump.c | 4 +++- > util/iov.c | 2 +- > 10 files changed, 24 insertions(+), 21 deletions(-) > > -- > 2.26.2 > > Reviewed-by: Stefano Garzarella

[PATCH] block/rbd: add 'namespace' to qemu_rbd_strong_runtime_opts[]

2020-09-14 Thread Stefano Garzarella
can changes the data of a BDS. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1821528 Fixes: 19ae9ae014 ("block/rbd: Add support for ceph namespaces") Cc: Florian Florensa Signed-off-by: Stefano Garzarella --- block/rbd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bl

Re: [PATCH v2] virtio-blk: Respect discard granularity

2021-02-23 Thread Stefano Garzarella
On Tue, Feb 23, 2021 at 02:36:16PM +0900, Akihiko Odaki wrote: Signed-off-by: Akihiko Odaki --- hw/block/virtio-blk.c | 8 +++- hw/core/machine.c | 9 - include/hw/virtio/virtio-blk.h | 1 + 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/hw/block/v

[PATCH] blockjob: report a better error message

2021-02-23 Thread Stefano Garzarella
as explained in include/qemu/job.h: typedef struct Job { ... /** * Error object for a failed job. * If job->ret is nonzero and an error object was not set, it will be set * to strerror(-job->ret) during job_completed. */ Error *err; } Suggested-by: Kevin

Re: [PATCH v3] virtio-blk: Respect discard granularity

2021-02-24 Thread Stefano Garzarella
+Cc stefa...@redhat.com Please explain a bit the changes in the commit message, for example that you added 'report-discard-granularity', disabled it for older machines, that we use blk_size as default granularity, etc. Something like this: Report the configured granularity for discard op

Re: [PATCH] blockjob: report a better error message

2021-02-24 Thread Stefano Garzarella
On Wed, Feb 24, 2021 at 03:36:20PM +0100, Kevin Wolf wrote: Am 23.02.2021 um 14:11 hat Stefano Garzarella geschrieben: When a block job fails, we report 'strerror(-job->job.ret)' error message, also if the job set an error object. Let's report a better error message using &#x

Re: [PATCH] blockjob: report a better error message

2021-02-24 Thread Stefano Garzarella
On Wed, Feb 24, 2021 at 06:04:14PM +0100, Kevin Wolf wrote: Am 24.02.2021 um 16:59 hat Stefano Garzarella geschrieben: On Wed, Feb 24, 2021 at 03:36:20PM +0100, Kevin Wolf wrote: > Am 23.02.2021 um 14:11 hat Stefano Garzarella geschrieben: > > When a block job fails, we report '

Re: [PATCH v4] virtio-blk: Respect discard granularity

2021-02-25 Thread Stefano Garzarella
+), 2 deletions(-) Reviewed-by: Stefano Garzarella

[PATCH v2] blockjob: report a better error message

2021-02-25 Thread Stefano Garzarella
ere 'job.err' is not set by a scheduled bottom half. In that case we use strerror(-job->ret) as it was before. Suggested-by: Kevin Wolf Signed-off-by: Stefano Garzarella --- Notes: v2: - fixed potential issue in block_job_query() [Kevin] - updated commit message blockjob.

Re: [RFC PATCH 1/3] exec/memory: Introduce memory_region_init_rom_device_from_file()

2021-03-01 Thread Stefano Garzarella
I don't know this code very well, but I have a couple of comments below :-) On Fri, Feb 26, 2021 at 12:02:36AM +0100, Philippe Mathieu-Daudé wrote: Introduce memory_region_init_rom_device_from_file() which mmap the backing file of ROM devices. This allows to reduce QEMU memory footprint as the

QEMU RBD is slow with QCOW2 images

2021-03-03 Thread Stefano Garzarella
Hi Jason, as reported in this BZ [1], when qemu-img creates a QCOW2 image on RBD writing data is very slow compared to a raw file. Comparing raw vs QCOW2 image creation with RBD I found that we use a different object size, for the raw file I see '4 MiB objects', for QCOW2 I see '64 KiB object

Re: QEMU RBD is slow with QCOW2 images

2021-03-04 Thread Stefano Garzarella
On Wed, Mar 03, 2021 at 01:47:06PM -0500, Jason Dillaman wrote: On Wed, Mar 3, 2021 at 12:41 PM Stefano Garzarella wrote: Hi Jason, as reported in this BZ [1], when qemu-img creates a QCOW2 image on RBD writing data is very slow compared to a raw file. Comparing raw vs QCOW2 image creation

Re: QEMU RBD is slow with QCOW2 images

2021-03-04 Thread Stefano Garzarella
On Wed, Mar 03, 2021 at 10:26:12PM +0100, Peter Lieven wrote: Am 03.03.21 um 19:47 schrieb Jason Dillaman: On Wed, Mar 3, 2021 at 12:41 PM Stefano Garzarella wrote: Hi Jason, as reported in this BZ [1], when qemu-img creates a QCOW2 image on RBD writing data is very slow compared to a raw

Re: QEMU RBD is slow with QCOW2 images

2021-03-04 Thread Stefano Garzarella
On Thu, Mar 04, 2021 at 10:25:33AM +, Daniel P. Berrangé wrote: On Thu, Mar 04, 2021 at 09:55:40AM +0100, Stefano Garzarella wrote: On Wed, Mar 03, 2021 at 01:47:06PM -0500, Jason Dillaman wrote: > On Wed, Mar 3, 2021 at 12:41 PM Stefano Garzarella wrote: > > > > Hi Jason,

Re: QEMU RBD is slow with QCOW2 images

2021-03-04 Thread Stefano Garzarella
On Thu, Mar 04, 2021 at 01:05:02PM +0100, Kevin Wolf wrote: Am 03.03.2021 um 18:40 hat Stefano Garzarella geschrieben: Hi Jason, as reported in this BZ [1], when qemu-img creates a QCOW2 image on RBD writing data is very slow compared to a raw file. Comparing raw vs QCOW2 image creation with

Re: QEMU RBD is slow with QCOW2 images

2021-03-04 Thread Stefano Garzarella
On Thu, Mar 04, 2021 at 03:59:17PM +0100, Kevin Wolf wrote: Am 04.03.2021 um 15:08 hat Stefano Garzarella geschrieben: On Thu, Mar 04, 2021 at 01:05:02PM +0100, Kevin Wolf wrote: > Am 03.03.2021 um 18:40 hat Stefano Garzarella geschrieben: > > Hi Jason, > > as reported in this BZ

Re: QEMU RBD is slow with QCOW2 images

2021-03-05 Thread Stefano Garzarella
On Fri, Mar 05, 2021 at 10:16:41AM +0100, Kevin Wolf wrote: Am 04.03.2021 um 18:32 hat Stefano Garzarella geschrieben: On Thu, Mar 04, 2021 at 03:59:17PM +0100, Kevin Wolf wrote: > Am 04.03.2021 um 15:08 hat Stefano Garzarella geschrieben: > > On Thu, Mar 04, 2021 at 01:05:02PM +01

[PATCH] block: remove format defaults from QemuOpts in bdrv_create_file()

2021-03-08 Thread Stefano Garzarella
rt QemuOpts to QDict, in this way we take only the set options, and then convert it back to QemuOpts, using the 'create_opts' of the protocol. So the new QemuOpts, will contain only the protocol defaults. Suggested-by: Kevin Wolf Signed-off-by: Stefano Garzarella --- block.c | 36 +

[PATCH 0/2] block/rbd: fix memory leaks

2021-03-29 Thread Stefano Garzarella
This series fixes two memory leaks, found through valgrind, in the rbd driver. Stefano Garzarella (2): block/rbd: fix memory leak in qemu_rbd_connect() block/rbd: fix memory leak in qemu_rbd_co_create_opts() block/rbd.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions

[PATCH 1/2] block/rbd: fix memory leak in qemu_rbd_connect()

2021-03-29 Thread Stefano Garzarella
(qapi-commands-block-core.c:1086) by 0x90B528: do_qmp_dispatch_bh (qmp-dispatch.c:131) by 0x907EA4: aio_bh_poll (async.c:164) Fix freeing 'mon_host' also when qemu_rbd_connect() ends correctly. Signed-off-by: Stefano Garzarella --- block/rbd.c | 9 + 1 file ch

[PATCH 2/2] block/rbd: fix memory leak in qemu_rbd_co_create_opts()

2021-03-29 Thread Stefano Garzarella
o_entry (block.c:492) by 0x241902: coroutine_trampoline (coroutine-ucontext.c:173) by 0x57530AF: ??? (in /usr/lib64/libc-2.32.so) by 0x1FFEFFFA6F: ??? Fix setting 'has_q_namespace' to true when we allocate 'q_namespace'. Fixes: 19ae9ae014 ("block/rbd: Add support

Re: [PATCH 1/2] block/rbd: fix memory leak in qemu_rbd_connect()

2021-04-08 Thread Stefano Garzarella
On Tue, Apr 06, 2021 at 10:22:30AM +0200, Markus Armbruster wrote: Stefano Garzarella writes: In qemu_rbd_connect(), 'mon_host' is allocated by qemu_rbd_mon_host() using g_strjoinv(), but it's only freed in the error path, leaking memory in the success path as reported by

Re: [PATCH 0/2] block/rbd: fix memory leaks

2021-04-08 Thread Stefano Garzarella
On Wed, Apr 07, 2021 at 11:38:17AM +0200, Markus Armbruster wrote: Max Reitz writes: On 29.03.21 17:01, Stefano Garzarella wrote: This series fixes two memory leaks, found through valgrind, in the rbd driver. Stefano Garzarella (2): block/rbd: fix memory leak in qemu_rbd_connect

Re: [PATCH v3 1/2] iotests/231: Update expected deprecation message

2021-04-21 Thread Stefano Garzarella
Kuehl Reviewed-by: Max Reitz --- tests/qemu-iotests/231.out | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) Reviewed-by: Stefano Garzarella diff --git a/tests/qemu-iotests/231.out b/tests/qemu-iotests/231.out index 579ba11c16..747dd221bb 100644 --- a/tests/qemu-iotests/231.out +++ b

<    1   2   3   4   5   6   >