Re: [PATCH for 6.1] tests: filter out TLS distinguished name in certificate checks

2021-08-04 Thread Eric Blake
On Wed, Aug 04, 2021 at 07:03:30PM +0100, Daniel P. Berrangé wrote: > The version of GNUTLS in Fedora 34 has changed the order in which encodes > fields when generating new TLS certificates. This in turn changes the > order seen when querying the distinguished name. This ultimately breaks > the

Re: [PATCH 5/9] tests/acceptance: Use image_expand() in test_arm_orangepi_uboot_netbsd9

2021-08-04 Thread Philippe Mathieu-Daudé
Hi Niek, On 6/23/21 8:00 PM, Philippe Mathieu-Daudé wrote: > The NetBSD OrangePi image must be at least 2GiB, not less. > Expand the SD card image to this size before using it. > > Signed-off-by: Philippe Mathieu-Daudé > --- > tests/acceptance/boot_linux_console.py | 9 +++-- > 1 file

[PATCH for 6.1] tests: filter out TLS distinguished name in certificate checks

2021-08-04 Thread Daniel P . Berrangé
The version of GNUTLS in Fedora 34 has changed the order in which encodes fields when generating new TLS certificates. This in turn changes the order seen when querying the distinguished name. This ultimately breaks the expected output in the NBD TLS iotests. We don't need to be comparing the

Re: [PATCH v7 25/33] iotests.py: VM: add own __enter__ method

2021-08-04 Thread John Snow
On Wed, Aug 4, 2021 at 5:39 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > In superclass __enter__ method is defined with return value type hint > 'QEMUMachine'. So, mypy thinks that return value of VM.__enter__ is > QEMUMachine. Let's redefine __enter__ in VM class, to give

Re: [PATCH v2] block/io_uring: resubmit when result is -EAGAIN

2021-08-04 Thread Kevin Wolf
Am 04.08.2021 um 16:50 hat Stefano Garzarella geschrieben: > On Mon, Aug 02, 2021 at 02:40:36PM +0200, Kevin Wolf wrote: > > Am 29.07.2021 um 11:10 hat Fabian Ebner geschrieben: > > > Linux SCSI can throw spurious -EAGAIN in some corner cases in its > > > completion path, which will end up being

Re: [PATCH v7 29/33] iotests.py: hmp_qemu_io: support qdev

2021-08-04 Thread John Snow
On Wed, Aug 4, 2021 at 5:39 AM Vladimir Sementsov-Ogievskiy < vsement...@virtuozzo.com> wrote: > Signed-off-by: Vladimir Sementsov-Ogievskiy > Reviewed-by: Max Reitz > --- > tests/qemu-iotests/iotests.py | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git

Re: [PATCH 0/7] floppy: build as modules.

2021-08-04 Thread Philippe Mathieu-Daudé
+Mark On 8/4/21 4:27 PM, Gerd Hoffmann wrote: > Some code shuffling needed beforehand due to floppy being part of > several platforms. While being at it also make floppy optional > in pc machine type. > floppy: move fdctrl_init_sysbus > floppy: move sun4m_fdctrl_init

Re: [PATCH v2] block/io_uring: resubmit when result is -EAGAIN

2021-08-04 Thread Stefano Garzarella
On Mon, Aug 02, 2021 at 02:40:36PM +0200, Kevin Wolf wrote: Am 29.07.2021 um 11:10 hat Fabian Ebner geschrieben: Linux SCSI can throw spurious -EAGAIN in some corner cases in its completion path, which will end up being the result in the completed io_uring request. Resubmitting such requests

[PATCH 7/7] pc: add floppy=OnOffAuto

2021-08-04 Thread Gerd Hoffmann
Allows to enable/disable the floppy controller. Default depends on MachineClass->no_floppy. It's ON for now, but we can flip the default for 6.2+ machine types. NOTE: This requires -nodefaults or no_floppy=1 to actually have an effect. Otherwise the default floppy drive created by qemu will

[PATCH 6/7] floppy: build as modules.

2021-08-04 Thread Gerd Hoffmann
Add module_obj() annotations, update meson build rules. Signed-off-by: Gerd Hoffmann --- hw/block/fdc-isa.c| 2 ++ hw/block/fdc-sysbus.c | 4 hw/block/fdc.c| 2 ++ hw/block/meson.build | 17 ++--- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git

