Re: [Qemu-block] [Qemu-devel] [PATCH v12 1/2] block/backup: fix max_transfer handling for copy_range

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
18.09.2019 22:57, John Snow wrote: > > > On 9/17/19 12:07 PM, Vladimir Sementsov-Ogievskiy wrote: >> Of course, QEMU_ALIGN_UP is a typo, it should be QEMU_ALIGN_DOWN, as we >> are trying to find aligned size which satisfy both source and target. >> Also, don't ignore too small max_transfer. In th

Re: [Qemu-block] [RFC] error: auto propagated local_err

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
18.09.2019 21:32, Eric Blake wrote: > On 9/18/19 1:05 PM, Eric Blake wrote: > #define MAKE_ERRP_SAFE() \ g_auto(ErrorPropagationStruct) (__auto_errp_prop) = {.errp = errp}; \ errp = &__auto_errp_prop.local_err > > I tried to see if this could be done with just a single declara

[Qemu-block] COMPARE_AND_WRITE support for rbd driver

2019-09-18 Thread Yaowei Bai
baiyao...@cmss.chinamobile.com Bcc: Subject: COMPARE_AND_WRITE support for rbd driver Reply-To: baiyao...@cmss.chinamobile.com Hey guys, I noticed that COMPARE_AND_WRITE had been supported by CEPH/librbd since v12.1.1. And in my company, we use this COMPARE_AND_WRITE support in CEPH with the IS

Re: [Qemu-block] [Qemu-devel] [RFC] error: auto propagated local_err

2019-09-18 Thread no-reply
Patchew URL: https://patchew.org/QEMU/20190918130244.24257-1-vsement...@virtuozzo.com/ Hi, This series seems to have some coding style problems. See output below for more information: Subject: [Qemu-devel] [RFC] error: auto propagated local_err Message-id: 20190918130244.24257-1-vsement...@vi

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Require Python 3.5 or later

2019-09-18 Thread Eduardo Habkost
On Wed, Sep 18, 2019 at 02:49:25PM -0400, John Snow wrote: > On 9/18/19 4:55 AM, Kevin Wolf wrote: > > Running iotests is not required to build QEMU, so we can have stricter > > version requirements for Python here and can make use of new features > > and drop compatibility code earlier. > > > > T

Re: [Qemu-block] [Qemu-devel] [PATCH 2/4] block/dirty-bitmap: add bs link

2019-09-18 Thread John Snow
On 9/16/19 10:19 AM, Vladimir Sementsov-Ogievskiy wrote: > Add bs field to BdrvDirtyBitmap structure. Drop BlockDriverState > parameter from bitmap APIs where possible. > > Signed-off-by: Vladimir Sementsov-Ogievskiy I've thought about doing this before, but couldn't figure out if it was wort

Re: [Qemu-block] [PATCH 7/8] block: Pass truncate exact=true where reasonable

2019-09-18 Thread Maxim Levitsky
On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote: > This is a change in behavior, so all instances need a good > justification. The comments added here should explain my reasoning. > > qed already had a comment that suggests it always expected > bdrv_truncate()/blk_truncate() to behave as if ex

Re: [Qemu-block] [PATCH 4/8] block: Add @exact parameter to bdrv_co_truncate()

2019-09-18 Thread Maxim Levitsky
On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote: > We have two drivers (iscsi and file-posix) that (in some cases) return > success from their .bdrv_co_truncate() implementation if the block > device is larger than the requested offset, but cannot be shrunk. Some > callers do not want that beha

Re: [Qemu-block] [PATCH 8/8] Revert "qemu-img: Check post-truncation size"

2019-09-18 Thread Maxim Levitsky
On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote: > This reverts commit 5279b30392da7a3248b320c75f20c61e3a95863c. > > We no longer need this check because exact=true forces the block driver > to give the image the exact size requested by the user. Looks very good to me. Reviewed-by: Maxim Levi

Re: [Qemu-block] [PATCH 6/8] block: Let format drivers pass @exact

2019-09-18 Thread Maxim Levitsky
On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote: > When truncating a format node, the @exact parameter is generally handled > simply by virtue of the format storing the new size in the image > metadata. Such formats do not need to pass on the parameter to their > file nodes. > > There are exce

Re: [Qemu-block] [PATCH 3/8] block: Do not truncate file node when formatting

