Re: [PATCH v2 0/2] block: deprecate the sheepdog driver

2020-09-22 Thread Neal Gompa
On Tue, Sep 22, 2020 at 12:16 PM Daniel P. Berrangé wrote: > > 2 years back I proposed dropping the sheepdog mailing list from the > MAINTAINERS file, but somehow the patch never got picked up: > > https://lists.gnu.org/archive/html/qemu-block/2018-03/msg01048.html > > So here I am with the

[PATCH v2 10/20] iotests/046: Avoid renaming images

2020-09-22 Thread Max Reitz
This generally does not work on non-file protocols. It is better to create the image with the final name from the start, and most tests do this already. Let 046 follow suit. Signed-off-by: Max Reitz --- tests/qemu-iotests/046 | 5 +++-- tests/qemu-iotests/046.out | 2 +- 2 files changed,

[PATCH v2 16/20] storage-daemon: Call bdrv_close_all() on exit

2020-09-22 Thread Max Reitz
Otherwise, exports and block devices are not properly shut down and closed, unless the users explicitly issues blockdev-del and block-export-del commands for each of them. Signed-off-by: Max Reitz --- storage-daemon/qemu-storage-daemon.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

Re: [PATCH v2 01/20] configure: Detect libfuse

2020-09-22 Thread Thomas Huth
On 22/09/2020 12.49, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > configure | 34 ++ > meson.build | 6 ++ > 2 files changed, 40 insertions(+) > > diff --git a/configure b/configure > index ce27eafb0a..21c31e4694 100755 > --- a/configure > +++

Re: [PATCH 0/1] block: future of sheepdog storage driver ?

2020-09-22 Thread Markus Armbruster
Thomas Huth writes: > On 22/09/2020 11.01, Daniel P. Berrangé wrote: > [...] >> Does someone have a compelling reason for QEMU to keep supporting >> this driver, other than the fact that it already exists ? >> >> If not, it looks like a candidate for deprecating in QEMU with a >> view to later

[PATCH v2 2/2] block: deprecate the sheepdog block driver

2020-09-22 Thread Daniel P . Berrangé
This thread from a little over a year ago: http://lists.wpkg.org/pipermail/sheepdog/2019-March/thread.html states that sheepdog is no longer actively developed. The only mentioned users are some companies who are said to have it for legacy reasons with plans to replace it by Ceph. There is

Re: [PATCH v2 1/2] block: drop moderated sheepdog mailing list from MAINTAINERS file

2020-09-22 Thread Thomas Huth
On 22/09/2020 18.16, Daniel P. Berrangé wrote: > The sheepdog mailing list is setup to stop and queue messages from > non-subscribers, pending moderator approval. Unfortunately it seems > that the moderation queue is not actively dealt with. Even when messages > are approved, the sender is never

Re: [PATCH v2 2/2] block: deprecate the sheepdog block driver

2020-09-22 Thread Vladimir Sementsov-Ogievskiy
22.09.2020 19:16, Daniel P. Berrangé wrote: This thread from a little over a year ago: http://lists.wpkg.org/pipermail/sheepdog/2019-March/thread.html states that sheepdog is no longer actively developed. The only mentioned users are some companies who are said to have it for legacy reasons

Re: [PATCH v2 0/2] block: deprecate the sheepdog driver

2020-09-22 Thread Neal Gompa
On Tue, Sep 22, 2020 at 1:43 PM Daniel P. Berrangé wrote: > > On Tue, Sep 22, 2020 at 01:09:06PM -0400, Neal Gompa wrote: > > On Tue, Sep 22, 2020 at 12:16 PM Daniel P. Berrangé > > wrote: > > > > > > 2 years back I proposed dropping the sheepdog mailing list from the > > > MAINTAINERS file,

Re: [PATCH v2 0/2] block: deprecate the sheepdog driver

2020-09-22 Thread Daniel P . Berrangé
On Tue, Sep 22, 2020 at 01:09:06PM -0400, Neal Gompa wrote: > On Tue, Sep 22, 2020 at 12:16 PM Daniel P. Berrangé > wrote: > > > > 2 years back I proposed dropping the sheepdog mailing list from the > > MAINTAINERS file, but somehow the patch never got picked up: > > > >

Re: [PATCH v3 00/17] hw/block/nvme: multiple namespaces support

2020-09-22 Thread Klaus Jensen
On Sep 22 08:31, Keith Busch wrote: > On Tue, Sep 22, 2020 at 10:45:16AM +0200, Klaus Jensen wrote: > > From: Klaus Jensen > > > > This is the next round of my patches for the nvme device. > > > > This includes a bit of cleanup and two new features: > > > > * support for scatter/gather lists

Re: [PATCH v2 2/2] block: deprecate the sheepdog block driver

