[PULL for-6.0 v2 03/10] hw/block/nvme: fix the nsid 'invalid' value

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen The `nvme_nsid()` function returns '-1' (h) when the given namespace is NULL. Since h is actually a valid namespace identifier (the "broadcast" value), change this to be '0' since that actually *is* the invalid value. Signed-off-by: Klaus Jensen Reviewed-by:

[PULL for-6.0 v2 07/10] hw/block/nvme: add missing copyright headers

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Add missing license/copyright headers to the nvme-dif.{c,h} files. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme-dif.h | 10 ++ hw/block/nvme-dif.c | 10 ++ 2 files changed, 20 insertions(+) diff --git a/hw/block/nvme-dif.h

[PULL for-6.0 v2 05/10] hw/block/nvme: update dmsrl limit on namespace detachment

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen The Non-MDTS DMSRL limit must be recomputed when namespaces are detached. Fixes: 645ce1a70cb6 ("hw/block/nvme: support namespace attachment command") Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- hw/block/nvme.c | 17

[PULL for-6.0 v2 04/10] hw/block/nvme: fix warning about legacy namespace configuration

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Remove the unused BlockConf from the controller structure and fix the constraint checking to actually check the right BlockConf and issue the warning. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- hw/block/nvme.h | 1 -

[PULL for-6.0 v2 01/10] hw/block/nvme: fix pi constraint check

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Protection Information can only be enabled if there is at least 8 bytes of metadata. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- hw/block/nvme-ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PULL for-6.0 v2 02/10] hw/block/nvme: fix missing string representation for ns attachment

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Add the missing nvme_adm_opc_str entry for the Namespace Attachment command. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- hw/block/nvme.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/nvme.h b/hw/block/nvme.h index

[PULL for-6.0 v2 00/10] emulated nvme fixes for -rc3

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, My apologies that these didn't make it for -rc2! I botched v1, so please pull this v2 instead. The following changes since commit d0d3dd401b70168a353450e031727affee828527: Update version for v6.0.0-rc2 release (2021-04-06 18:34:34 +0100) are available in the

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-04-06 Thread Jason Wang
在 2021/4/7 上午7:27, Dongli Zhang 写道: This will answer your question that "Can it bypass the masking?". For vhost-scsi, virtio-blk, virtio-scsi and virtio-net, to write to eventfd is not able to bypass masking because masking is to unregister the eventfd. To write to eventfd does not take

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-04-06 Thread Jason Wang
在 2021/4/6 下午4:43, Dongli Zhang 写道: On 4/5/21 6:55 PM, Jason Wang wrote: 在 2021/4/6 上午4:00, Dongli Zhang 写道: On 4/1/21 8:47 PM, Jason Wang wrote: 在 2021/3/30 下午3:29, Dongli Zhang 写道: On 3/28/21 8:56 PM, Jason Wang wrote: 在 2021/3/27 上午5:16, Dongli Zhang 写道: Hi Jason, On 3/26/21 12:24

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-04-06 Thread Dongli Zhang
On 4/6/21 1:43 AM, Dongli Zhang wrote: > > > On 4/5/21 6:55 PM, Jason Wang wrote: >> >> 在 2021/4/6 上午4:00, Dongli Zhang 写道: >>> >>> On 4/1/21 8:47 PM, Jason Wang wrote: 在 2021/3/30 下午3:29, Dongli Zhang 写道: > On 3/28/21 8:56 PM, Jason Wang wrote: >> 在 2021/3/27 上午5:16, Dongli

[PULL for-6.0 6/7] hw/block/nvme: fix handling of private namespaces

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Prior to this patch, if a private nvme-ns device (that is, a namespace that is not linked to a subsystem) is wired up to an nvme-subsys linked nvme controller device, the device fails to verify that the namespace id is unique within the subsystem. NVM Express v1.4b, Section

[PULL for-6.0 5/7] hw/block/nvme: update dmsrl limit on namespace detachment

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen The Non-MDTS DMSRL limit must be recomputed when namespaces are detached. Fixes: 645ce1a70cb6 ("hw/block/nvme: support namespace attachment command") Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- hw/block/nvme.c | 17

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

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Protection Information can only be enabled if there is at least 8 bytes of metadata. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- hw/block/nvme-ns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

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

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Add the missing nvme_adm_opc_str entry for the Namespace Attachment command. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- hw/block/nvme.h | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/block/nvme.h b/hw/block/nvme.h index

