Re: [PATCH 1/3] meson: move vhost_user_blk_server to meson.build

2020-11-12 Thread Stefan Hajnoczi
On Wed, Nov 11, 2020 at 12:54:38PM +0100, Philippe Mathieu-Daudé wrote: > On 11/11/20 12:44 PM, Philippe Mathieu-Daudé wrote: > > On 11/11/20 10:41 AM, Philippe Mathieu-Daudé wrote: > >> On 11/10/20 6:11 PM, Stefan Hajnoczi wrote: > >>> The --enable/disable-vhost-user-blk-server options were implem

Re: [PATCH 2/2] qemu-img: align next status sector on destination alignment.

2020-11-12 Thread Peter Lieven
Am 11.11.20 um 16:39 schrieb Maxim Levitsky: > This helps avoid unneeded writes and discards. > > Signed-off-by: Maxim Levitsky > --- > qemu-img.c | 13 - > 1 file changed, 8 insertions(+), 5 deletions(-) > > diff --git a/qemu-img.c b/qemu-img.c > index c2c56fc797..7e9b0f659f 100644 >

Re: [PATCH 2/2] qemu-img: align next status sector on destination alignment.

2020-11-12 Thread Eric Blake
On 11/12/20 6:40 AM, Peter Lieven wrote: >> /* >> - * Avoid that s->sector_next_status becomes unaligned to the source >> - * request alignment and/or cluster size to avoid unnecessary read >> - * cycles. >> + * Avoid that s->sector_next_status becomes unal

Re: [PATCH for-5.2 04/10] vhost-user-blk-test: rename destroy_drive() to destroy_file()

2020-11-12 Thread Max Reitz
On 11.11.20 13:43, Stefan Hajnoczi wrote: The function is used not just for image files but also for UNIX domain sockets (QMP monitor and vhost-user-blk). Reflect that in the name. Signed-off-by: Stefan Hajnoczi --- tests/qtest/vhost-user-blk-test.c | 9 + 1 file changed, 5 insertion

Re: [PATCH 0/2] RFC: Issue with discards on raw block device without O_DIRECT

2020-11-12 Thread Jan Kara
[added some relevant people and lists to CC] On Wed 11-11-20 17:44:05, Maxim Levitsky wrote: > On Wed, 2020-11-11 at 17:39 +0200, Maxim Levitsky wrote: > > clone of "starship_production" > > The git-publish destroyed the cover letter: > > For the reference this is for bz #1872633 > > The issue

Re: [PATCH 0/2] RFC: Issue with discards on raw block device without O_DIRECT

2020-11-12 Thread Jan Kara
On Thu 12-11-20 12:19:51, Jan Kara wrote: > [added some relevant people and lists to CC] > > On Wed 11-11-20 17:44:05, Maxim Levitsky wrote: > > On Wed, 2020-11-11 at 17:39 +0200, Maxim Levitsky wrote: > > > clone of "starship_production" > > > > The git-publish destroyed the cover letter: > > >

Re: [PATCH 2/2] qemu-img: align next status sector on destination alignment.

2020-11-12 Thread Maxim Levitsky
On Thu, 2020-11-12 at 07:45 -0600, Eric Blake wrote: > On 11/12/20 6:40 AM, Peter Lieven wrote: > > > > /* > > > - * Avoid that s->sector_next_status becomes unaligned to the > > > source > > > - * request alignment and/or cluster size to avoid unnecessary > > > read > >

Re: [PATCH for-5.2 08/10] block/export: port virtio-blk discard/write zeroes input validation

2020-11-12 Thread Max Reitz
On 11.11.20 13:43, Stefan Hajnoczi wrote: Validate discard/write zeroes the same way we do for virtio-blk. Some of these checks are mandated by the VIRTIO specification, others are internal to QEMU. Signed-off-by: Stefan Hajnoczi --- block/export/vhost-user-blk-server.c | 115

Re: [PATCH 0/2] RFC: Issue with discards on raw block device without O_DIRECT

2020-11-12 Thread Maxim Levitsky
On Thu, 2020-11-12 at 12:19 +0100, Jan Kara wrote: > [added some relevant people and lists to CC] > > On Wed 11-11-20 17:44:05, Maxim Levitsky wrote: > > On Wed, 2020-11-11 at 17:39 +0200, Maxim Levitsky wrote: > > > clone of "starship_production" > > > > The git-publish destroyed the cover lette

Re: [PATCH for-5.2 09/10] vhost-user-blk-test: test discard/write zeroes invalid inputs

2020-11-12 Thread Max Reitz
On 11.11.20 13:43, Stefan Hajnoczi wrote: Exercise input validation code paths in block/export/vhost-user-blk-server.c. Signed-off-by: Stefan Hajnoczi --- block/export/vhost-user-blk-server.c | 4 +- tests/qtest/vhost-user-blk-test.c| 124 +++ 2 files changed,

Re: [PATCH for-5.2 10/10] block/export: port virtio-blk read/write range check

2020-11-12 Thread Max Reitz
On 11.11.20 13:43, Stefan Hajnoczi wrote: Check that the sector number and byte count are valid. Signed-off-by: Stefan Hajnoczi --- block/export/vhost-user-blk-server.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/block/export/vhost-user-blk-server.c b/block/export/vh

Re: [PATCH for-5.2 04/10] vhost-user-blk-test: rename destroy_drive() to destroy_file()

2020-11-12 Thread Stefan Hajnoczi
On Thu, Nov 12, 2020 at 03:32:58PM +0100, Max Reitz wrote: > On 11.11.20 13:43, Stefan Hajnoczi wrote: > > The function is used not just for image files but also for UNIX domain > > sockets (QMP monitor and vhost-user-blk). Reflect that in the name. > > > > Signed-off-by: Stefan Hajnoczi > > ---

Re: [PATCH v9 08/12] hw/block/nvme: Support Zoned Namespace Command Set

2020-11-12 Thread Klaus Jensen
Hi Dmitry, I know you posted v10, but my comments should be relevant to that as well. On Nov 5 11:53, 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. > > De

Re: [PATCH v10 09/12] hw/block/nvme: Introduce max active and open zone limits

2020-11-12 Thread Klaus Jensen
On Nov 7 08:43, Dmitry Fomichev wrote: > Add two module properties, "zoned.max_active" and "zoned.max_open" > to control the maximum number of zones that can be active or open. > Once these variables are set to non-default values, these limits are > checked during I/O and Too Many Active or Too Ma

[PATCH v8 2/5] hw/block/nvme: pull aio error handling

2020-11-12 Thread Klaus Jensen
From: Klaus Jensen Add a new function, nvme_aio_err, to handle errors resulting from AIOs and use this from the callbacks. Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 61 + 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/hw/

[PATCH v8 1/5] hw/block/nvme: remove superfluous NvmeCtrl parameter

2020-11-12 Thread Klaus Jensen
From: Klaus Jensen nvme_check_bounds has no use of the NvmeCtrl parameter; remove it. Signed-off-by: Klaus Jensen --- hw/block/nvme.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 01b657b1c5e2..51f35e8cf18b 100644 --- a/hw/b

[PATCH v8 3/5] hw/block/nvme: add dulbe support

2020-11-12 Thread Klaus Jensen
From: Klaus Jensen Add support for reporting the Deallocated or Unwritten Logical Block Error (DULBE). Rely on the block status flags reported by the block layer and consider any block with the BDRV_BLOCK_ZERO flag to be deallocated. Multiple factors affect when a Write Zeroes command result in

[PATCH v8 0/5] hw/block/nvme: dulbe and dsm support

2020-11-12 Thread Klaus Jensen
From: Klaus Jensen This adds support for the Deallocated or Unwritten Logical Block error recovery feature as well as the Dataset Management command. v8: - Move req->opaque clearing to nvme_req_clear. - Add two preparation/cleanup patches. v7: - Handle negative return value from bdrv_bloc

[PATCH v8 4/5] nvme: add namespace I/O optimization fields to shared header

2020-11-12 Thread Klaus Jensen
From: Klaus Jensen This adds the NPWG, NPWA, NPDG, NPDA and NOWS family of fields to the shared nvme.h header for use by later patches. Signed-off-by: Klaus Jensen Cc: Stefan Hajnoczi Cc: Fam Zheng Reviewed-by: Stefan Hajnoczi --- include/block/nvme.h | 7 ++- 1 file changed, 6 insertio

[PATCH v8 5/5] hw/block/nvme: add the dataset management command

2020-11-12 Thread Klaus Jensen
From: Klaus Jensen Add support for the Dataset Management command and the Deallocate attribute. Deallocation results in discards being sent to the underlying block device. Whether of not the blocks are actually deallocated is affected by the same factors as Write Zeroes (see previous commit).

Re: [PATCH v10 06/12] hw/block/nvme: Support allocated CNS command variants

2020-11-12 Thread Klaus Jensen
On Nov 7 08:42, Dmitry Fomichev wrote: > From: Niklas Cassel > > Many CNS commands have "allocated" command variants. These include > a namespace as long as it is allocated, that is a namespace is > included regardless if it is active (attached) or not. > > While these commands are optional (th

Re: [PATCH for-5.2?] nbd: Silence Coverity false positive

2020-11-12 Thread Richard Henderson
On 11/11/20 8:35 AM, Eric Blake wrote: > -if (!full) { > -/* last non dirty extent */ > -nbd_extent_array_add(es, end - start, 0); > +if (!full && nbd_extent_array_add(es, end - start, 0) < 0) { > +/* last non dirty extent, nothing to do if array was already full */

Re: [PATCH for-5.2?] nbd: Silence Coverity false positive

2020-11-12 Thread Eric Blake
On 11/12/20 3:04 PM, Richard Henderson wrote: > On 11/11/20 8:35 AM, Eric Blake wrote: >> -if (!full) { >> -/* last non dirty extent */ >> -nbd_extent_array_add(es, end - start, 0); >> +if (!full && nbd_extent_array_add(es, end - start, 0) < 0) { >> +/* last non dirt

Re: [PATCH] docs: Better mention of qemu-img amend limitations

2020-11-12 Thread Eric Blake
Ping^2 On 10/20/20 10:44 AM, Eric Blake wrote: > On 9/23/20 4:56 PM, Nir Soffer wrote: >> On Wed, Sep 23, 2020 at 11:38 PM Eric Blake wrote: >>> >>> Missed during merge resolution of commit bc5ee6da71. >>> >>> Signed-off-by: Eric Blake >>> --- >>> docs/tools/qemu-img.rst | 4 >>> 1 file ch

Re: [PATCH for-5.2?] nbd: Silence Coverity false positive

2020-11-12 Thread Richard Henderson
On 11/12/20 1:09 PM, Eric Blake wrote: > On 11/12/20 3:04 PM, Richard Henderson wrote: >> On 11/11/20 8:35 AM, Eric Blake wrote: >>> -if (!full) { >>> -/* last non dirty extent */ >>> -nbd_extent_array_add(es, end - start, 0); >>> +if (!full && nbd_extent_array_add(es, end -

[PATCH v3 09/53] qdev: Make qdev_get_prop_ptr() get Object* arg

2020-11-12 Thread Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE. Reviewed-by: Marc-André Lureau Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: - Fix build error with CONFIG_XEN I took the liberty of keeping the Reviewed-by line from Marc-André as the build fix is a trivial one line change -

[PATCH v3 30/53] qdev: Rename qdev_get_prop_ptr() to object_field_prop_ptr()

2020-11-12 Thread Eduardo Habkost
The function will be moved to common QOM code, as it is not specific to TYPE_DEVICE anymore. Reviewed-by: Stefan Berger Signed-off-by: Eduardo Habkost --- Changes v1 -> v2: * Rename to object_field_prop_ptr() instead of object_static_prop_ptr() --- Cc: Stefan Berger Cc: Stefano Stabellini Cc:

[PATCH v3 23/53] qdev: Move dev->realized check to qdev_property_set()

2020-11-12 Thread Eduardo Habkost
Every single qdev property setter function manually checks dev->realized. We can just check dev->realized inside qdev_property_set() instead. The check is being added as a separate function (qdev_prop_allow_set()) because it will become a callback later. Reviewed-by: Stefan Berger Signed-off-by

Re: [PATCH 0/2] RFC: Issue with discards on raw block device without O_DIRECT

2020-11-12 Thread Darrick J. Wong
On Thu, Nov 12, 2020 at 01:00:56PM +0100, Jan Kara wrote: > On Thu 12-11-20 12:19:51, Jan Kara wrote: > > [added some relevant people and lists to CC] > > > > On Wed 11-11-20 17:44:05, Maxim Levitsky wrote: > > > On Wed, 2020-11-11 at 17:39 +0200, Maxim Levitsky wrote: > > > > clone of "starship_p

RE: [PATCH v3 1/3] hw/block/m25p80: Fix Numonyx NVCFG DIO and QIO bit polarity

2020-11-12 Thread Joe Komlodi
Hi Francisco, -Original Message- From: Francisco Iglesias Sent: Wednesday, November 11, 2020 6:33 AM To: Joe Komlodi Cc: qemu-de...@nongnu.org; philippe.mathieu.da...@gmail.com; Francisco Eduardo Iglesias ; alist...@alistair23.me; qemu-block@nongnu.org; mre...@redhat.com Subject: Re:

[PATCH v2 6/7] qapi: Use QAPI_LIST_APPEND in trivial cases

2020-11-12 Thread Eric Blake
The easiest spots to use QAPI_LIST_APPEND are where we already have an obvious pointer to the tail of a list. Signed-off-by: Eric Blake --- backends/hostmem.c | 8 +--- block/dirty-bitmap.c| 6 +-- block/export/export.c | 5 +-- block/qapi.c

[PATCH v2 4/7] qapi: Use QAPI_LIST_PREPEND() where possible

2020-11-12 Thread Eric Blake
Anywhere we create a list of just one item or by prepending items (typically because order doesn't matter), we can use the now-public macro. But places where we must keep the list in order by appending remain open-coded until later patches. Note that as a side effect, this also performs a cleanup

[PATCH v2 7/7] qapi: More complex uses of QAPI_LIST_APPEND

2020-11-12 Thread Eric Blake
These cases require a bit more thought to review; in each case, the code was appending to a list, but not with a FOOList **tail variable. Signed-off-by: Eric Blake --- block/gluster.c| 13 +--- block/qapi.c | 14 + dump/dump.c| 22 ++- hw/core

[PATCH v4 2/4] hw/block/m25p80: Fix when VCFG XIP bit is set for Numonyx

2020-11-12 Thread Joe Komlodi
VCFG XIP is set (disabled) when the NVCFG XIP bits are all set (disabled). 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 452d252..eb6539f 100644 --- a/hw/block/m25p80.c +++ b/hw/blo

[PATCH v4 1/4] hw/block/m25p80: Make Numonyx config field names more accurate

2020-11-12 Thread Joe Komlodi
The previous naming of the configuration registers made it sound like that if the bits were set the settings would be enabled, while the opposite is true. Signed-off-by: Joe Komlodi --- hw/block/m25p80.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/block/m2

[PATCH v4 0/4] hw/block/m25p80: Numonyx: Fix dummy cycles and check for SPI mode on cmds

2020-11-12 Thread Joe Komlodi
Changelog: v3 -> v4 - 1/4: Patch changed to change names of register fields to be more accurate. - 1/4: Revert polarity change from v3. - 2/4: Added, fixes polarity of VCFG XIP mode when copied from NVCFG. - 3/4: Removed check_cmd_mode function, each command check is done in decode_new_cmd ins

[PATCH v4 3/4] hw/block/m25p80: Check SPI mode before running some Numonyx commands

2020-11-12 Thread Joe Komlodi
Some Numonyx flash commands cannot be executed in DIO and QIO mode, such as trying to do DPP or DOR when in QIO mode. Signed-off-by: Joe Komlodi --- hw/block/m25p80.c | 134 +- 1 file changed, 112 insertions(+), 22 deletions(-) diff --git a/hw

[PATCH v4 4/4] hw/block/m25p80: Fix Numonyx fast read dummy cycle count

2020-11-12 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] https://www.m