[PATCH 5/7] floppy: move cmos_get_fd_drive_type

2021-08-04 Thread Gerd Hoffmann
Needed by pc machine init. Move to separate source file so we can keep it in core qemu when building floppy as module. Signed-off-by: Gerd Hoffmann --- hw/block/fdc-isa.c| 25 - hw/block/fdc-module.c | 25 + 2 files changed, 25 insertions(+),

[PATCH 3/7] floppy: move fdctrl_init_sysbus

2021-08-04 Thread Gerd Hoffmann
Needed by mips machine init. Move to separate source file so we can keep it in core qemu when building floppy as module. Signed-off-by: Gerd Hoffmann --- hw/block/fdc-internal.h | 15 +++ hw/block/fdc-module.c | 21 + hw/block/fdc-sysbus.c | 34

[PATCH 4/7] floppy: move sun4m_fdctrl_init

2021-08-04 Thread Gerd Hoffmann
Needed by sparc machine init. Move to separate source file so we can keep it in core qemu when building floppy as module. Signed-off-by: Gerd Hoffmann --- hw/block/fdc-module.c | 16 hw/block/fdc-sysbus.c | 16 2 files changed, 16 insertions(+), 16

[PATCH 1/7] floppy: move isa_fdc_get_drive_type to separate source file.

2021-08-04 Thread Gerd Hoffmann
isa_fdc_get_drive_type() is needed by pc machine types when setting up the cmos. Move to separate source file so we can keep it in core qemu when building floppy as module. Signed-off-by: Gerd Hoffmann --- hw/block/fdc-internal.h | 16 hw/block/fdc-isa.c | 22

[PATCH 2/7] floppy: move isa_fdc_init_drives + fdctrl_init_drives

2021-08-04 Thread Gerd Hoffmann
isa_fdc_init_drives() is called by pc machine setup, and it depends on fdctrl_init_drives(). Move both functions to separate source file so we can keep them in core qemu when building floppy as module. Signed-off-by: Gerd Hoffmann --- hw/block/fdc-isa.c| 5 - hw/block/fdc-module.c |

[PATCH 0/7] floppy: build as modules.

2021-08-04 Thread Gerd Hoffmann
Some code shuffling needed beforehand due to floppy being part of several platforms. While being at it also make floppy optional in pc machine type. Gerd Hoffmann (7): floppy: move isa_fdc_get_drive_type to separate source file. floppy: move isa_fdc_init_drives + fdctrl_init_drives floppy:

Re: [PATCH for-6.1? v2 5/7] job: Add job_cancel_requested()

2021-08-04 Thread Max Reitz
On 04.08.21 12:34, Kevin Wolf wrote: [ Peter, the question for you is at the end. ] Am 04.08.2021 um 10:07 hat Max Reitz geschrieben: On 03.08.21 16:25, Kevin Wolf wrote: Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: Most callers of job_is_cancelled() actually want to know whether the

Re: Failing iotest 206

2021-08-04 Thread Daniel P . Berrangé
On Tue, Aug 03, 2021 at 07:17:47PM +0200, Kevin Wolf wrote: > Am 20.07.2021 um 10:32 hat Daniel P. Berrangé geschrieben: > > On Mon, Jul 19, 2021 at 08:12:58PM -0500, Eric Blake wrote: > > > On Mon, Jul 19, 2021 at 10:06:01AM +0200, Thomas Huth wrote: > > > > Hi, > > > > > > > > iotest 206 fails

[PATCH 11/11] block: introduce fleecing block driver

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Introduce a new driver, that works in pair with copy-before-write to improve fleecing. Without fleecing driver, fleecing scheme may look as follows: [guest] | |root v [copy-before-write] -> [temp.qcow2] <--- [nbd export] | target | |file

[PATCH 08/11] block/reqlist: add reqlist_wait_all()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
To be used in the next commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/reqlist.h | 2 ++ block/reqlist.c | 6 ++ 2 files changed, 8 insertions(+) diff --git a/include/block/reqlist.h b/include/block/reqlist.h index 2de86be300..59d5c24cda 100644 ---

[PATCH 06/11] block: intoduce reqlist

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Split intersecting-requests functionality out of block-copy to be reused in copy-before-write filter. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/reqlist.h | 45 block/block-copy.c | 116 +--- block/reqlist.c |

