[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 35/42] qemu-img: Document check exit codes
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 35/42] qemu-img: Document check exit codes |
Date: |
Fri, 6 Jun 2014 18:13:56 +0200 |
From: Max Reitz <address@hidden>
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.
Also, document all of check's exit codes in the manpage.
Signed-off-by: Max Reitz <address@hidden>
Reported-by: Markus Armbruster <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Benoit Canet <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
qemu-img.c | 9 +++++----
qemu-img.texi | 23 +++++++++++++++++++++++
2 files changed, 28 insertions(+), 4 deletions(-)
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 otherwise
+ * 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 otherwise
+ * 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 occurred.
Only the formats @code{qcow2}, @code{qed} and @code{vdi} support
consistency checks.
+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 another error
+occurred. The following table summarizes all exit codes of the check
subcommand:
+
address@hidden @option
+
address@hidden 0
+Check completed, the image is (now) consistent
address@hidden 1
+Check not completed because of internal errors
address@hidden 2
+Check completed, image is corrupted
address@hidden 3
+Check completed, image has leaked clusters, but is not corrupted
address@hidden 63
+Checks are not supported by the image format
+
address@hidden table
+
+If @code{-r} is specified, exit codes representing the image state refer 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} address@hidden
Create the new disk image @var{filename} of size @var{size} and format
--
1.9.3
- [Qemu-devel] [PULL 27/42] block: Move declaration of bdrv_get_aio_context to block.h, (continued)
- [Qemu-devel] [PULL 27/42] block: Move declaration of bdrv_get_aio_context to block.h, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 22/42] vmdk: implement .bdrv_detach/attach_aio_context(), Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 28/42] virtio-blk: Allow config-wce in dataplane, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 29/42] virtio-blk: Factor out virtio_blk_handle_scsi_req from virtio_blk_handle_scsi, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 31/42] throttle: add throttle_detach/attach_aio_context(), Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 30/42] dataplane: Support VIRTIO_BLK_T_SCSI_CMD, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 32/42] throttle: add detach/attach test case, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 33/42] blockdev: acquire AioContext in block_set_io_throttle, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 34/42] block: fix wrong order in live block migration setup, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 36/42] rbd: Fix leaks in rbd_start_aio() error path, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 35/42] qemu-img: Document check exit codes,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 40/42] qapi: create two block related json modules, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 39/42] qapi: Extract qapi/common.json definitions, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 41/42] qapi: Extract qapi/block-core.json definitions, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 42/42] qapi: Extract qapi/block.json definitions, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 23/42] dataplane: use the QEMU block layer for I/O, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 37/42] sheepdog: fix vdi object update after live snapshot, Stefan Hajnoczi, 2014/06/06
- [Qemu-devel] [PULL 38/42] sheepdog: reload only header in a case of live snapshot, Stefan Hajnoczi, 2014/06/06
- Re: [Qemu-devel] [PULL 00/42] Block patches, Peter Maydell, 2014/06/09