[PULL for-6.0 7/7] hw/block/nvme: add missing copyright headers

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Add missing license/copyright headers to the nvme-dif.{c,h} files. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme-dif.h | 10 ++ hw/block/nvme-dif.c | 10 ++ 2 files changed, 20 insertions(+) diff --git a/hw/block/nvme-dif.h

[PULL for-6.0 3/7] hw/block/nvme: fix the nsid 'invalid' value

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen The `nvme_nsid()` function returns '-1' (h) when the given namespace is NULL. Since h is actually a valid namespace identifier (the "broadcast" value), change this to be '0' since that actually *is* the invalid value. Signed-off-by: Klaus Jensen Reviewed-by:

[PULL for-6.0 4/7] hw/block/nvme: fix warning about legacy namespace configuration

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Remove the unused BlockConf from the controller structure and fix the constraint checking to actually check the right BlockConf and issue the warning. Signed-off-by: Klaus Jensen Reviewed-by: Gollu Appalanaidu Reviewed-by: Keith Busch --- hw/block/nvme.h | 1 -

[PULL for-6.0 0/7] emulated nvme fixes for -rc3

2021-04-06 Thread Klaus Jensen
From: Klaus Jensen Hi Peter, My apologies that these didn't make it for -rc2! The following changes since commit d0d3dd401b70168a353450e031727affee828527: Update version for v6.0.0-rc2 release (2021-04-06 18:34:34 +0100) are available in the Git repository at:

Re: [PATCH for-6.0 v2 4/8] hw/block/nvme: fix controller namespaces array indexing

2021-04-06 Thread Klaus Jensen
On Apr 6 09:28, Klaus Jensen wrote: > On Apr 6 09:01, Philippe Mathieu-Daudé wrote: > > On 4/5/21 7:54 PM, Klaus Jensen wrote: > > > From: Klaus Jensen > > > > > > The controller namespaces array being 0-indexed requires 'nsid - 1' > > > everywhere. Something that is easy to miss. Align the

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

2021-04-06 Thread Max Reitz
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() block/rbd: fix memory leak in qemu_rbd_co_create_opts() block/rbd.c | 10 ++ 1

Re: [PATCH for-6.0] block/nbd: fix possible use after free of s->connect_thread

2021-04-06 Thread Vladimir Sementsov-Ogievskiy
06.04.2021 18:51, Vladimir Sementsov-Ogievskiy wrote: If on nbd_close() we detach the thread (in nbd_co_establish_connection_cancel() thr->state becomes CONNECT_THREAD_RUNNING_DETACHED), after that point we should not use s->connect_thread (which is set to NULL), as running thread may free it at

Re: [PATCH 1/7] block/nbd: avoid touching freed connect_thread

2021-04-06 Thread Vladimir Sementsov-Ogievskiy
15.03.2021 09:06, Roman Kagan wrote: When the NBD connection is being torn down, the connection thread gets canceled and "detached", meaning it is about to get freed. If this happens while the connection coroutine yielded waiting for the connection thread to complete, when it resumes it may

[PATCH for-6.0] block/nbd: fix possible use after free of s->connect_thread

2021-04-06 Thread Vladimir Sementsov-Ogievskiy
If on nbd_close() we detach the thread (in nbd_co_establish_connection_cancel() thr->state becomes CONNECT_THREAD_RUNNING_DETACHED), after that point we should not use s->connect_thread (which is set to NULL), as running thread may free it at any time. Still nbd_co_establish_connection() does

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

2021-04-06 Thread Max Reitz
On 01.04.21 23:01, 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 further. However,

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

2021-04-06 Thread Peter Maydell
On Mon, 5 Apr 2021 at 18:34, Klaus Jensen wrote: > > From: Klaus Jensen > > Hi Peter, > > The following changes since commit 25d75c99b2e5941c67049ee776efdb226414f4c6: > > Merge remote-tracking branch 'remotes/xtensa/tags/20210403-xtensa' into > staging (2021-04-04 21:48:45 +0100) > > are

Re: [PATCH 0/6] Add debug interface to kick/call on purpose

2021-04-06 Thread Dongli Zhang
On 4/5/21 6:55 PM, Jason Wang wrote: > > 在 2021/4/6 上午4:00, Dongli Zhang 写道: >> >> On 4/1/21 8:47 PM, Jason Wang wrote: >>> 在 2021/3/30 下午3:29, Dongli Zhang 写道: On 3/28/21 8:56 PM, Jason Wang wrote: > 在 2021/3/27 上午5:16, Dongli Zhang 写道: >> Hi Jason, >> >> On 3/26/21 12:24

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

