From: "Daniel P. Berrangé" <berrange@redhat.com>
To: "Denis V. Lunev" <den@openvz.org>
Cc: Kevin Wolf <kwolf@redhat.com>, Fam Zheng <fam@euphon.net>,
qemu-block@nongnu.org, Juan Quintela <quintela@redhat.com>,
"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
qemu-devel@nongnu.org, Denis Plotnikov <dplotnikov@virtuozzo.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Max Reitz <mreitz@redhat.com>
Subject: Re: [PATCH 4/6] block, migration: add bdrv_finalize_vmstate helper
Date: Thu, 27 Aug 2020 14:06:45 +0100 [thread overview]
Message-ID: <20200827130645.GT192458@redhat.com> (raw)
In-Reply-To: <a5e7f90b-629a-69d1-d9f2-4d57802ba617@openvz.org>
On Thu, Aug 27, 2020 at 04:02:38PM +0300, Denis V. Lunev wrote:
> On 8/27/20 3:58 PM, Daniel P. Berrangé wrote:
> > On Thu, Jul 09, 2020 at 04:26:42PM +0300, Denis V. Lunev wrote:
> >> Right now bdrv_fclose() is just calling bdrv_flush().
> >>
> >> The problem is that migration code is working inefficiently from block
> >> layer terms and are frequently called for very small pieces of
> >> unaligned data. Block layer is capable to work this way, but this is very
> >> slow.
> >>
> >> This patch is a preparation for the introduction of the intermediate
> >> buffer at block driver state. It would be beneficial to separate
> >> conventional bdrv_flush() from closing QEMU file from migration code.
> >>
> >> The patch also forces bdrv_finalize_vmstate() operation inside
> >> synchronous blk_save_vmstate() operation. This helper is used from
> >> qemu-io only.
> >>
> >> Signed-off-by: Denis V. Lunev <den@openvz.org>
> >> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> >> CC: Kevin Wolf <kwolf@redhat.com>
> >> CC: Max Reitz <mreitz@redhat.com>
> >> CC: Stefan Hajnoczi <stefanha@redhat.com>
> >> CC: Fam Zheng <fam@euphon.net>
> >> CC: Juan Quintela <quintela@redhat.com>
> >> CC: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >> CC: Denis Plotnikov <dplotnikov@virtuozzo.com>
> >> ---
> >> block/block-backend.c | 6 +++++-
> >> block/io.c | 15 +++++++++++++++
> >> include/block/block.h | 5 +++++
> >> migration/savevm.c | 4 ++++
> >> 4 files changed, 29 insertions(+), 1 deletion(-)
> >> diff --git a/migration/savevm.c b/migration/savevm.c
> >> index 45c9dd9d8a..d8a94e312c 100644
> >> --- a/migration/savevm.c
> >> +++ b/migration/savevm.c
> >> @@ -150,6 +150,10 @@ static ssize_t block_get_buffer(void *opaque, uint8_t *buf, int64_t pos,
> >>
> >> static int bdrv_fclose(void *opaque, Error **errp)
> >> {
> >> + int err = bdrv_finalize_vmstate(opaque);
> >> + if (err < 0) {
> >> + return err;
> > This is returning an error without having populating 'errp' which means
> > the caller will be missing error diagnosis
>
> but this behaves exactly like the branch below,
> bdrv_flush() could return error too and errp
> is not filled in the same way.
Doh, it seems the only caller passes NULL for the errp too,
so it is a redundant parameter. So nothing wrong with your
patch after all.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2020-08-27 13:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-09 13:26 [PATCH v8 0/6] block: seriously improve savevm/loadvm performance Denis V. Lunev
2020-07-09 13:26 ` [PATCH 1/6] block/aio_task: allow start/wait task from any coroutine Denis V. Lunev
2020-07-09 13:26 ` [PATCH 2/6] block/aio_task: drop aio_task_pool_wait_one() helper Denis V. Lunev
2020-07-09 13:26 ` [PATCH 3/6] block/block-backend: remove always true check from blk_save_vmstate Denis V. Lunev
2020-07-09 13:26 ` [PATCH 4/6] block, migration: add bdrv_finalize_vmstate helper Denis V. Lunev
2020-08-27 12:58 ` Daniel P. Berrangé
2020-08-27 13:02 ` Denis V. Lunev
2020-08-27 13:06 ` Daniel P. Berrangé [this message]
2020-08-28 6:13 ` Markus Armbruster
2020-07-09 13:26 ` [PATCH 5/6] block/io: improve savevm performance Denis V. Lunev
2020-07-09 13:26 ` [PATCH 6/6] block/io: improve loadvm performance Denis V. Lunev
2020-07-10 14:40 ` Vladimir Sementsov-Ogievskiy
2020-08-20 7:42 ` [PATCH v8 0/6] block: seriously improve savevm/loadvm performance Denis V. Lunev
2020-08-27 12:41 ` Denis V. Lunev
2020-09-14 13:13 ` Stefan Hajnoczi
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=20200827130645.GT192458@redhat.com \
--to=berrange@redhat.com \
--cc=den@openvz.org \
--cc=dgilbert@redhat.com \
--cc=dplotnikov@virtuozzo.com \
--cc=fam@euphon.net \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=stefanha@redhat.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.