2019-09-18 Thread Maxim Levitsky
On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote: > There is no reason why the format drivers need to truncate the protocol > node when formatting it. When using the old .bdrv_co_create_ops() > interface, the file will be created with no size option anyway, which > generally gives it a size of 0

Re: [Qemu-block] [PATCH 5/8] block: Evaluate @exact in protocol drivers

2019-09-18 Thread Maxim Levitsky
On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote: > We have two protocol drivers that return success when trying to shrink a > block device even though they cannot shrink it. This behavior is now > only allowed with exact=false, so they should return an error with > exact=true. > > Signed-off-b

Re: [Qemu-block] [PATCH 2/8] block/cor: Drop cor_co_truncate()

2019-09-18 Thread Maxim Levitsky
On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote: > No other filter driver has a .bdrv_co_truncate() implementation, and > there is no need to because the general block layer code can handle it > just as well. > > Signed-off-by: Max Reitz > --- > block/copy-on-read.c | 8 > 1 file cha

Re: [Qemu-block] [PATCH 1/8] block: Handle filter truncation like native impl.

2019-09-18 Thread Maxim Levitsky
On Wed, 2019-09-18 at 11:51 +0200, Max Reitz wrote: > Make the filter truncation (passing it through to bs->file) a > first-class citizen and handle it exactly as if it was the filter > driver's native implementation of .bdrv_co_truncate(). > > I do not see a reason not to, it makes the code a bit

Re: [Qemu-block] [Qemu-devel] [PATCH] block/backup: install notifier during creation

2019-09-18 Thread John Snow
On 9/10/19 9:23 AM, John Snow wrote: > > > On 9/10/19 4:19 AM, Stefan Hajnoczi wrote: >> On Wed, Aug 21, 2019 at 04:01:52PM -0400, John Snow wrote: >>> >>> >>> On 8/21/19 10:41 AM, Vladimir Sementsov-Ogievskiy wrote: 09.08.2019 23:13, John Snow wrote: > Backup jobs may yield prior to

Re: [Qemu-block] [Qemu-devel] [PATCH v2 2/2] block/nvme: add support for discard

2019-09-18 Thread John Snow
On 9/13/19 9:36 AM, Maxim Levitsky wrote: > Signed-off-by: Maxim Levitsky Same comments as 1/2; but not worth holding anything up. We'll find out from users if there are problems, but I wish we had a nicer way to test it. Reviewed-by: John Snow > --- > block/nvme.c | 83 +

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] block/nvme: add support for write zeros

2019-09-18 Thread John Snow
On 9/13/19 9:36 AM, Maxim Levitsky wrote: > Signed-off-by: Maxim Levitsky It'd still be nice to have a commit message... > --- Or here, what changed from V1. > block/nvme.c | 72 +++- > block/trace-events | 1 + > include/block/nvme.h | 19

Re: [Qemu-block] [Qemu-devel] [PATCH v12 2/2] block/backup: fix backup_cow_with_offload for last cluster

2019-09-18 Thread John Snow
On 9/17/19 12:07 PM, Vladimir Sementsov-Ogievskiy wrote: We shouldn't try to copy bytes beyond EOF. Fix it. Fixes: 9ded4a0114968e Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/backup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bloc

Re: [Qemu-block] [Qemu-devel] [PATCH v12 1/2] block/backup: fix max_transfer handling for copy_range

2019-09-18 Thread John Snow
On 9/17/19 12:07 PM, Vladimir Sementsov-Ogievskiy wrote: Of course, QEMU_ALIGN_UP is a typo, it should be QEMU_ALIGN_DOWN, as we are trying to find aligned size which satisfy both source and target. Also, don't ignore too small max_transfer. In this case seems safer to disable copy_range. Fix

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Require Python 3.5 or later

2019-09-18 Thread John Snow
On 9/18/19 4:55 AM, Kevin Wolf wrote: Running iotests is not required to build QEMU, so we can have stricter version requirements for Python here and can make use of new features and drop compatibility code earlier. This makes qemu-iotests skip all Python tests if a Python version before 3.5

Re: [Qemu-block] [Qemu-devel] [PATCH 4/4] iotests: Add test for failing mirror complete

2019-09-18 Thread John Snow
On 9/12/19 9:56 AM, Max Reitz wrote: Signed-off-by: Max Reitz --- tests/qemu-iotests/041 | 44 ++ tests/qemu-iotests/041.out | 4 ++-- 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041 i

Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/4] iotests: add script_initialize

