Re: [PATCH v5 0/7] vhost-user-blk: fix the migration issue and enhance qtests

2020-09-29 Thread Michael S. Tsirkin
On Sun, Sep 27, 2020 at 09:48:28AM +0300, Dima Stepanov wrote: > On Thu, Sep 24, 2020 at 07:26:14AM -0400, Michael S. Tsirkin wrote: > > On Fri, Sep 11, 2020 at 11:39:42AM +0300, Dima Stepanov wrote: > > > v4 -> v5: > > > - vhost: check queue state in the vhost_dev_set_log routine > > > tests

[PULL v4 06/48] vhost: recheck dev state in the vhost_migration_log routine

2020-09-29 Thread Michael S. Tsirkin
From: Dima Stepanov vhost-user devices can get a disconnect in the middle of the VHOST-USER handshake on the migration start. If disconnect event happened right before sending next VHOST-USER command, then the vhost_dev_set_log() call in the vhost_migration_log() function will return error. This

Re: [PATCH v5 0/7] vhost-user-blk: fix the migration issue and enhance qtests

2020-09-29 Thread Dima Stepanov
On Tue, Sep 29, 2020 at 03:13:09AM -0400, Michael S. Tsirkin wrote: > On Sun, Sep 27, 2020 at 09:48:28AM +0300, Dima Stepanov wrote: > > On Thu, Sep 24, 2020 at 07:26:14AM -0400, Michael S. Tsirkin wrote: > > > On Fri, Sep 11, 2020 at 11:39:42AM +0300, Dima Stepanov wrote: > > > > v4 -> v5: > > > >

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Klaus Jensen
On Sep 28 22:54, Damien Le Moal wrote: > On 2020/09/29 6:25, Keith Busch wrote: > > On Mon, Sep 28, 2020 at 08:36:48AM +0200, Klaus Jensen wrote: > >> On Sep 28 02:33, Dmitry Fomichev wrote: > >>> You are making it sound like the entire WDC series relies on this > >>> approach. > >>> Actually, the

[PATCH v10 5/9] copy-on-read: limit guest COR activity to base in COR driver

2020-09-29 Thread Andrey Shinkevich via
Limit the guest's COR operations by the base node in the backing chain when the base node name is given. It will be useful for a block stream job when the COR-filter is applied. Signed-off-by: Andrey Shinkevich --- block/copy-on-read.c | 38 -- 1 file changed,

[PATCH v10 0/9] Apply COR-filter to the block-stream permanently

2020-09-29 Thread Andrey Shinkevich via
Despite the patch "freeze link to base node..." has been removed from the series in the current version 9, the iotest case test_stream_parallel does not pass after the COR-filter is inserted into the backing chain. As the test case may not be initialized, it does not make a sense and was removed ag

[PATCH v10 1/9] copy-on-read: Support preadv/pwritev_part functions

2020-09-29 Thread Andrey Shinkevich via
Add support for the recently introduced functions bdrv_co_preadv_part() and bdrv_co_pwritev_part() to the COR-filter driver. Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/copy-on-read.c | 28 1 file changed, 16 insertions(+), 1

[PATCH v10 2/9] copy-on-read: add filter append/drop functions

2020-09-29 Thread Andrey Shinkevich via
Provide API for the COR-filter insertion/removal. Also, drop the filter child permissions for an inactive state when the filter node is being removed. Signed-off-by: Andrey Shinkevich --- block/copy-on-read.c | 84 block/copy-on-read.h | 35 ++

[PATCH v10 3/9] qapi: add filter-node-name to block-stream

2020-09-29 Thread Andrey Shinkevich via
Provide the possibility to pass the 'filter-node-name' parameter to the block-stream job as it is done for the commit block job. Signed-off-by: Andrey Shinkevich Reviewed-by: Vladimir Sementsov-Ogievskiy --- block/monitor/block-hmp-cmds.c | 4 ++-- block/stream.c | 4 +++- block

[PATCH v10 8/9] block: remove unused backing-file name parameter

2020-09-29 Thread Andrey Shinkevich via
The block stream QMP parameter backing-file is in use no more. It designates a backing file name to set in QCOW2 image header after the block stream job finished. The base file name is used instead. Signed-off-by: Andrey Shinkevich --- block/monitor/block-hmp-cmds.c | 2 +- block/stream.c

