On Sep 24 19:24, Keith Busch wrote:
> On Thu, Sep 24, 2020 at 10:45:00PM +0200, Klaus Jensen wrote:
> > Finally, I wrote this. I am *NOT* saying that this somehow makes it
> > better, but as a maintainer, is a big deal to me since both series are
> > arguably a lot of code to maintain and support (
On Thu, Sep 24, 2020 at 10:45:00PM +0200, Klaus Jensen wrote:
> Finally, I wrote this. I am *NOT* saying that this somehow makes it
> better, but as a maintainer, is a big deal to me since both series are
> arguably a lot of code to maintain and support (both series are about
> the same size). But
Patchew URL:
https://patchew.org/QEMU/20200924204516.1881843-1-...@irrelevant.dk/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Type: series
Message-id: 20200924204516.1881843-1-...@irrelevant.dk
Subject: [PATCH 00/16] hw/block/nvme: zoned na
Patchew URL:
https://patchew.org/QEMU/20200924194003.22080-1-vsement...@virtuozzo.com/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing
commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEG
On Sep 24 16:52, Markus Armbruster wrote:
> Cc'ing nvme maintainers.
>
> Amey Narkhede writes:
>
> > Is there any TODO file/wiki for nvme emulation code?
> > I'm a beginner who is interested in getting into
> > nvme emulation. I have read nvme v1.4a specification
> > and some code in hw/block/nv
On Sep 24 22:45, Klaus Jensen wrote:
> From: Klaus Jensen
>
> Allos the LBA data size (lbads) to be set between 9 and 12.
>
The patch from Dmitry that uses the common logical_block_size BlockConf
parameter is probably better than this.
signature.asc
Description: PGP signature
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
From: Klaus Jensen
Allow the controller to release active resources by transitioning zones
to the full state if enabled.
Signed-off-by: Klaus Jensen
---
docs/specs/nvme.txt | 5 ++
hw/block/nvme-ns.h| 3 +
include/block/nvme.h | 30 ++--
hw/block/nvme-ns.c| 3 +
hw/block/
From: Klaus Jensen
Add the Zone Management Receive command.
Signed-off-by: Klaus Jensen
---
hw/block/nvme-ns.h| 8 +++
hw/block/nvme.h | 1 +
include/block/nvme.h | 46 ++
hw/block/nvme-ns.c| 35 ++-
hw/block/nvme.c | 135 +
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
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
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 | 65 +
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 | 52 +--
hw/block/trace-events | 1 +
4 files changed, 64 insertions(+), 2 deleti
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
On Sep 24 03:20, Dmitry Fomichev wrote:
> v3 -> v4
>
> - Fix bugs introduced in v2/v3 for QD > 1 operation. Now, all writes
>to a zone happen at the new write pointer variable, zone->w_ptr,
>that is advanced right after submitting the backend i/o. The existing
>zone->d.wp variable is
From: Klaus Jensen
Add the rrl,rrld,frl and frld device parameters. The frld and rrld
parameters specify the delay in seconds until the device sets the Finish
and Reset Zone Recommended attributes on zones when they are
transitioned to Full or an Opened state respectively. The rrl and frl
paramet
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| 11 +-
hw/block/nvme.h | 3 +
include/block/nvme.
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,
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
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 +++
From: Klaus Jensen
While going through a few rounds of reviews on Dmitry's series I have
also continued nursing my own implementation since originally posted. I
did not receive any reviews originally, since it depended on a lot of
preceding series, but now, with the staging of multiple namespaces
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
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
-
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
Patchew URL:
https://patchew.org/QEMU/20200924185414.28642-1-vsement...@virtuozzo.com/
Hi,
This series failed the docker-quick@centos7 build test. Please find the testing
commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.
=== TEST SCRIPT BEG
On 9/24/20 2:40 PM, Vladimir Sementsov-Ogievskiy wrote:
bdrv_is_allocated_above wrongly handles short backing files: it reports
after-EOF space as UNALLOCATED which is wrong, as on read the data is
generated on the level of short backing file (if all overlays has
s/has/have/
unallocated area
On 9/24/20 2:40 PM, Vladimir Sementsov-Ogievskiy wrote:
In order to reuse bdrv_common_block_status_above in
bdrv_is_allocated_above, let's support include_base parameter.
Signed-off-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Alberto Garcia
---
block/coroutines.h | 2 ++
block/io.c
On 9/24/20 2:39 PM, Vladimir Sementsov-Ogievskiy wrote:
bdrv_co_block_status_above has several design problems with handling
short backing files:
1. With want_zeros=true, it may return ret with BDRV_BLOCK_ZERO but
without BDRV_BLOCK_ALLOCATED flag, when actually short backing file
which produces
bdrv_is_allocated_above wrongly handles short backing files: it reports
after-EOF space as UNALLOCATED which is wrong, as on read the data is
generated on the level of short backing file (if all overlays has
unallocated area at that place).
Reusing bdrv_common_block_status_above fixes the issue an
On Thu, Sep 24, 2020 at 08:55:24PM +0200, Klaus Jensen wrote:
> On Sep 24 18:17, Niklas Cassel wrote:
> > On Thu, Sep 24, 2020 at 02:12:03PM +0200, Klaus Jensen wrote:
> > > On Sep 24 03:20, Dmitry Fomichev wrote:
> > > > From: Niklas Cassel
> > > >
> > > > E.g., if the user sets CC.CSS to Admin
These cases are fixed by previous patches around block_status and
is_allocated.
Signed-off-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Eric Blake
Reviewed-by: Alberto Garcia
---
tests/qemu-iotests/274 | 20 +++
tests/qemu-iotests/274.out | 68 +
In order to reuse bdrv_common_block_status_above in
bdrv_is_allocated_above, let's support include_base parameter.
Signed-off-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Alberto Garcia
---
block/coroutines.h | 2 ++
block/io.c | 21 ++---
2 files changed, 16 insertion
bdrv_co_block_status_above has several design problems with handling
short backing files:
1. With want_zeros=true, it may return ret with BDRV_BLOCK_ZERO but
without BDRV_BLOCK_ALLOCATED flag, when actually short backing file
which produces these after-EOF zeros is inside requested backing
sequenc
We are going to reuse bdrv_common_block_status_above in
bdrv_is_allocated_above. bdrv_is_allocated_above may be called with
include_base == false and still bs == base (for ex. from img_rebase()).
So, support this corner case.
Signed-off-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Kevin Wolf
R
Hi all!
These series are here to address the following problem:
block-status-above functions may consider space after EOF of
intermediate backing files as unallocated, which is wrong, as these
backing files are the reason of producing zeroes, we never go further by
backing chain after a short back
On 9/24/20 1:54 PM, Vladimir Sementsov-Ogievskiy wrote:
We have a very frequent pattern of creating a coroutine from a function
with several arguments:
- create a structure to pack parameters
- create _entry function to call original function taking parameters
from struct
- do diff
On 9/24/20 1:54 PM, Vladimir Sementsov-Ogievskiy wrote:
Hi all!
The aim of the series is to reduce code-duplication and writing
parameters structure-packing by hand around coroutine function wrappers.
Benefits:
- no code duplication
- less indirection
v9: Thanks to Eric, I used commit mess
On Sep 24 18:17, Niklas Cassel wrote:
> On Thu, Sep 24, 2020 at 02:12:03PM +0200, Klaus Jensen wrote:
> > On Sep 24 03:20, Dmitry Fomichev wrote:
> > > From: Niklas Cassel
> > >
> > > E.g., if the user sets CC.CSS to Admin Only, NVM namespaces should be
> > > marked as inactive.
> > >
> >
> > H
Now that we are not maintaining boilerplate code for coroutine
wrappers, there is no more sense in keeping the extra indirection layer
of bdrv_prwv(). Let's drop it and instead generate pure bdrv_preadv()
and bdrv_pwritev().
Currently, bdrv_pwritev() and bdrv_preadv() are returning bytes on
succe
We have a very frequent pattern of creating a coroutine from a function
with several arguments:
- create a structure to pack parameters
- create _entry function to call original function taking parameters
from struct
- do different magic to handle completion: set ret to NOT_DONE or
E
Use code generation implemented in previous commit to generated
coroutine wrappers in block.c and block/io.c
Signed-off-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Eric Blake
Reviewed-by: Stefan Hajnoczi
---
block/coroutines.h| 6 +-
include/block/block.h | 16 ++--
block.c
This is the only coroutine wrapper from block.c and block/io.c which
doesn't return a value, so let's convert it to the common behavior, to
simplify moving to generated coroutine wrappers in a further commit.
Also, bdrv_invalidate_cache is a void function, returning error only
through **errp param
Most of our coroutine wrappers already follow this convention:
We have 'coroutine_fn bdrv_co_()' as
the core function, and a wrapper 'bdrv_()' which does parameter packing and calls bdrv_run_co().
The only outsiders are the bdrv_prwv_co and
bdrv_common_block_status_above wrappers. Let's refactor
We are going to keep coroutine-wrappers code (structure-packing
parameters, BDRV_POLL wrapper functions) in separate auto-generated
files. So, we'll need a header with declaration of original _co_
functions, for those which are static now. As well, we'll need
declarations for wrapper functions. Do
Like for read/write in a previous commit, drop extra indirection layer,
generate directly bdrv_readv_vmstate() and bdrv_writev_vmstate().
Signed-off-by: Vladimir Sementsov-Ogievskiy
Reviewed-by: Eric Blake
Reviewed-by: Stefan Hajnoczi
---
block/coroutines.h| 10 +++
include/block/block
Hi all!
The aim of the series is to reduce code-duplication and writing
parameters structure-packing by hand around coroutine function wrappers.
Benefits:
- no code duplication
- less indirection
v9: Thanks to Eric, I used commit message tweaks and rebase-conflict solving
from his git.
01: ad
24.09.2020 20:56, Eric Blake wrote:
On 9/15/20 11:44 AM, Vladimir Sementsov-Ogievskiy wrote:
We have a very frequent pattern of creating coroutine from function
with several arguments:
+++ b/docs/devel/block-coroutine-wrapper.rst
@@ -0,0 +1,54 @@
+===
+block-coroutine-wra
On Thu, Sep 24, 2020 at 02:12:03PM +0200, Klaus Jensen wrote:
> On Sep 24 03:20, Dmitry Fomichev wrote:
> > From: Niklas Cassel
> >
> > E.g., if the user sets CC.CSS to Admin Only, NVM namespaces should be
> > marked as inactive.
> >
>
> Hmm. I'm not convinced that this is correct. Can you refe
On 9/15/20 11:44 AM, Vladimir Sementsov-Ogievskiy wrote:
We have a very frequent pattern of creating coroutine from function
with several arguments:
+++ b/docs/devel/block-coroutine-wrapper.rst
@@ -0,0 +1,54 @@
+===
+block-coroutine-wrapper
+===
+
+A lo
24.09.2020 20:40, Andrey Shinkevich wrote:
On 24.09.2020 20:29, Andrey Shinkevich wrote:
On 24.09.2020 18:00, Max Reitz wrote:
On 24.09.20 16:51, Vladimir Sementsov-Ogievskiy wrote:
24.09.2020 16:25, Max Reitz wrote:
On 23.09.20 16:38, Vladimir Sementsov-Ogievskiy wrote:
17.09.2020 19:09, An
On 24.09.2020 20:29, Andrey Shinkevich wrote:
On 24.09.2020 18:00, Max Reitz wrote:
On 24.09.20 16:51, Vladimir Sementsov-Ogievskiy wrote:
24.09.2020 16:25, Max Reitz wrote:
On 23.09.20 16:38, Vladimir Sementsov-Ogievskiy wrote:
17.09.2020 19:09, Andrey Shinkevich wrote:
On 04.09.2020 14:22,
24.09.2020 19:50, Max Reitz wrote:
On 18.09.20 20:19, Vladimir Sementsov-Ogievskiy wrote:
It's intended to be inserted between format and protocol nodes to
preallocate additional space (expanding protocol file) on writes
crossing EOF. It improves performance for file-systems with slow
allocation
On 24.09.2020 18:00, Max Reitz wrote:
On 24.09.20 16:51, Vladimir Sementsov-Ogievskiy wrote:
24.09.2020 16:25, Max Reitz wrote:
On 23.09.20 16:38, Vladimir Sementsov-Ogievskiy wrote:
17.09.2020 19:09, Andrey Shinkevich wrote:
On 04.09.2020 14:22, Max Reitz wrote:
On 28.08.20 18:52, Andrey Sh
Patchew URL: https://patchew.org/QEMU/20200924152717.287415-1-kw...@redhat.com/
Hi,
This series seems to have some coding style problems. See output below for
more information:
Type: series
Message-id: 20200924152717.287415-1-kw...@redhat.com
Subject: [PATCH v2 00/31] block/export: Add infrast
On 18.09.20 20:19, Vladimir Sementsov-Ogievskiy wrote:
> This will be used in further test.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy
> ---
> qemu-io-cmds.c | 46 --
> 1 file changed, 32 insertions(+), 14 deletions(-)
>
> diff --git a/qemu-io-cm
On Wed 16 Sep 2020 02:20:08 PM CEST, Vladimir Sementsov-Ogievskiy
wrote:
> These cases are fixed by previous patches around block_status and
> is_allocated.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy
> Reviewed-by: Eric Blake
Reviewed-by: Alberto Garcia
Berto
On Wed 16 Sep 2020 02:20:07 PM CEST, Vladimir Sementsov-Ogievskiy
wrote:
> bdrv_is_allocated_above wrongly handles short backing files: it reports
> after-EOF space as UNALLOCATED which is wrong, as on read the data is
> generated on the level of short backing file (if all overlays has
> unalloca
On Wed 16 Sep 2020 02:20:04 PM CEST, Vladimir Sementsov-Ogievskiy
wrote:
> bdrv_co_block_status_above has several design problems with handling
> short backing files:
>
> 1. With want_zeros=true, it may return ret with BDRV_BLOCK_ZERO but
> without BDRV_BLOCK_ALLOCATED flag, when actually short b
On 18.09.20 20:19, Vladimir Sementsov-Ogievskiy wrote:
> It's intended to be inserted between format and protocol nodes to
> preallocate additional space (expanding protocol file) on writes
> crossing EOF. It improves performance for file-systems with slow
> allocation.
>
> Signed-off-by: Vladimir
On 9/23/20 8:00 PM, Eric Blake wrote:
There's enough grammar fixes, and the fact that John is working on
python cleanups, to make me wonder if we need a v9, or if I should just
stage it where it is with any other cleanups as followups. But I'm
liking the reduced maintenance burden once it i
Add a function to list the NBD exports offered by an NBD server.
Signed-off-by: Kevin Wolf
---
tests/qemu-iotests/iotests.py | 13 -
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 81edf8adbf..cb9f90f73
Every export type will need a BlockBackend, so creating it centrally in
blk_exp_add() instead of the .create driver callback avoids duplication.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
---
include/block/nbd.h | 4 ++--
block/export/export.c | 49 +
Signed-off-by: Kevin Wolf
---
tests/qemu-iotests/307 | 132 +
tests/qemu-iotests/307.out | 124 ++
tests/qemu-iotests/group | 1 +
3 files changed, 257 insertions(+)
create mode 100755 tests/qemu-iotests/307
create mode
This adds a simple QMP command to query the list of block exports.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
---
qapi/block-export.json | 32
block/export/export.c | 23 +++
2 files changed, 55 insertions(+)
diff --git a/qapi/block-e
This is useful for specifying 'generic' as supported (which includes
only writable image formats), but still excluding some incompatible
writable formats.
It also removes more lines than it adds.
Signed-off-by: Kevin Wolf
---
tests/qemu-iotests/iotests.py | 6 +-
1 file changed, 1 insertion
There is no real reason any more why nbd_export_new() and
nbd_export_create() should be separate functions. The latter only
performs a few checks before it calls the former.
What makes the current state stand out is that it's the only function in
BlockExportDriver that is not a static function ins
This adds a function to shut down all block exports, and another one to
shut down the block exports of a single type. The latter is used for now
when stopping the NBD server. As soon as we implement support for
multiple NBD servers, we'll need a per-server list of exports and it
will be replaced by
Every block export needs a block node to export, so add a 'node-name'
option to BlockExportOptions and remove the replaced option 'device'
from BlockExportOptionsNbd.
To maintain compatibility in nbd-server-add, BlockExportOptionsNbd needs
to be wrapped by a new type NbdServerAddOptions that adds
Having a refcount makes sense for all types of block exports. It is also
a prerequisite for keeping a list of all exports at the BlockExport
level.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
---
include/block/export.h | 15 +
include/block/nbd.h| 2 --
block/export/export.c
We'll need an id to identify block exports in monitor commands. This
adds one.
Note that this is different from the 'name' option in the NBD server,
which is the externally visible export name. While block export ids need
to be unique in the whole process, export names must be unique only for
the
These QMP commands are replaced by block-export-add/del.
Signed-off-by: Kevin Wolf
---
qapi/block-export.json | 11 +--
docs/system/deprecated.rst | 6 ++
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/qapi/block-export.json b/qapi/block-export.json
index ad01e9
Every block export has a BlockBackend representing the disk that is
exported. It should live in BlockExport therefore.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
---
include/block/export.h | 3 +++
block/export/export.c | 3 +++
nbd/server.c | 43 +
We have three almost identical functions that call an external process
and return its output and return code. Refactor them into small wrappers
around a common function.
Signed-off-by: Kevin Wolf
---
tests/qemu-iotests/iotests.py | 49 ---
1 file changed, 23 inser
We want to have a common set of commands for all types of block exports.
Currently, this is only NBD, but we're going to add more types.
This patch adds the basic BlockExport and BlockExportDriver structs and
a QMP command block-export-add that creates a new export based on the
given BlockExportOp
This is a QMP equivalent of qemu-nbd's --shared option, limiting the
maximum number of clients that can attach at the same time.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
Reviewed-by: Eric Blake
---
qapi/block-export.json | 10 +++--
include/block/nbd.h
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
Reviewed-by: Eric Blake
---
include/block/nbd.h | 2 --
nbd/server.c| 5 -
2 files changed, 7 deletions(-)
diff --git a/include/block/nbd.h b/include/block/nbd.h
index 9bc3bfaeec..0451683d03 100644
--- a/include/block/nbd.h
+++ b/inc
Implement a new QMP command block-export-del and make nbd-server-remove
a wrapper around it.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
---
qapi/block-export.json | 32 -
include/block/export.h | 1 +
include/block/nbd.h| 1 -
block/ex
The reference owned by the user/monitor that is created when adding the
export and dropped when removing it was tied to the 'exports' list in
nbd/server.c. Every block export will have a user reference, so move it
to the block export level and tie it to the 'block_exports' list in
block/export/expo
The 'writable' option is a basic option that will probably be applicable
to most if not all export types that we will implement. Move it from NBD
to the generic BlockExport layer.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
---
qapi/block-export.json | 15 ++-
block/export/expo
Clients may want to know when an export has finally disappeard
(block-export-del returns earlier than that in the general case), so add
a QAPI event for it.
Signed-off-by: Kevin Wolf
---
qapi/block-export.json | 12
block/export/export.c | 2 ++
tests/qemu-iotests/140
Instead of letting the driver allocate and return the BlockExport
object, allocate it already in blk_exp_add() and pass it. This allows us
to initialise the generic part before calling into the driver so that
the driver can just use these values instead of having to parse the
options a second time.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
---
include/block/export.h | 3 +++
block/export/export.c | 2 ++
nbd/server.c | 26 +-
3 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/include/block/export.h b/include/block/export.h
index 523
Closing export is somewhat convoluted because nbd_export_close() and
nbd_export_put() call each other and the ways they actually end up being
nested is not necessarily obvious.
However, it is not really necessary to call nbd_export_close() from
nbd_export_put() when putting the last reference beca
nbd-server-add tries to be convenient and adds two questionable
features that we don't want to share in block-export-add, even for NBD
exports:
1. When requesting a writable export of a read-only device, the export
is silently downgraded to read-only. This should be an error in the
context o
With this change, NBD exports are now only created through the
BlockExport interface. This allows us finally to move things from the
NBD layer to the BlockExport layer if they make sense for other export
types, too.
blk_exp_add() returns only a weak reference, so the explicit
nbd_export_put() goes
The export close callback is unused by the built-in NBD server. qemu-nbd
uses it only during shutdown to wait for the unrefed export to actually
go away. It can just use nbd_export_close_all() instead and do without
the callback.
This removes the close callback from nbd_export_new() and makes both
qemu-nbd allows use of writethrough cache modes, which mean that write
requests made through NBD will cause a flush before they complete.
Expose the same functionality in block-export-add.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
---
qapi/block-export.json | 7 ++-
blockdev-nbd.c
The name BlockExport will be used for the struct containing the runtime
state of block exports, so change the name of export creation options.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
Reviewed-by: Eric Blake
---
qapi/block-export.json | 12 ++--
block/monitor/bloc
Unexpected EOF is an error that must be reported.
Signed-off-by: Stefan Hajnoczi
---
util/vhost-user-server.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/util/vhost-user-server.c b/util/vhost-user-server.c
index 5a60e2ca2a..ec555abcb2 100644
--- a/util/vhost-user-se
Instead of implementing qemu-nbd --offset in the NBD code, just put a
raw block node with the requested offset on top of the user image and
rely on that doing the job.
This does not only simplify the nbd_export_new() interface and bring it
closer to the set of options that the nbd-server-add QMP c
No reason to duplicate the functionality locally, we can now just reuse
the QMP command block-export-add for --export.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
Reviewed-by: Eric Blake
---
storage-daemon/qemu-storage-daemon.c | 13 +
1 file changed, 1 insertion(+), 12 deleti
Move all block export related types and commands from block-core to the
new QAPI module block-export.
Signed-off-by: Kevin Wolf
Reviewed-by: Max Reitz
Reviewed-by: Eric Blake
---
qapi/block-core.json | 166 -
qapi/block-export.json | 175 ++
We are planning to add more block export types than just NBD in the near
future (e.g. vhost-user-blk and FUSE). This series lays the ground for
this with some generic block export infrastructure and QAPI interfaces
that will allow managing all of them (for now add/remove/query).
As a side effect,
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
fds[] is leaked when qio_channel_readv_full() fails.
Use vmsg->fds[] instead of keeping a local fds[] array. Then we can
reuse goto fail to clean up fds. vmsg->fd_num must be zeroed before the
loop to make this safe.
Signed-off-by: Stefan Hajnoczi
---
util/vhost-user-server.c | 50 +
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
Headers used by other subsystems are located in include/. Also add the
vhost-user-server and vhost-user-blk-server headers to MAINTAINERS.
Signed-off-by: Stefan Hajnoczi
---
MAINTAINERS| 4 +++-
{util => include/qemu}/vhost-user-server.h | 0
block/export/vhost-us
Propagate the flush return value since errors are possible.
Signed-off-by: Stefan Hajnoczi
---
block/export/vhost-user-blk-server.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/block/export/vhost-user-blk-server.c
b/block/export/vhost-user-blk-server.c
index b
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 and contains a BlockExport field.
Severa
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 a/
1 - 100 of 132 matches
Mail list logo