From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkbUw-0006Jh-Tg for qemu-devel@nongnu.org; Mon, 17 Dec 2012 09:16:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TkbUn-0007Ux-Ow for qemu-devel@nongnu.org; Mon, 17 Dec 2012 09:16:50 -0500 Received: from 212-4-128-36.cust.selfnet.cz ([212.4.128.36]:46974 helo=lws-ntb.brq.redhat.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TkbUl-0007T3-DA for qemu-devel@nongnu.org; Mon, 17 Dec 2012 09:16:41 -0500 From: mrezanin@redhat.com Date: Mon, 17 Dec 2012 14:39:49 +0100 Message-Id: <1355751593-31535-1-git-send-email-mrezanin@redhat.com> Subject: [Qemu-devel] [PATCH v7 0/4] Add subcommand compare for qemu-img List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, Miroslav Rezanina , stefanha@redhat.com From: Miroslav Rezanina This is seventh version of patch adding compare subcommand that compares two images. Compare has following criteria: - only data part is compared - unallocated sectors are not read - in case of different image size, exceeding part of bigger disk has to be zeroed/unallocated to compare rest - qemu-img returns: - 0 if images are identical - 1 if images differ - 2 on error v7: - split patch into pieces - Quiet mode added for all relevant subcommands - check non-shared part of disk after shared one - minor docummentation and naming fixes v6: - added handling -?, -h options for compare subcommand v5 (only minor changes): - removed redundant comment - removed dead code (goto after help()) - set final total_sectors on first assignment v4: - Fixed various typos - Added functions for empty sector check and sector-to-bytes offset conversion - Fixed command-line parameters processing v3: - options -f/-F are orthogonal - documentation updated to new syntax and behavior - used byte offset instead of sector number for output v2: - changed option for second image format to -F - changed handling of -f and -F [1] - added strict mode (-s) - added quiet mode (-q) - improved output messages [2] - rename variables for larger image handling - added man page content Signed-off-by: Miroslav Rezanina Miroslav Rezanina (4): block: Add synchronous wrapper for bdrv_co_is_allocated_above qemu-img: Add "Quiet mode" option qemu-img: Add compare subcommand Add qemu-img compare documentation block.c | 50 +++++++- block.h | 4 +- blockdev.c | 6 +- qemu-img-cmds.hx | 34 +++-- qemu-img.c | 383 ++++++++++++++++++++++++++++++++++++++++++++++++++----- qemu-img.texi | 35 +++++ 6 files changed, 460 insertions(+), 52 deletions(-) -- 1.7.11.7