2020-09-22 Thread Thomas Huth
On 22/09/2020 18.16, Daniel P. Berrangé wrote: > This thread from a little over a year ago: > > http://lists.wpkg.org/pipermail/sheepdog/2019-March/thread.html > > states that sheepdog is no longer actively developed. The only mentioned > users are some companies who are said to have it for

Re: [PATCH v3 00/17] hw/block/nvme: multiple namespaces support

2020-09-22 Thread Keith Busch
On Tue, Sep 22, 2020 at 07:27:30PM +0200, Klaus Jensen wrote: > On Sep 22 08:31, Keith Busch wrote: > > On Tue, Sep 22, 2020 at 10:45:16AM +0200, Klaus Jensen wrote: > > > From: Klaus Jensen > > > > > > This is the next round of my patches for the nvme device. > > > > > > This includes a bit of

Re: [PATCH v2 1/2] block: drop moderated sheepdog mailing list from MAINTAINERS file

2020-09-22 Thread Vladimir Sementsov-Ogievskiy
22.09.2020 19:16, Daniel P. Berrangé wrote: The sheepdog mailing list is setup to stop and queue messages from non-subscribers, pending moderator approval. Unfortunately it seems that the moderation queue is not actively dealt with. Even when messages are approved, the sender is never added to

Re: [PATCH 2/6] block/nvme: Map doorbells pages write-only

2020-09-22 Thread Fam Zheng
On Mon, 2020-09-21 at 18:29 +0200, Philippe Mathieu-Daudé wrote: > Per the datasheet sections 3.1.13/3.1.14: > "The host should not read the doorbell registers." > > As we don't need read access, map the doorbells with write-only > permission. We keep a reference to this mapped address in the >

[PATCH v2 3/6] block/nvme: Reduce I/O registers scope

2020-09-22 Thread Philippe Mathieu-Daudé
We only access the I/O register in nvme_init(). Remove the reference in BDRVNVMeState and reduce its scope. Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 29 - 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/block/nvme.c b/block/nvme.c

[PATCH v2 4/6] block/nvme: Drop NVMeRegs structure, directly use NvmeBar

2020-09-22 Thread Philippe Mathieu-Daudé
NVMeRegs only contains NvmeBar. Simplify the code by using NvmeBar directly. This triggers a checkpatch.pl error: ERROR: Use of volatile is usually wrong, please add a comment #30: FILE: block/nvme.c:691: +volatile NvmeBar *regs; This is a false positive as in our case we are using

[PATCH v2 6/6] block/nvme: Replace magic value by SCALE_MS definition

2020-09-22 Thread Philippe Mathieu-Daudé
Use self-explicit SCALE_MS definition instead of magic value (missed in similar commit e4f310fe7f5). Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nvme.c b/block/nvme.c index 959569d262f..b48f6f25881 100644 ---

[PATCH v3 08/17] hw/block/nvme: add symbolic command name to trace events

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Add the symbolic command name to the pci_nvme_{io,admin}_cmd and pci_nvme_rw trace events. Signed-off-by: Klaus Jensen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Keith Busch --- hw/block/nvme.h | 28 hw/block/nvme.c | 8

[PATCH v3 16/17] pci: allocate pci id for nvme

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen The emulated nvme device (hw/block/nvme.c) is currently using an internal Intel device id. Prepare to change that by allocating a device id under the 1b36 (Red Hat, Inc.) vendor id. Signed-off-by: Klaus Jensen Acked-by: Gerd Hoffmann Reviewed-by: Maxim Levitsky

Re: [PATCH 2/6] block/nvme: Map doorbells pages write-only

2020-09-22 Thread Philippe Mathieu-Daudé
On 9/22/20 11:04 AM, Paolo Bonzini wrote: > On 22/09/20 10:41, Philippe Mathieu-Daudé wrote: >>> Besides looking more correct in access mode, is there any side effect >>> of WO mapping? >> TBH I don't have enough knowledge to answer this question. >> I tested successfully on X86. I'm writing more