[PATCH 10/11] block/copy-before-write: add cbw_snapshot_discard()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
To be used soon. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/copy-before-write.h | 1 + block/copy-before-write.c | 11 +++ 2 files changed, 12 insertions(+) diff --git a/block/copy-before-write.h b/block/copy-before-write.h index a7e286620c..5809ffc7d0 100644 ---

[PATCH 09/11] block/copy-before-write: add cbw_snapshot_read_{lock, unlock}()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy via
Add interface which help to do fleecing read. To be used in the next commit. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/copy-before-write.h | 5 ++ block/copy-before-write.c | 103 +- 2 files changed, 106 insertions(+), 2 deletions(-) diff --git

[PATCH 07/11] block/dirty-bitmap: introduce bdrv_dirty_bitmap_status()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Add a convenient function similar with bdrv_block_status() to get status of dirty bitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/dirty-bitmap.h | 2 ++ include/qemu/hbitmap.h | 11 +++ block/dirty-bitmap.c | 6 ++ util/hbitmap.c |

[PATCH 03/11] block/block-copy: block_copy_state_new(): add bitmap parameter

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
This will be used in the following commit to bring "incremental" mode to copy-before-write filter. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 2 +- block/block-copy.c | 16 +--- block/copy-before-write.c | 3 ++- 3 files changed, 16

Re: [PATCH v7 22/33] qapi: publish copy-before-write filter

2021-08-04 Thread Markus Armbruster
Vladimir Sementsov-Ogievskiy writes: > Signed-off-by: Vladimir Sementsov-Ogievskiy > Reviewed-by: Max Reitz > --- > qapi/block-core.json | 25 +++-- > 1 file changed, 23 insertions(+), 2 deletions(-) > > diff --git a/qapi/block-core.json b/qapi/block-core.json > index

[PATCH 04/11] block/copy-before-write: add bitmap open parameter

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
This brings "incremental" mode to copy-before-write filter: user can specify bitmap so that filter will copy only "dirty" areas. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qapi/block-core.json | 10 +- block/copy-before-write.c | 28 +++- 2 files

[PATCH RFC DRAFT 00/11] Make image fleecing more usable

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Hi all! That's an untested draft. I'll be on vocation 05-22, so no reason for this just lay in my hard drive. Any comments are welcome (mostly about general design), but don't waste time on careful reviewing. What this series brings to image-fleecing: 1. support for bitmap (patch 04). So, we

[PATCH 05/11] block/block-copy: add block_copy_reset()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Split block_copy_reset() out of block_copy_reset_unallocated() to be used in separate later. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 1 + block/block-copy.c | 21 + 2 files changed, 14 insertions(+), 8 deletions(-) diff --git

[PATCH 02/11] block/dirty-bitmap: bdrv_merge_dirty_bitmap(): add return value

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
That simplifies handling failure in existing code and in further new usage of bdrv_merge_dirty_bitmap(). Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/dirty-bitmap.h| 2 +- block/dirty-bitmap.c| 8 ++-- block/monitor/bitmap-qmp-cmds.c | 5 + 3 files

[PATCH 01/11] block/block-copy: move copy_bitmap initialization to block_copy_state_new()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to complicate bitmap initialization in the following commit. And in future, backup job will be able to work without filter (when source is immutable), so we'll need same bitmap initialization in copy-before-write filter and in backup job. So, it's reasonable to do it in block-copy.

Re: [PULL 0/2] SD/MMC patches for 2021-08-03

2021-08-04 Thread Peter Maydell
On Tue, 3 Aug 2021 at 18:42, Philippe Mathieu-Daudé wrote: > > The following changes since commit acf8200722251a0a995cfa75fe5c15aea0886418: > > Merge remote-tracking branch > 'remotes/mdroth/tags/qga-pull-2021-08-03-pull-tag' into staging (2021-08-03 > 14:48:57 +0100) > > are available in the

Re: [PATCH for-6.1? v2 5/7] job: Add job_cancel_requested()

2021-08-04 Thread Peter Krempa
On Wed, Aug 04, 2021 at 12:34:31 +0200, Kevin Wolf wrote: > We could in theory keep allowing redundant completion requests when the > completion mode doesn't conflict, but I don't see the point of that. I don't see either. Especially since ... > Unless libvirt can actually issue multiple

