From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bbpcu-0003oz-0Y for qemu-devel@nongnu.org; Mon, 22 Aug 2016 09:50:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bbpco-0003do-2I for qemu-devel@nongnu.org; Mon, 22 Aug 2016 09:50:55 -0400 Date: Mon, 22 Aug 2016 15:50:26 +0200 From: Reda Sallahi Message-ID: <20160822135025.GA21105@vps308710.ovh.net> References: <20160822075517.5859-1-fullmanet@gmail.com> <20160822075517.5859-6-fullmanet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160822075517.5859-6-fullmanet@gmail.com> Subject: Re: [Qemu-devel] [PATCH 5/7] qemu-img: add status option to dd List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, Kevin Wolf , Max Reitz , Fam Zheng , Stefan Hajnoczi I should have checked the previous test suites because : Mon, Aug 22, 2016 at 09:55:15AM +0200, Reda Sallahi wrote: > > if (in.offset > INT64_MAX / ibsz || size < in.offset * ibsz) { > - /* We give a warning if the skip option is bigger than the input > - * size and create an empty output disk image (i.e. like dd(1)). > - */ > - error_report("%s: cannot skip to specified offset", in.filename); > - in_pos = size; > + if (!(dd.status & C_STATUS_NONE)) { > + /* We give a warning if the skip option is bigger than the input > + * size and create an empty output disk image (i.e. like dd(1)). > + */ > + error_report("%s: cannot skip to specified offset", in.filename); > + in_pos = size; > + } in_pos = size should have gone outside of this last block. This means in_pos is set to size only if dd.status != C_STATUS_NONE. > +$QEMU_IMG compare "$TEST_IMG" "$TEST_IMG.out" And also this should have been $TEST_IMG.out.dd. I fixed this just now (and with a test file that also adds in skip and seek) and will send it in the next version. -- Reda