[PATCH v10 6/9] copy-on-read: skip non-guest reads if no copy needed

2020-09-29 Thread Andrey Shinkevich via
If the flag BDRV_REQ_PREFETCH was set, pass it further to the COR-driver to skip unneeded reading. It can be taken into account for the COR-algorithms optimization. That check is being made during the block stream job by the moment. Signed-off-by: Andrey Shinkevich --- block/copy-on-read.c | 14

[PATCH v10 4/9] copy-on-read: pass base node name to COR driver

2020-09-29 Thread Andrey Shinkevich via
To limit the guest's COR operations by the base node in the backing chain during stream job, pass the base node name to the copy-on-read driver. The rest of the functionality will be implemented in the patch that follows. Signed-off-by: Andrey Shinkevich --- block/copy-on-read.c | 13 +++

[PATCH v10 7/9] stream: skip filters when writing backing file name to QCOW2 header

2020-09-29 Thread Andrey Shinkevich via
Avoid writing a filter JSON-name to QCOW2 image when the backing file is changed after the block stream job. Signed-off-by: Andrey Shinkevich --- block/stream.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/stream.c b/block/stream.c index e0540ee..b0719e9 100

[PATCH v10 9/9] block: apply COR-filter to block-stream jobs

2020-09-29 Thread Andrey Shinkevich via
This patch completes the series with the COR-filter insertion for block-stream operations. Adding the filter makes it possible for copied regions to be discarded in backing files during the block-stream job, what will reduce the disk overuse. The COR-filter insertion incurs changes in the iotests c

[PATCH v2 0/4] block/export: add BlockExportOptions->iothread member

2020-09-29 Thread Stefan Hajnoczi
v2: * Add fixed-iothread option to set AioContext change policy [Kevin] * Use os-posix.c signal handling utilities in qemu-nbd.c [Paolo] This series adjusts the build system and then adds a BlockExportOptions->iothread member so that it is possible to set the iothread for an export. Based-on: 2

[PATCH v2 2/4] qemu-storage-daemon: avoid compiling blockdev_ss twice

2020-09-29 Thread Stefan Hajnoczi
Introduce libblkdev.fa to avoid recompiling blockdev_ss twice. Suggested-by: Paolo Bonzini Reviewed-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- meson.build| 12 ++-- storage-daemon/meson.build | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --

[PATCH v2 1/4] util/vhost-user-server: use static library in meson.build

2020-09-29 Thread Stefan Hajnoczi
Don't compile contrib/libvhost-user/libvhost-user.c again. Instead build the static library once and then reuse it throughout QEMU. Also switch from CONFIG_LINUX to CONFIG_VHOST_USER, which is what the vhost-user tools (vhost-user-gpu, etc) do. Signed-off-by: Stefan Hajnoczi --- block/export/ex

[PATCH v2 4/4] block/export: add iothread and fixed-iothread options

2020-09-29 Thread Stefan Hajnoczi
Make it possible to specify the iothread where the export will run. By default the block node can be moved to other AioContexts later and the export will follow. The fixed-iothread option forces strict behavior that prevents changing AioContext while the export is active. See the QAPI docs for deta

[PATCH v2 3/4] block: move block exports to libblockdev

2020-09-29 Thread Stefan Hajnoczi
Block exports are used by softmmu, qemu-storage-daemon, and qemu-nbd. They are not used by other programs and are not otherwise needed in libblock. Undo the recent move of blockdev-nbd.c from blockdev_ss into block_ss. Since bdrv_close_all() (libblock) calls blk_exp_close_all() (libblockdev) a stu

Re: [PATCH v2 3/4] block: move block exports to libblockdev

