blob: a418b46a409ebb8f15018323d34fa29cdfb5e737 [file] [log] [blame]
aliguorie3aff4f2009-04-05 19:14:04 +00001/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it would be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
Blue Swirl8167ee82009-07-16 20:47:01 +000015 * along with this program; if not, see <http://www.gnu.org/licenses/>.
aliguorie3aff4f2009-04-05 19:14:04 +000016 */
Kevin Wolf3d219942013-06-05 14:19:39 +020017
18#ifndef QEMU_IO_H
19#define QEMU_IO_H
aliguorie3aff4f2009-04-05 19:14:04 +000020
Kevin Wolf734c3b82013-06-05 14:19:30 +020021#include "qemu-common.h"
22
Kevin Wolf3d219942013-06-05 14:19:39 +020023#define CMD_FLAG_GLOBAL ((int)0x80000000) /* don't iterate "args" */
Kevin Wolf734c3b82013-06-05 14:19:30 +020024
25typedef int (*cfunc_t)(BlockDriverState *bs, int argc, char **argv);
aliguorie3aff4f2009-04-05 19:14:04 +000026typedef void (*helpfunc_t)(void);
27
28typedef struct cmdinfo {
Kevin Wolf3d219942013-06-05 14:19:39 +020029 const char* name;
30 const char* altname;
31 cfunc_t cfunc;
32 int argmin;
33 int argmax;
34 int canpush;
35 int flags;
36 const char *args;
37 const char *oneline;
38 helpfunc_t help;
aliguorie3aff4f2009-04-05 19:14:04 +000039} cmdinfo_t;
40
Kevin Wolf3d219942013-06-05 14:19:39 +020041bool qemuio_command(BlockDriverState *bs, const char *cmd);
aliguorie3aff4f2009-04-05 19:14:04 +000042
Kevin Wolf3d219942013-06-05 14:19:39 +020043void qemuio_add_command(const cmdinfo_t *ci);
Kevin Wolfc2cdf5c2013-06-05 14:19:36 +020044int qemuio_command_usage(const cmdinfo_t *ci);
aliguorie3aff4f2009-04-05 19:14:04 +000045
Kevin Wolf3d219942013-06-05 14:19:39 +020046#endif /* QEMU_IO_H */