Re: [PULL 0/1] Block layer patches

2021-08-04 Thread Peter Maydell
On Tue, 3 Aug 2021 at 15:41, Kevin Wolf wrote: > > The following changes since commit 7f1cab9c628a798ae2607940993771e6300e9e00: > > Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' > into staging (2021-08-02 17:21:50 +0100) > > are available in the Git repository at: > >

Re: [PATCH for-6.1? v2 5/7] job: Add job_cancel_requested()

2021-08-04 Thread Kevin Wolf
[ Peter, the question for you is at the end. ] Am 04.08.2021 um 10:07 hat Max Reitz geschrieben: > On 03.08.21 16:25, Kevin Wolf wrote: > > Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: > > > Most callers of job_is_cancelled() actually want to know whether the job > > > is on its way to

Re: [PATCH for-6.1? v2 6/7] mirror: Check job_is_cancelled() earlier

2021-08-04 Thread Max Reitz
On 04.08.21 11:48, Kevin Wolf wrote: Am 04.08.2021 um 10:25 hat Max Reitz geschrieben: On 03.08.21 16:34, Kevin Wolf wrote: Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: We must check whether the job is force-cancelled early in our main loop, most importantly before any `continue`

[PATCH v7 33/33] iotests/image-fleecing: add test-case for copy-before-write filter

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
New fleecing method becomes available: copy-before-write filter. Actually we don't need backup job to setup image fleecing. Add test for new recommended way of image fleecing. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing |

Re: [PATCH v2 for-6.2 0/6] push backup with fleecing

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Consider that as RFC. I'm preparing an alternative and more efficient fleecing scheme, based on special block driver, not on backing link. So, this will be rebased, and probably some permission-related difficulties may be avoided. 21.07.2021 17:04, Vladimir Sementsov-Ogievskiy wrote: Hi

[PATCH v7 31/33] iotests/image-fleecing: rename tgt_node

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Actually target of backup(sync=None) is not a final backup target: image fleecing is intended to be used with external tool, which will copy data from fleecing node to some real backup target. Also, we are going to add a test case for "push backup with fleecing", where instead of exporting

[PATCH v7 26/33] iotests/222: fix pylint and mypy complains

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Here: - long line - move to new interface of vm.qmp() (direct passing dict), to avoid mypy false-positive, as it thinks that unpacked dict is a positional argument. - extra parenthesis - handle event_wait possible None value Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max

Re: [PATCH for-6.1? v2 6/7] mirror: Check job_is_cancelled() earlier

2021-08-04 Thread Kevin Wolf
Am 04.08.2021 um 10:25 hat Max Reitz geschrieben: > On 03.08.21 16:34, Kevin Wolf wrote: > > Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: > > > We must check whether the job is force-cancelled early in our main loop, > > > most importantly before any `continue` statement. For example, we

[PATCH v7 32/33] iotests/image-fleecing: prepare for adding new test-case

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to add a test-case with some behavior modifications. So, let's prepare a function to be reused. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/tests/image-fleecing | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-)

[PATCH v7 25/33] iotests.py: VM: add own __enter__ method

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
In superclass __enter__ method is defined with return value type hint 'QEMUMachine'. So, mypy thinks that return value of VM.__enter__ is QEMUMachine. Let's redefine __enter__ in VM class, to give it correct type hint. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz ---

[PATCH v7 28/33] iotests: move 222 to tests/image-fleecing

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Give a good name to test file. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/{222 => tests/image-fleecing} | 0 tests/qemu-iotests/{222.out => tests/image-fleecing.out} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename

[PATCH v7 30/33] iotests/image-fleecing: proper source device

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Define scsi device to operate with it by qom-set in further patch. Give a new node-name to source block node, to not look like device name. Job now don't want to work without giving explicit id, so, let's call it "fleecing". Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz

[PATCH v7 27/33] iotests/222: constantly use single quotes for strings

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
The file use both single and double quotes for strings. Let's be consistent. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/222 | 68 +- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git

[PATCH v7 22/33] qapi: publish copy-before-write filter

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- qapi/block-core.json | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/qapi/block-core.json b/qapi/block-core.json index 675d8265eb..59d3e5e42d 100644 --- a/qapi/block-core.json

