Re: [PATCH 5/7] vhost: Distinguish errors in vhost_dev_get_config()

2021-06-10 Thread Stefano Garzarella
ret = hdev->vhost_ops->vhost_get_config(hdev, config, config_len, errp); +if (ret < 0 && !*errp) { +error_setg_errno(errp, -ret, "vhost_get_config failed"); +} + return ret; } -return -1; +error_setg(errp, "vhost_dev_get_config not implemented"); ^ Maybe I'd replace s/vhost_dev_get_config/vhost_get_config But it's not that important: Reviewed-by: Stefano Garzarella

Re: [PATCH 4/7] vhost-user-blk: Add Error parameter to vhost_user_blk_start()

2021-06-10 Thread Stefano Garzarella
, 15 insertions(+), 16 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH 3/7] vhost: Return 0/-errno in vhost_dev_init()

2021-06-10 Thread Stefano Garzarella
-user.c| 10 +++--- hw/virtio/vhost-vdpa.c| 4 +++- hw/virtio/vhost.c | 8 4 files changed, 17 insertions(+), 9 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH 2/7] vhost: Distinguish errors in vhost_backend_init()

2021-06-10 Thread Stefano Garzarella
/vhost.c | 13 +- 5 files changed, 32 insertions(+), 29 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH 1/7] vhost: Add Error parameter to vhost_dev_init()

2021-06-10 Thread Stefano Garzarella
| 4 +--- hw/scsi/vhost-user-scsi.c| 4 +--- hw/virtio/vhost-user-fs.c| 3 +-- hw/virtio/vhost-user-vsock.c | 3 +-- hw/virtio/vhost-vsock.c | 3 +-- hw/virtio/vhost.c| 16 ++-- 11 files changed, 29 insertions(+), 25 deletions(-) Reviewed-by: Stefano

Re: [PATCH] MAINTAINERS: update block/rbd.c maintainer

2021-05-21 Thread Stefano Garzarella
eab178aeee5e..3e77ac9030fa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3042,7 +3042,7 @@ S: Supported F: block/vmdk.c RBD -M: Jason Dillaman +M: Ilya Dryomov L: qemu-block@nongnu.org S: Supported F: block/rbd.c -- 2.19.2 Acked-by: Stefano Garzarella Thanks for taking this! Stefano

Re: [PATCH 0/3] hw/virtio: Constify VirtIOFeature

2021-05-12 Thread Stefano Garzarella
feature_sizes[] virtio-net: Constify VirtIOFeature feature_sizes[] include/hw/virtio/virtio.h | 2 +- hw/block/virtio-blk.c | 2 +- hw/net/virtio-net.c| 2 +- hw/virtio/virtio.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH 2/4] block/vvfat: Fix leak of BDRVVVFATState::used_clusters

2021-05-03 Thread Stefano Garzarella
et to NULL the other pointers allocated through GLib API (e.g. s->qcow_filename), but IIUC the BDRVVVFATState (bs->opaque) is allocated through g_malloc0() in bdrv_open_driver(), so those initializations should be superfluous and in this case we can avoid setting s->used_clusters to NULL. Reviewed-by: Stefano Garzarella

Re: [PATCH 1/4] block/vvfat: Fix leak of BDRVVVFATState::qcow_filename

