From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, kwolf@redhat.com, hreitz@redhat.com,
eblake@redhat.com, jsnow@redhat.com, vsementsov@virtuozzo.com,
den@openvz.org
Subject: [PATCH 0/4] qemu-img compare --stat
Date: Wed, 29 Sep 2021 16:34:23 +0300 [thread overview]
Message-ID: <20210929133427.44923-1-vsementsov@virtuozzo.com> (raw)
Hi all!
Recently we faced the following task:
Customer comes and say: incremental backup images are too fat. Does you
incremental backup works correct?
What to answer? We should check something. At least check that
incremental images doesn't store same data twice. And we don't have a
tool for it. I just wrote a simple python script to compare raw files
cluster-by-cluster. Then we've mounted the qcow2 images with help of
qemu-nbd, the resulting /dev/nbd* were compared and we proved that
incremental backups don't store same data.
But that leads to idea that some kind of that script would be good to
have at hand.
So, here is a new option for qemu-img compare, that is a lot more
powerful and effective than original script, and allows to compare and
calculate statistics, i.e. how many clusters differs, how many
clusters changed from unallocated to data, and so on.
For examples of output look at the test in patch 04.
Vladimir Sementsov-Ogievskiy (4):
qemu-img: implement compare --stat
qemu-img: make --block-size optional for compare --stat
qemu-img: add --shallow option for qemu-img compare --stat
iotests: add qemu-img-compare-stat test
docs/tools/qemu-img.rst | 29 +-
qemu-img.c | 275 +++++++++++++++++-
qemu-img-cmds.hx | 4 +-
.../qemu-iotests/tests/qemu-img-compare-stat | 88 ++++++
.../tests/qemu-img-compare-stat.out | 106 +++++++
5 files changed, 484 insertions(+), 18 deletions(-)
create mode 100755 tests/qemu-iotests/tests/qemu-img-compare-stat
create mode 100644 tests/qemu-iotests/tests/qemu-img-compare-stat.out
--
2.29.2
next reply other threads:[~2021-09-29 13:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-29 13:34 Vladimir Sementsov-Ogievskiy [this message]
2021-09-29 13:34 ` [PATCH 1/4] qemu-img: implement compare --stat Vladimir Sementsov-Ogievskiy
2021-09-29 13:34 ` [PATCH 2/4] qemu-img: make --block-size optional for " Vladimir Sementsov-Ogievskiy
2021-09-29 13:34 ` [PATCH 3/4] qemu-img: add --shallow option for qemu-img " Vladimir Sementsov-Ogievskiy
2021-09-29 16:00 ` Nir Soffer
2021-09-29 16:28 ` Vladimir Sementsov-Ogievskiy
2021-09-29 16:47 ` Nir Soffer
2021-09-29 13:34 ` [PATCH 4/4] iotests: add qemu-img-compare-stat test Vladimir Sementsov-Ogievskiy
2021-09-30 0:27 ` [PATCH 0/4] qemu-img compare --stat John Snow
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=20210929133427.44923-1-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=den@openvz.org \
--cc=eblake@redhat.com \
--cc=hreitz@redhat.com \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/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).