From: Evanzhang <Evanzhang@archeros.com>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: jsnow@redhat.com, vsementsov@yandex-team.ru, kwolf@redhat.com,
hreitz@redhat.com, Evanzhang <Evanzhang@archeros.com>
Subject: [PATCH v1] block/stream:add flush l2_table_cache, ensure data integrity
Date: Mon, 24 Jul 2023 15:30:04 +0800 [thread overview]
Message-ID: <bce1328c87f7e5d877dead476e9e66036cc4f7d8.1690166344.git.Evanzhang@archeros.com> (raw)
In-Reply-To: <cover.1690166344.git.Evanzhang@archeros.com>
block_stream will not actively flush l2_table_cache,when qemu
process exception exit,causing disk data loss
Signed-off-by: Evanzhang <Evanzhang@archeros.com>
---
block/stream.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/block/stream.c b/block/stream.c
index e522bbd..a5e08da 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -207,6 +207,12 @@ static int coroutine_fn stream_run(Job *job, Error **errp)
}
}
+ /*
+ * Complete stream_populate,force flush l2_table_cache,to
+ * avoid unexpected termination of process, l2_table loss
+ */
+ qcow2_cache_flush(bs, ((BDRVQcow2State *)bs->opaque)->l2_table_cache);
+
/* Do not remove the backing file if an error was there but ignored. */
return error;
}
--
2.9.5
next prev parent reply other threads:[~2023-07-24 14:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-24 7:30 [PATCH v1] block/stream:add flush l2_table_cache, ensure data integrity Evanzhang
2023-07-24 7:30 ` Evanzhang [this message]
2023-07-25 14:25 ` [PATCH v1] block/stream:add flush l2_table_cache,ensure " Vladimir Sementsov-Ogievskiy
2023-07-25 15:13 ` Denis V. Lunev
2023-07-25 16:38 ` Vladimir Sementsov-Ogievskiy
2023-07-26 7:04 ` 回复: " 张承
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=bce1328c87f7e5d877dead476e9e66036cc4f7d8.1690166344.git.Evanzhang@archeros.com \
--to=evanzhang@archeros.com \
--cc=hreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--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).