aboutsummaryrefslogtreecommitdiff
path: root/cmd.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2013-06-05 14:19:30 +0200
committerStefan Hajnoczi <stefanha@redhat.com>2013-06-06 11:27:04 +0200
commit734c3b85cb72d264ad2b38a87f30304e05de2cb1 (patch)
treeaad868657469551e947b5279a2d88bca03ddff9f /cmd.c
parentcf49a6a00c19cabf4006d4f82bef26345043e7b5 (diff)
qemu-io: Don't use global bs in command implementations
Pass in the BlockDriverState to the command handlers instead of using the global variable. This is an important step to make the commands usable outside of qemu-io. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'cmd.c')
-rw-r--r--cmd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cmd.c b/cmd.c
index 214c6f757d..d501aabb0c 100644
--- a/cmd.c
+++ b/cmd.c
@@ -57,7 +57,7 @@ check_command(
const cmdinfo_t *ci)
{
if (check_func)
- return check_func(ci);
+ return check_func(qemuio_bs, ci);
return 1;
}
@@ -103,7 +103,7 @@ command(
return 0;
}
optind = 0;
- return ct->cfunc(argc, argv);
+ return ct->cfunc(qemuio_bs, argc, argv);
}
const cmdinfo_t *
@@ -452,6 +452,7 @@ static cmdinfo_t quit_cmd;
/* ARGSUSED */
static int
quit_f(
+ BlockDriverState *bs,
int argc,
char **argv)
{
@@ -490,6 +491,7 @@ help_all(void)
static int
help_f(
+ BlockDriverState *bs,
int argc,
char **argv)
{