aboutsummaryrefslogtreecommitdiff
path: root/qemu-io-cmds.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-06-05 14:19:39 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2013-06-06 11:27:05 +0200
commit3d21994f9c511cb63220fef5abea164b83fbb997 (patch)
tree0904ba640749913e45ab3711323ccc8c0c58bfd9 /qemu-io-cmds.c
parent0b613881ae8fc59359b3d91e666fea6c9b1e731b (diff)
downloadqemu-3d21994f9c511cb63220fef5abea164b83fbb997.zip
qemu-3d21994f9c511cb63220fef5abea164b83fbb997.tar.gz
qemu-3d21994f9c511cb63220fef5abea164b83fbb997.tar.bz2
qemu-io: Interface cleanup
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'qemu-io-cmds.c')
-rw-r--r--qemu-io-cmds.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c
index 05ce342..ffbcf31 100644
--- a/qemu-io-cmds.c
+++ b/qemu-io-cmds.c
@@ -8,9 +8,8 @@
* See the COPYING file in the top-level directory.
*/
-#include "qemu-common.h"
+#include "qemu-io.h"
#include "block/block_int.h"
-#include "cmd.h"
#define CMD_NOFILE_OK 0x01
@@ -50,11 +49,12 @@ static int init_check_command(BlockDriverState *bs, const cmdinfo_t *ct)
return 1;
}
-static int command(const cmdinfo_t *ct, int argc, char **argv)
+static int command(BlockDriverState *bs, const cmdinfo_t *ct, int argc,
+ char **argv)
{
char *cmd = argv[0];
- if (!init_check_command(qemuio_bs, ct)) {
+ if (!init_check_command(bs, ct)) {
return 0;
}
@@ -75,7 +75,7 @@ static int command(const cmdinfo_t *ct, int argc, char **argv)
return 0;
}
optind = 0;
- return ct->cfunc(qemuio_bs, argc, argv);
+ return ct->cfunc(bs, argc, argv);
}
static const cmdinfo_t *find_command(const char *cmd)
@@ -2068,7 +2068,7 @@ static const cmdinfo_t help_cmd = {
.oneline = "help for one or all commands",
};
-bool qemuio_command(const char *cmd)
+bool qemuio_command(BlockDriverState *bs, const char *cmd)
{
char *input;
const cmdinfo_t *ct;
@@ -2081,7 +2081,7 @@ bool qemuio_command(const char *cmd)
if (c) {
ct = find_command(v[0]);
if (ct) {
- done = command(ct, c, v);
+ done = command(bs, ct, c, v);
} else {
fprintf(stderr, "command \"%s\" not found\n", v[0]);
}