From: Hanna Reitz <hreitz@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-block@nongnu.org
Cc: kwolf@redhat.com, berrange@redhat.com, ehabkost@redhat.com,
jsnow@redhat.com, qemu-devel@nongnu.org, armbru@redhat.com,
crosa@redhat.com, pbonzini@redhat.com,
Max Reitz <mreitz@redhat.com>,
eblake@redhat.com
Subject: Re: [PATCH v8 09/34] block/backup: move cluster size calculation to block-copy
Date: Wed, 1 Sep 2021 13:57:02 +0200 [thread overview]
Message-ID: <8c8a44c3-0aa1-ca40-8b34-6a863cc7c2fa@redhat.com> (raw)
In-Reply-To: <20210824083856.17408-10-vsementsov@virtuozzo.com>
On 24.08.21 10:38, Vladimir Sementsov-Ogievskiy wrote:
> 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 calculate it automatically.
> So, now is the time to get rid of cluster_size argument for
> bdrv_cbw_append().
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Reviewed-by: Max Reitz <mreitz@redhat.com>
> ---
> block/copy-before-write.h | 1 -
> include/block/block-copy.h | 5 +--
> block/backup.c | 62 ++++++--------------------------------
> block/block-copy.c | 51 ++++++++++++++++++++++++++++++-
> block/copy-before-write.c | 10 +++---
> 5 files changed, 66 insertions(+), 63 deletions(-)
[...]
> diff --git a/block/block-copy.c b/block/block-copy.c
> index e83870ff81..b0e0a38330 100644
> --- a/block/block-copy.c
> +++ b/block/block-copy.c
[...]
> @@ -342,14 +343,57 @@ void block_copy_set_copy_opts(BlockCopyState *s, bool use_copy_range,
> }
> }
>
> +static int64_t block_copy_calculate_cluster_size(BlockDriverState *target,
> + Error **errp)
> +{
> + int ret;
> + BlockDriverInfo bdi;
> + bool target_does_cow = bdrv_backing_chain_next(target);
> +
> + /*
> + * If there is no backing file on the target, we cannot rely on COW if our
> + * backup cluster size is smaller than the target cluster size. Even for
> + * targets with a backing file, try to avoid COW if possible.
> + */
> + ret = bdrv_get_info(target, &bdi);
> + if (ret == -ENOTSUP && !target_does_cow) {
> + /* Cluster size is not defined */
> + warn_report("The target block device doesn't provide "
> + "information about the block size and it doesn't have a "
> + "backing file. The default block size of %u bytes is "
> + "used. If the actual block size of the target exceeds "
> + "this default, the backup may be unusable",
> + BLOCK_COPY_CLUSTER_SIZE_DEFAULT);
I get some build errors in the gitlab CI because of this – I think we
need to add a qemu/error-report.h include in block/block-copy.c now. (I
don’t know why this works for some configurations, apparently, but not
for others...)
Is it OK if I add it to this patch?
diff --git a/block/block-copy.c b/block/block-copy.c
index b0e0a38330..5d0076ac93 100644
--- a/block/block-copy.c
+++ b/block/block-copy.c
@@ -21,6 +21,7 @@
#include "qemu/units.h"
#include "qemu/coroutine.h"
#include "block/aio_task.h"
+#include "qemu/error-report.h"
#define BLOCK_COPY_MAX_COPY_RANGE (16 * MiB)
#define BLOCK_COPY_MAX_BUFFER (1 * MiB)
Hanna
next prev parent reply other threads:[~2021-09-01 12:08 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-24 8:38 [PATCH v8 00/34] block: publish backup-top filter Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 01/34] block: introduce bdrv_replace_child_bs() Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 02/34] block: introduce blk_replace_bs Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 03/34] qdev-properties: PropertyInfo: add realized_set_allowed field Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 04/34] qdev: allow setting drive property for realized device Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 05/34] block: rename backup-top to copy-before-write Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 06/34] block-copy: move detecting fleecing scheme to block-copy Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 07/34] block/block-copy: introduce block_copy_set_copy_opts() Vladimir Sementsov-Ogievskiy
2021-08-24 13:32 ` Hanna Reitz
2021-08-24 8:38 ` [PATCH v8 08/34] block/backup: set copy_range and compress after filter insertion Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 09/34] block/backup: move cluster size calculation to block-copy Vladimir Sementsov-Ogievskiy
2021-09-01 11:57 ` Hanna Reitz [this message]
2021-09-01 12:04 ` Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 10/34] block/copy-before-write: relax permission requirements when no parents Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 11/34] block/copy-before-write: drop extra bdrv_unref on failure path Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 12/34] block/copy-before-write: use file child instead of backing Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 13/34] block/copy-before-write: bdrv_cbw_append(): replace child at last Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 14/34] block/copy-before-write: introduce cbw_init() Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 15/34] block/copy-before-write: cbw_init(): rename variables Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 16/34] block/copy-before-write: cbw_init(): use file child after attaching Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 17/34] block/copy-before-write: bdrv_cbw_append(): drop unused compress arg Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 18/34] block/copy-before-write: cbw_init(): use options Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 19/34] block/copy-before-write: initialize block-copy bitmap Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 20/34] block/block-copy: make setting progress optional Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 21/34] block/copy-before-write: make public block driver Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 22/34] qapi: publish copy-before-write filter Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 23/34] python/qemu/machine.py: refactor _qemu_args() Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 24/34] python/qemu/machine: QEMUMachine: improve qmp() method Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 25/34] python:QEMUMachine: template typing for self returning methods Vladimir Sementsov-Ogievskiy
2021-08-24 13:56 ` Hanna Reitz
2021-08-24 8:38 ` [PATCH v8 26/34] iotests/222: fix pylint and mypy complains Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 27/34] iotests/222: constantly use single quotes for strings Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 28/34] iotests: move 222 to tests/image-fleecing Vladimir Sementsov-Ogievskiy
2021-09-01 12:37 ` Hanna Reitz
2021-09-01 12:47 ` Vladimir Sementsov-Ogievskiy
2021-09-01 12:54 ` Hanna Reitz
2021-09-01 13:00 ` Daniel P. Berrangé
2021-08-24 8:38 ` [PATCH v8 29/34] iotests.py: hmp_qemu_io: support qdev Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 30/34] iotests/image-fleecing: proper source device Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 31/34] iotests/image-fleecing: rename tgt_node Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 32/34] iotests/image-fleecing: prepare for adding new test-case Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 33/34] iotests/image-fleecing: add test-case for copy-before-write filter Vladimir Sementsov-Ogievskiy
2021-08-24 8:38 ` [PATCH v8 34/34] block/block-copy: block_copy_state_new(): drop extra arguments Vladimir Sementsov-Ogievskiy
2021-08-24 14:05 ` Hanna Reitz
2021-08-24 15:51 ` [PATCH v8 00/34] block: publish backup-top filter Hanna Reitz
2021-08-24 16:24 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8c8a44c3-0aa1-ca40-8b34-6a863cc7c2fa@redhat.com \
--to=hreitz@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=crosa@redhat.com \
--cc=eblake@redhat.com \
--cc=ehabkost@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).