2021-04-06 Thread Markus Armbruster
Stefano Garzarella writes: > 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

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

2021-04-06 Thread Markus Armbruster
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 bytes in 4 blocks are definitely lost in loss record 5,028 of

Re: issuing [block-]job-complete to jobs in STANDBY state

2021-04-06 Thread Peter Krempa
On Thu, Apr 01, 2021 at 15:02:35 -0400, John Snow wrote: > Hi; downstream we've run into an issue where VMs under heavy load with many > simultaneously concurrent block jobs running might occasionally flicker into > the STANDBY state, during which time they will be unable to receive JOB > COMPLETE

Re: [PATCH for-6.0 v2 4/8] hw/block/nvme: fix controller namespaces array indexing

2021-04-06 Thread Klaus Jensen
On Apr 6 09:01, Philippe Mathieu-Daudé wrote: > On 4/5/21 7:54 PM, Klaus Jensen wrote: > > From: Klaus Jensen > > > > The controller namespaces array being 0-indexed requires 'nsid - 1' > > everywhere. Something that is easy to miss. Align the controller > > namespaces array with the subsystem

Re: [PATCH for-6.0 v2 6/8] hw/block/nvme: update dmsrl limit on namespace detachment

2021-04-06 Thread Klaus Jensen
On Apr 6 09:10, Philippe Mathieu-Daudé wrote: > On 4/5/21 7:54 PM, Klaus Jensen wrote: > > From: Klaus Jensen > > > > The Non-MDTS DMSRL limit must be recomputed when namespaces are > > detached. > > > > Fixes: 645ce1a70cb6 ("hw/block/nvme: support namespace attachment command") > >

Re: [PATCH for-6.0 v2 3/8] hw/block/nvme: fix the nsid 'invalid' value

2021-04-06 Thread Klaus Jensen
On Apr 6 08:53, Philippe Mathieu-Daudé wrote: > Hi Klaus, > > On 4/5/21 7:54 PM, Klaus Jensen wrote: > > From: Klaus Jensen > > > > The `nvme_nsid()` function returns '-1' (h) when the given > > namespace is NULL. Since h is actually a valid namespace > > identifier (the

Re: [PATCH for-6.0 v2 6/8] hw/block/nvme: update dmsrl limit on namespace detachment

2021-04-06 Thread Philippe Mathieu-Daudé
On 4/5/21 7:54 PM, Klaus Jensen wrote: > From: Klaus Jensen > > The Non-MDTS DMSRL limit must be recomputed when namespaces are > detached. > > Fixes: 645ce1a70cb6 ("hw/block/nvme: support namespace attachment command") > Signed-off-by: Klaus Jensen > Reviewed-by: Gollu Appalanaidu > --- >

Re: [PATCH for-6.0 v2 4/8] hw/block/nvme: fix controller namespaces array indexing

2021-04-06 Thread Philippe Mathieu-Daudé
On 4/5/21 7:54 PM, Klaus Jensen wrote: > From: Klaus Jensen > > The controller namespaces array being 0-indexed requires 'nsid - 1' > everywhere. Something that is easy to miss. Align the controller > namespaces array with the subsystem namespaces array such that both are > 1-indexed. TBH I

Re: [PATCH for-6.0 v2 3/8] hw/block/nvme: fix the nsid 'invalid' value

2021-04-06 Thread Philippe Mathieu-Daudé
Hi Klaus, On 4/5/21 7:54 PM, Klaus Jensen wrote: > From: Klaus Jensen > > The `nvme_nsid()` function returns '-1' (h) when the given > namespace is NULL. Since h is actually a valid namespace > identifier (the "broadcast" value), change this to be '0' since that > actually *is*

Re: [PATCH for-6.0 v2 7/8] hw/block/nvme: fix handling of private namespaces

2021-04-06 Thread Minwoo Im
On 21-04-05 19:54:51, Klaus Jensen wrote: > From: Klaus Jensen > > Prior to this patch, if a private nvme-ns device (that is, a namespace > that is not linked to a subsystem) is wired up to an nvme-subsys linked > nvme controller device, the device fails to verify that the namespace id > is