qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] qemu-img: Fix check's leak/corruption fix report
@ 2020-02-27 17:02 Max Reitz
  2020-02-27 17:02 ` [PATCH 1/3] " Max Reitz
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Max Reitz @ 2020-02-27 17:02 UTC (permalink / raw)
  To: qemu-block; +Cc: Kevin Wolf, qemu-devel, Max Reitz

(Cc-ing Eric because of patch 2, mostly)

Hi,

While reviewing the “fix two small memleaks” series
(<20200227012950.12256-1-pannengyuan@huawei.com>) I noticed that we save
ImageCheck.(leaks|corruptions)_fixed from the first run and overwrite
the values obtained in the second run (where they must be zero because
we do not request any fixes in that second run), but we do not overwrite
ImageCheck.has_(leaks|corruptions)_fixed after the second run.  That
smells fishy.

Furthermore, ImageCheck.has_(leaks|corruptions)_fixed are not set based
on whether (leaks|corruptions)_fixed is non-zero, but actually based on
whether the leaks and corruptions fields (respectively) are non-zero.
qcow2’s check implementation reduces the leaks and corruptions values
when it fixes them, because then there are no leaks and corruptions
after the check anymore.

All in all, after a successful run, you will not see
“qemu-img check --output=json” report corruptions-fixed or leaks-fixed.
Which is a shame.  So this series fixes that and adds a test to ensure
those fields are indeed reported.


Max Reitz (3):
  qemu-img: Fix check's leak/corruption fix report
  iotests: Add poke_file_[bl]e functions
  iotests/138: Test leaks/corruptions fixed report

 qemu-img.c                   |  9 ++++++--
 tests/qemu-iotests/138       | 41 ++++++++++++++++++++++++++++++++++--
 tests/qemu-iotests/138.out   | 14 ++++++++++++
 tests/qemu-iotests/common.rc | 37 ++++++++++++++++++++++++++++++++
 4 files changed, 97 insertions(+), 4 deletions(-)

-- 
2.24.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-03-24 14:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-27 17:02 [PATCH 0/3] qemu-img: Fix check's leak/corruption fix report Max Reitz
2020-02-27 17:02 ` [PATCH 1/3] " Max Reitz
2020-02-27 18:22   ` Eric Blake
2020-02-27 17:02 ` [PATCH 2/3] iotests: Add poke_file_[bl]e functions Max Reitz
2020-02-27 18:46   ` Eric Blake
2020-03-10 17:22     ` Max Reitz
2020-03-24 14:43       ` Eric Blake
2020-02-27 17:02 ` [PATCH 3/3] iotests/138: Test leaks/corruptions fixed report Max Reitz
2020-02-27 18:56   ` Eric Blake
2020-03-10 17:31     ` Max Reitz

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).