qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Evanzhang <Evanzhang@archeros.com>
To: vsementsov@yandex-team.ru
Cc: Evanzhang@archeros.com, den@openvz.org, hreitz@redhat.com,
	jsnow@redhat.com, kwolf@redhat.com, qemu-block@nongnu.org,
	qemu-devel@nongnu.org, vsementsov@virtuozzo.com
Subject: Re: [PATCH v4] block-jobs: flush target at the end of .run()
Date: Thu,  3 Aug 2023 10:43:46 +0800	[thread overview]
Message-ID: <20230803024346.1446-1-Evanzhang@archeros.com> (raw)
In-Reply-To: <20230725174008.1147467-1-vsementsov@yandex-team.ru>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1333 bytes --]

[...]

>diff --git a/block/mirror.c b/block/mirror.c
>index d3cacd1708..cd19b49f7f 100644
>--- a/block/mirror.c
>+++ b/block/mirror.c
>@@ -1143,6 +1143,10 @@ immediate_exit:
>     g_free(s->in_flight_bitmap);
>     bdrv_dirty_iter_free(s->dbi);
> 
>+    if (ret >= 0) {
>+        ret = block_job_final_target_flush(&s->common, blk_bs(s->target));
>+    }
>+
>     if (need_drain) {
>         s->in_drain = true;
>         bdrv_drained_begin(bs);

hi,I use gdb tested drive-mirror,break block_job_final_target_flush,
mirror_run  was not called it.
qmp command:
{"execute": "drive-mirror","arguments": {"device": "drive-virtio1","target": 
"./data1.test","sync": "full"}}

[...]

>--- a/include/block/blockjob_int.h
>+++ b/include/block/blockjob_int.h
>@@ -152,4 +152,15 @@ void block_job_ratelimit_sleep(BlockJob *job);
> BlockErrorAction block_job_error_action(BlockJob *job, BlockdevOnError on_err,
>                                         int is_read, int error);
> 
>+/**
>+ * block_job_final_target_flush:
>+ * @job: The job to signal an error for if flush failed.
>+ * @target_bs: The bs to flush.
>+ *
>+ * The function is intended to be called at the end of .run() for any data
>+ * copying job.
>+ */
>+int coroutine_fn
>+block_job_final_target_flush(BlockJob *job, BlockDriverState *target_bs);
>+
> #endif
>-- 
>2.34.1


  parent reply	other threads:[~2023-08-03  3:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-25 17:40 [PATCH v4] block-jobs: flush target at the end of .run() Vladimir Sementsov-Ogievskiy
2023-07-26  8:35 ` Denis V. Lunev
2023-07-27 15:27 ` Hanna Czenczek
2023-07-27 18:40   ` Vladimir Sementsov-Ogievskiy
2023-08-03  2:43 ` Evanzhang [this message]
2023-10-03  9:53   ` 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=20230803024346.1446-1-Evanzhang@archeros.com \
    --to=evanzhang@archeros.com \
    --cc=den@openvz.org \
    --cc=hreitz@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    --cc=vsementsov@yandex-team.ru \
    /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).