aboutsummaryrefslogtreecommitdiff
path: root/include/qemu-io.h
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2018-05-09 21:42:59 +0200
committerMax Reitz <mreitz@redhat.com>2018-06-11 16:18:45 +0200
commitb32d7a39af488d280ce5f02a2ed94871d696f87a (patch)
tree8c2782e7a13f9d46066b5720223f82923b8eb0d5 /include/qemu-io.h
parentb444d0e9d1ae323fed1ef7c35a359ce064f36b32 (diff)
qemu-io: Let command functions return error code
This is basically what everything else in the qemu code base does, so we can do it here, too. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20180509194302.21585-3-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/qemu-io.h')
-rw-r--r--include/qemu-io.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/qemu-io.h b/include/qemu-io.h
index 06cdfbf660..7433239372 100644
--- a/include/qemu-io.h
+++ b/include/qemu-io.h
@@ -22,7 +22,12 @@
#define CMD_FLAG_GLOBAL ((int)0x80000000) /* don't iterate "args" */
-typedef void (*cfunc_t)(BlockBackend *blk, int argc, char **argv);
+/* Implement a qemu-io command.
+ * Operate on @blk using @argc/@argv as the command's arguments, and
+ * return 0 on success or negative errno on failure.
+ */
+typedef int (*cfunc_t)(BlockBackend *blk, int argc, char **argv);
+
typedef void (*helpfunc_t)(void);
typedef struct cmdinfo {
@@ -41,7 +46,7 @@ typedef struct cmdinfo {
extern bool qemuio_misalign;
-void qemuio_command(BlockBackend *blk, const char *cmd);
+int qemuio_command(BlockBackend *blk, const char *cmd);
void qemuio_add_command(const cmdinfo_t *ci);
void qemuio_command_usage(const cmdinfo_t *ci);