2021-05-03 Thread Stefano Garzarella
vfat_close(BlockDriverState *bs) array_free(&(s->directory)); array_free(&(s->mapping)); g_free(s->cluster_buffer); +g_free(s->qcow_filename); if (s->qcow) { migrate_del_blocker(s->migration_blocker); -- 2.26.3 Reviewed-by: Stefano Garzarella

Re: [PATCH v4 2/2] block/rbd: Add an escape-aware strchr helper

2021-04-22 Thread Stefano Garzarella
4 tests/qemu-iotests/231.out | 3 +++ 3 files changed, 28 insertions(+), 11 deletions(-) Reviewed-by: Stefano Garzarella

Re: [PATCH v3 2/2] block/rbd: Add an escape-aware strchr helper

2021-04-22 Thread Stefano Garzarella
Hi Connor, On Wed, Apr 21, 2021 at 04:15:42PM -0500, Connor Kuehl wrote: On 4/21/21 6:04 AM, Stefano Garzarella wrote: +static char *qemu_rbd_strchr(char *src, char delim) +{ +char *p; + +for (p = src; *p; ++p) { +if (*p == delim) { +return p

Re: [PATCH v3 2/2] block/rbd: Add an escape-aware strchr helper

2021-04-21 Thread Stefano Garzarella
On Fri, Apr 09, 2021 at 09:38:54AM -0500, Connor Kuehl wrote: Sometimes the parser needs to further split a token it has collected from the token input stream. Right now, it does a cursory check to see if the relevant characters appear in the token to determine if it should break it down

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

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 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 valgrind: 80

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

2021-03-29 Thread Stefano Garzarella
) 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 for ceph namespaces") Signed-off-b

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

2021-03-29 Thread Stefano Garzarella
-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 changed, 5 insertions(+), 4

[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] block: remove format defaults from QemuOpts in bdrv_create_file()

2021-03-08 Thread Stefano Garzarella
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 +++- 1 f

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

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-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

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 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 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

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

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

[PATCH v2] blockjob: report a better error message

2021-02-25 Thread Stefano Garzarella
where '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.c | 10 +++-

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

2021-02-25 Thread Stefano Garzarella
(-) Reviewed-by: Stefano Garzarella

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 'stre

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 'error_get_pretty(

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

[PATCH] blockjob: report a better error message

2021-02-23 Thread Stefano Garzarella
emu/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 Wolf Signed-off-by: Ste

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

Re: [PATCH] block/nfs: fix int overflow in nfs_client_open_qdict

2020-12-10 Thread Stefano Garzarella
/nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) The issue seems to be pre-existing to the commit a1a42af422d46812f1f0cebe6b230c20409a3731, but of course that commit touched this code and this patch would not apply before, so it seems okay to me: Reviewed-by: Stefano Garzarella

Re: [PATCH v2 0/4] vhost-user: avoid g_return_val_if() in get/set_config()

2020-12-03 Thread Stefano Garzarella
, 20 insertions(+), 4 deletions(-) -- 2.28.0 Reviewed-by: Stefano Garzarella

Re: [PATCH 0/4] vhost-user: avoid g_return_val_if() in get/set_config()

2020-11-23 Thread Stefano Garzarella
(-) Reviewed-by: Stefano Garzarella

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

2020-09-14 Thread Stefano Garzarella
a 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/block/rbd.c b/block/rb

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

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] 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 >

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

2020-08-21 Thread Stefano Garzarella
-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: convert to meson") Cc: pbonz...@redhat.com Signed-off-b

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 > >>

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 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 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 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:

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 13/15] block/nvme: Simplify nvme_create_queue_pair() arguments

2020-08-21 Thread Stefano Garzarella
-- > 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 +208,12

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, ); > > -BDRV_POLL_WHILE(bs, ret == -EINPROGRESS); > +AIO_WAIT_WHILE(aio_context, ret == -EINPROGRESS); Maybe I would have: AIO_WAIT_WHILE(bdrv_get_aio_context(bs),

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

2020-08-21 Thread Stefano Garzarella
| 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 runtime_o

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 09/15] block/nvme: Replace qemu_try_blockalign0 by qemu_try_blockalign/memset

2020-08-21 Thread Stefano Garzarella
i > 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/block/n

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

2020-08-21 Thread Stefano Garzarella
> > -s->nsze = le64_to_cpu(idns->nsze); > -lbaf = >lbaf[NVME_ID_NS_FLBAS_INDEX(idns->flbas)]; > +s->nsze = le64_to_cpu(id->ns.nsze); > +lbaf = >ns.lbaf[NVME_ID_NS_FLBAS_INDEX(id->ns.flbas)]; > > -if (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 07/15] block/nvme: Rename local variable

2020-08-21 Thread Stefano Garzarella
d-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 > --- a/block/nvme.c

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 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 04/15] block/nvme: Define INDEX macros to ease code review

2020-08-21 Thread Stefano Garzarella
t; 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/block/nvme.c > @

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 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 v2] qemu-img: Explicit number replaced by a constant

2020-08-19 Thread Stefano Garzarella
.total_sectors * BDRV_SECTOR_SIZE, > _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] qemu-img: Explicit number replaced by a constant

2020-08-18 Thread Stefano Garzarella
Hi Yi Li, thanks for this patch! Just a comment below: On Mon, Aug 17, 2020 at 07:01:13PM +0800, Yi Li wrote: > Signed-off-by: Yi Li > --- > qemu-img.c | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/qemu-img.c b/qemu-img.c > index 5308773811..a0fbc2757c

Re: [PATCH 0/7] block: Use definitions instead of magic values

2020-08-17 Thread Stefano Garzarella
- > hw/ide/pci.c| 2 +- > hw/scsi/scsi-disk.c | 44 +++- > 6 files changed, 47 insertions(+), 41 deletions(-) Series: Reviewed-by: Stefano Garzarella Thanks for the cleaning that makes the code more readable! Stefano

Re: [PATCH 10/12] block/file-posix: fix a possible undefined behavior

2020-08-17 Thread Stefano Garzarella
f-by: Pan Nengyuan > --- > Cc: Kevin Wolf > Cc: Max Reitz > Cc: Aarushi Mehta > Cc: qemu-block@nongnu.org > --- > block/file-posix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefano Garzarella Thanks, Stefano > > diff --git a/block/file

