Re: [PATCH for-6.0 2/7] hw/block/nvme: fix missing string representation for ns attachment

2021-03-29 Thread Gollu Appalanaidu
On Wed, Mar 24, 2021 at 09:09:02PM +0100, Klaus Jensen wrote: From: Klaus Jensen Add the missing nvme_adm_opc_str entry for the Namespace Attachment command. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/nvme.h b/hw/block/nvme.h in

Re: [PATCH for-6.0 1/7] hw/block/nvme: fix pi constraint check

2021-03-29 Thread Gollu Appalanaidu
On Wed, Mar 24, 2021 at 09:09:01PM +0100, Klaus Jensen wrote: From: Klaus Jensen Protection Information can only be enabled if there is at least 8 bytes of metadata. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/

Re: [PATCH v3 6/6] block/qcow2: use seqcache for compressed writes

2021-03-29 Thread Vladimir Sementsov-Ogievskiy
12.03.2021 21:15, Max Reitz wrote: On 05.03.21 18:35, Vladimir Sementsov-Ogievskiy wrote: Compressed writes are unaligned to 512, which works very slow in O_DIRECT mode. Let's use the cache. Signed-off-by: Vladimir Sementsov-Ogievskiy ---   block/coroutines.h |   3 +   block/qcow2.h   

Re: [RFC 0/8] virtio: Improve boot time of virtio-scsi-pci and virtio-blk-pci

2021-03-29 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 04:07:27PM +0100, Greg Kurz wrote: > Now that virtio-scsi-pci and virtio-blk-pci map 1 virtqueue per vCPU, > a serious slow down may be observed on setups with a big enough number > of vCPUs. > > Exemple with a pseries guest on a bi-POWER9 socket system (128 HW threads): >

Re: [RFC 6/8] virtio-blk: Use virtio_bus_set_host_notifiers()

2021-03-29 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 04:07:33PM +0100, Greg Kurz wrote: > This allows the virtio-blk-pci device to batch additions and deletions > of host notifiers. This significantly improves boot time of VMs with a > high number of vCPUs, e.g. from 3m26.408s down to 0m59.923s for a pseries > machine with 384

Re: [RFC 5/8] virtio-blk: Fix rollback path in virtio_blk_data_plane_start()

2021-03-29 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 04:07:32PM +0100, Greg Kurz wrote: > When dataplane multiqueue support was added in QEMU 2.7, the path > that would rollback guest notifiers assignment in case of error > simply got dropped. > > Later on, when Error was added to blk_set_aio_context() in QEMU 4.1, > another

Re: [RFC 8/8] virtio-scsi: Use virtio_bus_set_host_notifiers()

2021-03-29 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 04:07:35PM +0100, Greg Kurz wrote: > This allows the virtio-scsi-pci device to batch additions and deletions > of host notifiers. This significantly improves boot time of VMs with a > high number of vCPUs, e.g. from 6m13.969s down to 1m4.268s for a pseries > machine with 384

Re: [RFC 2/8] virtio: Introduce virtio_bus_set_host_notifiers()

2021-03-29 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 04:07:29PM +0100, Greg Kurz wrote: > Multiqueue devices such as virtio-scsi or virtio-blk, all open-code the > same pattern to setup/tear down host notifiers of the request virtqueues. > Consolidate the pattern in a new virtio_bus_set_host_notifiers() API. > Since virtio-scs

Re: [RFC 4/8] virtio-pci: Batch add/del ioeventfds in a single MR transaction

