Skip to contentSkip to conversation

qemu-img: add special exit code if bdrv_check is not supported

PATCH Applied Peter Lieven 3 participants 3 messages Oct 24, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 qemu-img: add special exit code if bdrv_check is not supported

currently it is not possible to distinguish by exitcode if there has been an error or if bdrv_check is not supported by the image format. Change the exitcode from 1 to 63 for the latter case.

---
v1->v2: As Eric suggested changed the exitcode from 255 to 63.

 qemu-img.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-img.c +1 -1
index 926f0a0..bf3fb4f 100644
@@ -607,7 +607,7 @@ static int img_check(int argc, char **argv)
         if (output_format == OFORMAT_HUMAN) {
             error_report("This image format does not support checks");
         }
-        ret = 1;
+        ret = 63;
         goto fail;
     }
 
Signature · 1 line
1.7.9.5
Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Peter Lieven

currently it is not possible to distinguish by exitcode if there has been an error or if bdrv_check is not supported by the image format. Change the exitcode from 1 to 63 for the latter case.

---
v1->v2: As Eric suggested changed the exitcode from 255 to 63.

 qemu-img.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Should the man page document this exit status? Then again, it doesn't document ANY exit status, so that could be a separate patch.

Quoted 15 lines
qemu-img.c +1 -1
index 926f0a0..bf3fb4f 100644
@@ -607,7 +607,7 @@ static int img_check(int argc, char **argv)
         if (output_format == OFORMAT_HUMAN) {
             error_report("This image format does not support checks");
         }
-        ret = 1;
+        ret = 63;
         goto fail;
     }
 
Signature · 2 lines
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Applied
#2 lore raw

Am 24.10.2013 um 09:00 hat Eric Blake geschrieben:

Quoted 9 lines · Peter Lieven
Quoted 8 lines

currently it is not possible to distinguish by exitcode if there has been an error or if bdrv_check is not supported by the image format. Change the exitcode from 1 to 63 for the latter case.

---
v1->v2: As Eric suggested changed the exitcode from 255 to 63.

Quoted 7 lines
Quoted 2 lines
 qemu-img.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Should the man page document this exit status? Then again, it doesn't document ANY exit status, so that could be a separate patch.

Thanks, applied to the block branch.

Kevin