Received: from eggs.gnu.org ([2001:4830:134:3::10]:41820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrkJc-0004xT-Il for qemu-devel@nongnu.org; Tue, 03 Jun 2014 04:43:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrkJX-0000oT-En for qemu-devel@nongnu.org; Tue, 03 Jun 2014 04:43:28 -0400 Received: from lputeaux-656-01-25-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:38705 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrkJX-0000oG-8u for qemu-devel@nongnu.org; Tue, 03 Jun 2014 04:43:23 -0400 Date: Tue, 3 Jun 2014 10:43:21 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140603084321.GA18578@irqsave.net> References: <1401740121-15506-1-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1401740121-15506-1-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2] qemu-img: Document check exit codes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi , Markus Armbruster The Monday 02 Jun 2014 =E0 22:15:21 (+0200), Max Reitz wrote : > The exit code 63 (check not supported by image format) was not even > documented in the comment above the check command in the source code; > add it, as it does indeed seem useful. >=20 > Also, document all of check's exit codes in the manpage. >=20 > Signed-off-by: Max Reitz > Reported-by: Markus Armbruster > Reviewed-by: Eric Blake > --- > v2: Fixed spelling mistakes [Eric] > --- > qemu-img.c | 9 +++++---- > qemu-img.texi | 23 +++++++++++++++++++++++ > 2 files changed, 28 insertions(+), 4 deletions(-) >=20 > diff --git a/qemu-img.c b/qemu-img.c > index b3d2bc6..aa89ba2 100644 > --- a/qemu-img.c > +++ b/qemu-img.c > @@ -580,10 +580,11 @@ static int collect_image_check(BlockDriverState *= bs, > /* > * Checks an image for consistency. Exit codes: > * > - * 0 - Check completed, image is good > - * 1 - Check not completed because of internal errors > - * 2 - Check completed, image is corrupted > - * 3 - Check completed, image has leaked clusters, but is good otherwi= se > + * 0 - Check completed, image is good > + * 1 - Check not completed because of internal errors > + * 2 - Check completed, image is corrupted > + * 3 - Check completed, image has leaked clusters, but is good otherw= ise > + * 63 - Checks are not supported by the image format > */ > static int img_check(int argc, char **argv) > { > diff --git a/qemu-img.texi b/qemu-img.texi > index f84590e..c68b541 100644 > --- a/qemu-img.texi > +++ b/qemu-img.texi > @@ -126,6 +126,29 @@ wrong fix or hiding corruption that has already oc= curred. > Only the formats @code{qcow2}, @code{qed} and @code{vdi} support > consistency checks. > =20 > +In case the image does not have any inconsistencies, check exits with = @code{0}. > +Other exit codes indicate the kind of inconsistency found or if anothe= r error > +occurred. The following table summarizes all exit codes of the check s= ubcommand: > + > +@table @option > + > +@item 0 > +Check completed, the image is (now) consistent > +@item 1 > +Check not completed because of internal errors > +@item 2 > +Check completed, image is corrupted > +@item 3 > +Check completed, image has leaked clusters, but is not corrupted > +@item 63 > +Checks are not supported by the image format > + > +@end table > + > +If @code{-r} is specified, exit codes representing the image state ref= er to the > +state after (the attempt at) repairing it. That is, a successful @code= {-r all} > +will yield the exit code 0, independently of the image state before. > + > @item create [-f @var{fmt}] [-o @var{options}] @var{filename} [@var{si= ze}] > =20 > Create the new disk image @var{filename} of size @var{size} and format > --=20 > 1.9.3 >=20 >=20 Reviewed-by: Benoit Canet