From: Kevin Wolf <kwolf@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, famz@redhat.com,
stefanha@redhat.com, jcody@redhat.com, mreitz@redhat.com,
den@openvz.org, eblake@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 11/11] block/backup: use backup-top instead of write notifiers
Date: Tue, 6 Nov 2018 18:35:59 +0100 [thread overview]
Message-ID: <20181106173559.GH4758@linux.fritz.box> (raw)
In-Reply-To: <20181015160633.63130-12-vsementsov@virtuozzo.com>
Am 15.10.2018 um 18:06 hat Vladimir Sementsov-Ogievskiy geschrieben:
> Drop write notifiers and use filter node instead. Changes:
>
> 1. copy-before-writes now handled by filter node, so, drop all
> is_write_notifier arguments.
>
> 2. we don't have intersecting requests, so their handling is dropped.
> Instead, synchronization works as follows:
> when backup or backup-top starts copying of some area it firstly
> clears copy-bitmap bits, and nobody touches areas, not marked with
> dirty bits in copy-bitmap, so there is no intersection. Also, backup
> job copy operations are surrounded by bdrv region lock, which is
> actually serializing request, to not interfer with guest writes and
> not read changed data from source (before reading we clear
> corresponding bit in copy-bitmap, so, this area is not more handled by
> backup-top).
>
> 3. To sync with in-flight requests we now just drain hook node, we
> don't need rw-lock.
>
> 4. After the whole backup loop (top, full, incremental modes), we need
> to check for not copied clusters, which were under backup-top operation
> and we skipped them, but backup-top operation failed, error returned to
> the guest and dirty bits set back.
>
> 5. Don't create additional blk, use backup-top children for copy
> operations.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Haven't reviewed it yet, but gcc complains correctly here:
block/backup.c: In function 'backup_job_create':
block/backup.c:717:9: error: 'backup_top' may be used uninitialized in this function [-Werror=maybe-uninitialized]
bdrv_backup_top_drop(backup_top);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
> @@ -653,24 +648,29 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
>
> copy_bitmap = hbitmap_alloc(len, ctz32(cluster_size));
>
> + /* bdrv_get_device_name will not help to find device name starting from
> + * @bs after backup-top append, so let's calculate job_id before. Do
> + * it in the same way like block_job_create
> + */
> + if (job_id == NULL && !(creation_flags & JOB_INTERNAL)) {
> + job_id = bdrv_get_device_name(bs);
> + }
> +
> + backup_top = bdrv_backup_top_append(bs, target, copy_bitmap, errp);
> + if (!backup_top) {
> + return NULL;
This needs to be goto error, just like in the bdrv_getlength() failure a
few lines above (which is where the uninitialised backup_top warning
comes from).
Kevin
next prev parent reply other threads:[~2018-11-06 17:37 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-15 16:06 [Qemu-devel] [PATCH v4 00/11] backup-top filter driver for backup Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 01/11] block/backup: simplify backup_incremental_init_copy_bitmap Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 02/11] block/backup: move to copy_bitmap with granularity Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 03/11] block: allow serialized reads to intersect Vladimir Sementsov-Ogievskiy
2018-11-06 17:57 ` Kevin Wolf
2018-11-07 10:08 ` Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 04/11] block: improve should_update_child Vladimir Sementsov-Ogievskiy
2018-11-06 18:09 ` Kevin Wolf
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 05/11] iotests: handle -f argument correctly for qemu_io_silent Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 06/11] iotests: allow resume_drive by node name Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 07/11] iotests: prepare 055 to graph changes during backup job Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 08/11] block: introduce backup-top filter driver Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 09/11] block: add lock/unlock range functions Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 10/11] block/backup: tiny refactor backup_job_create Vladimir Sementsov-Ogievskiy
2018-10-15 16:06 ` [Qemu-devel] [PATCH v4 11/11] block/backup: use backup-top instead of write notifiers Vladimir Sementsov-Ogievskiy
2018-11-06 17:35 ` Kevin Wolf [this message]
2018-11-02 16:41 ` [Qemu-devel] ping Re: [PATCH v4 00/11] backup-top filter driver for backup Vladimir Sementsov-Ogievskiy
2018-11-06 17:21 ` Kevin Wolf
2018-11-06 22:35 ` [Qemu-devel] [Qemu-block] " John Snow
2018-11-07 10:16 ` 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=20181106173559.GH4758@linux.fritz.box \
--to=kwolf@redhat.com \
--cc=den@openvz.org \
--cc=eblake@redhat.com \
--cc=famz@redhat.com \
--cc=jcody@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.