[PATCH v7 21/33] block/copy-before-write: make public block driver

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Finally, copy-before-write gets own .bdrv_open and .bdrv_close handlers, block_init() call and becomes available through bdrv_open(). To achieve this: - cbw_init gets unused flags argument and becomes cbw_open - block_copy_state_free() call moved to new cbw_close() - in bdrv_cbw_append: -

[PATCH v7 19/33] block/copy-before-write: initialize block-copy bitmap

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter to be used in separate of backup. Future step would support bitmap for the filter. But let's start from full set bitmap. We have to modify backup, as bitmap is first initialized by copy-before-write filter, and then backup modifies it.

[PATCH v7 29/33] iotests.py: hmp_qemu_io: support qdev

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- tests/qemu-iotests/iotests.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index 025e288ddd..9d0031a0e8 100644 ---

[PATCH v7 24/33] python/qemu/machine: QEMUMachine: improve qmp() method

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We often call qmp() with unpacking dict, like qmp('foo', **{...}). mypy don't really like it, it thinks that passed unpacked dict is a positional argument and complains that it type should be bool (because second argument of qmp() is conv_keys: bool). Allow passing dict directly, simplifying

[PATCH v7 20/33] block/block-copy: make setting progress optional

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Now block-copy will crash if user don't set progress meter by block_copy_set_progress_meter(). copy-before-write filter will be used in separate of backup job, and it doesn't want any progress meter (for now). So, allow not setting it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max

[PATCH v7 14/33] block/copy-before-write: introduce cbw_init()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Move part of bdrv_cbw_append() to new function cbw_open(). It's an intermediate step for adding normal .bdrv_open() handler to the filter. With this commit no logic is changed, but we have a function which will be turned into .bdrv_open() handler in future commit. Signed-off-by: Vladimir

[PATCH v7 23/33] python/qemu/machine.py: refactor _qemu_args()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
- use shorter construction - don't create new dict if not needed - drop extra unpacking key-val arguments - drop extra default values Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz Reviewed-by: John Snow --- python/qemu/machine/machine.py | 18 -- 1

[PATCH v7 17/33] block/copy-before-write: bdrv_cbw_append(): drop unused compress arg

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/copy-before-write.h | 1 - block/backup.c| 2 +- block/copy-before-write.c | 7 +++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/block/copy-before-write.h b/block/copy-before-write.h index

[PATCH v7 16/33] block/copy-before-write: cbw_init(): use file child after attaching

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
In the next commit we'll get rid of source argument of cbw_init(). Prepare to it now, to make next commit simpler: move the code block that uses source below attaching the child and use bs->file->bs instead of source variable. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz

[PATCH v7 18/33] block/copy-before-write: cbw_init(): use options

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
One more step closer to .bdrv_open(): use options instead of plain arguments. Move to bdrv_open_child() calls, native for drive open handlers. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/copy-before-write.c | 29 +++-- 1 file changed, 15 insertions(+), 14

[PATCH v7 09/33] block/backup: move cluster size calculation to block-copy

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
The main consumer of cluster-size is block-copy. Let's calculate it here instead of passing through backup-top. We are going to publish copy-before-write filter soon, so it will be created through options. But we don't want for now to make explicit option for cluster-size, let's continue to

[PATCH v7 06/33] block-copy: move detecting fleecing scheme to block-copy

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We want to simplify initialization interface of copy-before-write filter as we are going to make it public. So, let's detect fleecing scheme exactly in block-copy code, to not pass this information through extra levels. Why not just set BDRV_REQ_SERIALISING unconditionally: because we are going

[PATCH v7 11/33] block/copy-before-write: drop extra bdrv_unref on failure path

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
bdrv_attach_child() do bdrv_unref() on failure, so we shouldn't do it by hand here. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/copy-before-write.c b/block/copy-before-write.c index

[PATCH v7 15/33] block/copy-before-write: cbw_init(): rename variables

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
One more step closer to real .bdrv_open() handler: use more usual names for bs being initialized and its state. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-)

[PATCH v7 13/33] block/copy-before-write: bdrv_cbw_append(): replace child at last

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Refactor the function to replace child at last. Thus we don't need to revert it and code is simplified. block-copy state initialization being done before replacing the child doesn't need any drained section. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz ---

