Re: [PATCH v5 00/26] nvme: support NVMe v1.3d, SGLs and multiple namespaces

2020-02-05 Thread Klaus Birkelund Jensen
On Feb 5 01:47, Keith Busch wrote: > On Tue, Feb 04, 2020 at 10:51:42AM +0100, Klaus Jensen wrote: > > Hi, > > > > > > Changes since v4 > > - Changed vendor and device id to use a Red Hat allocated one. For > >backwards compatibility add the 'x-use-intel-id' nvme device > >parameter.

Re: [PATCH v5 24/26] nvme: change controller pci id

2020-02-05 Thread Klaus Birkelund Jensen
On Feb 5 01:35, Keith Busch wrote: > On Tue, Feb 04, 2020 at 10:52:06AM +0100, Klaus Jensen wrote: > > 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

Re: [PATCH v5 22/26] nvme: support multiple namespaces

2020-02-05 Thread Klaus Birkelund Jensen
On Feb 5 01:31, Keith Busch wrote: > On Tue, Feb 04, 2020 at 10:52:04AM +0100, Klaus Jensen wrote: > > 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

Re: [PATCH v5 26/26] nvme: make lba data size configurable

2020-02-05 Thread Klaus Birkelund Jensen
On Feb 5 01:43, Keith Busch wrote: > On Tue, Feb 04, 2020 at 10:52:08AM +0100, Klaus Jensen wrote: > > Signed-off-by: Klaus Jensen > > --- > > hw/block/nvme-ns.c | 2 +- > > hw/block/nvme-ns.h | 4 +++- > > hw/block/nvme.c| 1 + > > 3 files changed, 5 insertions(+), 2 deletions(-) > > > >

Re: [PATCH] qemu-img: Place the '-i aio' option in alphabetical order

2020-02-05 Thread Stefan Hajnoczi
On Wed, Feb 05, 2020 at 05:30:08PM +0100, Julia Suvorova wrote: > The '-i AIO' option was accidentally placed after '-n' and '-t'. Move it > after '--flush-interval'. > > Signed-off-by: Julia Suvorova > --- > docs/interop/qemu-img.rst | 8 > qemu-img-cmds.hx | 4 ++-- > 2

Re: [PATCH v4 1/1] qemu-img: Add --target-is-zero to convert

2020-02-05 Thread Eric Blake
On 2/5/20 5:02 AM, David Edmondson wrote: In many cases the target of a convert operation is a newly provisioned target that the user knows is blank (reads as zero). In this situation there is no requirement for qemu-img to wastefully zero out the entire device. Add a new option,

Re: [PATCH v2 26/33] block: Use child_of_bds in remaining places

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Replace child_file by child_of_bds in all remaining places (excluding tests). Signed-off-by: Max Reitz --- +++ b/block/raw-format.c @@ -444,6 +444,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags, BDRVRawState *s =

Re: [PATCH v3 00/13] RFC: [for 5.0]: HMP monitor handlers cleanups

2020-02-05 Thread John Snow
On 1/28/20 11:47 AM, Dr. David Alan Gilbert wrote: > * John Snow (js...@redhat.com) wrote: >> >> >> On 1/27/20 3:43 PM, Peter Krempa wrote: >>> On Mon, Jan 27, 2020 at 14:39:02 -0500, John Snow wrote: On 1/27/20 5:36 AM, Maxim Levitsky wrote: > This patch series is bunch of

Re: [PATCH v2 25/33] block: Make filter drivers use child_of_bds

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Note that some filters have secondary children, namely blkverify (the image to be verified) and blklogwrites (the log). This patch does not touch those children. I would have guessed blkdebug; but I guess that's not quite a filter for other reasons, so it

Re: [PATCH v2 24/33] block: Make format drivers use child_of_bds

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Commonly, they need to pass the BDRV_CHILD_IMAGE set as the BdrvChildRole; but there are exceptions for drivers with external data files (qcow2 and vmdk). Signed-off-by: Max Reitz --- Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer

Re: [PATCH v2 23/33] block: Drop child_backing

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Signed-off-by: Max Reitz --- block.c | 62 +++ include/block/block_int.h | 1 - 2 files changed, 4 insertions(+), 59 deletions(-) More code deletion. diff --git a/block.c b/block.c index

Re: [PATCH v2 22/33] block: Make backing files child_of_bds children

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Signed-off-by: Max Reitz Another sparse commit message (a recurring theme of this series). The subject line says 'what', and the patch appears to be faithful to that, but if a future bisection lands here, even a one-sentence 'why' would be handy; maybe:

