*/
typedef struct {
const char *name;
- int (*handler) (vshControl *, vshCmd *); /* command handler */
+ int (*handler) (vshControl *, const vshCmd *); /* command handler */
const vshCmdOptDef *opts; /* definition of command options */
const vshCmdInfo *info; /* details about command */
} vshCmdDef;
static const vshCmdDef commands[];
-static void vshError(vshControl * ctl, int doexit, const char *format, ...)
+static void vshError(vshControl *ctl, int doexit, const char *format, ...)
ATTRIBUTE_FORMAT(printf, 3, 4);
-static int vshInit(vshControl * ctl);
-static int vshDeinit(vshControl * ctl);
-static void vshUsage(vshControl * ctl, const char *cmdname);
+static int vshInit(vshControl *ctl);
+static int vshDeinit(vshControl *ctl);
+static void vshUsage(vshControl *ctl, const char *cmdname);
static void vshOpenLogFile(vshControl *ctl);
static void vshOutputLogFile(vshControl *ctl, int log_level, const char *format, va_list ap);
static void vshCloseLogFile(vshControl *ctl);
-static int vshParseArgv(vshControl * ctl, int argc, char **argv);
+static int vshParseArgv(vshControl *ctl, int argc, char **argv);
-static const char *vshCmddefGetInfo(const vshCmdDef * cmd, const char *info);
+static const char *vshCmddefGetInfo(const vshCmdDef *cmd, const char *info);
static const vshCmdDef *vshCmddefSearch(const char *cmdname);
-static int vshCmddefHelp(vshControl * ctl, const char *name, int withprog);
+static int vshCmddefHelp(vshControl *ctl, const char *name, int withprog);
-static vshCmdOpt *vshCommandOpt(vshCmd * cmd, const char *name);
-static int vshCommandOptInt(vshCmd * cmd, const char *name, int *found);
-static char *vshCommandOptString(vshCmd * cmd, const char *name,
+static vshCmdOpt *vshCommandOpt(const vshCmd *cmd, const char *name);
+static int vshCommandOptInt(const vshCmd *cmd, const char *name, int *found);
+static char *vshCommandOptString(const vshCmd *cmd, const char *name,
int *found);
#if 0
-static int vshCommandOptStringList(vshCmd * cmd, const char *name, char ***data);
+static int vshCommandOptStringList(const vshCmd *cmd, const char *name, char ***data);
#endif
-static int vshCommandOptBool(vshCmd * cmd, const char *name);
+static int vshCommandOptBool(const vshCmd *cmd, const char *name);
#define VSH_BYID (1 << 1)
#define VSH_BYUUID (1 << 2)
#define VSH_BYNAME (1 << 3)
-static virDomainPtr vshCommandOptDomainBy(vshControl * ctl, vshCmd * cmd,
+static virDomainPtr vshCommandOptDomainBy(vshControl *ctl, const vshCmd *cmd,
const char *optname, char **name, int flag);
/* default is lookup by Id, Name and UUID */
vshCommandOptDomainBy(_ctl, _cmd, _optname, _name, \
VSH_BYID|VSH_BYUUID|VSH_BYNAME)
-static virNetworkPtr vshCommandOptNetworkBy(vshControl * ctl, vshCmd * cmd,
+static virNetworkPtr vshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd,
const char *optname, char **name, int flag);
/* default is lookup by Name and UUID */
vshCommandOptNetworkBy(_ctl, _cmd, _optname, _name, \
VSH_BYUUID|VSH_BYNAME)
-static virStoragePoolPtr vshCommandOptPoolBy(vshControl * ctl, vshCmd * cmd,
+static virStoragePoolPtr vshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd,
const char *optname, char **name, int flag);
/* default is lookup by Name and UUID */
vshCommandOptPoolBy(_ctl, _cmd, _optname, _name, \
VSH_BYUUID|VSH_BYNAME)
-static virStorageVolPtr vshCommandOptVolBy(vshControl * ctl, vshCmd * cmd,
+static virStorageVolPtr vshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
const char *optname,
const char *pooloptname,
char **name, int flag);
vshCommandOptVolBy(_ctl, _cmd, _optname, _pooloptname, _name, \
VSH_BYUUID|VSH_BYNAME)
-static void vshPrintExtra(vshControl * ctl, const char *format, ...)
+static void vshPrintExtra(vshControl *ctl, const char *format, ...)
ATTRIBUTE_FORMAT(printf, 2, 3);
-static void vshDebug(vshControl * ctl, int level, const char *format, ...)
+static void vshDebug(vshControl *ctl, int level, const char *format, ...)
ATTRIBUTE_FORMAT(printf, 3, 4);
/* XXX: add batch support */
static const char *vshDomainStateToString(int state);
static const char *vshDomainVcpuStateToString(int state);
-static int vshConnectionUsability(vshControl * ctl, virConnectPtr conn,
+static int vshConnectionUsability(vshControl *ctl, virConnectPtr conn,
int showerror);
-static void *_vshMalloc(vshControl * ctl, size_t sz, const char *filename, int line);
+static void *_vshMalloc(vshControl *ctl, size_t sz, const char *filename, int line);
#define vshMalloc(_ctl, _sz) _vshMalloc(_ctl, _sz, __FILE__, __LINE__)
-static void *_vshCalloc(vshControl * ctl, size_t nmemb, size_t sz, const char *filename, int line);
+static void *_vshCalloc(vshControl *ctl, size_t nmemb, size_t sz, const char *filename, int line);
#define vshCalloc(_ctl, _nmemb, _sz) _vshCalloc(_ctl, _nmemb, _sz, __FILE__, __LINE__)
-static void *_vshRealloc(vshControl * ctl, void *ptr, size_t sz, const char *filename, int line);
+static void *_vshRealloc(vshControl *ctl, void *ptr, size_t sz, const char *filename, int line);
#define vshRealloc(_ctl, _ptr, _sz) _vshRealloc(_ctl, _ptr, _sz, __FILE__, __LINE__)
-static char *_vshStrdup(vshControl * ctl, const char *s, const char *filename, int line);
+static char *_vshStrdup(vshControl *ctl, const char *s, const char *filename, int line);
#define vshStrdup(_ctl, _s) _vshStrdup(_ctl, _s, __FILE__, __LINE__)
};
static int
-cmdHelp(vshControl * ctl, vshCmd * cmd)
+cmdHelp(vshControl *ctl, const vshCmd *cmd)
{
const char *cmdname = vshCommandOptString(cmd, "command", NULL);
};
static int
-cmdAutostart(vshControl * ctl, vshCmd * cmd)
+cmdAutostart(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *name;
};
static int
-cmdConnect(vshControl * ctl, vshCmd * cmd)
+cmdConnect(vshControl *ctl, const vshCmd *cmd)
{
int ro = vshCommandOptBool(cmd, "readonly");
#ifndef __MINGW32__
static int
-cmdConsole(vshControl * ctl, vshCmd * cmd)
+cmdConsole(vshControl *ctl, const vshCmd *cmd)
{
xmlDocPtr xml = NULL;
xmlXPathObjectPtr obj = NULL;
#else /* __MINGW32__ */
static int
-cmdConsole(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
+cmdConsole(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
vshError (ctl, FALSE, "%s", _("console not implemented on this platform"));
return FALSE;
static int
-cmdList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
+cmdList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
int inactive = vshCommandOptBool(cmd, "inactive");
int all = vshCommandOptBool(cmd, "all");
};
static int
-cmdDomstate(vshControl * ctl, vshCmd * cmd)
+cmdDomstate(vshControl *ctl, const vshCmd *cmd)
{
virDomainInfo info;
virDomainPtr dom;
};
static int
-cmdDomblkstat (vshControl *ctl, vshCmd *cmd)
+cmdDomblkstat (vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *name, *device;
};
static int
-cmdDomIfstat (vshControl *ctl, vshCmd *cmd)
+cmdDomIfstat (vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *name, *device;
};
static int
-cmdSuspend(vshControl * ctl, vshCmd * cmd)
+cmdSuspend(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *name;
};
static int
-cmdCreate(vshControl * ctl, vshCmd * cmd)
+cmdCreate(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *from;
};
static int
-cmdDefine(vshControl * ctl, vshCmd * cmd)
+cmdDefine(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *from;
};
static int
-cmdUndefine(vshControl * ctl, vshCmd * cmd)
+cmdUndefine(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
int ret = TRUE;
};
static int
-cmdStart(vshControl * ctl, vshCmd * cmd)
+cmdStart(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
int ret = TRUE;
};
static int
-cmdSave(vshControl * ctl, vshCmd * cmd)
+cmdSave(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *name;
};
static int
-cmdSchedinfo(vshControl * ctl, vshCmd * cmd)
+cmdSchedinfo(vshControl *ctl, const vshCmd *cmd)
{
char *schedulertype;
virDomainPtr dom;
};
static int
-cmdRestore(vshControl * ctl, vshCmd * cmd)
+cmdRestore(vshControl *ctl, const vshCmd *cmd)
{
char *from;
int found;
};
static int
-cmdDump(vshControl * ctl, vshCmd * cmd)
+cmdDump(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *name;
};
static int
-cmdResume(vshControl * ctl, vshCmd * cmd)
+cmdResume(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
int ret = TRUE;
};
static int
-cmdShutdown(vshControl * ctl, vshCmd * cmd)
+cmdShutdown(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
int ret = TRUE;
};
static int
-cmdReboot(vshControl * ctl, vshCmd * cmd)
+cmdReboot(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
int ret = TRUE;
};
static int
-cmdDestroy(vshControl * ctl, vshCmd * cmd)
+cmdDestroy(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
int ret = TRUE;
};
static int
-cmdDominfo(vshControl * ctl, vshCmd * cmd)
+cmdDominfo(vshControl *ctl, const vshCmd *cmd)
{
virDomainInfo info;
virDomainPtr dom;
};
static int
-cmdFreecell(vshControl * ctl, vshCmd * cmd)
+cmdFreecell(vshControl *ctl, const vshCmd *cmd)
{
int ret;
int cell, cell_given;
};
static int
-cmdVcpuinfo(vshControl * ctl, vshCmd * cmd)
+cmdVcpuinfo(vshControl *ctl, const vshCmd *cmd)
{
virDomainInfo info;
virDomainPtr dom;
};
static int
-cmdVcpupin(vshControl * ctl, vshCmd * cmd)
+cmdVcpupin(vshControl *ctl, const vshCmd *cmd)
{
virDomainInfo info;
virDomainPtr dom;
};
static int
-cmdSetvcpus(vshControl * ctl, vshCmd * cmd)
+cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
int count;
};
static int
-cmdSetmem(vshControl * ctl, vshCmd * cmd)
+cmdSetmem(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
virDomainInfo info;
};
static int
-cmdSetmaxmem(vshControl * ctl, vshCmd * cmd)
+cmdSetmaxmem(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
virDomainInfo info;
};
static int
-cmdNodeinfo(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
+cmdNodeinfo(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
virNodeInfo info;
};
static int
-cmdCapabilities (vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
+cmdCapabilities (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
char *caps;
};
static int
-cmdDumpXML(vshControl * ctl, vshCmd * cmd)
+cmdDumpXML(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
int ret = TRUE;
};
static int
-cmdDomname(vshControl * ctl, vshCmd * cmd)
+cmdDomname(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
};
static int
-cmdDomid(vshControl * ctl, vshCmd * cmd)
+cmdDomid(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
unsigned int id;
};
static int
-cmdDomuuid(vshControl * ctl, vshCmd * cmd)
+cmdDomuuid(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char uuid[VIR_UUID_STRING_BUFLEN];
};
static int
-cmdMigrate (vshControl *ctl, vshCmd *cmd)
+cmdMigrate (vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom = NULL;
const char *desturi;
};
static int
-cmdNetworkAutostart(vshControl * ctl, vshCmd * cmd)
+cmdNetworkAutostart(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
char *name;
};
static int
-cmdNetworkCreate(vshControl * ctl, vshCmd * cmd)
+cmdNetworkCreate(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
char *from;
};
static int
-cmdNetworkDefine(vshControl * ctl, vshCmd * cmd)
+cmdNetworkDefine(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
char *from;
};
static int
-cmdNetworkDestroy(vshControl * ctl, vshCmd * cmd)
+cmdNetworkDestroy(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
int ret = TRUE;
};
static int
-cmdNetworkDumpXML(vshControl * ctl, vshCmd * cmd)
+cmdNetworkDumpXML(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
int ret = TRUE;
};
static int
-cmdNetworkList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
+cmdNetworkList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
int inactive = vshCommandOptBool(cmd, "inactive");
int all = vshCommandOptBool(cmd, "all");
};
static int
-cmdNetworkName(vshControl * ctl, vshCmd * cmd)
+cmdNetworkName(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
};
static int
-cmdNetworkStart(vshControl * ctl, vshCmd * cmd)
+cmdNetworkStart(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
int ret = TRUE;
};
static int
-cmdNetworkUndefine(vshControl * ctl, vshCmd * cmd)
+cmdNetworkUndefine(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
int ret = TRUE;
};
static int
-cmdNetworkUuid(vshControl * ctl, vshCmd * cmd)
+cmdNetworkUuid(vshControl *ctl, const vshCmd *cmd)
{
virNetworkPtr network;
char uuid[VIR_UUID_STRING_BUFLEN];
};
static int
-cmdPoolAutostart(vshControl * ctl, vshCmd * cmd)
+cmdPoolAutostart(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
char *name;
};
static int
-cmdPoolCreate(vshControl * ctl, vshCmd * cmd)
+cmdPoolCreate(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
char *from;
static int
-cmdPoolCreateAs(vshControl * ctl, vshCmd * cmd)
+cmdPoolCreateAs(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
int found;
};
static int
-cmdPoolDefine(vshControl * ctl, vshCmd * cmd)
+cmdPoolDefine(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
char *from;
static int
-cmdPoolDefineAs(vshControl * ctl, vshCmd * cmd)
+cmdPoolDefineAs(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
int found;
};
static int
-cmdPoolBuild(vshControl * ctl, vshCmd * cmd)
+cmdPoolBuild(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
int ret = TRUE;
};
static int
-cmdPoolDestroy(vshControl * ctl, vshCmd * cmd)
+cmdPoolDestroy(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
int ret = TRUE;
};
static int
-cmdPoolDelete(vshControl * ctl, vshCmd * cmd)
+cmdPoolDelete(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
int ret = TRUE;
};
static int
-cmdPoolRefresh(vshControl * ctl, vshCmd * cmd)
+cmdPoolRefresh(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
int ret = TRUE;
};
static int
-cmdPoolDumpXML(vshControl * ctl, vshCmd * cmd)
+cmdPoolDumpXML(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
int ret = TRUE;
};
static int
-cmdPoolList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
+cmdPoolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
int inactive = vshCommandOptBool(cmd, "inactive");
int all = vshCommandOptBool(cmd, "all");
};
static int
-cmdPoolInfo(vshControl * ctl, vshCmd * cmd)
+cmdPoolInfo(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolInfo info;
virStoragePoolPtr pool;
};
static int
-cmdPoolName(vshControl * ctl, vshCmd * cmd)
+cmdPoolName(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
};
static int
-cmdPoolStart(vshControl * ctl, vshCmd * cmd)
+cmdPoolStart(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
int ret = TRUE;
}
static int
-cmdVolCreateAs(vshControl * ctl, vshCmd * cmd)
+cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
virStorageVolPtr vol;
};
static int
-cmdPoolUndefine(vshControl * ctl, vshCmd * cmd)
+cmdPoolUndefine(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
int ret = TRUE;
};
static int
-cmdPoolUuid(vshControl * ctl, vshCmd * cmd)
+cmdPoolUuid(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
char uuid[VIR_UUID_STRING_BUFLEN];
};
static int
-cmdVolCreate(vshControl * ctl, vshCmd * cmd)
+cmdVolCreate(vshControl *ctl, const vshCmd *cmd)
{
virStoragePoolPtr pool;
virStorageVolPtr vol;
};
static int
-cmdVolDelete(vshControl * ctl, vshCmd * cmd)
+cmdVolDelete(vshControl *ctl, const vshCmd *cmd)
{
virStorageVolPtr vol;
int ret = TRUE;
};
static int
-cmdVolInfo(vshControl * ctl, vshCmd * cmd)
+cmdVolInfo(vshControl *ctl, const vshCmd *cmd)
{
virStorageVolInfo info;
virStorageVolPtr vol;
};
static int
-cmdVolDumpXML(vshControl * ctl, vshCmd * cmd)
+cmdVolDumpXML(vshControl *ctl, const vshCmd *cmd)
{
virStorageVolPtr vol;
int ret = TRUE;
};
static int
-cmdVolList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
+cmdVolList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
virStoragePoolPtr pool;
int maxactive = 0, i;
};
static int
-cmdVolName(vshControl * ctl, vshCmd * cmd)
+cmdVolName(vshControl *ctl, const vshCmd *cmd)
{
virStorageVolPtr vol;
};
static int
-cmdVolKey(vshControl * ctl, vshCmd * cmd)
+cmdVolKey(vshControl *ctl, const vshCmd *cmd)
{
virStorageVolPtr vol;
};
static int
-cmdVolPath(vshControl * ctl, vshCmd * cmd)
+cmdVolPath(vshControl *ctl, const vshCmd *cmd)
{
virStorageVolPtr vol;
static int
-cmdVersion(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
+cmdVersion(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
unsigned long hvVersion;
const char *hvType;
};
static int
-cmdHostname (vshControl *ctl, vshCmd *cmd ATTRIBUTE_UNUSED)
+cmdHostname (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
char *hostname;
};
static int
-cmdURI (vshControl *ctl, vshCmd *cmd ATTRIBUTE_UNUSED)
+cmdURI (vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
char *uri;
};
static int
-cmdVNCDisplay(vshControl * ctl, vshCmd * cmd)
+cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd)
{
xmlDocPtr xml = NULL;
xmlXPathObjectPtr obj = NULL;
};
static int
-cmdTTYConsole(vshControl * ctl, vshCmd * cmd)
+cmdTTYConsole(vshControl *ctl, const vshCmd *cmd)
{
xmlDocPtr xml = NULL;
xmlXPathObjectPtr obj = NULL;
};
static int
-cmdAttachDevice(vshControl * ctl, vshCmd * cmd)
+cmdAttachDevice(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *from;
};
static int
-cmdDetachDevice(vshControl * ctl, vshCmd * cmd)
+cmdDetachDevice(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom;
char *from;
};
static int
-cmdAttachInterface(vshControl * ctl, vshCmd * cmd)
+cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom = NULL;
char *mac, *target, *script, *type, *source;
};
static int
-cmdDetachInterface(vshControl * ctl, vshCmd * cmd)
+cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom = NULL;
xmlDocPtr xml = NULL;
};
static int
-cmdAttachDisk(vshControl * ctl, vshCmd * cmd)
+cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
{
virDomainPtr dom = NULL;
char *source, *target, *driver, *subdriver, *type, *mode;
};
static int
-cmdDetachDisk(vshControl * ctl, vshCmd * cmd)
+cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
{
xmlDocPtr xml = NULL;
xmlXPathObjectPtr obj=NULL;
};
static int
-cmdQuit(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED)
+cmdQuit(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
{
ctl->imode = FALSE;
return TRUE;
* Checks for required options
*/
static int
-vshCommandCheckOpts(vshControl * ctl, const vshCmd * cmd)
+vshCommandCheckOpts(vshControl *ctl, const vshCmd *cmd)
{
const vshCmdDef *def = cmd->def;
const vshCmdOptDef *d;
}
static int
-vshCmddefHelp(vshControl * ctl, const char *cmdname, int withprog)
+vshCmddefHelp(vshControl *ctl, const char *cmdname, int withprog)
{
const vshCmdDef *def = vshCmddefSearch(cmdname);
}
static void
-vshCommandFree(vshCmd * cmd)
+vshCommandFree(vshCmd *cmd)
{
vshCmd *c = cmd;
* Returns option by name
*/
static vshCmdOpt *
-vshCommandOpt(vshCmd * cmd, const char *name)
+vshCommandOpt(const vshCmd *cmd, const char *name)
{
vshCmdOpt *opt = cmd->opts;
* Returns option as INT
*/
static int
-vshCommandOptInt(vshCmd * cmd, const char *name, int *found)
+vshCommandOptInt(const vshCmd *cmd, const char *name, int *found)
{
vshCmdOpt *arg = vshCommandOpt(cmd, name);
int res = 0, num_found = FALSE;
* Returns option as STRING
*/
static char *
-vshCommandOptString(vshCmd * cmd, const char *name, int *found)
+vshCommandOptString(const vshCmd *cmd, const char *name, int *found)
{
vshCmdOpt *arg = vshCommandOpt(cmd, name);
#if 0
static int
-vshCommandOptStringList(vshCmd * cmd, const char *name, char ***data)
+vshCommandOptStringList(const vshCmd *cmd, const char *name, char ***data)
{
vshCmdOpt *arg = cmd->opts;
char **val = NULL;
* Returns TRUE/FALSE if the option exists
*/
static int
-vshCommandOptBool(vshCmd * cmd, const char *name)
+vshCommandOptBool(const vshCmd *cmd, const char *name)
{
return vshCommandOpt(cmd, name) ? TRUE : FALSE;
}
static virDomainPtr
-vshCommandOptDomainBy(vshControl * ctl, vshCmd * cmd, const char *optname,
+vshCommandOptDomainBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
char **name, int flag)
{
virDomainPtr dom = NULL;
}
static virNetworkPtr
-vshCommandOptNetworkBy(vshControl * ctl, vshCmd * cmd, const char *optname,
+vshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
char **name, int flag)
{
virNetworkPtr network = NULL;
}
static virStoragePoolPtr
-vshCommandOptPoolBy(vshControl * ctl, vshCmd * cmd, const char *optname,
+vshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname,
char **name, int flag)
{
virStoragePoolPtr pool = NULL;
}
static virStorageVolPtr
-vshCommandOptVolBy(vshControl * ctl, vshCmd * cmd,
+vshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd,
const char *optname,
const char *pooloptname,
char **name, int flag)
* Executes command(s) and returns return code from last command
*/
static int
-vshCommandRun(vshControl * ctl, vshCmd * cmd)
+vshCommandRun(vshControl *ctl, const vshCmd *cmd)
{
int ret = TRUE;
#define VSH_TK_END 3
static int
-vshCommandGetToken(vshControl * ctl, char *str, char **end, char **res)
+vshCommandGetToken(vshControl *ctl, char *str, char **end, char **res)
{
int tk = VSH_TK_NONE;
int quote = FALSE;
}
static int
-vshCommandParse(vshControl * ctl, char *cmdstr)
+vshCommandParse(vshControl *ctl, char *cmdstr)
{
char *str;
char *tkdata = NULL;
}
static int
-vshConnectionUsability(vshControl * ctl, virConnectPtr conn, int showerror)
+vshConnectionUsability(vshControl *ctl, virConnectPtr conn, int showerror)
{
/* TODO: use something like virConnectionState() to
* check usability of the connection
}
static void
-vshDebug(vshControl * ctl, int level, const char *format, ...)
+vshDebug(vshControl *ctl, int level, const char *format, ...)
{
va_list ap;
}
static void
-vshPrintExtra(vshControl * ctl, const char *format, ...)
+vshPrintExtra(vshControl *ctl, const char *format, ...)
{
va_list ap;
static void
-vshError(vshControl * ctl, int doexit, const char *format, ...)
+vshError(vshControl *ctl, int doexit, const char *format, ...)
{
va_list ap;
}
static void *
-_vshMalloc(vshControl * ctl, size_t size, const char *filename, int line)
+_vshMalloc(vshControl *ctl, size_t size, const char *filename, int line)
{
void *x;
}
static void *
-_vshCalloc(vshControl * ctl, size_t nmemb, size_t size, const char *filename, int line)
+_vshCalloc(vshControl *ctl, size_t nmemb, size_t size, const char *filename, int line)
{
void *x;
}
static void *
-_vshRealloc(vshControl * ctl, void *ptr, size_t size, const char *filename, int line)
+_vshRealloc(vshControl *ctl, void *ptr, size_t size, const char *filename, int line)
{
void *x;
}
static char *
-_vshStrdup(vshControl * ctl, const char *s, const char *filename, int line)
+_vshStrdup(vshControl *ctl, const char *s, const char *filename, int line)
{
char *x;
* Initialize connection.
*/
static int
-vshInit(vshControl * ctl)
+vshInit(vshControl *ctl)
{
if (ctl->conn)
return FALSE;
* Deinitialize virsh
*/
static int
-vshDeinit(vshControl * ctl)
+vshDeinit(vshControl *ctl)
{
vshCloseLogFile(ctl);
free(ctl->name);
* Print usage
*/
static void
-vshUsage(vshControl * ctl, const char *cmdname)
+vshUsage(vshControl *ctl, const char *cmdname)
{
const vshCmdDef *cmd;
*
*/
static int
-vshParseArgv(vshControl * ctl, int argc, char **argv)
+vshParseArgv(vshControl *ctl, int argc, char **argv)
{
char *last = NULL;
int i, end = 0, help = 0;