[PATCH v7 12/33] block/copy-before-write: use file child instead of backing

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter, and there no public backing-child-based filter in Qemu. No reason to create a precedent, so let's refactor copy-before-write filter instead. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- block/copy-before-write.c | 39

[PATCH v7 02/33] block: introduce blk_replace_bs

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Add function to change bs inside blk. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/sysemu/block-backend.h | 1 + block/block-backend.c | 8 2 files changed, 9 insertions(+) diff --git a/include/sysemu/block-backend.h

[PATCH v7 03/33] qdev-properties: PropertyInfo: add realized_set_allowed field

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Add field, so property can declare support for setting the property when device is realized. To be used in the following commit. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/hw/qdev-properties.h | 1 + hw/core/qdev-properties.c| 6 +++--- 2 files changed,

[PATCH v7 08/33] block/backup: set copy_range and compress after filter insertion

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter, so it would be initialized through options. Still we don't want to publish compress and copy-range options, as 1. Modern way to enable compression is to use compress filter. 2. For copy-range it's unclean how to make proper interface: - it's has

[PATCH v7 07/33] block/block-copy: introduce block_copy_set_copy_opts()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We'll need a possibility to set compress and use_copy_range options after initialization of the state. So make corresponding part of block_copy_state_new() separate and public. Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block-copy.h | 2 ++ block/block-copy.c | 66

[PATCH v7 04/33] qdev: allow setting drive property for realized device

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We need an ability to insert filters above top block node, attached to block device. It can't be achieved with blockdev-reopen command. So, we want do it with help of qom-set. Intended usage: Assume there is a node A that is attached to some guest device. 1. blockdev-add to create a filter node

[PATCH v7 10/33] block/copy-before-write: relax permission requirements when no parents

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to publish copy-before-write filter. So, user should be able to create it with blockdev-add first, specifying both filtered and target children. And then do blockdev-reopen, to actually insert the filter where needed. Currently, filter unshares write permission unconditionally on

[PATCH v7 01/33] block: introduce bdrv_replace_child_bs()

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Add function to transactionally replace bs inside BdrvChild. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Max Reitz --- include/block/block.h | 2 ++ block.c | 31 +++ 2 files changed, 33 insertions(+) diff --git a/include/block/block.h

[PATCH v7 05/33] block: rename backup-top to copy-before-write

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
We are going to convert backup_top to full featured public filter, which can be used in separate of backup job. Start from renaming from "how it used" to "what it does". While updating comments in 283 iotest, drop and rephrase also things about ".active", as this field is now dropped, and filter

[PATCH v7 00/33] block: publish backup-top filter

2021-08-04 Thread Vladimir Sementsov-Ogievskiy
Hi all! v7: small change: keep fleecing detection logic. I'm now implementing a more effective way to do fleecing, that doesn't rely on backing chain and on serializing requests. So, for this alternative way we'll not need BDRV_REQ_SERIALISING flag. Let's keep automatic addition of this flag when

Re: [PATCH for-6.1? v2 6/7] mirror: Check job_is_cancelled() earlier

2021-08-04 Thread Max Reitz
On 03.08.21 16:34, Kevin Wolf wrote: Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: We must check whether the job is force-cancelled early in our main loop, most importantly before any `continue` statement. For example, we used to have `continue`s before our current checking location that

Re: [PATCH for-6.1? v2 5/7] job: Add job_cancel_requested()

2021-08-04 Thread Max Reitz
On 03.08.21 16:25, Kevin Wolf wrote: Am 26.07.2021 um 16:46 hat Max Reitz geschrieben: Most callers of job_is_cancelled() actually want to know whether the job is on its way to immediate termination. For example, we refuse to pause jobs that are cancelled; but this only makes sense for jobs

Re: [Question] qemu-img convert block alignment

2021-08-04 Thread Zhenyu Ye
On 2021/8/3 23:03, Eric Blake wrote: > On Fri, Apr 02, 2021 at 11:52:25AM +0800, Zhenyu Ye wrote: >> Hi all, >> >> commit 8dcd3c9b91 ("qemu-img: align result of is_allocated_sectors") >> introduces block alignment when doing qemu-img convert. However, the >> alignment is: >> >> s.alignment =