2019-09-18 Thread John Snow
On 9/18/19 9:05 AM, Thomas Huth wrote: On 18/09/2019 00.29, John Snow wrote: On 9/16/19 10:56 AM, Vladimir Sementsov-Ogievskiy wrote: [...] Finally do we support something except linux for iotests? for bash tests _supported_os also used only with "Linux" in 87 tests.. The iotests in the

Re: [Qemu-block] [Qemu-devel] [PATCH v4 6/7] iotests: Test driver whitelisting in 136

2019-09-18 Thread John Snow
On 9/17/19 5:20 AM, Max Reitz wrote: null-aio may not be whitelisted. Skip all test cases that require it. Signed-off-by: Max Reitz Reviewed-by: John Snow --- tests/qemu-iotests/136 | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/qemu-iotest

Re: [Qemu-block] [Qemu-devel] [PATCH v4 5/7] iotests: Test driver whitelisting in 093

2019-09-18 Thread John Snow
On 9/17/19 5:20 AM, Max Reitz wrote: null-aio may not be whitelisted. Skip all test cases that require it. (And skip the whole test if null-co is not whitelisted.) Signed-off-by: Max Reitz Sorry for the goose chase on v(n-1). I feel like maybe there's a nicer way to do this, but I can't

Re: [Qemu-block] [RFC] error: auto propagated local_err

2019-09-18 Thread Eric Blake
On 9/18/19 1:05 PM, Eric Blake wrote: >>> #define MAKE_ERRP_SAFE() \ >>> g_auto(ErrorPropagationStruct) (__auto_errp_prop) = {.errp = errp}; \ >>> errp = &__auto_errp_prop.local_err >>> I tried to see if this could be done with just a single declaration line, as in: typedef struct ErrorPropagato

Re: [Qemu-block] [Qemu-devel] [PATCH v4 3/7] iotests: Use case_skip() in skip_if_unsupported()