2021-03-29 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 04:07:31PM +0100, Greg Kurz wrote: > diff --git a/softmmu/memory.c b/softmmu/memory.c > index 1b1942d521cc..0279e5671bcb 100644 > --- a/softmmu/memory.c > +++ b/softmmu/memory.c > @@ -2368,7 +2368,7 @@ void memory_region_add_eventfd_full(MemoryRegion *mr, > if (size) {

Re: [RFC 3/8] virtio: Add API to batch set host notifiers

2021-03-29 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 04:07:30PM +0100, Greg Kurz wrote: > Introduce VirtioBusClass methods to begin and commit a transaction > of setting/unsetting host notifiers. These handlers will be implemented > by virtio-pci to batch addition and deletion of ioeventfds for multiqueue > devices like virtio

[PULL for-6.0 2/2] hw/block/nvme: fix ref counting in nvme_format_ns

2021-03-29 Thread Klaus Jensen
From: Klaus Jensen Max noticed that since blk_aio_pwrite_zeroes() may invoke the callback before returning, the callbacks will never see *count == 0 and thus never free the count variable or decrement num_formats causing a CQE to never be posted. Coverity (CID 1451082) also picked up on the fact

[PULL for-6.0 0/2] emulated nvme fixes

2021-03-29 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, The following changes since commit ec2e6e016d24bd429792d08cf607e4c5350dcdaa: Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-6.0-pull-request' into staging (2021-03-28 19:49:57 +0100) are available in the Git repository at: git://git.infrad

[PULL for-6.0 1/2] hw/block/nvme: fix resource leak in nvme_dif_rw

2021-03-29 Thread Klaus Jensen
From: Klaus Jensen If nvme_map_dptr() fails, nvme_dif_rw() will leak the bounce context. Fix this by using the same error handling as everywhere else in the function. Reported-by: Coverity (CID 1451080) Fixes: 146f720c5563 ("hw/block/nvme: end-to-end data protection") Signed-off-by: Klaus Jensen

Re: [RFC 1/8] memory: Allow eventfd add/del without starting a transaction

2021-03-29 Thread Stefan Hajnoczi
On Thu, Mar 25, 2021 at 04:07:28PM +0100, Greg Kurz wrote: > diff --git a/include/exec/memory.h b/include/exec/memory.h > index 5728a681b27d..98ed552e001c 100644 > --- a/include/exec/memory.h > +++ b/include/exec/memory.h > @@ -1848,13 +1848,25 @@ void memory_region_clear_flush_coalesced(MemoryRegi

Re: [PATCH] qsd: Document FUSE exports

2021-03-29 Thread Max Reitz
On 17.02.21 12:58, Max Reitz wrote: Implementing FUSE exports required no changes to the storage daemon, so we forgot to document them there. Considering that both NBD and vhost-user-blk exports are documented in its man page (and NBD exports in its --help text), we should probably do the same f

Re: [PATCH 0/2] file-posix: Cache next hole

2021-03-29 Thread Max Reitz
On 11.02.21 18:22, Max Reitz wrote: Hi, [...] (Speaking of “unless the WRITE permission is shared”: mirror_top is a bit broken in that it takes no permissions (but WRITE if necessary) and shares everything. That seems wrong. Patch 1 addresses that, so that patch 2 can actually do something

Re: [PATCH] iotests/046: Filter request length

2021-03-29 Thread Max Reitz
On 18.09.20 17:33, Max Reitz wrote: For its concurrent requests, 046 has always filtered the offset, probably because concurrent requests may settle in any order. However, it did not filter the request length, and so if requests with different lengths settle in an unexpected order (notably the l

Re: [for-6.0] Non-deterministic qemu-iotests qsd-jobs failures

2021-03-29 Thread Max Reitz
On 29.03.21 17:05, Stefan Hajnoczi wrote: Hi Kevin, Peter hit an s390 qemu-iotests failure. I was able to reproduce it easily. I haven't checked if it reproduce on other platforms too, but it seems likely. Here is what I found. qsd-jobs has race conditions: # Just make sure that this doesn't

Re: [PATCH 4/4] iotests/297: Cover tests/

2021-03-29 Thread Willian Rampazzo
On Mon, Mar 29, 2021 at 10:28 AM Max Reitz wrote: > > 297 so far does not check the named tests, which reside in the tests/ > directory (i.e. full path tests/qemu-iotests/tests). Fix it. > > Thanks to the previous two commits, all named tests pass its scrutiny, > so we do not have to add anything

Re: [PATCH 3/4] migrate-bitmaps-test: Fix pylint warnings

2021-03-29 Thread Willian Rampazzo
On Mon, Mar 29, 2021 at 10:28 AM Max Reitz wrote: > > There are a couple of things pylint takes issue with: > - The "time" import is unused > - The import order (iotests should come last) > - get_bitmap_hash() doesn't use @self and so should be a function > - Semicolons at the end of some lines >

Re: [PATCH 2/4] migrate-bitmaps-postcopy-test: Fix pylint warnings

2021-03-29 Thread Willian Rampazzo
On Mon, Mar 29, 2021 at 10:28 AM Max Reitz wrote: > > pylint complains that discards1_sha256 and all_discards_sha256 are first > set in non-__init__ methods. Let's make it happy. > > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test | 3 +++ > 1 file change

Re: [PATCH 1/4] iotests/297: Drop 169 and 199 from the skip list

2021-03-29 Thread Willian Rampazzo
On Mon, Mar 29, 2021 at 10:28 AM Max Reitz wrote: > > 169 and 199 have been renamed and moved to tests/ (commit a44be0334be: > "iotests: rename and move 169 and 199 tests"), so we can drop them from > the skip list. > > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/297 | 2 +- > 1 file cha

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

2021-03-29 Thread Stefano Garzarella
When we allocate 'q_namespace', we forgot to set 'has_q_namespace' to true. This can cause several issues, including a memory leak, since qapi_free_BlockdevCreateOptions() does not deallocate that memory, as reported by valgrind: 13 bytes in 1 blocks are definitely lost in loss record 7 of 96

[for-6.0] Non-deterministic qemu-iotests qsd-jobs failures

2021-03-29 Thread Stefan Hajnoczi
Hi Kevin, Peter hit an s390 qemu-iotests failure. I was able to reproduce it easily. I haven't checked if it reproduce on other platforms too, but it seems likely. Here is what I found. qsd-jobs has race conditions: # Just make sure that this doesn't crash $QSD --chardev stdio,id=stdio --moni

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

2021-03-29 Thread Stefano Garzarella
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 bytes in 4 blocks are definitely lost in loss record 5,028 of 6,516 at 0x4839809: malloc (vg_replac

[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(-) -- 2.

Re: [PATCH v3 0/3] vhost-user-blk: fix bug on device disconnection during initialization

2021-03-29 Thread Denis Plotnikov
ping! On 25.03.2021 18:12, Denis Plotnikov wrote: v3: * 0003: a new patch added fixing the problem on vm shutdown I stumbled on this bug after v2 sending. * 0001: gramma fixing (Raphael) * 0002: commit message fixing (Raphael) v2: * split the initial patch into two (Raphael)

Re: [PATCH] iotests: add test for removing persistent bitmap from backing file

2021-03-29 Thread Vladimir Sementsov-Ogievskiy
29.03.2021 15:56, Max Reitz wrote: On 17.03.21 17:02, Vladimir Sementsov-Ogievskiy wrote: Just demonstrate one of x-blockdev-reopen usecases. We can't simply remove persistent bitmap from RO node (for example from backing file), as we need to remove it from the image too. So, we should reopen th

[PATCH 4/4] iotests/297: Cover tests/

2021-03-29 Thread Max Reitz
297 so far does not check the named tests, which reside in the tests/ directory (i.e. full path tests/qemu-iotests/tests). Fix it. Thanks to the previous two commits, all named tests pass its scrutiny, so we do not have to add anything to SKIP_FILES. Signed-off-by: Max Reitz --- tests/qemu-iot

[PATCH 0/4] iotests/297: Cover tests/

2021-03-29 Thread Max Reitz
Hi, When reviewing Vladimir’s new addition to tests/, I noticed that 297 so far does not cover named tests. That isn’t so good. This series makes it cover them, and because tests/ is rather sparse at this point, I decided to also fix up the two tests in there that don’t pass pylint’s scrutiny ye

[PATCH 3/4] migrate-bitmaps-test: Fix pylint warnings

2021-03-29 Thread Max Reitz
There are a couple of things pylint takes issue with: - The "time" import is unused - The import order (iotests should come last) - get_bitmap_hash() doesn't use @self and so should be a function - Semicolons at the end of some lines - Parentheses after "if" - Some lines are too long (80 characters

[PATCH 1/4] iotests/297: Drop 169 and 199 from the skip list

2021-03-29 Thread Max Reitz
169 and 199 have been renamed and moved to tests/ (commit a44be0334be: "iotests: rename and move 169 and 199 tests"), so we can drop them from the skip list. Signed-off-by: Max Reitz --- tests/qemu-iotests/297 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests

[PATCH 2/4] migrate-bitmaps-postcopy-test: Fix pylint warnings

2021-03-29 Thread Max Reitz
pylint complains that discards1_sha256 and all_discards_sha256 are first set in non-__init__ methods. Let's make it happy. Signed-off-by: Max Reitz --- tests/qemu-iotests/tests/migrate-bitmaps-postcopy-test | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/qemu-iotests/tests/migrate-

Re: [PATCH v2 2/2] hw/block/nvme: fix ref counting in nvme_format_ns

2021-03-29 Thread Gollu Appalanaidu
On Mon, Mar 22, 2021 at 01:09:44PM +0100, Klaus Jensen wrote: From: Klaus Jensen Max noticed that since blk_aio_pwrite_zeroes() may invoke the callback before returning, the callbacks will never see *count == 0 and thus never free the count variable or decrement num_formats causing a CQE to nev

Re: [PATCH] iotests: add test for removing persistent bitmap from backing file

2021-03-29 Thread Max Reitz
On 17.03.21 17:02, Vladimir Sementsov-Ogievskiy wrote: Just demonstrate one of x-blockdev-reopen usecases. We can't simply remove persistent bitmap from RO node (for example from backing file), as we need to remove it from the image too. So, we should reopen the node first. Signed-off-by: Vladim

Re: [PATCH v2 1/2] hw/block/nvme: fix resource leak in nvme_dif_rw

2021-03-29 Thread Gollu Appalanaidu
On Mon, Mar 22, 2021 at 01:09:43PM +0100, Klaus Jensen wrote: From: Klaus Jensen If nvme_map_dptr() fails, nvme_dif_rw() will leak the bounce context. Fix this by using the same error handling as everywhere else in the function. Reported-by: Coverity (CID 1451080) Fixes: 146f720c5563 ("hw/bloc

Re: [PATCH] qcow2: use external virtual timers

2021-03-29 Thread Paolo Bonzini
On 29/03/21 10:06, Pavel Dovgalyuk wrote: Regular virtual timers are used to emulate timings related to vCPU and peripheral states. QCOW2 uses timers to clean the cache. These timers should have external flag. In the opposite case they affect the execution and it can't be recorded and replayed. T

[RFC PATCH] block/vpc: Support probing of fixed-size VHD images

2021-03-29 Thread Thomas Huth
Fixed-size VHD images don't have a header, only a footer. To be able to still detect them right, support probing via the file name, too. Without this change, images get detected as raw: $ qemu-img create -f vpc -o subformat=fixed test.vhd 2G Formatting 'test.vhd', fmt=vpc size=2147483648 subforma