Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

vzctl start: fix exit code if ioprio set failed

Return code from ve_ioprio_set() is propagated all the way up to main()
and is used as vzctl exit code:
main()
  run_action()
    start()
      vps_start()
        vps_start_custom()
          vps_setup_res()
            ve_ioprio_set()

So we ended up exiting with -1 (255) from vzctl if ioprio set failed.

Fix it by introducing VZ_IO_SET. Document it in vzctl(8) man page.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
  • Loading branch information...
commit 1ef7a072a6da73c5d5124a0edd587d24d244c871 1 parent 56bdaf2
@kolyshkin kolyshkin authored
Showing with 5 additions and 1 deletion.
  1. +1 −0  include/vzerror.h
  2. +2 −0  man/vzctl.8
  3. +2 −1  src/lib/io.c
View
1  include/vzerror.h
@@ -148,4 +148,5 @@
#define VZ_CONFIG_SAVE_ERROR 139
#define VZ_SET_OSRELEASE 144
+#define VZ_SET_IO 148
#endif /* _VZ_ERROR_H_ */
View
2  man/vzctl.8
@@ -889,6 +889,8 @@ Error setting container name
Waiting for container start failed
.IP 139
Error saving container configuration file
+.IP 148
+Error setting container IO parameters (ioprio)
.SH EXAMPLES
To create and start "basic" container with ID of 1000 using
\fIfedora-core-5\fR OS template and IP address of 192.168.10.200:
View
3  src/lib/io.c
@@ -52,6 +52,7 @@ int ve_ioprio_set(vps_handler *h, envid_t veid, io_param *io_param)
}
else
logger(-1, errno, "Unable to set ioprio");
+ return VZ_SET_IO;
}
- return ret;
+ return 0;
}
Please sign in to comment.
Something went wrong with that request. Please try again.