2020-09-29 Thread Paolo Bonzini
On 29/09/20 14:55, Stefan Hajnoczi wrote: > Block exports are used by softmmu, qemu-storage-daemon, and qemu-nbd. > They are not used by other programs and are not otherwise needed in > libblock. > > Undo the recent move of blockdev-nbd.c from blockdev_ss into block_ss. > Since bdrv_close_all() (l

Re: [PATCH v2 3/4] block: move block exports to libblockdev

2020-09-29 Thread Eric Blake
On 9/29/20 7:55 AM, Stefan Hajnoczi wrote: Block exports are used by softmmu, qemu-storage-daemon, and qemu-nbd. They are not used by other programs and are not otherwise needed in libblock. Undo the recent move of blockdev-nbd.c from blockdev_ss into block_ss. Since bdrv_close_all() (libblock)

Re: [PATCH v2 4/4] block/export: add iothread and fixed-iothread options

2020-09-29 Thread Eric Blake
On 9/29/20 7:55 AM, Stefan Hajnoczi wrote: Make it possible to specify the iothread where the export will run. By default the block node can be moved to other AioContexts later and the export will follow. The fixed-iothread option forces strict behavior that prevents changing AioContext while the

Re: [PATCH v3 07/18] hw/block/nvme: add support for the get log page command

2020-09-29 Thread Peter Maydell
On Mon, 6 Jul 2020 at 07:15, Klaus Jensen wrote: > > From: Klaus Jensen > > Add support for the Get Log Page command and basic implementations of > the mandatory Error Information, SMART / Health Information and Firmware > Slot Information log pages. > > In violation of the specification, the SMA

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Damien Le Moal
On 2020/09/29 19:46, Klaus Jensen wrote: > On Sep 28 22:54, Damien Le Moal wrote: >> On 2020/09/29 6:25, Keith Busch wrote: >>> On Mon, Sep 28, 2020 at 08:36:48AM +0200, Klaus Jensen wrote: On Sep 28 02:33, Dmitry Fomichev wrote: > You are making it sound like the entire WDC series relies

[PATCH] job: delete job_{lock, unlock} functions and replace them with lock guard

2020-09-29 Thread Elena Afanasova
Signed-off-by: Elena Afanasova --- job.c | 46 +- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/job.c b/job.c index 8fecf38960..89ceb53434 100644 --- a/job.c +++ b/job.c @@ -79,16 +79,6 @@ struct JobTxn { * job_enter. */ static Qemu

Re: [PATCH v2] hw/ide: check null block before _cancel_dma_sync

2020-09-29 Thread Li Qiang
P J P 于2020年9月29日周二 下午2:22写道: > > Hello Li, > > +-- On Fri, 18 Sep 2020, Li Qiang wrote --+ > | P J P 于2020年9月18日周五 下午6:26写道: > | > +-- On Fri, 18 Sep 2020, Li Qiang wrote --+ > | > | Update v2: use an assert() call > | > | > ->https://lists.nongnu.org/archive/html/qemu-devel/2020-08/msg0833

Re: qcow2 merge_cow() question

2020-09-29 Thread Alberto Garcia
On Fri 21 Aug 2020 03:42:29 PM CEST, Vladimir Sementsov-Ogievskiy wrote: >>> What are these ifs for? >>> >>> /* The data (middle) region must be immediately after the >>> * start region */ >>> if (l2meta_cow_start(m) + m->cow_start.nb_bytes != offset) { >>>

RE: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Monday, September 28, 2020 2:37 AM > To: Dmitry Fomichev > Cc: Keith Busch ; Damien Le Moal > ; Klaus Jensen ; Kevin > Wolf ; Philippe Mathieu-Daudé ; > Maxim Levitsky ; Fam Zheng ; > Niklas Cassel ; qemu-block@nongnu.org; qemu- > de...@no

RE: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Dmitry Fomichev
> -Original Message- > From: Qemu-block bounces+dmitry.fomichev=wdc@nongnu.org> On Behalf Of Klaus > Jensen > Sent: Tuesday, September 29, 2020 6:47 AM > To: Damien Le Moal > Cc: Fam Zheng ; Kevin Wolf ; qemu- > bl...@nongnu.org; Niklas Cassel ; Klaus Jensen > ; qemu-de...@nongnu.org;

RE: [PATCH v5 13/14] hw/block/nvme: Use zone metadata file for persistence

2020-09-29 Thread Dmitry Fomichev
> -Original Message- > From: Klaus Jensen > Sent: Monday, September 28, 2020 3:52 AM > To: Dmitry Fomichev > Cc: Keith Busch ; Klaus Jensen > ; Kevin Wolf ; Philippe > Mathieu-Daudé ; Maxim Levitsky > ; Fam Zheng ; Niklas Cassel > ; Damien Le Moal ; > qemu-block@nongnu.org; qemu-de...@n

Re: [PULL 5/5] crypto/tls-cipher-suites: Produce fw_cfg consumable blob

2020-09-29 Thread Kevin Wolf
Am 04.07.2020 um 18:39 hat Philippe Mathieu-Daudé geschrieben: > Since our format is consumable by the fw_cfg device, > we can implement the FW_CFG_DATA_GENERATOR interface. > > Example of use to dump the cipher suites (if tracing enabled): > > $ qemu-system-x86_64 -S \ > -object tls-ciphe

Re: [PATCH v2 4/4] block/export: add iothread and fixed-iothread options

2020-09-29 Thread Stefan Hajnoczi
On Tue, Sep 29, 2020 at 08:07:38AM -0500, Eric Blake wrote: > On 9/29/20 7:55 AM, Stefan Hajnoczi wrote: > > Make it possible to specify the iothread where the export will run. By > > default the block node can be moved to other AioContexts later and the > > export will follow. The fixed-iothread o

Re: [PATCH] qcow2: Use L1E_SIZE in qcow2_write_l1_entry()

2020-09-29 Thread Eric Blake
On 9/28/20 11:23 AM, Alberto Garcia wrote: > We overlooked these in 02b1ecfa100e7ecc2306560cd27a4a2622bfeb04 > > Signed-off-by: Alberto Garcia > --- > block/qcow2-cluster.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Reviewed-by: Eric Blake > diff --git a/block/qcow2-cluste

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Klaus Jensen
On Sep 29 15:43, Dmitry Fomichev wrote: > > -Original Message- > > From: Qemu-block > bounces+dmitry.fomichev=wdc@nongnu.org> On Behalf Of Klaus > > Jensen > > Sent: Tuesday, September 29, 2020 6:47 AM > > To: Damien Le Moal > > Cc: Fam Zheng ; Kevin Wolf ; qemu- > > bl...@nongnu.org;

Re: [PATCH v5 13/14] hw/block/nvme: Use zone metadata file for persistence

2020-09-29 Thread Klaus Jensen
On Sep 29 15:43, Dmitry Fomichev wrote: > > > > -Original Message- > > From: Klaus Jensen > > Sent: Monday, September 28, 2020 3:52 AM > > To: Dmitry Fomichev > > Cc: Keith Busch ; Klaus Jensen > > ; Kevin Wolf ; Philippe > > Mathieu-Daudé ; Maxim Levitsky > > ; Fam Zheng ; Niklas Casse

[PATCH 1/4] keyval: Parse help options

2020-09-29 Thread Kevin Wolf
This adds a new parameter 'help' to keyval_parse() that enables parsing of help options. If NULL is passed, the function behaves the same as before. But if a bool pointer is given, it contains the information whether an option "help" without value was given (which would otherwise either result in a

[PATCH 4/4] qemu-storage-daemon: Remove QemuOpts from --object parser

2020-09-29 Thread Kevin Wolf
The command line parser for --object parses the input twice: Once into QemuOpts just for detecting help options, and then again into a QDict using the keyval parser for actually creating the object. Now that the keyval parser can also detect help options, we can simplify this and remove the QemuOp

[PATCH 0/4] qemu-storage-daemon: Remove QemuOpts from --object parser

2020-09-29 Thread Kevin Wolf
This replaces the QemuOpts-based help code for --object in the storage daemon with code based on the keyval parser. Kevin Wolf (4): keyval: Parse help options qom: Factor out helpers from user_creatable_print_help() qom: Add user_creatable_print_help_from_qdict() qemu-storage-daemon: Remov

[PATCH 2/4] qom: Factor out helpers from user_creatable_print_help()

2020-09-29 Thread Kevin Wolf
This creates separate helper functions for printing a list of user creatable object types and for printing a list of properties of a given type. This allows using these parts without having a QemuOpts. Signed-off-by: Kevin Wolf --- qom/object_interfaces.c | 90 ---

[PATCH 3/4] qom: Add user_creatable_print_help_from_qdict()

2020-09-29 Thread Kevin Wolf
This adds a function that, given a QDict of non-help options, prints help for user creatable objects. Signed-off-by: Kevin Wolf --- include/qom/object_interfaces.h | 9 + qom/object_interfaces.c | 9 + 2 files changed, 18 insertions(+) diff --git a/include/qom/object_int

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Keith Busch
On Tue, Sep 29, 2020 at 12:46:33PM +0200, Klaus Jensen wrote: > It is unmistakably clear that you are invalidating my arguments about > portability and endianness issues by suggesting that we just remove > persistent state and deal with it later, but persistence is the killer > feature that sets th

Re: [PATCH v2 3/4] block: move block exports to libblockdev

2020-09-29 Thread Eric Blake
On 9/29/20 7:55 AM, Stefan Hajnoczi wrote: > Block exports are used by softmmu, qemu-storage-daemon, and qemu-nbd. > They are not used by other programs and are not otherwise needed in > libblock. > > Undo the recent move of blockdev-nbd.c from blockdev_ss into block_ss. > Since bdrv_close_all() (

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Keith Busch
On Tue, Sep 29, 2020 at 11:13:51AM +, Damien Le Moal wrote: > OK. Then let's move the persistence implementation as the last patch in the > series. This way, if it is still controversial, it will not block the rest. > > Here is what I propose: > Dmitry: remove persistence stuff from your patch

Re: [PATCH 1/4] keyval: Parse help options

2020-09-29 Thread Eric Blake
On 9/29/20 12:26 PM, Kevin Wolf wrote: > This adds a new parameter 'help' to keyval_parse() that enables parsing > of help options. If NULL is passed, the function behaves the same as > before. But if a bool pointer is given, it contains the information > whether an option "help" without value was

Re: [PATCH 2/4] qom: Factor out helpers from user_creatable_print_help()

2020-09-29 Thread Eric Blake
On 9/29/20 12:26 PM, Kevin Wolf wrote: > This creates separate helper functions for printing a list of user > creatable object types and for printing a list of properties of a given > type. This allows using these parts without having a QemuOpts. > > Signed-off-by: Kevin Wolf > --- > qom/object_

Re: [PATCH 3/4] qom: Add user_creatable_print_help_from_qdict()

2020-09-29 Thread Eric Blake
On 9/29/20 12:26 PM, Kevin Wolf wrote: > This adds a function that, given a QDict of non-help options, prints > help for user creatable objects. > > Signed-off-by: Kevin Wolf > --- > include/qom/object_interfaces.h | 9 + > qom/object_interfaces.c | 9 + > 2 files changed

Re: [PATCH 4/4] qemu-storage-daemon: Remove QemuOpts from --object parser

2020-09-29 Thread Eric Blake
On 9/29/20 12:26 PM, Kevin Wolf wrote: > The command line parser for --object parses the input twice: Once into > QemuOpts just for detecting help options, and then again into a QDict > using the keyval parser for actually creating the object. > > Now that the keyval parser can also detect help op

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Klaus Jensen
On Sep 29 10:29, Keith Busch wrote: > On Tue, Sep 29, 2020 at 12:46:33PM +0200, Klaus Jensen wrote: > > It is unmistakably clear that you are invalidating my arguments about > > portability and endianness issues by suggesting that we just remove > > persistent state and deal with it later, but pers

Re: [PATCH] job: delete job_{lock, unlock} functions and replace them with lock guard

2020-09-29 Thread John Snow
On 9/29/20 9:42 AM, Elena Afanasova wrote: Signed-off-by: Elena Afanasova Hi, can I have a commit message here, please? --- job.c | 46 +- 1 file changed, 17 insertions(+), 29 deletions(-) diff --git a/job.c b/job.c index 8fecf38960..89ceb53434

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Keith Busch
On Tue, Sep 29, 2020 at 08:00:04PM +0200, Klaus Jensen wrote: > On Sep 29 10:29, Keith Busch wrote: > > On Tue, Sep 29, 2020 at 12:46:33PM +0200, Klaus Jensen wrote: > > > It is unmistakably clear that you are invalidating my arguments about > > > portability and endianness issues by suggesting tha

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Klaus Jensen
On Sep 29 11:15, Keith Busch wrote: > On Tue, Sep 29, 2020 at 08:00:04PM +0200, Klaus Jensen wrote: > > On Sep 29 10:29, Keith Busch wrote: > > > On Tue, Sep 29, 2020 at 12:46:33PM +0200, Klaus Jensen wrote: > > > > It is unmistakably clear that you are invalidating my arguments about > > > > porta

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Klaus Jensen
On Sep 29 18:17, Matias Bjorling wrote: > > > > -Original Message- > > From: Klaus Jensen > > Sent: Tuesday, 29 September 2020 20.00 > > To: Keith Busch > > Cc: Damien Le Moal ; Fam Zheng > > ; Kevin Wolf ; qemu- > > bl...@nongnu.org; Niklas Cassel ; Klaus Jensen > > ; qemu-de...@nongnu

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Klaus Jensen
On Sep 29 15:42, Dmitry Fomichev wrote: > > -Original Message- > > From: Klaus Jensen > > Sent: Monday, September 28, 2020 2:37 AM > > To: Dmitry Fomichev > > Cc: Keith Busch ; Damien Le Moal > > ; Klaus Jensen ; Kevin > > Wolf ; Philippe Mathieu-Daudé ; > > Maxim Levitsky ; Fam Zheng ; >

RE: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Dmitry Fomichev
> -Original Message- > From: Keith Busch > Sent: Tuesday, September 29, 2020 3:22 PM > To: Klaus Jensen > Cc: Dmitry Fomichev ; Kevin Wolf > ; Fam Zheng ; Damien Le Moal > ; qemu-block@nongnu.org; Niklas Cassel > ; Klaus Jensen ; qemu- > de...@nongnu.org; Alistair Francis ; Philippe >

Re: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Keith Busch
All, Let's de-escalate this, please. There's no reason to doubt Klaus wants to see this to work well, just as everyone else does. We unfortunately have conflicting proposals posted, and everyone is passionate enough about their work, but please simmer down. As I mentioned earlier, I'd like to ref

RE: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Matias Bjorling
> -Original Message- > From: Klaus Jensen > Sent: Tuesday, 29 September 2020 20.36 > To: Matias Bjorling > Cc: Keith Busch ; Damien Le Moal > ; Fam Zheng ; Kevin Wolf > ; qemu-block@nongnu.org; Niklas Cassel > ; Klaus Jensen ; qemu- > de...@nongnu.org; Alistair Francis ; Philippe > Math

RE: [PATCH v4 00/14] hw/block/nvme: Support Namespace Types and Zoned Namespace Command Set

2020-09-29 Thread Matias Bjorling
> -Original Message- > From: Klaus Jensen > Sent: Tuesday, 29 September 2020 20.00 > To: Keith Busch > Cc: Damien Le Moal ; Fam Zheng > ; Kevin Wolf ; qemu- > bl...@nongnu.org; Niklas Cassel ; Klaus Jensen > ; qemu-de...@nongnu.org; Alistair Francis > ; Philippe Mathieu-Daudé ; > Matias

Re: [PATCH v3 07/18] hw/block/nvme: add support for the get log page command

2020-09-29 Thread Klaus Jensen
On Sep 29 14:11, Peter Maydell wrote: > On Mon, 6 Jul 2020 at 07:15, Klaus Jensen wrote: > > > > From: Klaus Jensen > > > > Add support for the Get Log Page command and basic implementations of > > the mandatory Error Information, SMART / Health Information and Firmware > > Slot Information log p

Re: [PATCH v3 07/18] hw/block/nvme: add support for the get log page command

2020-09-29 Thread Keith Busch
On Tue, Sep 29, 2020 at 11:46:00PM +0200, Klaus Jensen wrote: > On Sep 29 14:11, Peter Maydell wrote: > > > +static uint16_t nvme_fw_log_info(NvmeCtrl *n, NvmeCmd *cmd, uint32_t > > > buf_len, > > > + uint64_t off, NvmeRequest *req) > > > +{ > > > +uint32_t tran

Re: [PATCH v3 07/18] hw/block/nvme: add support for the get log page command

2020-09-29 Thread Klaus Jensen
On Sep 29 15:34, Keith Busch wrote: > On Tue, Sep 29, 2020 at 11:46:00PM +0200, Klaus Jensen wrote: > > On Sep 29 14:11, Peter Maydell wrote: > > > > +static uint16_t nvme_fw_log_info(NvmeCtrl *n, NvmeCmd *cmd, uint32_t > > > > buf_len, > > > > + uint64_t off, NvmeR

Re: [PATCH v3 07/18] hw/block/nvme: add support for the get log page command

2020-09-29 Thread Keith Busch
On Wed, Sep 30, 2020 at 12:42:48AM +0200, Klaus Jensen wrote: > On Sep 29 15:34, Keith Busch wrote: > > Yeah, looks safe as-is, but we're missing out on returning the spec > > required 'Invalid Field'. > > I can't see where it says that we should do that? Invalid Field in > Command if offset is *g

[PATCH v2 01/14] hw/block/nvme: add nsid to get/setfeat trace events

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen Include the namespace id in the pci_nvme_{get,set}feat trace events. Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 4 ++-- hw/block/trace-events | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index da8344f

[PATCH v2 00/14] hw/block/nvme: zoned namespace command set

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen So, things escalated a bit. I'm removing the old cover letter. I don't think we need it anymore - you all know the reason I keep posting versions of this implementation ;) Based-on: <20200922084533.1273962-1-...@irrelevant.dk> Changes for v2 ~~ * "hw/block/nvm

[PATCH v2 04/14] hw/block/nvme: reject io commands if only admin command set selected

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen If the host sets CC.CSS to 111b, all commands submitted to I/O queues should be completed with status Invalid Command Opcode. Note that this is technically a v1.4 feature, but it does not hurt to implement before we finally bump the reported version implemented. Signed-off-by

[PATCH v2 06/14] hw/block/nvme: add support for dulbe and block utilization tracking

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen This adds support for reporting the Deallocated or Unwritten Logical Block error (DULBE). This requires tracking the allocated/deallocated status of all logical blocks. Introduce a bitmap that does this. The bitmap is persisted on the new 'pstate' blockdev that is associated w

[PATCH v2 02/14] hw/block/nvme: add trace event for requests with non-zero status code

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen If a command results in a non-zero status code, trace it. Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 6 ++ hw/block/trace-events | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 84b6b516fa7b..3cbc3c7b75b1 100644 -

[PATCH v2 03/14] hw/block/nvme: make lba data size configurable

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen Allos the LBA data size (lbads) to be set between 9 and 12. Signed-off-by: Klaus Jensen Acked-by: Keith Busch Reviewed-by: Maxim Levitsky Reviewed-by: Philippe Mathieu-Daudé --- docs/specs/nvme.txt | 11 ++- hw/block/nvme-ns.h | 1 + hw/block/nvme-ns.c | 8 +++

[PATCH v2 05/14] hw/block/nvme: consolidate read, write and write zeroes

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen Consolidate the read/write and write zeroes functions. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 11 include/block/nvme.h | 2 ++ hw/block/nvme.c | 65 +++ hw/block/trace-events | 3 +- 4 files changed,

[PATCH v2 09/14] hw/block/nvme: add basic read/write for zoned namespaces

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen This adds basic read and write for zoned namespaces. A zoned namespace is created by setting the iocs namespace parameter to 0x2 and specifying the zns.zcap parameter (zone capacity) in number of logical blocks per zone. If a zone size (zns.zsze) is not specified, the namespac

[PATCH v2 07/14] hw/block/nvme: add commands supported and effects log page

2020-09-29 Thread Klaus Jensen
From: Gollu Appalanaidu This is to support for the Commands Supported and Effects log page. See NVM Express Spec 1.3d, sec. 5.14.1.5 ("Commands Supported and Effects") Signed-off-by: Gollu Appalanaidu Signed-off-by: Klaus Jensen --- include/block/nvme.h | 21 + hw/block/nvme.c

[PATCH v2 08/14] hw/block/nvme: support namespace types

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen Implement support for TP 4056 ("Namespace Types"). This adds the 'iocs' (I/O Command Set) device parameter to the nvme-ns device. Signed-off-by: Klaus Jensen --- docs/specs/nvme.txt | 3 + hw/block/nvme-ns.h| 14 ++- hw/block/nvme.h | 3 + include/block/nvme

[PATCH v2 11/14] hw/block/nvme: add the zone management send command

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen Add the Zone Management Send command. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 1 + include/block/nvme.h | 29 +++ hw/block/nvme.c | 552 -- hw/block/trace-events | 11 + 4 files changed, 574 insertions(+), 19

[PATCH v2 13/14] hw/block/nvme: track and enforce zone resources

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen Track number of open/active resources. Signed-off-by: Klaus Jensen --- docs/specs/nvme.txt | 7 + hw/block/nvme-ns.h | 7 + include/block/nvme.h | 2 ++ hw/block/nvme-ns.c | 25 +++-- hw/block/nvme.c | 67 +

[PATCH v2 10/14] hw/block/nvme: add the zone management receive command

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen Add the Zone Management Receive command. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.h| 11 +++- hw/block/nvme.h | 1 + include/block/nvme.h | 46 ++ hw/block/nvme-ns.c| 49 --- hw/block/nvme.c | 135

[PATCH v2 12/14] hw/block/nvme: add the zone append command

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen Add the Zone Append command. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 6 include/block/nvme.h | 7 + hw/block/nvme.c | 71 +++ hw/block/trace-events | 1 + 4 files changed, 79 insertions(+), 6 deletion

[PATCH v2 14/14] hw/block/nvme: allow open to close transitions by controller

2020-09-29 Thread Klaus Jensen
From: Klaus Jensen Allow the controller to release open resources by transitioning implicitly and explicitly opened zones to closed. This is done using a naive "least recently opened" strategy. Signed-off-by: Klaus Jensen --- hw/block/nvme-ns.h| 5 ++ hw/block/nvme-ns.c| 5 ++ hw/b

[PATCH 1/2] hw/block/m25p80: Fix Numonyx dummy cycle register behavior

2020-09-29 Thread Joe Komlodi
Numonyx chips determine the number of cycles to wait based on bits 7:4 in the volatile configuration register. However, if these bits are 0x0 or 0xF, the number of dummy cycles to wait is 10 on a QIOR or QIOR4 command, or 8 on any other currently supported fast read command. [1] [1] http://www.mi

[PATCH 2/2] hw/block/m25p80: Fix nonvolatile-cfg property default value

2020-09-29 Thread Joe Komlodi
The nvcfg registers are all 1s, unless previously modified. Signed-off-by: Joe Komlodi --- hw/block/m25p80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/m25p80.c b/hw/block/m25p80.c index 43830c9..69c88d4 100644 --- a/hw/block/m25p80.c +++ b/hw/block/m25p80.c @@

[PATCH 0/2] hw/block/m25p80: Fix Numonyx flash dummy cycle register behavior

2020-09-29 Thread Joe Komlodi
Hi all, This series addresses a couple issues with dummy cycle counts with Numonyx flashes. The first patch fixes the behavior of the dummy cycle register so it's closer to how hardware behaves. As a consequence, it also corrects the amount of dummy cycles QIOR and QIOR4 commands need by default.

Re: [PATCH v2] hw/ide: check null block before _cancel_dma_sync

2020-09-29 Thread P J P
+-- On Tue, 29 Sep 2020, Li Qiang wrote --+ | P J P 于2020年9月29日周二 下午2:22写道: | > +-- On Fri, 18 Sep 2020, Li Qiang wrote --+ | > | P J P 于2020年9月18日周五 下午6:26写道: | > | > +-- On Fri, 18 Sep 2020, Li Qiang wrote --+ | > | > | Update v2: use an assert() call | > | > | ->https://lists.nongnu.org/arc

Re: [PATCH v5 09/14] hw/block/nvme: Support Zoned Namespace Command Set

2020-09-29 Thread Klaus Jensen
On Sep 28 12:42, Klaus Jensen wrote: > On Sep 28 11:35, Dmitry Fomichev wrote: > > The emulation code has been changed to advertise NVM Command Set when > > "zoned" device property is not set (default) and Zoned Namespace > > Command Set otherwise. > > > > Handlers for three new NVMe commands intr

Re: [PATCH v2 11/13] block/export: convert vhost-user-blk server to block export API

2020-09-29 Thread Markus Armbruster
Stefan Hajnoczi writes: > Use the new QAPI block exports API instead of defining our own QOM > objects. > > This is a large change because the lifecycle of VuBlockDev needs to > follow BlockExportDriver. QOM properties are replaced by QAPI options > objects. > > VuBlockDev is renamed VuBlkExport

Re: [PATCH v5 09/14] hw/block/nvme: Support Zoned Namespace Command Set

2020-09-29 Thread Klaus Jensen
On Sep 28 11:35, Dmitry Fomichev wrote: > The emulation code has been changed to advertise NVM Command Set when > "zoned" device property is not set (default) and Zoned Namespace > Command Set otherwise. > > Handlers for three new NVMe commands introduced in Zoned Namespace > Command Set specifica