2019-09-18 Thread John Snow
On 9/17/19 5:20 AM, Max Reitz wrote: skip_if_unsupported() should use the stronger variant case_skip(), because this allows it to be used even with setUp() (in a meaningful way). In the process, make it explicit what we expect the first argument of the func_wrapper to be (namely something der

Re: [Qemu-block] [RFC] error: auto propagated local_err

2019-09-18 Thread Eric Blake
On 9/18/19 12:46 PM, Vladimir Sementsov-Ogievskiy wrote: >>> +/* >>> + * Third variant: >>> + * Pros: >>> + * - simpler movement for functions which don't have local_err yet >>> + * the only thing to do is to call one macro at function start. >>> + * This extremely simplifies Gre

Re: [Qemu-block] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()

2019-09-18 Thread Eric Blake
On 9/18/19 5:26 AM, Cornelia Huck wrote: > On Tue, 17 Sep 2019 18:36:20 +0200 > Greg Kurz wrote: > >> On Tue, 17 Sep 2019 13:24:12 +0200 >> Cornelia Huck wrote: >> >>> On Tue, 17 Sep 2019 12:21:34 +0200 >>> Greg Kurz wrote: >>> Ensure that hints are added even if errp is &error_fatal or

Re: [Qemu-block] [RFC] error: auto propagated local_err

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
18.09.2019 20:10, Eric Blake wrote: > On 9/18/19 8:02 AM, Vladimir Sementsov-Ogievskiy wrote: >> Hi all! >> >> Here is a proposal (three of them, actually) of auto propagation for >> local_err, to not call error_propagate on every exit point, when we >> deal with local_err. >> >> It also may help m

Re: [Qemu-block] [Qemu-devel] [PATCH 3/4] iotests: Add @error to wait_until_completed

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
12.09.2019 16:56, Max Reitz wrote: > Callers can use this new parameter to expect failure during the > completion process. > > Signed-off-by: Max Reitz Reviewed-by: Vladimir Sementsov-Ogievskiy -- Best regards, Vladimir

Re: [Qemu-block] [RFC] error: auto propagated local_err

2019-09-18 Thread Eric Blake
On 9/18/19 8:02 AM, Vladimir Sementsov-Ogievskiy wrote: > Hi all! > > Here is a proposal (three of them, actually) of auto propagation for > local_err, to not call error_propagate on every exit point, when we > deal with local_err. > > It also may help make Greg's series[1] about error_append_hin

[Qemu-block] [Ping] [PATCH v6 0/3] qcow2: add zstd cluster compression

2019-09-18 Thread Denis Plotnikov
On 12.09.2019 11:46, Denis Plotnikov wrote: > ping! > > On 05.09.2019 12:31, Denis Plotnikov wrote: >> v6: >> * fixed zstd compressed length storing/loading [Eric] >> * fixed wording, spec section placement [Eric] >> >> v5: >> * type changed for compression_type at BDRVQcow2State [Kevin] >> * fixed

Re: [Qemu-block] [Qemu-devel] [PATCH v5 5/5] iotests: use python logging for iotests.log()

2019-09-18 Thread John Snow
On 9/18/19 10:52 AM, Vladimir Sementsov-Ogievskiy wrote: > 18.09.2019 2:45, John Snow wrote: >> We can turn logging on/off globally instead of per-function. >> >> Remove use_log from run_job, and use python logging to turn on >> diffable output when we run through a script entry point. >> >> iot

Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/4] iotests: add script_initialize

2019-09-18 Thread John Snow
On 9/18/19 12:44 PM, Vladimir Sementsov-Ogievskiy wrote: > 18.09.2019 13:30, Vladimir Sementsov-Ogievskiy wrote: >> 18.09.2019 1:29, John Snow wrote: >>> >>> >>> On 9/16/19 10:56 AM, Vladimir Sementsov-Ogievskiy wrote: 12.09.2019 3:16, John Snow wrote: > Like script_main, but doesn't re

Re: [Qemu-block] [PATCH v4 5/7] iotests: Test driver whitelisting in 093

2019-09-18 Thread Andrey Shinkevich
On 18/09/2019 09:29, Max Reitz wrote: > On 17.09.19 16:25, Andrey Shinkevich wrote: >> >> >> On 17/09/2019 12:20, Max Reitz wrote: >>> null-aio may not be whitelisted. Skip all test cases that require it. >>> >>> (And skip the whole test if null-co is not whitelisted.) >> This solution has been

Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/4] iotests: add script_initialize

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
18.09.2019 13:30, Vladimir Sementsov-Ogievskiy wrote: > 18.09.2019 1:29, John Snow wrote: >> >> >> On 9/16/19 10:56 AM, Vladimir Sementsov-Ogievskiy wrote: >>> 12.09.2019 3:16, John Snow wrote: Like script_main, but doesn't require a single point of entry. Replace all existing initializat

Re: [Qemu-block] [Qemu-devel] [PATCH 4/4] iotests: Add test for failing mirror complete

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
12.09.2019 16:56, Max Reitz wrote: > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/041 | 44 ++ > tests/qemu-iotests/041.out | 4 ++-- > 2 files changed, 46 insertions(+), 2 deletions(-) > > diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotest

Re: [Qemu-block] [Qemu-devel] [PATCH 2/4] blkdebug: Allow taking/unsharing permissions

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
12.09.2019 16:56, Max Reitz wrote: > Sometimes it is useful to be able to add a node to the block graph that > takes or unshare a certain set of permissions for debugging purposes. > This patch adds this capability to blkdebug. > > (Note that you cannot make blkdebug release or share permissions t

Re: [Qemu-block] [PULL 2/3] trace: Remove trailing newline in events

2019-09-18 Thread Philippe Mathieu-Daudé
On 9/18/19 3:21 PM, Stefan Hajnoczi wrote: > From: Philippe Mathieu-Daudé > > While the tracing framework does not forbid trailing newline in > events format string, using them lead to confuse output. > It is the responsibility of the backend to properly end an event > line. > > Some of our form

Re: [Qemu-block] [Qemu-devel] [PATCH 0/4] mirror: Do not dereference invalid pointers

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
12.09.2019 16:56, Max Reitz wrote: > Hi, > > The fix (patch 1) is pretty straightforward; patch 2 (which I need for > the test) may not be. > > The biggest problem with patch 2 is that you can use it to uncover where > our permission handling is broken. For example, devising the test case > (pat

Re: [Qemu-block] [Qemu-devel] [PATCH 1/4] mirror: Do not dereference invalid pointers

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
12.09.2019 16:56, Max Reitz wrote: > mirror_exit_common() may be called twice (if it is called from > mirror_prepare() and fails, it will be called from mirror_abort() > again). > > In such a case, many of the pointers in the MirrorBlockJob object will > already be freed. This can be seen most re

Re: [Qemu-block] [Qemu-devel] [PATCH v5 5/5] iotests: use python logging for iotests.log()

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
18.09.2019 2:45, John Snow wrote: > We can turn logging on/off globally instead of per-function. > > Remove use_log from run_job, and use python logging to turn on > diffable output when we run through a script entry point. > > iotest 245 changes output order due to buffering reasons. Interestin

Re: [Qemu-block] [Qemu-devel] [PATCH v5 2/5] iotests: add script_initialize

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
18.09.2019 2:45, John Snow wrote: > Like script_main, but doesn't require a single point of entry. > Replace all existing initialization sections with this drop-in replacement. > > This brings debug support to all existing script-style iotests. > > Any specification for supported_oses=['linux'] w

[Qemu-block] [PULL 2/3] trace: Remove trailing newline in events

2019-09-18 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé While the tracing framework does not forbid trailing newline in events format string, using them lead to confuse output. It is the responsibility of the backend to properly end an event line. Some of our formats have trailing newlines, remove them. [Fixed typo in co

Re: [Qemu-block] [Qemu-devel] [PATCH v5 1/5] iotests: remove 'linux' from default supported platforms

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
18.09.2019 2:45, John Snow wrote: > verify_platform will check an explicit whitelist and blacklist instead. > The default will now be assumed to be allowed to run anywhere. > > For tests that do not specify their platforms explicitly, this has the effect > of > enabling these tests on non-linux p

[Qemu-block] [PULL 0/3] Tracing patches

2019-09-18 Thread Stefan Hajnoczi
The following changes since commit f8c3db33a5e863291182f8862ddf81618a7c6194: target/sparc: Switch to do_transaction_failed() hook (2019-09-17 12:01:00 +0100) are available in the Git repository at: https://github.com/stefanha/qemu.git tags/tracing-pull-request for you to fetch changes up t

[Qemu-block] [PULL 1/3] loader: Trace loaded images

2019-09-18 Thread Stefan Hajnoczi
From: Alexey Kardashevskiy This adds a trace point which prints every loaded image. This includes bios/firmware/kernel/initradmdisk/pcirom. Signed-off-by: Alexey Kardashevskiy Reviewed-by: Philippe Mathieu-Daudé Message-Id: <20190613050937.124903-1-...@ozlabs.ru> Signed-off-by: Stefan Hajnoczi

[Qemu-block] [PULL 3/3] trace: Forbid event format ending with newline character

2019-09-18 Thread Stefan Hajnoczi
From: Philippe Mathieu-Daudé Event format ending with newlines confuse the trace reports. Forbid them. Add a check to refuse new format added with trailing newline: $ make [...] GEN hw/misc/trace.h Traceback (most recent call last): File "scripts/tracetool.py", line 152, in

Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/4] iotests: add script_initialize

2019-09-18 Thread Thomas Huth
On 18/09/2019 00.29, John Snow wrote: > > > On 9/16/19 10:56 AM, Vladimir Sementsov-Ogievskiy wrote: [...] >> Finally do we support something except linux for iotests? >> for bash tests _supported_os also used only with "Linux" in 87 tests.. The iotests in the "auto" group are supposed to work o

[Qemu-block] [RFC] error: auto propagated local_err

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
Hi all! Here is a proposal (three of them, actually) of auto propagation for local_err, to not call error_propagate on every exit point, when we deal with local_err. It also may help make Greg's series[1] about error_append_hint smaller. See definitions and examples below. I'm cc-ing to this RF

[Qemu-block] [PATCH] xen-block: treat XenbusStateUnknown the same as XenbusStateClosed

2019-09-18 Thread Paul Durrant
When a frontend gracefully disconnects from an offline backend, it will set its own state to XenbusStateClosed. The code in xen-block.c correctly deals with this and sets the backend into XenbusStateClosed. Unfortunately it is possible for toolstack to actually delete the frontend area before the s

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Require Python 3.5 or later

2019-09-18 Thread Philippe Mathieu-Daudé
On 9/18/19 11:29 AM, Kevin Wolf wrote: > Am 18.09.2019 um 11:20 hat Max Reitz geschrieben: >> On 18.09.19 10:55, Kevin Wolf wrote: >>> Running iotests is not required to build QEMU, so we can have stricter >>> version requirements for Python here and can make use of new features >>> and drop compat

Re: [Qemu-block] [Qemu-devel] [PATCH v4 1/4] iotests: add script_initialize

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
18.09.2019 1:29, John Snow wrote: > > > On 9/16/19 10:56 AM, Vladimir Sementsov-Ogievskiy wrote: >> 12.09.2019 3:16, John Snow wrote: >>> Like script_main, but doesn't require a single point of entry. >>> Replace all existing initialization sections with this drop-in replacement. >>> >>> This bri

Re: [Qemu-block] [PATCH 10/17] s390x/css: Pass local error object pointer to error_append_hint()

2019-09-18 Thread Cornelia Huck
On Tue, 17 Sep 2019 18:36:20 +0200 Greg Kurz wrote: > On Tue, 17 Sep 2019 13:24:12 +0200 > Cornelia Huck wrote: > > > On Tue, 17 Sep 2019 12:21:34 +0200 > > Greg Kurz wrote: > > > > > Ensure that hints are added even if errp is &error_fatal or &error_abort. > > > > > > Signed-off-by: Greg

Re: [Qemu-block] [Qemu-devel] [PATCH 02/17] block: Pass local error object pointer to error_append_hint()

2019-09-18 Thread Vladimir Sementsov-Ogievskiy
18.09.2019 10:58, Greg Kurz wrote: > On Tue, 17 Sep 2019 17:40:11 + > Vladimir Sementsov-Ogievskiy wrote: > >> 17.09.2019 18:37, Greg Kurz wrote: >>> On Tue, 17 Sep 2019 13:25:03 + >>> Vladimir Sementsov-Ogievskiy wrote: >>> 17.09.2019 13:20, Greg Kurz wrote: > Ensure that hints

[Qemu-block] [PATCH 7/8] block: Pass truncate exact=true where reasonable

2019-09-18 Thread Max Reitz
This is a change in behavior, so all instances need a good justification. The comments added here should explain my reasoning. qed already had a comment that suggests it always expected bdrv_truncate()/blk_truncate() to behave as if exact=true were passed (c743849bee7 came eight months before 55b

[Qemu-block] [PATCH 5/8] block: Evaluate @exact in protocol drivers

2019-09-18 Thread Max Reitz
We have two protocol drivers that return success when trying to shrink a block device even though they cannot shrink it. This behavior is now only allowed with exact=false, so they should return an error with exact=true. Signed-off-by: Max Reitz --- block/file-posix.c | 8 +++- block/iscsi.

[Qemu-block] [PATCH 8/8] Revert "qemu-img: Check post-truncation size"

2019-09-18 Thread Max Reitz
This reverts commit 5279b30392da7a3248b320c75f20c61e3a95863c. We no longer need this check because exact=true forces the block driver to give the image the exact size requested by the user. Signed-off-by: Max Reitz --- qemu-img.c | 39 --- 1 file changed, 4 i

[Qemu-block] [PATCH 4/8] block: Add @exact parameter to bdrv_co_truncate()

2019-09-18 Thread Max Reitz
We have two drivers (iscsi and file-posix) that (in some cases) return success from their .bdrv_co_truncate() implementation if the block device is larger than the requested offset, but cannot be shrunk. Some callers do not want that behavior, so this patch adds a new parameter that they can use t

[Qemu-block] [PATCH 3/8] block: Do not truncate file node when formatting

2019-09-18 Thread Max Reitz
There is no reason why the format drivers need to truncate the protocol node when formatting it. When using the old .bdrv_co_create_ops() interface, the file will be created with no size option anyway, which generally gives it a size of 0. (Exceptions are block devices, which cannot be truncated

[Qemu-block] [PATCH 6/8] block: Let format drivers pass @exact

2019-09-18 Thread Max Reitz
When truncating a format node, the @exact parameter is generally handled simply by virtue of the format storing the new size in the image metadata. Such formats do not need to pass on the parameter to their file nodes. There are exceptions, though: - raw and crypto cannot store the image size, an

[Qemu-block] [PATCH 2/8] block/cor: Drop cor_co_truncate()

2019-09-18 Thread Max Reitz
No other filter driver has a .bdrv_co_truncate() implementation, and there is no need to because the general block layer code can handle it just as well. Signed-off-by: Max Reitz --- block/copy-on-read.c | 8 1 file changed, 8 deletions(-) diff --git a/block/copy-on-read.c b/block/copy

[Qemu-block] [PATCH 1/8] block: Handle filter truncation like native impl.

2019-09-18 Thread Max Reitz
Make the filter truncation (passing it through to bs->file) a first-class citizen and handle it exactly as if it was the filter driver's native implementation of .bdrv_co_truncate(). I do not see a reason not to, it makes the code a bit shorter, and may be even more correct because this gets us to

[Qemu-block] [PATCH 0/8] block: Add @exact parameter to bdrv_co_truncate()

2019-09-18 Thread Max Reitz
Hi, This series is supposed to pull out some of the problems from my “Generic file creation fallback” series. The blk_truncate_for_formatting() function added there was buggy, as Maxim noted, in that it did not check whether blk_truncate() actually resized the block node to the target offset. On

Re: [Qemu-block] [PATCH] iotests: Require Python 3.5 or later

2019-09-18 Thread Kevin Wolf
Am 18.09.2019 um 11:20 hat Max Reitz geschrieben: > On 18.09.19 10:55, Kevin Wolf wrote: > > Running iotests is not required to build QEMU, so we can have stricter > > version requirements for Python here and can make use of new features > > and drop compatibility code earlier. > > > > This makes

Re: [Qemu-block] [PATCH v2 0/2] trace: Forbid trailing newline in event format

2019-09-18 Thread Stefan Hajnoczi
On Mon, Sep 16, 2019 at 11:51:19AM +0200, Philippe Mathieu-Daudé wrote: > Hi Stefan, > > I'v been confused by trailing newline in trace reports, > so this series aims to fix this, by cleaning current > formats and add a check to catch new one introduced. > > v2: > - Use regex format (easier to re

Re: [Qemu-block] [Qemu-devel] [PATCH v2 1/2] trace: Remove trailing newline in events

2019-09-18 Thread Stefan Hajnoczi
On Mon, Sep 16, 2019 at 12:41:44PM -0400, John Snow wrote: > On 9/16/19 12:40 PM, Philippe Mathieu-Daudé wrote: > > On 9/16/19 6:36 PM, Eric Blake wrote: > >> On 9/16/19 4:51 AM, Philippe Mathieu-Daudé wrote: > >>> While the tracing frawework does not forbid trailing newline in > >> > >> framework

Re: [Qemu-block] [PATCH] iotests: Require Python 3.5 or later

2019-09-18 Thread Max Reitz
On 18.09.19 10:55, Kevin Wolf wrote: > Running iotests is not required to build QEMU, so we can have stricter > version requirements for Python here and can make use of new features > and drop compatibility code earlier. > > This makes qemu-iotests skip all Python tests if a Python version before

Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Require Python 3.5 or later

2019-09-18 Thread Thomas Huth
On 18/09/2019 10.55, Kevin Wolf wrote: > Running iotests is not required to build QEMU, so we can have stricter > version requirements for Python here and can make use of new features > and drop compatibility code earlier. > > This makes qemu-iotests skip all Python tests if a Python version befor

[Qemu-block] [PATCH] iotests: Require Python 3.5 or later

2019-09-18 Thread Kevin Wolf
Running iotests is not required to build QEMU, so we can have stricter version requirements for Python here and can make use of new features and drop compatibility code earlier. This makes qemu-iotests skip all Python tests if a Python version before 3.5 is used for the build. Suggested-by: Eduar

Re: [Qemu-block] [Qemu-devel] [PATCH 02/17] block: Pass local error object pointer to error_append_hint()

2019-09-18 Thread Greg Kurz
On Tue, 17 Sep 2019 17:40:11 + Vladimir Sementsov-Ogievskiy wrote: > 17.09.2019 18:37, Greg Kurz wrote: > > On Tue, 17 Sep 2019 13:25:03 + > > Vladimir Sementsov-Ogievskiy wrote: > > > >> 17.09.2019 13:20, Greg Kurz wrote: > >>> Ensure that hints are added even if errp is &error_fatal o

Re: [Qemu-block] [PATCH 02/17] block: Pass local error object pointer to error_append_hint()

2019-09-18 Thread Kevin Wolf
Am 17.09.2019 um 21:10 hat John Snow geschrieben: > > > On 9/17/19 10:46 AM, Kevin Wolf wrote: > > Am 17.09.2019 um 16:39 hat Eric Blake geschrieben: > >> On 9/17/19 5:20 AM, Greg Kurz wrote: > >>> Ensure that hints are added even if errp is &error_fatal or &error_abort. > >>> > >>> Signed-off-by