if (vshCommandOptStringReq(ctl, cmd, "device", &disk) < 0)
goto cleanup;
- if ((rv = vshCommandOptULongLong(cmd, "total-bytes-sec", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "total-bytes-sec", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "read-bytes-sec", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "read-bytes-sec", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "write-bytes-sec", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "write-bytes-sec", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "total-bytes-sec-max", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "total-bytes-sec-max", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "read-bytes-sec-max", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "read-bytes-sec-max", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "write-bytes-sec-max", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "write-bytes-sec-max", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "total-iops-sec", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "total-iops-sec", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "read-iops-sec", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "read-iops-sec", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "write-iops-sec", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "write-iops-sec", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "write-iops-sec-max", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "write-iops-sec-max", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "read-iops-sec-max", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "read-iops-sec-max", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "total-iops-sec-max", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "total-iops-sec-max", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
goto save_error;
}
- if ((rv = vshCommandOptULongLong(cmd, "size-iops-sec", &value)) < 0) {
+ if ((rv = vshCommandOptULongLong(ctl, cmd, "size-iops-sec", &value)) < 0) {
goto interror;
} else if (rv > 0) {
if (virTypedParamsAddULLong(¶ms, &nparams, &maxparams,
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if ((rv = vshCommandOptInt(cmd, "weight", &weight)) < 0) {
+ if ((rv = vshCommandOptInt(ctl, cmd, "weight", &weight)) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"weight");
goto save_error;
}
- rv = vshCommandOptString(cmd, "device-weights", &device_weight);
+ rv = vshCommandOptString(ctl, cmd, "device-weights", &device_weight);
if (rv < 0) {
vshError(ctl, "%s", _("Unable to parse string parameter"));
goto cleanup;
goto save_error;
}
- rv = vshCommandOptString(cmd, "device-read-iops-sec", &device_riops);
+ rv = vshCommandOptString(ctl, cmd, "device-read-iops-sec", &device_riops);
if (rv < 0) {
vshError(ctl, "%s", _("Unable to parse string parameter"));
goto cleanup;
goto save_error;
}
- rv = vshCommandOptString(cmd, "device-write-iops-sec", &device_wiops);
+ rv = vshCommandOptString(ctl, cmd, "device-write-iops-sec", &device_wiops);
if (rv < 0) {
vshError(ctl, "%s", _("Unable to parse string parameter"));
goto cleanup;
goto save_error;
}
- rv = vshCommandOptString(cmd, "device-read-bytes-sec", &device_rbps);
+ rv = vshCommandOptString(ctl, cmd, "device-read-bytes-sec", &device_rbps);
if (rv < 0) {
vshError(ctl, "%s", _("Unable to parse string parameter"));
goto cleanup;
goto save_error;
}
- rv = vshCommandOptString(cmd, "device-write-bytes-sec", &device_wbps);
+ rv = vshCommandOptString(ctl, cmd, "device-write-bytes-sec", &device_wbps);
if (rv < 0) {
vshError(ctl, "%s", _("Unable to parse string parameter"));
goto cleanup;
if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0)
goto cleanup;
- if (vshCommandOptULWrap(cmd, "bandwidth", &bandwidth) < 0) {
+ if (vshCommandOptULWrap(ctl, cmd, "bandwidth", &bandwidth) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"bandwidth");
if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0)
return false;
- if (vshCommandOptString(cmd, "dest", &dest) < 0)
+ if (vshCommandOptString(ctl, cmd, "dest", &dest) < 0)
return false;
- if (vshCommandOptString(cmd, "xml", &xml) < 0)
+ if (vshCommandOptString(ctl, cmd, "xml", &xml) < 0)
return false;
- if (vshCommandOptString(cmd, "format", &format) < 0)
+ if (vshCommandOptString(ctl, cmd, "format", &format) < 0)
return false;
VSH_EXCLUSIVE_OPTIONS_VAR(dest, xml);
* MiB/s, and either reject negative input or treat it as 0 rather
* than trying to guess which value will work well across both
* APIs with their different sizes and scales. */
- if (vshCommandOptULWrap(cmd, "bandwidth", &bandwidth) < 0) {
+ if (vshCommandOptULWrap(ctl, cmd, "bandwidth", &bandwidth) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"bandwidth");
goto cleanup;
}
- if (vshCommandOptUInt(cmd, "granularity", &granularity) < 0) {
+ if (vshCommandOptUInt(ctl, cmd, "granularity", &granularity) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"granularity");
goto cleanup;
}
- if (vshCommandOptULongLong(cmd, "buf-size", &buf_size) < 0) {
+ if (vshCommandOptULongLong(ctl, cmd, "buf-size", &buf_size) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"buf-size");
if (vshCommandOptStringReq(ctl, cmd, "path", (const char **) &path) < 0)
return false;
- if (vshCommandOptScaledInt(cmd, "size", &size, 1024, ULLONG_MAX) < 0) {
+ if (vshCommandOptScaledInt(ctl, cmd, "size", &size, 1024, ULLONG_MAX) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"size");
if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
return false;
- if (vshCommandOptULongLong(cmd, "duration", &duration) < 0) {
+ if (vshCommandOptULongLong(ctl, cmd, "duration", &duration) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"duration");
size_t i;
size_t j;
- ignore_value(vshCommandOptString(cmd, "storage", &vol_string));
+ ignore_value(vshCommandOptString(ctl, cmd, "storage", &vol_string));
if (!(vol_string || remove_all_storage) && wipe_storage) {
vshError(ctl,
*nfdsret = 0;
*fdsret = NULL;
- if (vshCommandOptString(cmd, "pass-fds", &fdopt) <= 0)
+ if (vshCommandOptString(ctl, cmd, "pass-fds", &fdopt) <= 0)
return 0;
if (!(fdlist = virStringSplit(fdopt, ",", -1))) {
int ret = -1;
int rv;
- while ((opt = vshCommandOptArgv(cmd, opt))) {
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
set_field = vshStrdup(ctl, opt->data);
if (!(set_val = strchr(set_field, '='))) {
vshError(ctl, "%s", _("Invalid syntax for --set, "
goto out;
}
- if (vshCommandOptString(cmd, "format", &format)) {
+ if (vshCommandOptString(ctl, cmd, "format", &format)) {
if (STREQ(format, "kdump-zlib")) {
dumpformat = VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB;
} else if (STREQ(format, "kdump-lzo")) {
if (vshCommandOptStringReq(ctl, cmd, "file", (const char **) &file) < 0)
return false;
- if (vshCommandOptUInt(cmd, "screen", &screen) < 0) {
+ if (vshCommandOptUInt(ctl, cmd, "screen", &screen) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"screen");
if (!cpulist)
VSH_EXCLUSIVE_OPTIONS_VAR(live, config);
- if ((got_vcpu = vshCommandOptUInt(cmd, "vcpu", &vcpu)) < 0) {
+ if ((got_vcpu = vshCommandOptUInt(ctl, cmd, "vcpu", &vcpu)) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"vcpu");
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptInt(cmd, "count", &count) < 0 || count <= 0) {
+ if (vshCommandOptInt(ctl, cmd, "count", &count) < 0 || count <= 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"count");
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptUInt(cmd, "iothread", &iothread_id) < 0) {
+ if (vshCommandOptUInt(ctl, cmd, "iothread", &iothread_id) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"iothread");
goto cleanup;
}
- if (vshCommandOptString(cmd, "cpulist", &cpulist) < 0) {
+ if (vshCommandOptString(ctl, cmd, "cpulist", &cpulist) < 0) {
vshError(ctl, "%s", _("iothreadpin: invalid cpulist."));
goto cleanup;
}
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptInt(cmd, "id", &iothread_id) < 0) {
+ if (vshCommandOptInt(ctl, cmd, "id", &iothread_id) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"id");
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptInt(cmd, "id", &iothread_id) < 0) {
+ if (vshCommandOptInt(ctl, cmd, "id", &iothread_id) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"id");
show_total = vshCommandOptBool(cmd, "total");
- if ((rv = vshCommandOptInt(cmd, "start", &cpu)) < 0) {
+ if ((rv = vshCommandOptInt(ctl, cmd, "start", &cpu)) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"start");
show_per_cpu = true;
}
- if ((rv = vshCommandOptInt(cmd, "count", &show_count)) < 0) {
+ if ((rv = vshCommandOptInt(ctl, cmd, "count", &show_count)) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"count");
if ((state = vshDomainState(ctl, dom, NULL)) < 0)
goto cleanup;
- while ((opt = vshCommandOptArgv(cmd, opt))) {
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
if (pad)
virBufferAddChar(&buf, ' ');
pad = true;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptString(cmd, "codeset", &codeset_option) <= 0)
+ if (vshCommandOptString(ctl, cmd, "codeset", &codeset_option) <= 0)
codeset_option = "linux";
- if (vshCommandOptUInt(cmd, "holdtime", &holdtime) < 0) {
+ if (vshCommandOptUInt(ctl, cmd, "holdtime", &holdtime) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"holdtime");
goto cleanup;
}
- while ((opt = vshCommandOptArgv(cmd, opt))) {
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
if (count == VIR_DOMAIN_SEND_KEY_MAX_KEYS) {
vshError(ctl, _("too many keycodes"));
goto cleanup;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptLongLong(cmd, "pid", &pid_value) < 0) {
+ if (vshCommandOptLongLong(ctl, cmd, "pid", &pid_value) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"pid");
max = 1024ull * ULONG_MAX;
else
max = ULONG_MAX;
- if (vshCommandOptScaledInt(cmd, "size", &bytes, 1024, max) < 0) {
+ if (vshCommandOptScaledInt(ctl, cmd, "size", &bytes, 1024, max) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"size");
max = 1024ull * ULONG_MAX;
else
max = ULONG_MAX;
- if (vshCommandOptScaledInt(cmd, "size", &bytes, 1024, max) < 0) {
+ if (vshCommandOptScaledInt(ctl, cmd, "size", &bytes, 1024, max) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"size");
* <0 in all other cases
*/
static int
-vshMemtuneGetSize(const vshCmd *cmd, const char *name, long long *value)
+vshMemtuneGetSize(vshControl *ctl, const vshCmd *cmd, const char *name, long long *value)
{
int ret;
unsigned long long tmp;
const char *str;
char *end;
- ret = vshCommandOptString(cmd, name, &str);
+ ret = vshCommandOptString(ctl, cmd, name, &str);
if (ret <= 0)
return ret;
if (virStrToLong_ll(str, &end, 10, value) < 0)
return false;
#define PARSE_MEMTUNE_PARAM(NAME, FIELD) \
- if ((rc = vshMemtuneGetSize(cmd, NAME, &tmpVal)) < 0) { \
+ if ((rc = vshMemtuneGetSize(ctl, cmd, NAME, &tmpVal)) < 0) { \
vshError(ctl, _("Unable to parse integer parameter %s"), NAME); \
goto cleanup; \
} \
if (dom == NULL)
goto cleanup;
- while ((opt = vshCommandOptArgv(cmd, opt))) {
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
if (pad)
virBufferAddChar(&buf, ' ');
pad = true;
data.count = 0;
if (vshCommandOptTimeoutToMs(ctl, cmd, &timeout) < 0)
return false;
- if (vshCommandOptString(cmd, "event", &event) < 0)
+ if (vshCommandOptString(ctl, cmd, "event", &event) < 0)
return false;
if (vshCommandOptBool(cmd, "domain"))
unsigned int flags = 0;
unsigned int pid_value; /* API uses unsigned int, not pid_t */
- if (vshCommandOptUInt(cmd, "pid", &pid_value) <= 0) {
+ if (vshCommandOptUInt(ctl, cmd, "pid", &pid_value) <= 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"pid");
if (dom == NULL)
goto cleanup;
- while ((opt = vshCommandOptArgv(cmd, opt))) {
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
if (pad)
virBufferAddChar(&buf, ' ');
pad = true;
}
guest_agent_cmd = virBufferContentAndReset(&buf);
- judge = vshCommandOptInt(cmd, "timeout", &timeout);
+ judge = vshCommandOptInt(ctl, cmd, "timeout", &timeout);
if (judge < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
if (vshCommandOptBool(cmd, "noseclabel"))
setlabel = false;
- while ((opt = vshCommandOptArgv(cmd, opt))) {
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
if (VIR_EXPAND_N(cmdargv, ncmdargv, 1) < 0) {
vshError(ctl, _("%s: %d: failed to allocate argv"),
__FILE__, __LINE__);
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptLongLong(cmd, "downtime", &downtime) < 0) {
+ if (vshCommandOptLongLong(ctl, cmd, "downtime", &downtime) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"downtime");
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- rc = vshCommandOptULongLong(cmd, "size", &size);
+ rc = vshCommandOptULongLong(ctl, cmd, "size", &size);
if (rc < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptULWrap(cmd, "bandwidth", &bandwidth) < 0) {
+ if (vshCommandOptULWrap(ctl, cmd, "bandwidth", &bandwidth) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"bandwidth");
return true;
}
- if (vshCommandOptString(cmd, "event", &eventName) < 0)
+ if (vshCommandOptString(ctl, cmd, "event", &eventName) < 0)
return false;
if (eventName) {
for (event = 0; event < VIR_DOMAIN_EVENT_ID_LAST; event++)
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return ret;
- if (vshCommandOptULongLong(cmd, "minimum", &minimum) < 0) {
+ if (vshCommandOptULongLong(ctl, cmd, "minimum", &minimum) < 0) {
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"minimum");
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- while ((opt = vshCommandOptArgv(cmd, opt))) {
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
if (VIR_EXPAND_N(mountpoints, nmountpoints, 1) < 0) {
vshError(ctl, _("%s: %d: failed to allocate mountpoints"),
__FILE__, __LINE__);
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- while ((opt = vshCommandOptArgv(cmd, opt))) {
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
if (VIR_EXPAND_N(mountpoints, nmountpoints, 1) < 0) {
vshError(ctl, _("%s: %d: failed to allocate mountpoints"),
__FILE__, __LINE__);
{
const char *name = NULL;
- if (vshCommandOptString(cmd, "command", &name) <= 0) {
+ if (vshCommandOptString(ctl, cmd, "command", &name) <= 0) {
const vshCmdGrp *grp;
const vshCmdDef *def;
return false;
}
- if (vshCommandOptString(cmd, "dir", &dir) <= 0)
+ if (vshCommandOptString(ctl, cmd, "dir", &dir) <= 0)
dir = dir_malloced = virGetUserDirectory();
if (!dir)
dir = "/";
if (vshCommandOptBool(cmd, "xml"))
xml = true;
- while ((opt = vshCommandOptArgv(cmd, opt))) {
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
char *str;
virBuffer xmlbuf = VIR_BUFFER_INITIALIZER;
/**
* vshCommandOptInt:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* <0 in all other cases (@value untouched)
*/
int
-vshCommandOptInt(const vshCmd *cmd, const char *name, int *value)
+vshCommandOptInt(vshControl *ctl ATTRIBUTE_UNUSED, const vshCmd *cmd,
+ const char *name, int *value)
{
vshCmdOpt *arg;
int ret;
}
static int
-vshCommandOptUIntInternal(const vshCmd *cmd,
+vshCommandOptUIntInternal(vshControl *ctl ATTRIBUTE_UNUSED,
+ const vshCmd *cmd,
const char *name,
unsigned int *value,
bool wrap)
/**
* vshCommandOptUInt:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* See vshCommandOptInt()
*/
int
-vshCommandOptUInt(const vshCmd *cmd, const char *name, unsigned int *value)
+vshCommandOptUInt(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned int *value)
{
- return vshCommandOptUIntInternal(cmd, name, value, false);
+ return vshCommandOptUIntInternal(ctl, cmd, name, value, false);
}
/**
* vshCommandOptUIntWrap:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* See vshCommandOptInt()
*/
int
-vshCommandOptUIntWrap(const vshCmd *cmd, const char *name, unsigned int *value)
+vshCommandOptUIntWrap(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned int *value)
{
- return vshCommandOptUIntInternal(cmd, name, value, true);
+ return vshCommandOptUIntInternal(ctl, cmd, name, value, true);
}
static int
-vshCommandOptULInternal(const vshCmd *cmd,
+vshCommandOptULInternal(vshControl *ctl ATTRIBUTE_UNUSED,
+ const vshCmd *cmd,
const char *name,
unsigned long *value,
bool wrap)
/*
* vshCommandOptUL:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* See vshCommandOptInt()
*/
int
-vshCommandOptUL(const vshCmd *cmd, const char *name, unsigned long *value)
+vshCommandOptUL(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned long *value)
{
- return vshCommandOptULInternal(cmd, name, value, false);
+ return vshCommandOptULInternal(ctl, cmd, name, value, false);
}
/**
* vshCommandOptULWrap:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* See vshCommandOptInt()
*/
int
-vshCommandOptULWrap(const vshCmd *cmd, const char *name, unsigned long *value)
+vshCommandOptULWrap(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned long *value)
{
- return vshCommandOptULInternal(cmd, name, value, true);
+ return vshCommandOptULInternal(ctl, cmd, name, value, true);
}
/**
* vshCommandOptString:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* <0 in all other cases (@value untouched)
*/
int
-vshCommandOptString(const vshCmd *cmd, const char *name, const char **value)
+vshCommandOptString(vshControl *ctl ATTRIBUTE_UNUSED, const vshCmd *cmd,
+ const char *name, const char **value)
{
vshCmdOpt *arg;
int ret;
/**
* vshCommandOptLongLong:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* See vshCommandOptInt()
*/
int
-vshCommandOptLongLong(const vshCmd *cmd, const char *name,
- long long *value)
+vshCommandOptLongLong(vshControl *ctl ATTRIBUTE_UNUSED, const vshCmd *cmd,
+ const char *name, long long *value)
{
vshCmdOpt *arg;
int ret;
}
static int
-vshCommandOptULongLongInternal(const vshCmd *cmd,
+vshCommandOptULongLongInternal(vshControl *ctl ATTRIBUTE_UNUSED,
+ const vshCmd *cmd,
const char *name,
unsigned long long *value,
bool wrap)
/**
* vshCommandOptULongLong:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* See vshCommandOptInt()
*/
int
-vshCommandOptULongLong(const vshCmd *cmd, const char *name,
- unsigned long long *value)
+vshCommandOptULongLong(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned long long *value)
{
- return vshCommandOptULongLongInternal(cmd, name, value, false);
+ return vshCommandOptULongLongInternal(ctl, cmd, name, value, false);
}
/**
* vshCommandOptULongLongWrap:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* See vshCommandOptInt()
*/
int
-vshCommandOptULongLongWrap(const vshCmd *cmd, const char *name,
- unsigned long long *value)
+vshCommandOptULongLongWrap(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned long long *value)
{
- return vshCommandOptULongLongInternal(cmd, name, value, true);
+ return vshCommandOptULongLongInternal(ctl, cmd, name, value, true);
}
/**
* vshCommandOptScaledInt:
+ * @ctl virsh control structure
* @cmd command reference
* @name option name
* @value result
* See vshCommandOptInt()
*/
int
-vshCommandOptScaledInt(const vshCmd *cmd, const char *name,
- unsigned long long *value, int scale,
- unsigned long long max)
+vshCommandOptScaledInt(vshControl *ctl ATTRIBUTE_UNUSED, const vshCmd *cmd,
+ const char *name, unsigned long long *value,
+ int scale, unsigned long long max)
{
vshCmdOpt *arg;
char *end;
/**
* vshCommandOptArgv:
+ * @ctl virsh control structure
* @cmd command reference
* @opt starting point for the search
*
* list of supported options in CMD->def->opts.
*/
const vshCmdOpt *
-vshCommandOptArgv(const vshCmd *cmd, const vshCmdOpt *opt)
+vshCommandOptArgv(vshControl *ctl ATTRIBUTE_UNUSED, const vshCmd *cmd,
+ const vshCmdOpt *opt)
{
opt = opt ? opt->next : cmd->opts;
int ret;
unsigned int utimeout;
- if ((ret = vshCommandOptUInt(cmd, "timeout", &utimeout)) < 0)
+ if ((ret = vshCommandOptUInt(ctl, cmd, "timeout", &utimeout)) < 0)
vshError(ctl,
_("Numeric value for <%s> option is malformed or out of range"),
"timeout");
const vshCmdGrp *vshCmdGrpSearch(const char *grpname);
bool vshCmdGrpHelp(vshControl *ctl, const char *name);
-int vshCommandOptInt(const vshCmd *cmd, const char *name, int *value)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
-int vshCommandOptUInt(const vshCmd *cmd, const char *name,
- unsigned int *value)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
-int vshCommandOptUIntWrap(const vshCmd *cmd, const char *name,
- unsigned int *value)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
-int vshCommandOptUL(const vshCmd *cmd, const char *name,
- unsigned long *value)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
-int vshCommandOptULWrap(const vshCmd *cmd, const char *name,
- unsigned long *value)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
-int vshCommandOptString(const vshCmd *cmd, const char *name,
- const char **value)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptInt(vshControl *ctl, const vshCmd *cmd,
+ const char *name, int *value)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptUInt(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned int *value)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptUIntWrap(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned int *value)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptUL(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned long *value)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptULWrap(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned long *value)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptString(vshControl *ctl, const vshCmd *cmd,
+ const char *name, const char **value)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
int vshCommandOptStringReq(vshControl *ctl, const vshCmd *cmd,
const char *name, const char **value)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
-int vshCommandOptLongLong(const vshCmd *cmd, const char *name,
- long long *value)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
-int vshCommandOptULongLong(const vshCmd *cmd, const char *name,
- unsigned long long *value)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
-int vshCommandOptULongLongWrap(const vshCmd *cmd, const char *name,
- unsigned long long *value)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
-int vshCommandOptScaledInt(const vshCmd *cmd, const char *name,
- unsigned long long *value, int scale,
- unsigned long long max)
- ATTRIBUTE_NONNULL(3) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptLongLong(vshControl *ctl, const vshCmd *cmd,
+ const char *name, long long *value)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptULongLong(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned long long *value)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptULongLongWrap(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned long long *value)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
+int vshCommandOptScaledInt(vshControl *ctl, const vshCmd *cmd,
+ const char *name, unsigned long long *value,
+ int scale, unsigned long long max)
+ ATTRIBUTE_NONNULL(4) ATTRIBUTE_RETURN_CHECK;
bool vshCommandOptBool(const vshCmd *cmd, const char *name);
-const vshCmdOpt *vshCommandOptArgv(const vshCmd *cmd,
+const vshCmdOpt *vshCommandOptArgv(vshControl *ctl, const vshCmd *cmd,
const vshCmdOpt *opt);
int vshCommandOptTimeoutToMs(vshControl *ctl, const vshCmd *cmd, int *timeout);