Re: [PATCH-for-5.1?] util/pagesize: Make qemu_real_host_page_size of type size_t

2020-07-30 Thread Stefano Garzarella
On Thu, Jul 30, 2020 at 03:59:35PM +0200, Philippe Mathieu-Daudé wrote: > We use different types to hold 'qemu_real_host_page_size'. > Unify picking 'size_t' which seems the best candidate. I agree, it sounds better! Should we change even "qemu_host_page_size"? Thanks, Stefano > > Doing so

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 > >

[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

[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 changed, 1

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

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=EINT

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

2020-04-08 Thread Stefano Garzarella
fan 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 with EINTR? I mea

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

2020-04-03 Thread Stefano Garzarella
--- > 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-io_uring.

Re: [PATCH v2 1/2] virtio-blk: delete vqs on the error path in realize()

2020-03-27 Thread Stefano Garzarella
an Nengyuan > --- > v2->v1: > - Fix incorrect free in v1, it will cause a uaf. > --- > Cc: Stefan Hajnoczi > Cc: Kevin Wolf > Cc: Max Reitz > Cc: qemu-block@nongnu.org > --- > hw/block/virtio-blk.c | 3 +++ > 1 file changed, 3 insertions(+) Reviewed-by: Stefa

Re: [PATCH 1/2] virtio-blk: delete vqs on the error path in realize()

2020-03-27 Thread Stefano Garzarella
On Fri, Mar 27, 2020 at 11:56:49AM +0800, Pan Nengyuan wrote: > virtio_vqs forgot to free on the error path in realize(). Fix that. > > The asan stack: > Direct leak of 14336 byte(s) in 1 object(s) allocated from: > #0 0x7f58b93fd970 in __interceptor_calloc (/lib64/libasan.so.5+0xef970) >

Re: [PATCH] nvme: Print 'cqid' for nvme_del_cq

2020-03-25 Thread Stefano Garzarella
On Tue, Mar 24, 2020 at 11:06:46PM +0900, Minwoo Im wrote: > The given argument for this trace should be cqid, not sqid. > > Signed-off-by: Minwoo Im > --- > hw/block/trace-events | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefano Garzarella &g

Re: [PATCH] aio-posix: fix io_uring with external events

2020-03-20 Thread Stefano Garzarella
if (!QSLIST_EMPTY_RCU(>submit_list)) { > +return true; > +} > + > +/* Are we falling back to fdmon-poll? */ > + return atomic_read(>external_disable_cnt); > } > > static const FDMonOps fdmon_io_uring_ops = { > -- > 2.24.1 > Reviewed-by: Stefano Garzarella

Re: [PATCH RESEND 04/13] block/io_uring: Remove superfluous semicolon

2020-02-18 Thread Stefano Garzarella
On Tue, Feb 18, 2020 at 10:43:53AM +0100, Philippe Mathieu-Daudé wrote: > Fixes: 6663a0a3376 > Signed-off-by: Philippe Mathieu-Daudé > --- > Cc: Stefano Garzarella > --- > block/io_uring.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Stefano Garzare

Re: [PATCH v2 0/4] virtio-pci: enable blk and scsi multi-queue by default

2020-01-27 Thread Stefano Garzarella
4k direct=1 rw=randread. > > Stefan Hajnoczi (4): > virtio-scsi: introduce a constant for fixed virtqueues > virtio-scsi: default num_queues to -smp N > virtio-blk: default num_queues to -smp N > vhost-user-blk: default num_queues to -smp N The series looks good to me: Reviewed-by: Stefano Garzarella Thanks, Stefano

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

2020-01-16 Thread Stefano Garzarella
; message. > > 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 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 v3 04/15] block/io_uring: implements interfaces for io_uring

2020-01-13 Thread Stefano Garzarella
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 > +++ b/MAINTAIN

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

2019-12-05 Thread Stefano Garzarella
nbd_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 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 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] block/nbd: fix memory leak in nbd_open()

2019-11-28 Thread Stefano Garzarella
me, 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 patch LGTM, but just a c

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

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

2019-11-11 Thread Stefano Garzarella
ain(int argc, char **argv) > if (argc > 1) { > qemu_strtoul(argv[1], NULL, 0, ); > } 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 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

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

2019-10-18 Thread Stefano Garzarella
on'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 > > Rep

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

2019-09-10 Thread Stefano Garzarella
t, 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: [Qemu-block] [PATCH v7 1/4] block: Add zoned device model property

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

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] [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 >

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] [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 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 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 a

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 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 01/11] qemu-img: Fix bdrv_has_zero_init() use in convert

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

<    1   2   3   4   5   6   >