[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4] block-jobs: flush target at the end of .run()
From: |
Evanzhang |
Subject: |
Re: [PATCH v4] block-jobs: flush target at the end of .run() |
Date: |
Thu, 3 Aug 2023 10:43:46 +0800 |
[...]
>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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH v4] block-jobs: flush target at the end of .run(),
Evanzhang <=