diff options
author | Federico Simoncelli <fsimonce@redhat.com> | 2013-01-28 06:59:46 -0500 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2013-02-22 21:21:08 +0100 |
commit | c6bb9ad198c2caa9c7c8ba360a07630b5c10e4a8 (patch) | |
tree | fb7d050ec41a145e93d9a677c4136e880879fc59 /qemu-img.c | |
parent | 5cbb08283789caf7dbfd0890dcff47124ad766c2 (diff) |
qemu-img: find the image end offset during check
This patch adds the support for reporting the image end offset (in
bytes). This is particularly useful after a conversion (or a rebase)
where the destination is a block device in order to find the first
unused byte at the end of the image.
Signed-off-by: Federico Simoncelli <fsimonce@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-img.c')
-rw-r--r-- | qemu-img.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/qemu-img.c b/qemu-img.c index 85d3740b9c..e80c1c55fd 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -475,6 +475,10 @@ static int img_check(int argc, char **argv) result.bfi.fragmented_clusters * 100.0 / result.bfi.allocated_clusters); } + if (result.image_end_offset > 0) { + printf("Image end offset: %" PRId64 "\n", result.image_end_offset); + } + bdrv_delete(bs); if (ret < 0 || result.check_errors) { |