Re: [PATCH v2 2/2] qemu-nbd: Removed deprecated --partition option

2020-02-05 Thread Ján Tomko
On Thu, Jan 23, 2020 at 10:46:50AM -0600, Eric Blake wrote: The option was deprecated in 4.0.0 (commit 0ae2d546); it's now been long enough with no complaints to follow through with that process. Signed-off-by: Eric Blake --- docs/interop/qemu-nbd.rst | 15 ++--- qemu-deprecated.texi |

Re: [PATCH v2 21/33] block: Drop child_format

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Signed-off-by: Max Reitz --- Sparse message, but the diffstat makes it obvious that it is ripping out now-unused code, so there's not much more to say. block.c | 29 - include/block/block_int.h | 1 -

Re: [PATCH v2 20/33] block: Switch child_format users to child_of_bds

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Both users (quorum and blkverify) use child_format for not-really-filtered children, so the appropriate BdrvChildRole in both cases is DATA. (Note that this will cause bdrv_inherited_options() to force-allow format probing.) Signed-off-by: Max Reitz ---

Re: [PATCH v2 19/33] raw-format: Split raw_read_options()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Split raw_read_options() into one function that actually just reads the options, and another that applies them. This will allow us to detect whether the user has specified any options before attaching the file child (so we can decide on its role based on the

Re: [PATCH v2 18/33] block: Add bdrv_default_perms()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: This callback can be used by BDSs that use child_of_bds with the appropriate BdrvChildRole for their children. Also, make bdrv_format_default_perms() use it for child_of_bds children (just a temporary solution until we can drop bdrv_format_default_perms()

Re: [PATCH v2 17/33] block: Split bdrv_default_perms_for_storage()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: We can be less restrictive about pure data children than those with metadata on them. For bdrv_format_default_perms(), we keep the safe option of bdrv_default_perms_for_metadata() (until we drop bdrv_format_default_perms() altogether). That means that

Re: [PATCH v2 16/33] block: Pull out bdrv_default_perms_for_storage()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Signed-off-by: Max Reitz --- Commit message is short. block.c | 71 + 1 file changed, 46 insertions(+), 25 deletions(-) Reviewed-by: Eric Blake -- Eric Blake, Principal Software Engineer Red

Re: [PATCH v2 15/33] block: Pull out bdrv_default_perms_for_backing()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Signed-off-by: Max Reitz Rather light on the commit message. But looks like straightforward refactoring (with the previous patch making it easier to follow). --- block.c | 62 + 1 file changed,

Re: [PATCH v2 14/33] block: Distinguish paths in *_format_default_perms

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: bdrv_format_default_perms() has one code path for backing files, and one for storage files. We want to pull them out into own functions, so make sure they are completely distinct before so the next patches will be a bit cleaner. Signed-off-by: Max Reitz

Re: [PATCH v2 13/33] block: Add child_of_bds

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Any current user of child_file, child_format, and child_backing can and should use this generic BdrvChildClass instead, as it can handle all of these cases. However, to be able to do so, the users must pass the appropriate BdrvChildRole when the child is

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Eric Blake
On 2/5/20 11:04 AM, Max Reitz wrote: OK, I expected users to come in a separate patch. I can refactor that better in v2. That's the use case: when copying into a destination file, it's useful to know if the destination already reads as all zeroes, before attempting a fallback to

Re: [PATCH 09/17] block: Refactor bdrv_has_zero_init{,_truncate}

2020-02-05 Thread Eric Blake
On 2/5/20 11:22 AM, Max Reitz wrote: And thus callers which just want the trivially obtainable BDRV_ZERO_TRUNCATE info have to wait for the BDRV_ZERO_OPEN inquiry, even though they don’t care about that flag. True, but only to a minor extent; and the documentation mentions that the

Re: [PATCH 1/3] m25p80: Convert to support tracing

2020-02-05 Thread Guenter Roeck
On Wed, Feb 05, 2020 at 06:10:44PM +0100, Cédric Le Goater wrote: > On 2/5/20 5:35 PM, Guenter Roeck wrote: > > On Wed, Feb 05, 2020 at 11:05:04AM +0100, Cédric Le Goater wrote: > >> On 2/3/20 7:09 PM, Guenter Roeck wrote: > >>> While at it, add some trace messages to help debug problems > >>>

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Max Reitz
On 05.02.20 16:14, Vladimir Sementsov-Ogievskiy wrote: > 05.02.2020 17:47, Vladimir Sementsov-Ogievskiy wrote: >> 05.02.2020 17:26, Eric Blake wrote: >>> On 2/5/20 3:25 AM, Vladimir Sementsov-Ogievskiy wrote: >>> > 3. For qcow2 > Hmm. Here, as I understand, than main case is freshly

Re: [PATCH 09/17] block: Refactor bdrv_has_zero_init{,_truncate}

2020-02-05 Thread Max Reitz
On 05.02.20 15:07, Eric Blake wrote: > On 2/5/20 1:51 AM, Vladimir Sementsov-Ogievskiy wrote: > > +typedef enum { > +    /* > + * bdrv_known_zeroes() should include this bit if the contents of > + * a freshly-created image with no backing file reads as all > + *

Re: [PATCH 2/3] m25p80: Improve command handling for Jedec and unsupported commands

2020-02-05 Thread Guenter Roeck
On Wed, Feb 05, 2020 at 11:08:07AM +0100, Cédric Le Goater wrote: > On 2/4/20 3:28 PM, Guenter Roeck wrote: > > On 2/4/20 12:53 AM, Cédric Le Goater wrote: > >> On 2/3/20 7:09 PM, Guenter Roeck wrote: > >>> Always report 6 bytes of JEDEC data. Fill remaining data with 0. > >>> > >>> For

Re: [PATCH v2 11/33] block: Unify bdrv_child_cb_attach()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Make bdrv_child_cb_attach() call bdrv_backing_attach() for children with a COW role (and drop the reverse call from bdrv_backing_attach()), so it can be used for any child (with a proper role set). Because so far no child has a proper role set, we need a

Re: [PATCH v2 12/33] block: Unify bdrv_child_cb_detach()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Make bdrv_child_cb_detach() call bdrv_backing_detach() for children with a COW role (and drop the reverse call from bdrv_backing_detach()), so it can be used for any child (with a proper role set). Because so far no child has a proper role set, we need a

Re: [PATCH 09/17] block: Refactor bdrv_has_zero_init{,_truncate}

2020-02-05 Thread Max Reitz
On 04.02.20 20:03, Eric Blake wrote: > On 2/4/20 11:53 AM, Max Reitz wrote: >> On 31.01.20 18:44, Eric Blake wrote: >>> Having two slightly-different function names for related purposes is >>> unwieldy, especially since I envision adding yet another notion of >>> zero support in an upcoming patch. 

Re: [PATCH 10/17] block: Add new BDRV_ZERO_OPEN flag

2020-02-05 Thread Max Reitz
On 04.02.20 18:50, Eric Blake wrote: > On 2/4/20 11:34 AM, Max Reitz wrote: > >>> +++ b/include/block/block.h >>> @@ -105,6 +105,16 @@ typedef enum { >>>    * for drivers that set .bdrv_co_truncate. >>>    */ >>>   BDRV_ZERO_TRUNCATE  = 0x2, >>> + >>> +    /* >>> + *

Re: [PATCH 1/3] m25p80: Convert to support tracing

2020-02-05 Thread Cédric Le Goater
On 2/5/20 5:35 PM, Guenter Roeck wrote: > On Wed, Feb 05, 2020 at 11:05:04AM +0100, Cédric Le Goater wrote: >> On 2/3/20 7:09 PM, Guenter Roeck wrote: >>> While at it, add some trace messages to help debug problems >>> seen when running the latest Linux kernel. >> >> In case you resend, It would

Re: [PATCH v2 10/33] block: Use bdrv_inherited_options()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Let child_file's, child_format's, and child_backing's .inherit_options() implementations fall back to bdrv_inherited_options() to show that it would really work for all of these cases, if only the parents passed the appropriate BdrvChildRole and

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Max Reitz
On 04.02.20 19:53, Eric Blake wrote: > On 2/4/20 11:32 AM, Max Reitz wrote: >> On 31.01.20 18:44, Eric Blake wrote: >>> Based-on: <20200124103458.1525982-2-david.edmond...@oracle.com> >>> ([PATCH v2 1/2] qemu-img: Add --target-is-zero to convert) >>> >>> I'm working on adding an NBD extension that

Re: [PATCH v2 09/33] block: Add generic bdrv_inherited_options()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: After the series this patch belongs to, we want to have a common BdrvChildClass that encompasses all of child_file, child_format, and child_backing. Such a single class needs a single .inherit_options() implementation, and this patch introduces it. The next

[PATCH 1/2] nbd/proto: introduce structured request

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
Idea: reuse structured replies as requests too. For this: Rename structured reply "structure" to structured message. And, correspondingly structured reply chunk to structured message chunk. Keep name "structured reply" for structured messages sent by server, and name "structured request" a

[PATCH 2/2] nbd/proto: add NBD_CMD_WRITE_ZEROES64

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
Add new structured request type to represent 64bit version of NBD_CMD_WRITE_ZEROES. Signed-off-by: Vladimir Sementsov-Ogievskiy --- doc/proto.md | 26 ++ 1 file changed, 26 insertions(+) diff --git a/doc/proto.md b/doc/proto.md index cb0ac56..378a800 100644 ---

Re: [PATCH 09/17] block: Refactor bdrv_has_zero_init{,_truncate}

2020-02-05 Thread Max Reitz
On 04.02.20 18:51, Eric Blake wrote: > On 2/4/20 11:42 AM, Max Reitz wrote: > >>> >>> I understand that this is preexisting logic, but could I ask: why? >>> What's wrong >>> if driver can guarantee that created file is all-zero, but is not sure >>> about >>> file resizing? I agree that it's

[PATCH 0/2] Structured requests and 64bit commands

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
Hi all. This is a continuation of thread "NBD extended (or structured?) request" Here is a very drafty draft of the feature, to discuss the general design. Vladimir Sementsov-Ogievskiy (2): nbd/proto: introduce structured request nbd/proto: add NBD_CMD_WRITE_ZEROES64 doc/proto.md | 130

Re: [PATCH v2 08/33] block: Rename bdrv_inherited_options()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: The other two .inherit_options implementations specify exactly for what case they are used in their name, so do it for this one as well. (The actual intention behind this patch is to follow it up with a generic bdrv_inherited_options() that works for all

Re: [PATCH 1/3] m25p80: Convert to support tracing

2020-02-05 Thread Guenter Roeck
On Wed, Feb 05, 2020 at 11:05:04AM +0100, Cédric Le Goater wrote: > On 2/3/20 7:09 PM, Guenter Roeck wrote: > > While at it, add some trace messages to help debug problems > > seen when running the latest Linux kernel. > > In case you resend, It would be nice to printout a flash id in the tracing

Re: [PATCH v2 07/33] block: Pass parent_is_format to .inherit_options()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: We plan to unify the generic .inherit_options() functions. The resulting common function will need to decide whether to force-enable format probing, force-disable it, or leave it as-is. To make this decision, it will need to know whether the parent node is

Re: [PATCH v2 06/33] block: Pass BdrvChildRole to .inherit_options()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Signed-off-by: Max Reitz Another sparse commit message. --- block.c | 40 +++ block/block-backend.c | 3 ++- block/vvfat.c | 3 ++- include/block/block_int.h | 3 ++- 4 files

Re: [PATCH v2 05/33] block: Pass BdrvChildRole to bdrv_child_perm()

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: Signed-off-by: Max Reitz Sparse commit message - is the intent that this is no semantic change and just adding a parameter? --- block.c | 22 -- block/backup-top.c | 3 ++- block/blkdebug.c

Re: [PATCH for-5.0 v2 10/23] quorum: Implement .bdrv_recurse_can_replace()

2020-02-05 Thread Kevin Wolf
Am 05.02.2020 um 16:55 hat Kevin Wolf geschrieben: > Am 11.11.2019 um 17:02 hat Max Reitz geschrieben: > > Signed-off-by: Max Reitz > > --- > > block/quorum.c | 62 ++ > > 1 file changed, 62 insertions(+) > > > > diff --git a/block/quorum.c

Re: [PATCH for-5.0 v2 11/23] block: Use bdrv_recurse_can_replace()

2020-02-05 Thread Kevin Wolf
Am 11.11.2019 um 17:02 hat Max Reitz geschrieben: > Let check_to_replace_node() use the more specialized > bdrv_recurse_can_replace() instead of > bdrv_recurse_is_first_non_filter(), which is too restrictive. > > Signed-off-by: Max Reitz > --- > block.c | 18 -- > 1 file

Re: [PULL 15/18] qemu-img: adds option to use aio engine for benchmarking

2020-02-05 Thread Julia Suvorova
On Mon, Feb 3, 2020 at 11:56 AM Peter Maydell wrote: > > On Thu, 30 Jan 2020 at 21:32, Stefan Hajnoczi wrote: > > > > From: Aarushi Mehta > > > > Signed-off-by: Aarushi Mehta > > Acked-by: Stefano Garzarella > > Signed-off-by: Stefan Hajnoczi > > Message-id:

Re: [PATCH for-5.0 v2 10/23] quorum: Implement .bdrv_recurse_can_replace()

2020-02-05 Thread Kevin Wolf
Am 11.11.2019 um 17:02 hat Max Reitz geschrieben: > Signed-off-by: Max Reitz > --- > block/quorum.c | 62 ++ > 1 file changed, 62 insertions(+) > > diff --git a/block/quorum.c b/block/quorum.c > index 3a824e77e3..8ee03e9baf 100644 > ---

Re: [PATCH v3 09/21] quorum: Add QuorumChild.to_be_replaced

2020-02-05 Thread Kevin Wolf
Am 30.01.2020 um 22:44 hat Max Reitz geschrieben: > We will need this to verify that Quorum can let one of its children be > replaced without breaking anything else. > > Signed-off-by: Max Reitz > --- > block/quorum.c | 25 + > 1 file changed, 25 insertions(+) > > diff

Re: [PATCH v2 03/33] block: Add BdrvChildRole

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: This enum will supplement BdrvChildClass when it comes to what role (or combination of roles) a child takes for its parent. Because empty enums are not allowed, let us just start with it filled. Signed-off-by: Max Reitz --- include/block/block.h | 27

Re: [PATCH v2 02/33] block: Rename BdrvChildRole to BdrvChildClass

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: This structure nearly only contains parent callbacks for child state changes. It cannot really reflect a child's role, because different roles may overlap (as we will see when real roles are introduced), and because parents can have custom callbacks even

Re: [PATCH v4 01/10] hbitmap: assert that we don't create bitmap larger than INT64_MAX

2020-02-05 Thread Eric Blake
On 2/5/20 5:20 AM, Vladimir Sementsov-Ogievskiy wrote: We have APIs which returns signed int64_t, to be able to return error. s/returns/return/ Therefore we can't handle bitmaps with absolute size larger than (INT64_MAX+1). Still, keep maximum to be INT64_MAX which is a bit safer. Note,

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
05.02.2020 17:47, Vladimir Sementsov-Ogievskiy wrote: 05.02.2020 17:26, Eric Blake wrote: On 2/5/20 3:25 AM, Vladimir Sementsov-Ogievskiy wrote: 3. For qcow2 Hmm. Here, as I understand, than main case is freshly created qcow2, which is fully-unallocated. To understand that it is empty, we

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
05.02.2020 17:43, Vladimir Sementsov-Ogievskiy wrote: 05.02.2020 17:22, Eric Blake wrote: On 2/5/20 3:04 AM, Vladimir Sementsov-Ogievskiy wrote: [repo.or.cz appears to be down as I type this; I'll post a link to a repository later when it comes back up] Now up

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
05.02.2020 17:26, Eric Blake wrote: On 2/5/20 3:25 AM, Vladimir Sementsov-Ogievskiy wrote: 3. For qcow2 Hmm. Here, as I understand, than main case is freshly created qcow2, which is fully-unallocated. To understand that it is empty, we need only to check all L1 entries. And for empty L1 table

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
05.02.2020 17:22, Eric Blake wrote: On 2/5/20 3:04 AM, Vladimir Sementsov-Ogievskiy wrote: [repo.or.cz appears to be down as I type this; I'll post a link to a repository later when it comes back up] Now up https://repo.or.cz/qemu/ericb.git/shortlog/refs/tags/qcow2-all-zero-v1 I have

Re: [PATCH 09/17] block: Refactor bdrv_has_zero_init{,_truncate}

2020-02-05 Thread Eric Blake
On 2/5/20 8:25 AM, Vladimir Sementsov-Ogievskiy wrote: But when you truncate them (with PREALLOC_MODE_OFF, as BlockDriver.bdrv_has_zero_init_truncate()’s comment explains), the new area is always going to be 0, regardless of initial preallocation. ah yes, due to qcow2 zero clusters. Hmm. Do

Re: [PATCH 02/13] qcrypto-luks: implement encryption key management

2020-02-05 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Wed, Feb 05, 2020 at 10:30:11AM +0100, Kevin Wolf wrote: >> Am 05.02.2020 um 09:24 hat Markus Armbruster geschrieben: >> > Daniel, Kevin, any comments or objections to the QAPI schema design >> > sketch developed below? >> > >> > For your convenience, here's the

Re: [PATCH 02/13] qcrypto-luks: implement encryption key management

2020-02-05 Thread Markus Armbruster
Kevin Wolf writes: > Am 05.02.2020 um 11:03 hat Markus Armbruster geschrieben: >> Kevin Wolf writes: >> >> > Am 05.02.2020 um 09:24 hat Markus Armbruster geschrieben: >> >> Daniel, Kevin, any comments or objections to the QAPI schema design >> >> sketch developed below? >> >> >> >> For your

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Eric Blake
On 2/5/20 3:25 AM, Vladimir Sementsov-Ogievskiy wrote: 3. For qcow2 Hmm. Here, as I understand, than main case is freshly created qcow2, which is fully-unallocated. To understand that it is empty, we need only to check all L1 entries. And for empty L1 table it is fast. So we don't need any

Re: [PATCH 09/17] block: Refactor bdrv_has_zero_init{,_truncate}

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
05.02.2020 17:07, Eric Blake wrote: On 2/5/20 1:51 AM, Vladimir Sementsov-Ogievskiy wrote: +typedef enum { +    /* + * bdrv_known_zeroes() should include this bit if the contents of + * a freshly-created image with no backing file reads as all + * zeroes without any additional

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Eric Blake
On 2/5/20 3:04 AM, Vladimir Sementsov-Ogievskiy wrote: [repo.or.cz appears to be down as I type this; I'll post a link to a repository later when it comes back up] Now up https://repo.or.cz/qemu/ericb.git/shortlog/refs/tags/qcow2-all-zero-v1 I have several ideas around it. 1. For

Re: [PATCH] iscsi: Cap block count from GET LBA STATUS (CVE-2020-1711)

2020-02-05 Thread Felipe Franciosi
Hi and sorry for the delay, this got lost in my inbox. > On Jan 28, 2020, at 12:42 PM, Kevin Wolf wrote: > > Am 28.01.2020 um 13:30 hat Philippe Mathieu-Daudé geschrieben: >> Hi guys, >> >> (Cc'ing Jon) >> >> On 1/23/20 5:59 PM, Kevin Wolf wrote: >>> Am 23.01.2020 um 13:44 hat Felipe

Re: [PATCH 09/17] block: Refactor bdrv_has_zero_init{,_truncate}

2020-02-05 Thread Eric Blake
On 2/5/20 1:51 AM, Vladimir Sementsov-Ogievskiy wrote: +typedef enum { +    /* + * bdrv_known_zeroes() should include this bit if the contents of + * a freshly-created image with no backing file reads as all + * zeroes without any additional effort.  If .bdrv_co_truncate is + *

Re: [PATCH v4 0/4] qmp: Optionally run handlers in coroutines

2020-02-05 Thread Kevin Wolf
Am 21.01.2020 um 19:11 hat Kevin Wolf geschrieben: > Some QMP command handlers can block the main loop for a relatively long > time, for example because they perform some I/O. This is quite nasty. > Allowing such handlers to run in a coroutine where they can yield (and > therefore release the BQL)

Re: [PATCH v2 01/33] block: Add BlockDriver.is_format

2020-02-05 Thread Eric Blake
On 2/4/20 11:08 AM, Max Reitz wrote: We want to unify child_format and child_file at some point. One of the important things that set format drivers apart from other drivers is that they do not expect other format nodes under them (except in the backing chain). That means we need something on

Re: [PATCH for-4.2? v3 0/8] block: Fix resize (extending) of short overlays

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
19.12.2019 13:20, Vladimir Sementsov-Ogievskiy wrote: 19.12.2019 13:13, Kevin Wolf wrote: Am 19.12.2019 um 10:24 hat Vladimir Sementsov-Ogievskiy geschrieben: 10.12.2019 20:46, Kevin Wolf wrote: Am 22.11.2019 um 17:05 hat Kevin Wolf geschrieben: See patch 4 for the description of the bug

Re: [PATCH v2 4/7] block/block-copy: refactor interfaces to use bytes instead of end

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
29.01.2020 20:12, Andrey Shinkevich wrote: On 27/11/2019 21:08, Vladimir Sementsov-Ogievskiy wrote: We have a lot of "chunk_end - start" invocations, let's switch to bytes/cur_bytes scheme instead. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 4 +--

Re: [PATCH v4 1/1] qemu-img: Add --target-is-zero to convert

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
05.02.2020 14:02, David Edmondson wrote: In many cases the target of a convert operation is a newly provisioned target that the user knows is blank (reads as zero). In this situation there is no requirement for qemu-img to wastefully zero out the entire device. Add a new option,

[PATCH v4 05/10] block/dirty-bitmap: switch _next_dirty_area and _next_zero to int64_t

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
We are going to introduce bdrv_dirty_bitmap_next_dirty so that same variable may be used to store its return value and to be its parameter, so it would int64_t. Similarly, we are going to refactor hbitmap_next_dirty_area to use hbitmap_next_dirty together with hbitmap_next_zero, therefore we want

[PATCH v4 09/10] nbd/server: use bdrv_dirty_bitmap_next_dirty_area

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
Use bdrv_dirty_bitmap_next_dirty_area for bitmap_to_extents. Since bdrv_dirty_bitmap_next_dirty_area is very accurate in its interface, we'll never exceed requested region with last chunk. So, we don't need dont_fragment, and bitmap_to_extents() interface becomes clean enough to not require any

[PATCH v4 04/10] hbitmap: drop meta bitmaps as they are unused

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/qemu/hbitmap.h | 21 tests/test-hbitmap.c | 115 - util/hbitmap.c | 16 -- 3 files changed, 152 deletions(-) diff --git a/include/qemu/hbitmap.h

[PATCH v4 10/10] block/qcow2-bitmap: use bdrv_dirty_bitmap_next_dirty

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
store_bitmap_data() loop does bdrv_set_dirty_iter() on each iteration, which means that we actually don't need iterator itself and we can use simpler bitmap API. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/qcow2-bitmap.c | 15 +-- 1 file changed, 5

[PATCH v4 08/10] nbd/server: introduce NBDExtentArray

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
Introduce NBDExtentArray class, to handle extents list creation in more controlled way and with fewer OUT parameters in functions. Signed-off-by: Vladimir Sementsov-Ogievskiy --- nbd/server.c | 210 +-- 1 file changed, 118 insertions(+), 92

[PATCH v4 06/10] block/dirty-bitmap: add _next_dirty API

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
We have bdrv_dirty_bitmap_next_zero, let's add corresponding bdrv_dirty_bitmap_next_dirty, which is more comfortable to use than bitmap iterators in some cases. For test modify test_hbitmap_next_zero_check_range to check both next_zero and next_dirty and add some new checks. Signed-off-by:

[PATCH v4 07/10] block/dirty-bitmap: improve _next_dirty_area API

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
Firstly, _next_dirty_area is for scenarios when we may contiguously search for next dirty area inside some limited region, so it is more comfortable to specify "end" which should not be recalculated on each iteration. Secondly, let's add a possibility to limit resulting area size, not limiting

[PATCH v4 00/10] Further bitmaps improvements

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
Hi! The main feature here is improvement of _next_dirty_area API, which I'm going to use then for backup / block-copy. Somehow, I thought that it was merged, but seems I even forgot to send v4. v4: 01-04: add Max's r-b 05: switch test_hbitmap_next_zero_check_range args to int64_t too 06: fix

[PATCH v4 03/10] hbitmap: unpublish hbitmap_iter_skip_words

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
Function is internal and even commented as internal. Drop its definition from .h file. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/qemu/hbitmap.h | 7 --- util/hbitmap.c | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git

[PATCH v4 02/10] hbitmap: move hbitmap_iter_next_word to hbitmap.c

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
The function is definitely internal (it's not used by third party and it has complicated interface). Move it to .c file. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/qemu/hbitmap.h | 30 -- util/hbitmap.c | 29

[PATCH v4 01/10] hbitmap: assert that we don't create bitmap larger than INT64_MAX

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
We have APIs which returns signed int64_t, to be able to return error. Therefore we can't handle bitmaps with absolute size larger than (INT64_MAX+1). Still, keep maximum to be INT64_MAX which is a bit safer. Note, that bitmaps are used to represent disk images, which can't exceed INT64_MAX

Re: [PATCH v1 2/4] virtio: increase virtuqueue size for virtio-scsi and virtio-blk

2020-02-05 Thread Stefan Hajnoczi
On Tue, Feb 04, 2020 at 12:59:04PM +0300, Denis Plotnikov wrote: > > > On 30.01.2020 17:58, Stefan Hajnoczi wrote: > > On Wed, Jan 29, 2020 at 05:07:00PM +0300, Denis Plotnikov wrote: > > > The goal is to reduce the amount of requests issued by a guest on > > > 1M reads/writes. This rises the

[PATCH v4 1/1] qemu-img: Add --target-is-zero to convert

2020-02-05 Thread David Edmondson
In many cases the target of a convert operation is a newly provisioned target that the user knows is blank (reads as zero). In this situation there is no requirement for qemu-img to wastefully zero out the entire device. Add a new option, --target-is-zero, allowing the user to indicate that an

[PATCH v4 0/1] qemu-img: Add --target-is-zero to indicate that a target is blank

2020-02-05 Thread David Edmondson
qemu-img: Add --target-is-zero to indicate that a target is blank v4: - Wording in the doc and error message. v3: - Merge with the rST docs. - No more need to fix @var -> @code. v2: - Remove target_is_zero, preferring to set has_zero_init directly (Mark Kanda). - Disallow --target-is-zero

Re: [PATCH 02/13] qcrypto-luks: implement encryption key management

2020-02-05 Thread Kevin Wolf
Am 05.02.2020 um 11:03 hat Markus Armbruster geschrieben: > Kevin Wolf writes: > > > Am 05.02.2020 um 09:24 hat Markus Armbruster geschrieben: > >> Daniel, Kevin, any comments or objections to the QAPI schema design > >> sketch developed below? > >> > >> For your convenience, here's the result

Re: [PATCH 02/13] qcrypto-luks: implement encryption key management

2020-02-05 Thread Daniel P . Berrangé
On Wed, Feb 05, 2020 at 10:30:11AM +0100, Kevin Wolf wrote: > Am 05.02.2020 um 09:24 hat Markus Armbruster geschrieben: > > Daniel, Kevin, any comments or objections to the QAPI schema design > > sketch developed below? > > > > For your convenience, here's the result again: > > > > { 'enum':

Re: [PATCH 1/3] m25p80: Convert to support tracing

2020-02-05 Thread Cédric Le Goater
On 2/3/20 7:09 PM, Guenter Roeck wrote: > While at it, add some trace messages to help debug problems > seen when running the latest Linux kernel. In case you resend, It would be nice to printout a flash id in the tracing else I have a patch for it on top of yours. It helped me track a squashfs

Re: [PATCH 02/13] qcrypto-luks: implement encryption key management

2020-02-05 Thread Markus Armbruster
Kevin Wolf writes: > Am 05.02.2020 um 09:24 hat Markus Armbruster geschrieben: >> Daniel, Kevin, any comments or objections to the QAPI schema design >> sketch developed below? >> >> For your convenience, here's the result again: >> >> { 'enum': 'LUKSKeyslotState', >> 'data': [

Re: [PATCH 02/13] qcrypto-luks: implement encryption key management

2020-02-05 Thread Kevin Wolf
Am 05.02.2020 um 09:24 hat Markus Armbruster geschrieben: > Daniel, Kevin, any comments or objections to the QAPI schema design > sketch developed below? > > For your convenience, here's the result again: > > { 'enum': 'LUKSKeyslotState', > 'data': [ 'active', 'inactive' ] } > {

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
05.02.2020 12:04, Vladimir Sementsov-Ogievskiy wrote: 31.01.2020 20:44, Eric Blake wrote: Based-on: <20200124103458.1525982-2-david.edmond...@oracle.com> ([PATCH v2 1/2] qemu-img: Add --target-is-zero to convert) I'm working on adding an NBD extension that reports whether an image is already

Re: [PATCH 00/17] Improve qcow2 all-zero detection

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
31.01.2020 20:44, Eric Blake wrote: Based-on: <20200124103458.1525982-2-david.edmond...@oracle.com> ([PATCH v2 1/2] qemu-img: Add --target-is-zero to convert) I'm working on adding an NBD extension that reports whether an image is already all zero when the client first connects. I initially

Re: [PATCH 10/17] block: Add new BDRV_ZERO_OPEN flag

2020-02-05 Thread Vladimir Sementsov-Ogievskiy
04.02.2020 20:50, Eric Blake wrote: On 2/4/20 11:34 AM, Max Reitz wrote: +++ b/include/block/block.h @@ -105,6 +105,16 @@ typedef enum {    * for drivers that set .bdrv_co_truncate.    */   BDRV_ZERO_TRUNCATE  = 0x2, + +    /* + * bdrv_known_zeroes() should include this bit

Re: [PATCH 02/13] qcrypto-luks: implement encryption key management

2020-02-05 Thread Markus Armbruster
Daniel, Kevin, any comments or objections to the QAPI schema design sketch developed below? For your convenience, here's the result again: { 'enum': 'LUKSKeyslotState', 'data': [ 'active', 'inactive' ] } { 'struct': 'LUKSKeyslotActive', 'data': { 'secret': 'str',