Re: [PATCH v2] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200922085838.230505-1-stefa...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20200922085838.230505-1-stefa...@redhat.com Subject: [PATCH v2] qemu/atomic.h: prefix

Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread Paolo Bonzini
On 21/09/20 18:23, Stefan Hajnoczi wrote: > clang's C11 atomic_fetch_*() functions only take a C11 atomic type > pointer argument. QEMU uses direct types (int, etc) and this causes a > compiler error when a QEMU code calls these functions in a source file > that also included via a system header

Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread Paolo Bonzini
On 22/09/20 08:45, David Hildenbrand wrote: >> It's certainly a good idea but it's quite verbose. >> >> What about using atomic__* as the prefix? It is not very common in QEMU >> but there are some cases (and I cannot think of anything better). > > aqomic_*, lol :) Actually qatomic_ would be a

Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread Daniel P . Berrangé
On Tue, Sep 22, 2020 at 08:56:06AM +0200, Paolo Bonzini wrote: > On 22/09/20 08:45, David Hildenbrand wrote: > >> It's certainly a good idea but it's quite verbose. > >> > >> What about using atomic__* as the prefix? It is not very common in QEMU > >> but there are some cases (and I cannot think

[PATCH v3 12/17] hw/block/nvme: add support for scatter gather lists

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen For now, support the Data Block, Segment and Last Segment descriptor types. See NVM Express 1.3d, Section 4.4 ("Scatter Gather List (SGL)"). Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- include/block/nvme.h | 6 +- hw/block/nvme.c | 329

Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread Stefan Hajnoczi
On Mon, Sep 21, 2020 at 04:29:10PM -0500, Eric Blake wrote: > On 9/21/20 11:23 AM, Stefan Hajnoczi wrote: Thanks for the review! Your feedback prompted me to do this more systematically. I fixed the command-lines and published a diff of just the manual changes I made on top of the mechanical

[PATCH qemu 3/4] mirror: move some checks to qmp

2020-09-22 Thread Fabian Grünbichler
and assert the passing conditions in block/mirror.c. while incremental mode was never available for drive-mirror, it makes the interface more in line with backup block jobs. Signed-off-by: Fabian Grünbichler --- block/mirror.c | 28 +--- blockdev.c | 29

Re: [PATCH v2 0/6] block/nvme: Map doorbells pages write-only, remove magic from nvme_init

2020-09-22 Thread Fam Zheng
On Tue, 2020-09-22 at 10:38 +0200, Philippe Mathieu-Daudé wrote: > Instead of mapping 8K of I/O + doorbells as RW during the whole > execution, maps I/O temporarly at init, and map doorbells WO. > > Replace various magic values by slighly more explicit macros from > "block/nvme.h". > > Since v1:

Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread Stefan Hajnoczi
On Mon, Sep 21, 2020 at 01:56:08PM -0700, no-re...@patchew.org wrote: > ERROR: Macros with multiple statements should be enclosed in a do - while loop > #2968: FILE: include/qemu/atomic.h:152: > +#define qemu_atomic_rcu_read__nocheck(ptr, valptr) \ > __atomic_load(ptr, valptr,

[PATCH v2 5/6] block/nvme: Use register definitions from 'block/nvme.h'

2020-09-22 Thread Philippe Mathieu-Daudé
Use the NVMe register definitions from "block/nvme.h" which ease a bit reviewing the code while matching the datasheet. Signed-off-by: Philippe Mathieu-Daudé --- block/nvme.c | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/block/nvme.c b/block/nvme.c

[PATCH v3 01/17] hw/block/nvme: fix typo in trace event

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Fix a typo in the sq doorbell trace event. Signed-off-by: Klaus Jensen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Keith Busch --- hw/block/trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/block/trace-events b/hw/block/trace-events

[PATCH v3 05/17] hw/block/nvme: alignment style fixes

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Style fixes. Signed-off-by: Klaus Jensen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Keith Busch --- hw/block/nvme.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index

[PATCH v3 11/17] hw/block/nvme: harden cmb access

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Since the controller has only supported PRPs so far it has not been required to check the ending address (addr + len - 1) of the CMB access for validity since it has been guaranteed to be in range of the CMB. This changes when the controller adds support for SGLs (next

[PATCH qemu 2/4] drive-mirror: add support for conditional and always bitmap sync modes

2020-09-22 Thread Fabian Grünbichler
From: John Snow Teach mirror two new tricks for using bitmaps: Always: no matter what, we synchronize the copy_bitmap back to the sync_bitmap. In effect, this allows us resume a failed mirror at a later date, since the target bdrv should be exactly in the state referenced by the bitmap.

[PATCH qemu 1/4] drive-mirror: add support for sync=bitmap mode=never

2020-09-22 Thread Fabian Grünbichler
From: John Snow This patch adds support for the "BITMAP" sync mode to drive-mirror and blockdev-mirror. It adds support only for the BitmapSyncMode "never," because it's the simplest mode. This mode simply uses a user-provided bitmap as an initial copy manifest, and then does not clear any bits

[PATCH qemu 0/4] mirror: implement incremental and bitmap modes

2020-09-22 Thread Fabian Grünbichler
based on John's in-progress work from last year, this series introduces incremental drive-/block-dev mirror support using bitmaps with three bitmap modes. changes since RFC: - rebased on current master - squashed patches 2-4 - re-ordered patches 5/6, and moved all test code to patch 6 NOTE:

Re: [PATCH 2/6] block/nvme: Map doorbells pages write-only

2020-09-22 Thread Paolo Bonzini
On 22/09/20 10:41, Philippe Mathieu-Daudé wrote: >> Besides looking more correct in access mode, is there any side effect >> of WO mapping? > TBH I don't have enough knowledge to answer this question. > I tested successfully on X86. I'm writing more tests. No problem with doing this, but

Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread Philippe Mathieu-Daudé
On 9/22/20 10:17 AM, Stefan Hajnoczi wrote: > On Mon, Sep 21, 2020 at 01:56:08PM -0700, no-re...@patchew.org wrote: >> ERROR: Macros with multiple statements should be enclosed in a do - while >> loop >> #2968: FILE: include/qemu/atomic.h:152: >> +#define qemu_atomic_rcu_read__nocheck(ptr,

[PATCH v3 00/17] hw/block/nvme: multiple namespaces support

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen This is the next round of my patches for the nvme device. This includes a bit of cleanup and two new features: * support for scatter/gather lists * multiple namespaces support through a new nvme-ns device Finally, the series wraps up with changing the PCI vendor and

[PATCH v3 09/17] hw/block/nvme: refactor aio submission

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen This pulls block layer aio submission/completion to common functions. For completions, additionally map an AIO error to the Unrecovered Read and Write Fault status codes. Signed-off-by: Klaus Jensen --- hw/block/nvme.h | 14 + hw/block/nvme.c | 136

[PATCH v3 04/17] hw/block/nvme: commonize nvme_rw error handling

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Move common error handling to a label. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/hw/block/nvme.c b/hw/block/nvme.c index 744ff3d86c22..a76a6464d6a1 100644

[PATCH v3 17/17] hw/block/nvme: change controller pci id

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen There are two reasons for changing this: 1. The nvme device currently uses an internal Intel device id. 2. Since commits "nvme: fix write zeroes offset and count" and "nvme: support multiple namespaces" the controller device no longer has the quirks that the

[PATCH v3 13/17] hw/block/nvme: add support for sgl bit bucket descriptor

2020-09-22 Thread Klaus Jensen
From: Gollu Appalanaidu This adds support for SGL descriptor type 0x1 (bit bucket descriptor). See the NVM Express v1.3d specification, Section 4.4 ("Scatter Gather List (SGL)"). Signed-off-by: Gollu Appalanaidu Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.c | 33

[PATCH v3 15/17] hw/block/nvme: support multiple namespaces

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen This adds support for multiple namespaces by introducing a new 'nvme-ns' device model. The nvme device creates a bus named from the device name ('id'). The nvme-ns devices then connect to this and registers themselves with the nvme device. This changes how an nvme device is

[PATCH 0/1] block: future of sheepdog storage driver ?

2020-09-22 Thread Daniel P . Berrangé
2 years back I proposed dropping the sheepdog mailing list from the MAINTAINERS file, but somehow the patch never got picked up: https://lists.gnu.org/archive/html/qemu-block/2018-03/msg01048.html So here I am with the same patch again. I further looked at the sheepdog project though, and I'm

[PATCH v3 14/17] hw/block/nvme: refactor identify active namespace id list

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Prepare to support inactive namespaces. Signed-off-by: Klaus Jensen Reviewed-by: Maxim Levitsky Reviewed-by: Keith Busch --- 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

[PATCH 1/1] block: drop moderated sheepdog mailing list from MAINTAINERS file

2020-09-22 Thread Daniel P . Berrangé
The sheepdog mailing list is setup to stop and queue messages from non-subscribers, pending moderator approval. Unfortunately it seems that the moderation queue is not actively dealt with. Even when messages are approved, the sender is never added to the whitelist, so every future mail from the

[PATCH v3 06/17] hw/block/nvme: add a lba to bytes helper

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Add the nvme_l2b helper and use it for converting NLB and SLBA to byte counts and offsets. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch --- hw/block/nvme.h | 6 ++ hw/block/nvme.c | 12 2 files changed, 10 insertions(+), 8 deletions(-) diff --git

[PATCH v3 03/17] hw/block/nvme: handle dma errors

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Handling DMA errors gracefully is required for the device to pass the block/011 test ("disable PCI device while doing I/O") in the blktests suite. With this patch the device sets the Controller Fatal Status bit in the CSTS register when failing to read from a submission queue

[PATCH v3 07/17] hw/block/nvme: fix endian conversion

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen The raw NLB field is a 16 bit value, so use le16_to_cpu instead of le32_to_cpu and cast to uint32_t before incrementing the value to not wrap around. Signed-off-by: Klaus Jensen Reviewed-by: Keith Busch Reviewed-by: Philippe Mathieu-Daudé --- hw/block/nvme.c | 4 ++-- 1

[PATCH v3 02/17] pci: pass along the return value of dma_memory_rw

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Some devices might want to know the return value of dma_memory_rw, so pass it along instead of ignoring it. There are no existing users of the return value, so this patch should be safe. Signed-off-by: Klaus Jensen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Michael

[PATCH v3 10/17] hw/block/nvme: default request status to success

2020-09-22 Thread Klaus Jensen
From: Klaus Jensen Make the default request status NVME_SUCCESS so only error status codes have to be set. Signed-off-by: Klaus Jensen Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Keith Busch --- hw/block/nvme.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git

[PATCH v2] fdc: check null block pointer before r/w data transfer

2020-09-22 Thread P J P
From: Prasad J Pandit While transferring data via fdctrl_read/write_data() routines, check that current drive does not have a null block pointer. Avoid null pointer dereference. -> https://ruhr-uni-bochum.sciebo.de/s/NNWP2GfwzYKeKwE?path=%2Ffdc_nullptr1 ==1658854==Hint: address points to

[PATCH qemu 4/4] iotests: add test for bitmap mirror

2020-09-22 Thread Fabian Grünbichler
heavily based on/practically forked off iotest 257 for bitmap backups, but: - no writes to filter node 'mirror-top' between completion and finalization, as those seem to deadlock? - no inclusion of not-yet-available full/top sync modes in combination with bitmaps - extra set of reference/test

Re: [PATCH] hw: ide: check the pointer before do dma memory unmap

2020-09-22 Thread Philippe Mathieu-Daudé
On 9/22/20 3:34 AM, Alexander Bulekov wrote: > On 200815 0020, Li Qiang wrote: >> In 'map_page' we need to check the return value of >> 'dma_memory_map' to ensure the we actully maped something. >> Otherwise, we will hit an assert in 'address_space_unmap'. >> This is because we can't find the MR

[PATCH v2 1/6] util/vfio-helpers: Pass page protections to qemu_vfio_pci_map_bar()

2020-09-22 Thread Philippe Mathieu-Daudé
Pages are currently mapped READ/WRITE. To be able to use different protections, add a new argument to qemu_vfio_pci_map_bar(). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/vfio-helpers.h | 2 +- block/nvme.c| 3 ++- util/vfio-helpers.c | 4 ++-- 3 files

[PATCH v2 2/6] block/nvme: Map doorbells pages write-only

2020-09-22 Thread Philippe Mathieu-Daudé
Per the datasheet sections 3.1.13/3.1.14: "The host should not read the doorbell registers." As we don't need read access, map the doorbells with write-only permission. We keep a reference to this mapped address in the BDRVNVMeState structure. Signed-off-by: Philippe Mathieu-Daudé ---

[PATCH v2 0/6] block/nvme: Map doorbells pages write-only, remove magic from nvme_init

2020-09-22 Thread Philippe Mathieu-Daudé
Instead of mapping 8K of I/O + doorbells as RW during the whole execution, maps I/O temporarly at init, and map doorbells WO. Replace various magic values by slighly more explicit macros from "block/nvme.h". Since v1: Fix uninitialized regs* (patchew) Philippe Mathieu-Daudé (6):

Re: [PATCH 2/6] block/nvme: Map doorbells pages write-only

2020-09-22 Thread Fam Zheng
On Tue, 2020-09-22 at 10:41 +0200, Philippe Mathieu-Daudé wrote: > Hi Fam, > > +Paolo? > > On 9/22/20 10:18 AM, Fam Zheng wrote: > > On Mon, 2020-09-21 at 18:29 +0200, Philippe Mathieu-Daudé wrote: > > > Per the datasheet sections 3.1.13/3.1.14: > > > "The host should not read the doorbell

Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread David Hildenbrand
On 22.09.20 08:27, Paolo Bonzini wrote: > On 21/09/20 18:23, Stefan Hajnoczi wrote: >> clang's C11 atomic_fetch_*() functions only take a C11 atomic type >> pointer argument. QEMU uses direct types (int, etc) and this causes a >> compiler error when a QEMU code calls these functions in a source

Re: [PATCH] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread David Hildenbrand
On 22.09.20 08:56, Paolo Bonzini wrote: > On 22/09/20 08:45, David Hildenbrand wrote: >>> It's certainly a good idea but it's quite verbose. >>> >>> What about using atomic__* as the prefix? It is not very common in QEMU >>> but there are some cases (and I cannot think of anything better). >> >>

Re: [PATCH v2 0/3] virtio: restore elem->in/out_sg after iov_discard_front/back()

2020-09-22 Thread Stefan Hajnoczi
On Thu, Sep 17, 2020 at 10:44:52AM +0100, Stefan Hajnoczi wrote: > v2: > * Add missing undo in virtio-blk write zeroes error path [Li Qiang] > > Both virtio-blk and virtio-crypto use destructive iov_discard_front/back() > operations on elem->in/out_sg. virtqueue_push() calls dma_memory_unmap()

Re: [PATCH 2/6] block/nvme: Map doorbells pages write-only

2020-09-22 Thread Philippe Mathieu-Daudé
Hi Fam, +Paolo? On 9/22/20 10:18 AM, Fam Zheng wrote: > On Mon, 2020-09-21 at 18:29 +0200, Philippe Mathieu-Daudé wrote: >> Per the datasheet sections 3.1.13/3.1.14: >> "The host should not read the doorbell registers." >> >> As we don't need read access, map the doorbells with write-only >>

Re: [PATCH v2 0/6] block/nvme: Map doorbells pages write-only, remove magic from nvme_init

2020-09-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200922083821.578519-1-phi...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20200922083821.578519-1-phi...@redhat.com Subject: [PATCH v2 0/6] block/nvme: Map

Re: [PATCH v6 2/2] nvme: allow cmb and pmr to be enabled on same device

2020-09-22 Thread Klaus Jensen
On Aug 17 08:29, Klaus Jensen wrote: > On Jul 30 00:50, Klaus Jensen wrote: > > On Jul 29 15:01, Andrzej Jakowski wrote: > > > So far it was not possible to have CMB and PMR emulated on the same > > > device, because BAR2 was used exclusively either of PMR or CMB. This > > > patch places CMB at

[PATCH v2 07/20] iotests: Do not needlessly filter _make_test_img

2020-09-22 Thread Max Reitz
In most cases, _make_test_img does not need a _filter_imgfmt on top. It does that by itself. (The exception is when IMGFMT has been overwritten but TEST_IMG has not. In such cases, we do need a _filter_imgfmt on top to filter the test's original IMGFMT from TEST_IMG.) Signed-off-by: Max Reitz

Re: [PATCH v2 01/20] configure: Detect libfuse

2020-09-22 Thread Max Reitz
On 22.09.20 13:14, Thomas Huth wrote: [...] > Could you turn this immediately into a meson test instead? See e.g. > https://lists.gnu.org/archive/html/qemu-devel/2020-09/msg07112.html as > an example for how to do this. Sure! Max signature.asc Description: OpenPGP digital signature

Re: [PATCH] hw: ide: check the pointer before do dma memory unmap

2020-09-22 Thread Philippe Mathieu-Daudé
On 9/22/20 12:37 PM, Li Qiang wrote: > Philippe Mathieu-Daudé 于2020年9月22日周二 下午4:19写道: >> >> On 9/22/20 3:34 AM, Alexander Bulekov wrote: >>> On 200815 0020, Li Qiang wrote: In 'map_page' we need to check the return value of 'dma_memory_map' to ensure the we actully maped something.

[PATCH v2 03/20] fuse: Implement standard FUSE operations

2020-09-22 Thread Max Reitz
This makes the export actually useful instead of only producing errors whenever it is accessed. Signed-off-by: Max Reitz --- block/export/fuse.c | 226 1 file changed, 226 insertions(+) diff --git a/block/export/fuse.c b/block/export/fuse.c index

Re: [PATCH 0/1] block: future of sheepdog storage driver ?

2020-09-22 Thread Thomas Huth
On 22/09/2020 11.01, Daniel P. Berrangé wrote: [...] > Does someone have a compelling reason for QEMU to keep supporting > this driver, other than the fact that it already exists ? > > If not, it looks like a candidate for deprecating in QEMU with a > view to later removing it. I think you gave

[PATCH v2 01/20] configure: Detect libfuse

2020-09-22 Thread Max Reitz
Signed-off-by: Max Reitz --- configure | 34 ++ meson.build | 6 ++ 2 files changed, 40 insertions(+) diff --git a/configure b/configure index ce27eafb0a..21c31e4694 100755 --- a/configure +++ b/configure @@ -538,6 +538,7 @@ meson="" ninja=""

[PATCH v2 18/20] iotests: Allow testing FUSE exports

2020-09-22 Thread Max Reitz
This pretends FUSE exports are a kind of protocol. As such, they are always tested under the format node. This is probably the best way to test them, actually, because this will generate more I/O load and more varied patterns. Signed-off-by: Max Reitz --- tests/qemu-iotests/check |

Re: [PATCH v2] fdc: check null block pointer before r/w data transfer

2020-09-22 Thread Li Qiang
P J P 于2020年9月22日周二 下午5:29写道: > > From: Prasad J Pandit > > While transferring data via fdctrl_read/write_data() routines, > check that current drive does not have a null block pointer. > Avoid null pointer dereference. > > ->

[PATCH v2 02/20] fuse: Allow exporting BDSs via FUSE

2020-09-22 Thread Max Reitz
block-export-add type=fuse allows mounting block graph nodes via FUSE on some existing regular file. That file should then appears like a raw disk image, and accesses to it result in accesses to the exported BDS. Right now, we only implement the necessary block export functions to set it up and

[PATCH v2 04/20] fuse: Allow growable exports

2020-09-22 Thread Max Reitz
These will behave more like normal files in that writes beyond the EOF will automatically grow the export size. Signed-off-by: Max Reitz --- qapi/block-export.json | 6 +- block/export/fuse.c| 12 +++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git

[PATCH v2 05/20] fuse: (Partially) implement fallocate()

2020-09-22 Thread Max Reitz
This allows allocating areas after the (old) EOF as part of a growing resize, writing zeroes, and discarding. Signed-off-by: Max Reitz --- block/export/fuse.c | 79 + 1 file changed, 79 insertions(+) diff --git a/block/export/fuse.c

[PATCH v2 20/20] iotests/308: Add test for FUSE exports

2020-09-22 Thread Max Reitz
We have good coverage of the normal I/O paths now, but what remains is a test that tests some more special cases: Exporting an image on itself (thus turning a formatted image into a raw one), some error cases, and non-writable and non-growable exports. Signed-off-by: Max Reitz ---

[PATCH v2 14/20] iotests: Let _make_test_img guess $TEST_IMG_FILE

2020-09-22 Thread Max Reitz
When most iotests want to create a test image that is named differently from the default $TEST_IMG, they do something like this: TEST_IMG="$TEST_IMG.base" _make_test_img $options This works fine with the "file" protocol, but not so much for anything else: _make_test_img tries to create an

[PATCH v2 13/20] iotests: Restrict some Python tests to file

2020-09-22 Thread Max Reitz
Most Python tests are restricted to the file protocol (without explicitly saying so), but these are the ones that would break ./check -fuse -qcow2. Signed-off-by: Max Reitz --- tests/qemu-iotests/206 | 3 ++- tests/qemu-iotests/242 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff

[PATCH v2 08/20] iotests: Do not pipe _make_test_img

2020-09-22 Thread Max Reitz
Executing _make_test_img as part of a pipe will undo all variable changes it has done. As such, this could not work with FUSE (because we want to remember all of our exports and their qemu instances). Replace the pipe by a temporary file in 071 and 174 (the two tests that can run on FUSE).

[PATCH v2 19/20] iotests: Enable fuse for many tests

2020-09-22 Thread Max Reitz
Many tests (that do not support generic protocols) can run just fine with FUSE-exported images, so allow them to. Note that this is no attempt at being definitely complete. There are some tests that might be modified to run on FUSE, but this patch still skips them. This patch only tries to pick

[PATCH v2 11/20] iotests: Derive image names from $TEST_IMG

2020-09-22 Thread Max Reitz
Avoid creating images with custom filenames in $TEST_DIR, because non-file protocols may want to keep $TEST_IMG (and all other test images) in some other directory. Signed-off-by: Max Reitz --- tests/qemu-iotests/200 | 3 +-- tests/qemu-iotests/200.out | 4 ++-- tests/qemu-iotests/229 |

[PATCH v2 09/20] iotests: Use convert -n in some cases

2020-09-22 Thread Max Reitz
qemu-img convert (without -n) can often be replaced by a combination of _make_test_img + qemu-img convert -n. Doing so allows converting to protocols that do not allow direct file creation, such as FUSE exports. The only problem is that for formats other than qcow2 and qed (qcow1 at least), this

Re: [PATCH v2] qemu/atomic.h: prefix qemu_ to solve collisions

2020-09-22 Thread Paolo Bonzini
On 22/09/20 10:58, Stefan Hajnoczi wrote: > clang's C11 atomic_fetch_*() functions only take a C11 atomic type > pointer argument. QEMU uses direct types (int, etc) and this causes a > compiler error when a QEMU code calls these functions in a source file > that also included via a system header

Re: [PATCH] hw: ide: check the pointer before do dma memory unmap

2020-09-22 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月22日周二 下午6:46写道: > > On 9/22/20 12:37 PM, Li Qiang wrote: > > Philippe Mathieu-Daudé 于2020年9月22日周二 下午4:19写道: > >> > >> On 9/22/20 3:34 AM, Alexander Bulekov wrote: > >>> On 200815 0020, Li Qiang wrote: > In 'map_page' we need to check the return value of >

Re: [PATCH v8 5/7] copy-on-read: limit guest writes to base in COR driver

2020-09-22 Thread Andrey Shinkevich
On 04.09.2020 16:59, Vladimir Sementsov-Ogievskiy wrote: 04.09.2020 15:50, Max Reitz wrote: On 28.08.20 18:52, Andrey Shinkevich wrote: Limit the guest's COR operations by the base node in the backing chain during a stream job. I don’t understand.   Shouldn’t we limit the areas where we set

Re: [PATCH] hw: ide: check the pointer before do dma memory unmap

2020-09-22 Thread Li Qiang
Philippe Mathieu-Daudé 于2020年9月22日周二 下午4:19写道: > > On 9/22/20 3:34 AM, Alexander Bulekov wrote: > > On 200815 0020, Li Qiang wrote: > >> In 'map_page' we need to check the return value of > >> 'dma_memory_map' to ensure the we actully maped something. > >> Otherwise, we will hit an assert in

[PATCH v2 00/20] block/export: Allow exporting BDSs via FUSE

2020-09-22 Thread Max Reitz
Based-on: <20200907182011.521007-1-kw...@redhat.com> (“block/export: Add infrastructure and QAPI for block exports”) (Though its patch 16 needs a s/= \_exp_nbd/= drv/ on top.) v1: https://lists.nongnu.org/archive/html/qemu-block/2019-12/msg00451.html Branch:

[PATCH v2 12/20] iotests/091: Use _cleanup_qemu instad of "wait"

2020-09-22 Thread Max Reitz
If the test environment has some other child processes running (like a storage daemon that provides a FUSE export), then "wait" will never finish. Use wait=yes _cleanup_qemu instead. (We need to discard the output so there is no change to the reference output.) Signed-off-by: Max Reitz ---

[PATCH v2 06/20] fuse: Implement hole detection through lseek

2020-09-22 Thread Max Reitz
This is a relatively new feature in libfuse (available since 3.8.0, which was released in November 2019), so we have to let configure check whether it is available before making use of it. Signed-off-by: Max Reitz --- configure | 32 +++ block/export/fuse.c | 77

[PATCH v2 17/20] iotests: Give access to the qemu-storage-daemon

2020-09-22 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/check | 11 +++ tests/qemu-iotests/common.rc | 17 + 2 files changed, 28 insertions(+) diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check index e14a1f354d..467a7cf1b7 100755 --- a/tests/qemu-iotests/check

[PATCH v2 15/20] iotests/287: Clean up subshell test image

2020-09-22 Thread Max Reitz
287 creates an image in a subshell (thanks to the pipe) to see whether that is possible with compression_type=zstd. If _make_test_img were to modify any global state, this global state would then be lost before we could cleanup the image. When using FUSE as the test protocol, this global state

Re: [PATCH v2 01/20] configure: Detect libfuse

2020-09-22 Thread Paolo Bonzini
On 22/09/20 13:14, Thomas Huth wrote: > On 22/09/2020 12.49, Max Reitz wrote: >> Signed-off-by: Max Reitz >> --- >> configure | 34 ++ >> meson.build | 6 ++ >> 2 files changed, 40 insertions(+) >> >> diff --git a/configure b/configure >> index

Re: [PATCH 1/1] block: drop moderated sheepdog mailing list from MAINTAINERS file

2020-09-22 Thread Philippe Mathieu-Daudé
On 9/22/20 11:01 AM, Daniel P. Berrangé wrote: > The sheepdog mailing list is setup to stop and queue messages from > non-subscribers, pending moderator approval. Unfortunately it seems > that the moderation queue is not actively dealt with. Even when messages > are approved, the sender is never

Re: [PATCH v2 0/2] block: deprecate the sheepdog driver

2020-09-22 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20200922161611.2049616-1-berra...@redhat.com/ Hi, This series seems to have some coding style problems. See output below for more information: Type: series Message-id: 20200922161611.2049616-1-berra...@redhat.com Subject: [PATCH v2 0/2] block: deprecate

[PATCH 09/11] util/vhost-user-server: rework vu_client_trip() coroutine lifecycle

2020-09-22 Thread Stefan Hajnoczi
The vu_client_trip() coroutine is leaked during AioContext switching. It is also unsafe to destroy the vu_dev in panic_cb() since its callers still access it in some cases. Rework the lifecycle to solve these safety issues. Signed-off-by: Stefan Hajnoczi --- util/vhost-user-server.h

[PATCH 06/11] util/vhost-user-server: drop unused DevicePanicNotifier

2020-09-22 Thread Stefan Hajnoczi
The device panic notifier callback is not used. Drop it. Signed-off-by: Stefan Hajnoczi --- util/vhost-user-server.h | 3 --- block/export/vhost-user-blk-server.c | 3 +-- util/vhost-user-server.c | 6 -- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git

[PATCH 02/11] util/vhost-user-server: s/fileds/fields/ typo fix

2020-09-22 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi --- util/vhost-user-server.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c index 7b50a2b1fd..2cd0cf8277 100644 --- a/util/vhost-user-server.c +++ b/util/vhost-user-server.c @@ -407,7 +407,7

[PATCH 04/11] util/vhost-user-server: drop unnecessary watch deletion

2020-09-22 Thread Stefan Hajnoczi
Explicitly deleting watches is not necessary since libvhost-user calls remove_watch() during vu_deinit(). Add an assertion to check this though. Signed-off-by: Stefan Hajnoczi --- util/vhost-user-server.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git

  1   2   >