Re: [PATCH V4 4/6] hw/block/nvme: support for multi-controller in subsystem

2021-01-21 Thread Minwoo Im
On 21-01-21 15:17:16, Keith Busch wrote: > On Fri, Jan 22, 2021 at 07:09:06AM +0900, Minwoo Im wrote: > > -static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev) > > +static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev, uint16_t > > cntlid) > > { > > NvmeIdCtrl *id = >id_ctrl; >

Re: [PATCH V4 2/6] hw/block/nvme: support to map controller to a subsystem

2021-01-21 Thread Minwoo Im
On 21-01-21 15:03:38, Keith Busch wrote: > On Fri, Jan 22, 2021 at 07:09:04AM +0900, Minwoo Im wrote: > > --- a/hw/block/nvme.c > > +++ b/hw/block/nvme.c > > @@ -23,6 +23,7 @@ > > * max_ioqpairs=, \ > > * aerl=, aer_max_queued=, \ > > *

Re: [PATCH V4 1/6] hw/block/nvme: introduce nvme-subsys device

2021-01-21 Thread Minwoo Im
On 21-01-21 14:52:02, Keith Busch wrote: > On Fri, Jan 22, 2021 at 07:09:03AM +0900, Minwoo Im wrote: > > +static void nvme_subsys_setup(NvmeSubsystem *subsys) > > +{ > > +char *subnqn; > > + > > +subnqn = g_strdup_printf("nqn.2019-08.org.qemu:%s", > > subsys->parent_obj.id); > > +

Re: [PATCH V4 4/6] hw/block/nvme: support for multi-controller in subsystem

2021-01-21 Thread Keith Busch
On Fri, Jan 22, 2021 at 07:09:06AM +0900, Minwoo Im wrote: > -static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev) > +static void nvme_init_ctrl(NvmeCtrl *n, PCIDevice *pci_dev, uint16_t cntlid) > { > NvmeIdCtrl *id = >id_ctrl; > uint8_t *pci_conf = pci_dev->config; > > +

Re: [PATCH V4 2/6] hw/block/nvme: support to map controller to a subsystem

2021-01-21 Thread Keith Busch
On Fri, Jan 22, 2021 at 07:09:04AM +0900, Minwoo Im wrote: > --- a/hw/block/nvme.c > +++ b/hw/block/nvme.c > @@ -23,6 +23,7 @@ > * max_ioqpairs=, \ > * aerl=, aer_max_queued=, \ > * mdts=,zoned.append_size_limit= \ > + * ,subsys= \ For

Re: [PATCH v4 05/16] block/io: bdrv_pad_request(): support qemu_iovec_init_extended failure

2021-01-21 Thread Eric Blake
On 12/11/20 12:39 PM, Vladimir Sementsov-Ogievskiy wrote: > Make bdrv_pad_request() honest: return error if > qemu_iovec_init_extended() failed. > > Update also bdrv_padding_destroy() to clean the structure for safety. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/io.c | 45

Re: [PATCH V4 1/6] hw/block/nvme: introduce nvme-subsys device

2021-01-21 Thread Keith Busch
On Fri, Jan 22, 2021 at 07:09:03AM +0900, Minwoo Im wrote: > +static void nvme_subsys_setup(NvmeSubsystem *subsys) > +{ > +char *subnqn; > + > +subnqn = g_strdup_printf("nqn.2019-08.org.qemu:%s", > subsys->parent_obj.id); > +strpadcpy((char *)subsys->subnqn, sizeof(subsys->subnqn),

Re: [PATCH v4 04/16] block/io: refactor bdrv_pad_request(): move bdrv_pad_request() up

2021-01-21 Thread Eric Blake
On 12/11/20 12:39 PM, Vladimir Sementsov-Ogievskiy wrote: > Prepare to the following patch when bdrv_pad_request() will be able to s/Prepare to/Prepare for/ > fail. Update the comments. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/io.c | 25 +++-- > 1 file

Re: [PATCH v4 03/16] block: fix theoretical overflow in bdrv_init_padding()

2021-01-21 Thread Eric Blake
On 12/11/20 12:39 PM, Vladimir Sementsov-Ogievskiy wrote: > Calculation of sum may theoretically overflow, so use 64bit type and > add some good assertions. > > Use int64_t constantly. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > block/io.c | 8 ++-- > 1 file changed, 6

[PATCH V4 5/6] hw/block/nvme: add NMIC enum value for Identify Namespace

2021-01-21 Thread Minwoo Im
Added Namespace Multi-path I/O and Namespace Sharing Capabilities (NMIC) field to support shared namespace from controller(s). This field is in Identify Namespace data structure in [30]. Signed-off-by: Minwoo Im --- include/block/nvme.h | 4 1 file changed, 4 insertions(+) diff --git

[PATCH V4 3/6] hw/block/nvme: add CMIC enum value for Identify Controller

2021-01-21 Thread Minwoo Im
Added Controller Multi-path I/O and Namespace Sharing Capabilities (CMIC) field to support multi-controller in the following patches. This field is in Identify Controller data structure in [76]. Signed-off-by: Minwoo Im --- include/block/nvme.h | 4 1 file changed, 4 insertions(+) diff

[PATCH V4 2/6] hw/block/nvme: support to map controller to a subsystem

2021-01-21 Thread Minwoo Im
nvme controller(nvme) can be mapped to a NVMe subsystem(nvme-subsys). This patch maps a controller to a subsystem by adding a parameter 'subsys' to the nvme device. To map a controller to a subsystem, we need to put nvme-subsys first and then maps the subsystem to the controller: -device

[PATCH V4 4/6] hw/block/nvme: support for multi-controller in subsystem

2021-01-21 Thread Minwoo Im
We have nvme-subsys and nvme devices mapped together. To support multi-controller scheme to this setup, controller identifier(id) has to be managed. Earlier, cntlid(controller id) used to be always 0 because we didn't have any subsystem scheme that controller id matters. This patch introduced

[PATCH V4 6/6] hw/block/nvme: support for shared namespace in subsystem

2021-01-21 Thread Minwoo Im
nvme-ns device is registered to a nvme controller device during the initialization in nvme_register_namespace() in case that 'bus' property is given which means it's mapped to a single controller. This patch introduced a new property 'subsys' just like the controller device instance did to map a

[PATCH V4 1/6] hw/block/nvme: introduce nvme-subsys device

2021-01-21 Thread Minwoo Im
To support multi-path in QEMU NVMe device model, We need to have NVMe subsystem hierarchy to map controllers and namespaces to a NVMe subsystem. This patch introduced a simple nvme-subsys device model. The subsystem will be prepared with subsystem NQN with provided in nvme-subsys device: ex)

[PATCH V4 0/6] hw/block/nvme: support multi-path for ctrl/ns

2021-01-21 Thread Minwoo Im
Hello, This series is fourth series for the support of NVMe subsystem scheme with multi-controller and namespace sharing in a subsystem. This time, I've removed 'detached' scheme introduced in the previous series out of this series to focus on subsystem scheme in ths series. The attach/detach

Re: [PATCH v4 02/16] util/iov: make qemu_iovec_init_extended() honest

2021-01-21 Thread Eric Blake
On 12/11/20 12:39 PM, Vladimir Sementsov-Ogievskiy wrote: > Actually, we can't extend the io vector in all cases. Handle possible > MAX_IOV and size_t overflows. > > For now add assertion to callers (actually they rely on success anyway) > and fix them in the following patch. > > Add also some

Re: [PATCH 7/7] block/rbd: change request alignment to 1 byte

2021-01-21 Thread Jason Dillaman
On Thu, Jan 21, 2021 at 3:29 PM Peter Lieven wrote: > > Am 21.01.21 um 20:42 schrieb Jason Dillaman: > > On Wed, Jan 20, 2021 at 6:01 PM Peter Lieven wrote: > >> > >>> Am 19.01.2021 um 15:20 schrieb Jason Dillaman : > >>> > >>> On Tue, Jan 19, 2021 at 4:36 AM Peter Lieven wrote: > > Am

Re: [PATCH 7/7] block/rbd: change request alignment to 1 byte

2021-01-21 Thread Peter Lieven
Am 21.01.21 um 20:42 schrieb Jason Dillaman: > On Wed, Jan 20, 2021 at 6:01 PM Peter Lieven wrote: >> >>> Am 19.01.2021 um 15:20 schrieb Jason Dillaman : >>> >>> On Tue, Jan 19, 2021 at 4:36 AM Peter Lieven wrote: > Am 18.01.21 um 23:33 schrieb Jason Dillaman: > On Fri, Jan 15, 2021 at

Re: [PATCH 11/11] iotests/264: add backup-cancel test-case

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 05:21, Eric Blake wrote: On 1/20/21 7:28 PM, Eric Blake wrote: On 11/18/20 12:04 PM, Vladimir Sementsov-Ogievskiy wrote: Check that cancel doesn't wait for 10s of nbd reconnect timeout. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/264 | 21

Re: [PATCH 00/11] mirror: cancel nbd reconnect

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 05:14, Eric Blake wrote: On 11/18/20 12:04 PM, Vladimir Sementsov-Ogievskiy wrote: Hi all! The problem Assume we have mirror job with nbd target node with enabled reconnect. Connection failed. So, all current requests to nbd node are waiting for nbd driver to reconnect. And they

Re: [PATCH 7/7] block/rbd: change request alignment to 1 byte

2021-01-21 Thread Jason Dillaman
On Wed, Jan 20, 2021 at 6:01 PM Peter Lieven wrote: > > > > Am 19.01.2021 um 15:20 schrieb Jason Dillaman : > > > > On Tue, Jan 19, 2021 at 4:36 AM Peter Lieven wrote: > >>> Am 18.01.21 um 23:33 schrieb Jason Dillaman: > >>> On Fri, Jan 15, 2021 at 10:39 AM Peter Lieven wrote: > Am

Re: [PATCH 03/11] block/raw-format: implement .bdrv_cancel_in_flight handler

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 02:15, Eric Blake wrote: On 11/18/20 12:04 PM, Vladimir Sementsov-Ogievskiy wrote: We are going to cancel in-flight requests on mirror nbd target on job cancel. Still nbd is often used not directly but as raw-format child. So, add pass-through handler here. Signed-off-by: Vladimir

Re: [PATCH 09/11] iotests/264: add mirror-cancel test-case

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 04:26, Eric Blake wrote: On 11/18/20 12:04 PM, Vladimir Sementsov-Ogievskiy wrote: Check that cancel doesn't wait for 10s of nbd reconnect timeout. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/264 | 38 ++

Re: [PATCH 07/11] iotests/264: move to python unittest

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 04:17, Eric Blake wrote: On 11/18/20 12:04 PM, Vladimir Sementsov-Ogievskiy wrote: We are going to add more test cases, so use the library supporting test cases. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/qemu-iotests/264 | 93 ++

Re: [PATCH v6 3/7] qemu: add support for iOS host

2021-01-21 Thread Peter Maydell
On Tue, 5 Jan 2021 at 02:25, Joelle van Dyne wrote: > > This introduces support for building for iOS hosts. When the correct Xcode > toolchain is used, iOS host will be detected automatically. > > * block: disable features not supported by iOS sandbox > * slirp: disable SMB features for iOS > *

Re: [PATCH 01/11] block: add new BlockDriver handler: bdrv_cancel_in_flight

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 01:27, Eric Blake wrote: On 11/18/20 12:04 PM, Vladimir Sementsov-Ogievskiy wrote: It will be used to stop retrying NBD requests on mirror cancel. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block.h | 3 +++ include/block/block_int.h | 9 +

Re: [PATCH v3 2/2] block: move blk_exp_close_all() to qemu_cleanup()

2021-01-21 Thread Eric Blake
On 1/21/21 11:07 AM, Sergio Lopez wrote: > Move blk_exp_close_all() from bdrv_close() to qemu_cleanup(), before > bdrv_drain_all_begin(). > > Export drivers may have coroutines yielding at some point in the block > layer, so we need to shut them down before draining the block layer, > as

Re: [PATCH v3 1/2] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2021-01-21 Thread Eric Blake
On 1/21/21 11:06 AM, Sergio Lopez wrote: > Some graphs may contain an indirect reference to the first BDS in the > chain that can be reached while walking it bottom->up from one its one of its > children. > > Doubling-processing of a BDS is especially problematic for the Double-processing >

Re: [PATCH v7 10/11] iotests: rewrite check into python

2021-01-21 Thread Eric Blake
On 1/16/21 7:44 AM, Vladimir Sementsov-Ogievskiy wrote: > Just use classes introduced in previous three commits. Behavior > difference is described in these three commits. > > Drop group file, as it becomes unused. > > Drop common.env: now check is in python, and for tests we use same > python

Re: [PATCH v7 09/11] iotests: add testrunner.py

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 20:02, Eric Blake wrote: On 1/16/21 7:44 AM, Vladimir Sementsov-Ogievskiy wrote: Add TestRunner class, which will run tests in a new python iotests running framework. There are some differences with current ./check behavior, most significant are: - Consider all tests

[PATCH v3 2/2] block: move blk_exp_close_all() to qemu_cleanup()

2021-01-21 Thread Sergio Lopez
Move blk_exp_close_all() from bdrv_close() to qemu_cleanup(), before bdrv_drain_all_begin(). Export drivers may have coroutines yielding at some point in the block layer, so we need to shut them down before draining the block layer, as otherwise they may get stuck blk_wait_while_drained(). RHBZ:

[PATCH v3 0/2] nbd/server: Quiesce coroutines on context switch

2021-01-21 Thread Sergio Lopez
This series allows the NBD server to properly switch between AIO contexts, having quiesced recv_coroutine and send_coroutine before doing the transition. We need this because we send back devices running in IO Thread owned contexts to the main context when stopping the data plane, something that

Re: [PATCH v7 08/11] iotests: add testenv.py

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 19:48, Eric Blake wrote: On 1/16/21 7:44 AM, Vladimir Sementsov-Ogievskiy wrote: Add TestEnv class, which will handle test environment in a new python iotests running framework. Difference with current ./check interface: - -v (verbose) option dropped, as it is unused - -xdiff

[PATCH v3 1/2] block: Avoid processing BDS twice in bdrv_set_aio_context_ignore()

2021-01-21 Thread Sergio Lopez
Some graphs may contain an indirect reference to the first BDS in the chain that can be reached while walking it bottom->up from one its children. Doubling-processing of a BDS is especially problematic for the aio_notifiers, as they might attempt to work on both the old and the new AIO contexts.

Re: [PATCH v7 09/11] iotests: add testrunner.py

2021-01-21 Thread Eric Blake
On 1/16/21 7:44 AM, Vladimir Sementsov-Ogievskiy wrote: > Add TestRunner class, which will run tests in a new python iotests > running framework. > > There are some differences with current ./check behavior, most > significant are: > - Consider all tests self-executable, just run them, don't run

Re: [PATCH v7 07/11] iotests: add findtests.py

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 19:21, Eric Blake wrote: On 1/16/21 7:44 AM, Vladimir Sementsov-Ogievskiy wrote: Add python script with new logic of searching for tests: The file findtests.py is self-executable and may be used for debugging purposes. Signed-off-by: Vladimir Sementsov-Ogievskiy --- diff

Re: [PATCH v7 08/11] iotests: add testenv.py

2021-01-21 Thread Eric Blake
On 1/16/21 7:44 AM, Vladimir Sementsov-Ogievskiy wrote: > Add TestEnv class, which will handle test environment in a new python > iotests running framework. > > Difference with current ./check interface: > - -v (verbose) option dropped, as it is unused > > - -xdiff option is dropped, until

Re: [PATCH v7 07/11] iotests: add findtests.py

2021-01-21 Thread Eric Blake
On 1/16/21 7:44 AM, Vladimir Sementsov-Ogievskiy wrote: > Add python script with new logic of searching for tests: > > Current ./check behavior: > - tests are named [0-9][0-9][0-9] > - tests must be registered in group file (even if test doesn't belong >to any group, like 142) > > Behavior

Re: [PATCH v7 07/11] iotests: add findtests.py

2021-01-21 Thread Eric Blake
On 1/16/21 7:44 AM, Vladimir Sementsov-Ogievskiy wrote: > Add python script with new logic of searching for tests: > > The file findtests.py is self-executable and may be used for debugging > purposes. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- > diff --git

Re: [PATCH v7 00/11] Rework iotests/check

2021-01-21 Thread Paolo Bonzini
On 16/01/21 14:44, Vladimir Sementsov-Ogievskiy wrote: Hi all! These series has 3 goals: - get rid of group file (to forget about rebase and in-list conflicts) - introduce human-readable names for tests - rewrite check into python Very nice! I have wondered for some time if we should

Re: [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands

2021-01-21 Thread Francisco Iglesias
Hi Bin, On [2021 Jan 21] Thu 16:59:51, Bin Meng wrote: > Hi Francisco, > > On Thu, Jan 21, 2021 at 4:50 PM Francisco Iglesias > wrote: > > > > Dear Bin, > > > > On [2021 Jan 20] Wed 22:20:25, Bin Meng wrote: > > > Hi Francisco, > > > > > > On Tue, Jan 19, 2021 at 9:01 PM Francisco Iglesias > >

Re: [PATCH v2 3/3] hw/usb/dev-uas: Report command additional adb length as unsupported

2021-01-21 Thread Philippe Mathieu-Daudé
On 1/21/21 12:14 PM, Gerd Hoffmann wrote: > On Wed, Jan 20, 2021 at 04:35:22PM +0100, Philippe Mathieu-Daudé wrote: >> We are not ready to handle additional CDB data. >> >> If a guest sends a packet with such additional data, >> report the command parameter as not supported. >> >> Specify a size

Re: [PATCH v2 3/3] hw/usb/dev-uas: Report command additional adb length as unsupported

2021-01-21 Thread Gerd Hoffmann
On Wed, Jan 20, 2021 at 04:35:22PM +0100, Philippe Mathieu-Daudé wrote: > We are not ready to handle additional CDB data. > > If a guest sends a packet with such additional data, > report the command parameter as not supported. > > Specify a size (of 1 byte) for the add_cdb member we > are not

Re: [RFC PATCH 0/2] Allow changing bs->file on reopen

2021-01-21 Thread Kevin Wolf
Am 18.01.2021 um 11:22 hat Vladimir Sementsov-Ogievskiy geschrieben: > 15.01.2021 16:02, Alberto Garcia wrote: > > Hi, > > > > during the past months we talked about making x-blockdev-reopen stable > > API, and one of the missing things was having support for changing > > bs->file. See here for

Re: [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands

2021-01-21 Thread Francisco Iglesias
Dear Bin, On [2021 Jan 21] Thu 16:59:51, Bin Meng wrote: > Hi Francisco, > > On Thu, Jan 21, 2021 at 4:50 PM Francisco Iglesias > wrote: > > > > Dear Bin, > > > > On [2021 Jan 20] Wed 22:20:25, Bin Meng wrote: > > > Hi Francisco, > > > > > > On Tue, Jan 19, 2021 at 9:01 PM Francisco Iglesias >

[RFC PATCH v2 6/8] meson: Display block layer information altogether

2021-01-21 Thread Philippe Mathieu-Daudé
Display block layer information altogether, when it is relevant. Signed-off-by: Philippe Mathieu-Daudé --- Cc: qemu-block@nongnu.org Should coroutine be displayed generically (here, in Misc?) or restricted to have_block? There is probably more features I missed... --- meson.build | 45

Re: [RFC PATCH V3 8/8] hw/block/nvme: Add Identify Active Namespace ID List

2021-01-21 Thread Niklas Cassel
On Thu, Jan 21, 2021 at 06:58:19AM +0900, Minwoo Im wrote: > > Hello Minwoo, > > > > By introducing a detached parameter, > > you are also implicitly making the following > > NVMe commands no longer be spec compliant: > > > > NVME_ID_CNS_NS, NVME_ID_CNS_CS_NS, > > NVME_ID_CNS_NS_ACTIVE_LIST,

Re: [PATCH 04/11] job: add .cancel handler for the driver

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 02:17, Eric Blake wrote: On 11/18/20 12:04 PM, Vladimir Sementsov-Ogievskiy wrote: To be used in mirror in the following commit to cancel in-flight io on target to not waste the time. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/qemu/job.h | 5 + job.c

Re: [PULL 10/13] iotests: define group in each iotest

2021-01-21 Thread Vladimir Sementsov-Ogievskiy
21.01.2021 05:36, Eric Blake wrote: From: Vladimir Sementsov-Ogievskiy We are going to drop group file. Define group in tests as a preparatory step. The patch is generated by cd tests/qemu-iotests grep '^[0-9]\{3\} ' group | while read line; do file=$(awk '{print $1}' <<<

Re: [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands

2021-01-21 Thread Bin Meng
Hi Francisco, On Thu, Jan 21, 2021 at 4:50 PM Francisco Iglesias wrote: > > Dear Bin, > > On [2021 Jan 20] Wed 22:20:25, Bin Meng wrote: > > Hi Francisco, > > > > On Tue, Jan 19, 2021 at 9:01 PM Francisco Iglesias > > wrote: > > > > > > Hi Bin, > > > > > > On [2021 Jan 18] Mon 20:32:19, Bin

Re: [PATCH 0/9] hw/block: m25p80: Fix the mess of dummy bytes needed for fast read commands

2021-01-21 Thread Francisco Iglesias
Dear Bin, On [2021 Jan 20] Wed 22:20:25, Bin Meng wrote: > Hi Francisco, > > On Tue, Jan 19, 2021 at 9:01 PM Francisco Iglesias > wrote: > > > > Hi Bin, > > > > On [2021 Jan 18] Mon 20:32:19, Bin Meng wrote: > > > Hi Francisco, > > > > > > On Mon, Jan 18, 2021 at 6:06 PM Francisco Iglesias > >