Shorten the function name as there isn't any vshCommandOptString.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "backupxml", &backup_from) < 0)
+ if (vshCommandOptString(ctl, cmd, "backupxml", &backup_from) < 0)
return false;
if (!backup_from) {
}
}
- if (vshCommandOptStringReq(ctl, cmd, "checkpointxml", &check_from) < 0)
+ if (vshCommandOptString(ctl, cmd, "checkpointxml", &check_from) < 0)
return false;
if (check_from) {
if (virFileReadAll(check_from, VSH_MAX_XML_FILE, &check_buffer) < 0) {
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "xmlfile", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "xmlfile", &from) < 0)
return false;
if (!from) {
buffer = g_strdup("<domaincheckpoint/>");
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "description", &desc) < 0)
+ if (vshCommandOptString(ctl, cmd, "name", &name) < 0 ||
+ vshCommandOptString(ctl, cmd, "description", &desc) < 0)
return false;
virBufferAddLit(&buf, "<domaincheckpoint>\n");
{
const char *chkname = NULL;
- if (vshCommandOptStringReq(ctl, cmd, arg, &chkname) < 0)
+ if (vshCommandOptString(ctl, cmd, arg, &chkname) < 0)
return -1;
if (!(*chk = virDomainCheckpointLookupByName(dom, chkname, 0)))
if (virshDomainGetXML(ctl, cmd, flags, &xml, &ctxt) < 0)
return NULL;
- if (vshCommandOptStringReq(ctl, cmd, "interface", &iface) < 0)
+ if (vshCommandOptString(ctl, cmd, "interface", &iface) < 0)
return NULL;
/* normalize the mac addr */
virCheckFlags(0, NULL);
- if (vshCommandOptStringReq(ctl, cmd, "virttype", &virttype) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "emulator", &emulator) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "arch", &arch) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "machine", &machine) < 0)
+ if (vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
+ vshCommandOptString(ctl, cmd, "emulator", &emulator) < 0 ||
+ vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||
+ vshCommandOptString(ctl, cmd, "machine", &machine) < 0)
return NULL;
if (!priv->conn || virConnectIsAlive(priv->conn) <= 0)
return true;
}
- if (vshCommandOptStringReq(ctl, cmd, "event", &eventName) < 0)
+ if (vshCommandOptString(ctl, cmd, "event", &eventName) < 0)
return false;
if (!eventName && !all) {
int ninterfaces;
unsigned int flags = 0;
- if (vshCommandOptStringReq(ctl, cmd, "interface", &iface) < 0)
+ if (vshCommandOptString(ctl, cmd, "interface", &iface) < 0)
return false;
if (vshCommandOptBool(cmd, "config"))
string to denote 'all devices'. A NULL device arg would violate
API contract.
*/
- if (vshCommandOptStringReq(ctl, cmd, "device", &device) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &device) < 0)
return false;
if (!device)
if (!(dom = virshCommandOptDomain(ctl, cmd, &name)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "interface", &device) < 0)
+ if (vshCommandOptString(ctl, cmd, "interface", &device) < 0)
return false;
if (virDomainInterfaceStats(dom, device, &stats, sizeof(stats)) == -1) {
const char *sourcestr = NULL;
int source = VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE;
- if (vshCommandOptStringReq(ctl, cmd, "interface", &ifacestr) < 0)
+ if (vshCommandOptString(ctl, cmd, "interface", &ifacestr) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "source", &sourcestr) < 0)
+ if (vshCommandOptString(ctl, cmd, "source", &sourcestr) < 0)
return false;
if (sourcestr &&
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (persistent &&
if (live)
flags |= VIR_DOMAIN_AFFECT_LIVE;
- if (vshCommandOptStringReq(ctl, cmd, "source", &source) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "target", &target) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "driver", &driver) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "subdriver", &subdriver) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "type", &device) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "mode", &mode) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "iothread", &iothread) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "cache", &cache) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "io", &io) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "serial", &serial) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "wwn", &wwn) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "address", &straddr) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "targetbus", &targetbus) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "alias", &alias) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "sourcetype", &stype) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-protocol", &source_protocol) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-host-name", &host_name) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-host-transport", &host_transport) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-host-socket", &host_socket) < 0)
+ if (vshCommandOptString(ctl, cmd, "source", &source) < 0 ||
+ vshCommandOptString(ctl, cmd, "target", &target) < 0 ||
+ vshCommandOptString(ctl, cmd, "driver", &driver) < 0 ||
+ vshCommandOptString(ctl, cmd, "subdriver", &subdriver) < 0 ||
+ vshCommandOptString(ctl, cmd, "type", &device) < 0 ||
+ vshCommandOptString(ctl, cmd, "mode", &mode) < 0 ||
+ vshCommandOptString(ctl, cmd, "iothread", &iothread) < 0 ||
+ vshCommandOptString(ctl, cmd, "cache", &cache) < 0 ||
+ vshCommandOptString(ctl, cmd, "io", &io) < 0 ||
+ vshCommandOptString(ctl, cmd, "serial", &serial) < 0 ||
+ vshCommandOptString(ctl, cmd, "wwn", &wwn) < 0 ||
+ vshCommandOptString(ctl, cmd, "address", &straddr) < 0 ||
+ vshCommandOptString(ctl, cmd, "targetbus", &targetbus) < 0 ||
+ vshCommandOptString(ctl, cmd, "alias", &alias) < 0 ||
+ vshCommandOptString(ctl, cmd, "sourcetype", &stype) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-protocol", &source_protocol) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-host-name", &host_name) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-host-transport", &host_transport) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-host-socket", &host_socket) < 0)
return false;
if (stype &&
if (live)
flags |= VIR_DOMAIN_AFFECT_LIVE;
- if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source", &source) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "target", &target) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "mac", &mac) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "script", &script) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "model", &model) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "alias", &alias) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "inbound", &inboundStr) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "outbound", &outboundStr) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-mode", &sourceModeStr) < 0)
+ if (vshCommandOptString(ctl, cmd, "type", &type) < 0 ||
+ vshCommandOptString(ctl, cmd, "source", &source) < 0 ||
+ vshCommandOptString(ctl, cmd, "target", &target) < 0 ||
+ vshCommandOptString(ctl, cmd, "mac", &mac) < 0 ||
+ vshCommandOptString(ctl, cmd, "script", &script) < 0 ||
+ vshCommandOptString(ctl, cmd, "model", &model) < 0 ||
+ vshCommandOptString(ctl, cmd, "alias", &alias) < 0 ||
+ vshCommandOptString(ctl, cmd, "inbound", &inboundStr) < 0 ||
+ vshCommandOptString(ctl, cmd, "outbound", &outboundStr) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-mode", &sourceModeStr) < 0)
return false;
/* check interface type */
if (!(dom = virshCommandOptDomain(ctl, cmd, &name)))
goto cleanup;
- if (vshCommandOptStringReq(ctl, cmd, "device", &disk) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &disk) < 0)
goto cleanup;
#define VSH_ADD_IOTUNE_SCALED(PARAM, CONST) \
VSH_ADD_IOTUNE(write-iops-sec-max-length, WRITE_IOPS_SEC_MAX_LENGTH);
#undef VSH_ADD_IOTUNE
- if (vshCommandOptStringReq(ctl, cmd, "group-name", &group_name) < 0) {
+ if (vshCommandOptString(ctl, cmd, "group-name", &group_name) < 0) {
vshError(ctl, "%s", _("Unable to parse group-name parameter"));
goto cleanup;
}
VSH_EXCLUSIVE_OPTIONS("pivot", "keep-overlay");
- if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0)
+ if (vshCommandOptString(ctl, cmd, "path", &path) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "base", &base) < 0)
+ if (vshCommandOptString(ctl, cmd, "base", &base) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "top", &top) < 0)
+ if (vshCommandOptString(ctl, cmd, "top", &top) < 0)
return false;
if (vshBlockJobOptionBandwidth(ctl, cmd, bytes, &bandwidth) < 0)
virshBlockJobWaitData *bjWait = NULL;
int nparams = 0;
- if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0)
+ if (vshCommandOptString(ctl, cmd, "path", &path) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "dest", &dest) < 0)
+ if (vshCommandOptString(ctl, cmd, "dest", &dest) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "xml", &xml) < 0)
+ if (vshCommandOptString(ctl, cmd, "xml", &xml) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "format", &format) < 0)
+ if (vshCommandOptString(ctl, cmd, "format", &format) < 0)
return false;
if (vshBlockJobOptionBandwidth(ctl, cmd, bytes, &bandwidth) < 0)
return false;
return false;
/* XXX Allow path to be optional to list info on all devices at once */
- if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0)
+ if (vshCommandOptString(ctl, cmd, "path", &path) < 0)
return false;
if (bandwidth)
VSH_REQUIRE_OPTION("verbose", "wait");
VSH_REQUIRE_OPTION("async", "wait");
- if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0)
+ if (vshCommandOptString(ctl, cmd, "path", &path) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "base", &base) < 0)
+ if (vshCommandOptString(ctl, cmd, "base", &base) < 0)
return false;
if (vshBlockJobOptionBandwidth(ctl, cmd, bytes, &bandwidth) < 0)
VSH_ALTERNATIVE_OPTIONS("size", "capacity");
- if (vshCommandOptStringReq(ctl, cmd, "path", (const char **) &path) < 0)
+ if (vshCommandOptString(ctl, cmd, "path", (const char **) &path) < 0)
return false;
if (vshCommandOptScaledInt(ctl, cmd, "size", &size, 1024, ULLONG_MAX) < 0)
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "devname", &name) < 0) /* sc_prohibit_devname */
+ if (vshCommandOptString(ctl, cmd, "devname", &name) < 0) /* sc_prohibit_devname */
return false;
if (force)
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "interface", &iface) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "state", &state) < 0)
+ if (vshCommandOptString(ctl, cmd, "interface", &iface) < 0 ||
+ vshCommandOptString(ctl, cmd, "state", &state) < 0)
return false;
if (STRNEQ(state, "up") && STRNEQ(state, "down")) {
if (!(dom = virshCommandOptDomain(ctl, cmd, &name)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "interface", &device) < 0)
+ if (vshCommandOptString(ctl, cmd, "interface", &device) < 0)
goto cleanup;
- if (vshCommandOptStringReq(ctl, cmd, "inbound", &inboundStr) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "outbound", &outboundStr) < 0)
+ if (vshCommandOptString(ctl, cmd, "inbound", &inboundStr) < 0 ||
+ vshCommandOptString(ctl, cmd, "outbound", &outboundStr) < 0)
goto cleanup;
if (inboundStr) {
if (vshCommandOptULongLong(ctl, cmd, "duration", &duration) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "target", &target) < 0)
+ if (vshCommandOptString(ctl, cmd, "target", &target) < 0)
return false;
if ((suspendTarget = virshNodeSuspendTargetTypeFromString(target)) < 0) {
goto out_sig;
#endif /* !WIN32 */
- if (vshCommandOptStringReq(ctl, cmd, "file", &to) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &to) < 0)
goto out;
if (vshCommandOptBool(cmd, "bypass-cache"))
if (vshCommandOptBool(cmd, "paused"))
flags |= VIR_DOMAIN_SAVE_PAUSED;
- if (vshCommandOptStringReq(ctl, cmd, "xml", &xmlfile) < 0)
+ if (vshCommandOptString(ctl, cmd, "xml", &xmlfile) < 0)
goto out;
if (!(dom = virshCommandOptDomain(ctl, cmd, &name)))
if (!(dom = virshCommandOptDomain(ctl, cmd, &name)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &to) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &to) < 0)
return false;
if (vshCommandOptBool(cmd, "verbose"))
if (vshCommandOptBool(cmd, "security-info"))
flags |= VIR_DOMAIN_XML_SECURE;
- if (vshCommandOptStringReq(ctl, cmd, "file", &file) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &file) < 0)
return false;
if (vshCommandOptStringQuiet(ctl, cmd, "xpath", &xpath) < 0)
if (vshCommandOptBool(cmd, "paused"))
flags |= VIR_DOMAIN_SAVE_PAUSED;
- if (vshCommandOptStringReq(ctl, cmd, "file", &file) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &file) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "xml", &xmlfile) < 0)
+ if (vshCommandOptString(ctl, cmd, "xml", &xmlfile) < 0)
return false;
if (virFileReadAll(xmlfile, VSH_MAX_XML_FILE, &xml) < 0)
* flags, so we reject it up front to avoid looping. */
VSH_EXCLUSIVE_OPTIONS("running", "paused");
- if (vshCommandOptStringReq(ctl, cmd, "file", &file) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &file) < 0)
return false;
#define EDIT_GET_XML \
VSH_EXCLUSIVE_OPTIONS("running", "paused");
- if (vshCommandOptStringReq(ctl, cmd, "xml", &xmlfile) < 0)
+ if (vshCommandOptString(ctl, cmd, "xml", &xmlfile) < 0)
return false;
if (virFileReadAll(xmlfile, VSH_MAX_XML_FILE, &xml) < 0)
goto cleanup;
}
- rv = vshCommandOptStringReq(ctl, cmd, "cap", &val);
+ rv = vshCommandOptString(ctl, cmd, "cap", &val);
if (rv < 0 ||
(val &&
cmdSchedInfoUpdateOne(ctl, src_params, nsrc_params,
"cap", val) < 0))
goto cleanup;
- rv = vshCommandOptStringReq(ctl, cmd, "weight", &val);
+ rv = vshCommandOptString(ctl, cmd, "weight", &val);
if (rv < 0 ||
(val &&
cmdSchedInfoUpdateOne(ctl, src_params, nsrc_params,
virshControl *priv = ctl->privData;
int rc;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "bypass-cache"))
if (vshCommandOptBool(cmd, "reset-nvram"))
flags |= VIR_DOMAIN_SAVE_RESET_NVRAM;
- if (vshCommandOptStringReq(ctl, cmd, "xml", &xmlfile) < 0)
+ if (vshCommandOptString(ctl, cmd, "xml", &xmlfile) < 0)
return false;
if (xmlfile &&
goto out_sig;
#endif /* !WIN32 */
- if (vshCommandOptStringReq(ctl, cmd, "file", &to) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &to) < 0)
goto out;
if (!(dom = virshCommandOptDomain(ctl, cmd, &name)))
if (!(dom = virshCommandOptDomain(ctl, cmd, &name)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &to) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &to) < 0)
return false;
if (vshCommandOptBool(cmd, "verbose"))
virshControl *priv = ctl->privData;
virshStreamCallbackData cbdata;
- if (vshCommandOptStringReq(ctl, cmd, "file", (const char **) &file) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", (const char **) &file) < 0)
return false;
if (vshCommandOptUInt(ctl, cmd, "screen", &screen) < 0)
if (live)
flags |= VIR_DOMAIN_AFFECT_LIVE;
- if (vshCommandOptStringReq(ctl, cmd, "type", &typeStr) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "action", &actionStr) < 0) {
+ if (vshCommandOptString(ctl, cmd, "type", &typeStr) < 0 ||
+ vshCommandOptString(ctl, cmd, "action", &actionStr) < 0) {
return false;
}
if (vshCommandOptBool(cmd, "encrypted"))
flags = VIR_DOMAIN_PASSWORD_ENCRYPTED;
- if (vshCommandOptStringReq(ctl, cmd, "user", &user) < 0)
+ if (vshCommandOptString(ctl, cmd, "user", &user) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "password", &password) < 0)
+ if (vshCommandOptString(ctl, cmd, "password", &password) < 0)
return false;
if (!(dom = virshCommandOptDomain(ctl, cmd, &name)))
g_auto(GStrv) modes = NULL;
char **tmp;
- if (vshCommandOptStringReq(ctl, cmd, "mode", &mode) < 0)
+ if (vshCommandOptString(ctl, cmd, "mode", &mode) < 0)
return false;
if (mode && !(modes = g_strsplit(mode, ",", 0))) {
g_auto(GStrv) modes = NULL;
char **tmp;
- if (vshCommandOptStringReq(ctl, cmd, "mode", &mode) < 0)
+ if (vshCommandOptString(ctl, cmd, "mode", &mode) < 0)
return false;
if (mode && !(modes = g_strsplit(mode, ",", 0))) {
if (live)
flags |= VIR_DOMAIN_AFFECT_LIVE;
- if (vshCommandOptStringReq(ctl, cmd, "cpulist", &cpulist) < 0)
+ if (vshCommandOptString(ctl, cmd, "cpulist", &cpulist) < 0)
return false;
if (!cpulist)
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "cpulist", &cpulist) < 0) {
+ if (vshCommandOptString(ctl, cmd, "cpulist", &cpulist) < 0) {
return false;
}
query = !cpulist;
VSH_REQUIRE_OPTION("enable", "cpulist");
VSH_REQUIRE_OPTION("disable", "cpulist");
- if (vshCommandOptStringReq(ctl, cmd, "cpulist", &cpulist))
+ if (vshCommandOptString(ctl, cmd, "cpulist", &cpulist))
return false;
if (cpulist && !(enable || disable)) {
return false;
}
- if (vshCommandOptStringReq(ctl, cmd, "vcpulist", &vcpulist))
+ if (vshCommandOptString(ctl, cmd, "vcpulist", &vcpulist))
return false;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
const char *dev = NULL;
g_autoptr(virshDomain) dom = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "dev", &dev))
+ if (vshCommandOptString(ctl, cmd, "dev", &dev))
return false;
if (vshCommandOptScaledInt(ctl, cmd, "threshold",
if (vshCommandOptUInt(ctl, cmd, "iothread", &iothread_id) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "cpulist", &cpulist) < 0)
+ if (vshCommandOptString(ctl, cmd, "cpulist", &cpulist) < 0)
return false;
if ((maxcpu = virshNodeGetCPUCount(priv->conn)) < 0)
g_autofree int *fds = NULL;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0)
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "validate"))
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "uri", &uri) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "key", &key) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "set", &set) < 0)
+ if (vshCommandOptString(ctl, cmd, "uri", &uri) < 0 ||
+ vshCommandOptString(ctl, cmd, "key", &key) < 0 ||
+ vshCommandOptString(ctl, cmd, "set", &set) < 0)
return false;
if ((set || edit) && !key) {
if (vshCommandOptLongLong(ctl, cmd, "pid", &pid_value) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "signame", &signame) < 0)
+ if (vshCommandOptString(ctl, cmd, "signame", &signame) < 0)
return false;
if ((signum = getSignalNumber(signame)) < 0) {
return -1;
nodeOpt = vshCommandOptBool(cmd, "node");
- if (vshCommandOptStringReq(ctl, cmd, "alias", &alias) < 0 ||
+ if (vshCommandOptString(ctl, cmd, "alias", &alias) < 0 ||
vshCommandOptUInt(ctl, cmd, "node", &node) < 0) {
return -1;
}
if (live)
flags |= VIR_DOMAIN_AFFECT_LIVE;
- if (vshCommandOptStringReq(ctl, cmd, "enable", &enable) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "disable", &disable) < 0)
+ if (vshCommandOptString(ctl, cmd, "enable", &enable) < 0 ||
+ vshCommandOptString(ctl, cmd, "disable", &disable) < 0)
return false;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "nodeset", &nodeset) < 0)
+ if (vshCommandOptString(ctl, cmd, "nodeset", &nodeset) < 0)
goto cleanup;
if (nodeset &&
VIR_DOMAIN_NUMA_NODESET, nodeset) < 0)
goto save_error;
- if (vshCommandOptStringReq(ctl, cmd, "mode", &mode) < 0)
+ if (vshCommandOptString(ctl, cmd, "mode", &mode) < 0)
goto cleanup;
if (mode) {
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "secrethdr", &sechdrfile) < 0)
+ if (vshCommandOptString(ctl, cmd, "secrethdr", &sechdrfile) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "secret", &secfile) < 0)
+ if (vshCommandOptString(ctl, cmd, "secret", &secfile) < 0)
return false;
if (sechdrfile == NULL || secfile == NULL) {
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "name", &name) < 0)
return false;
if (virshFetchPassFdsList(ctl, cmd, &nfds, &fds) < 0)
data.count = 0;
if (vshCommandOptTimeoutToMs(ctl, cmd, &timeout) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "event", &event) < 0)
+ if (vshCommandOptString(ctl, cmd, "event", &event) < 0)
return false;
if (vshCommandOptBool(cmd, "domain"))
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "format", &format) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "config", &configFile) < 0)
+ if (vshCommandOptString(ctl, cmd, "format", &format) < 0 ||
+ vshCommandOptString(ctl, cmd, "config", &configFile) < 0)
return false;
if (virFileReadAll(configFile, VSH_MAX_XML_FILE, &configData) < 0)
virshControl *priv = ctl->privData;
g_autoptr(virshDomain) dom = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "format", &format) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "xml", &xmlFile) < 0)
+ if (vshCommandOptString(ctl, cmd, "format", &format) < 0 ||
+ vshCommandOptString(ctl, cmd, "xml", &xmlFile) < 0)
return false;
VSH_EXCLUSIVE_OPTIONS("domain", "xml");
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "new-name", &new_name) < 0)
+ if (vshCommandOptString(ctl, cmd, "new-name", &new_name) < 0)
return false;
if (virDomainRename(dom, new_name, 0) < 0)
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
goto out;
- if (vshCommandOptStringReq(ctl, cmd, "desturi", &desturi) < 0)
+ if (vshCommandOptString(ctl, cmd, "desturi", &desturi) < 0)
goto out;
- if (vshCommandOptStringReq(ctl, cmd, "migrateuri", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "migrateuri", &opt) < 0)
goto out;
if (opt &&
virTypedParamsAddString(¶ms, &nparams, &maxparams,
VIR_MIGRATE_PARAM_URI, opt) < 0)
goto save_error;
- if (vshCommandOptStringReq(ctl, cmd, "graphicsuri", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "graphicsuri", &opt) < 0)
goto out;
if (opt &&
virTypedParamsAddString(¶ms, &nparams, &maxparams,
VIR_MIGRATE_PARAM_GRAPHICS_URI, opt) < 0)
goto save_error;
- if (vshCommandOptStringReq(ctl, cmd, "listen-address", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "listen-address", &opt) < 0)
goto out;
if (opt &&
virTypedParamsAddString(¶ms, &nparams, &maxparams,
VIR_MIGRATE_PARAM_DISKS_PORT, intOpt) < 0)
goto save_error;
- if (vshCommandOptStringReq(ctl, cmd, "disks-uri", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "disks-uri", &opt) < 0)
goto out;
if (opt &&
virTypedParamsAddString(¶ms, &nparams, &maxparams,
opt) < 0)
goto save_error;
- if (vshCommandOptStringReq(ctl, cmd, "dname", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "dname", &opt) < 0)
goto out;
if (opt &&
virTypedParamsAddString(¶ms, &nparams, &maxparams,
VIR_MIGRATE_PARAM_DEST_NAME, opt) < 0)
goto save_error;
- if (vshCommandOptStringReq(ctl, cmd, "migrate-disks", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "migrate-disks", &opt) < 0)
goto out;
if (opt) {
g_autofree char **val = NULL;
}
}
- if (vshCommandOptStringReq(ctl, cmd, "comp-methods", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "comp-methods", &opt) < 0)
goto out;
if (opt) {
g_autofree char **val = g_strsplit(opt, ",", 0);
goto save_error;
}
- if (vshCommandOptStringReq(ctl, cmd, "xml", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "xml", &opt) < 0)
goto out;
if (opt) {
g_autofree char *xml = NULL;
}
}
- if (vshCommandOptStringReq(ctl, cmd, "persistent-xml", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "persistent-xml", &opt) < 0)
goto out;
if (opt) {
g_autofree char *xml = NULL;
goto save_error;
}
- if (vshCommandOptStringReq(ctl, cmd, "tls-destination", &opt) < 0)
+ if (vshCommandOptString(ctl, cmd, "tls-destination", &opt) < 0)
goto out;
if (opt &&
virTypedParamsAddString(¶ms, &nparams, &maxparams,
virConnectPtr dconn = NULL;
const char *desturi = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "desturi", &desturi) < 0)
+ if (vshCommandOptString(ctl, cmd, "desturi", &desturi) < 0)
goto cleanup;
dconn = virshConnect(ctl, desturi, false);
if (vshCommandOptBool(cmd, "include-password"))
flags |= VIR_DOMAIN_XML_SECURE;
- if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
+ if (vshCommandOptString(ctl, cmd, "type", &type) < 0)
return false;
if (virshDomainGetXMLFromDom(ctl, dom, flags, &xml, &ctxt) < 0)
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "source", &sourcestr) < 0)
+ if (vshCommandOptString(ctl, cmd, "source", &sourcestr) < 0)
return false;
if (sourcestr) {
virDomainIsActive(dom) == 1)
flags |= VIR_DOMAIN_AFFECT_LIVE;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0) {
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "alias", &alias) < 0)
+ if (vshCommandOptString(ctl, cmd, "alias", &alias) < 0)
return false;
if (virDomainDetachDeviceAlias(dom, alias, flags) < 0) {
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (persistent &&
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
+ if (vshCommandOptString(ctl, cmd, "type", &type) < 0)
goto cleanup;
- if (vshCommandOptStringReq(ctl, cmd, "mac", &mac) < 0)
+ if (vshCommandOptString(ctl, cmd, "mac", &mac) < 0)
goto cleanup;
affect_config = (config || persistent);
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "target", &target) < 0)
+ if (vshCommandOptString(ctl, cmd, "target", &target) < 0)
return false;
if (flags == VIR_DOMAIN_AFFECT_CONFIG)
VSH_EXCLUSIVE_OPTIONS_VAR(eject, block);
- if (vshCommandOptStringReq(ctl, cmd, "source", &source) < 0)
+ if (vshCommandOptString(ctl, cmd, "source", &source) < 0)
return false;
/* Docs state that update without source is eject */
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "path", &path) < 0)
+ if (vshCommandOptString(ctl, cmd, "path", &path) < 0)
return false;
if (flags & VIR_DOMAIN_AFFECT_CONFIG)
if (vshCommandOptULongLong(ctl, cmd, "minimum", &minimum) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "mountpoint", &mountPoint) < 0)
+ if (vshCommandOptString(ctl, cmd, "mountpoint", &mountPoint) < 0)
return false;
if (virDomainFSTrim(dom, mountPoint, minimum, flags) < 0) {
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "user", &user) < 0)
+ if (vshCommandOptString(ctl, cmd, "user", &user) < 0)
return false;
nkeys = virDomainAuthorizedSSHKeysGet(dom, user, &keys, flags);
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "user", &user) < 0)
+ if (vshCommandOptString(ctl, cmd, "user", &user) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "remove")) {
if (vshCommandOptInt(ctl, cmd, "seconds", &seconds) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "mode", &modestr) < 0)
+ if (vshCommandOptString(ctl, cmd, "mode", &modestr) < 0)
return false;
if (modestr) {
bool wrap = vshCommandOptBool(cmd, "wrap");
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "virttype", &virttype) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "emulatorbin", &emulatorbin) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "arch", &arch) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "machine", &machine) < 0 ||
+ if (vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
+ vshCommandOptString(ctl, cmd, "emulatorbin", &emulatorbin) < 0 ||
+ vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||
+ vshCommandOptString(ctl, cmd, "machine", &machine) < 0 ||
vshCommandOptStringQuiet(ctl, cmd, "xpath", &xpath) < 0)
return false;
g_autoptr(xmlXPathContext) ctxt = NULL;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
+ if (vshCommandOptString(ctl, cmd, "type", &type) < 0)
return false;
if ((caps = virConnectGetDomainCapabilities(priv->conn, NULL, NULL, NULL,
long long duration;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "target", &target) < 0)
+ if (vshCommandOptString(ctl, cmd, "target", &target) < 0)
return false;
if (vshCommandOptLongLong(ctl, cmd, "duration", &duration) < 0)
if (vshCommandOptBool(cmd, "validate"))
flags |= VIR_CONNECT_COMPARE_CPU_VALIDATE_XML;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (!(cpus = vshExtractCPUDefXMLs(ctl, from)))
if (vshCommandOptBool(cmd, "migratable"))
flags |= VIR_CONNECT_BASELINE_CPU_MIGRATABLE;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (!(list = vshExtractCPUDefXMLs(ctl, from)))
const char *arch = NULL;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "arch", &arch) < 0)
+ if (vshCommandOptString(ctl, cmd, "arch", &arch) < 0)
return false;
nmodels = virConnectGetCPUModelNames(priv->conn, arch, &models, 0);
if (vshCommandOptBool(cmd, "validate"))
flags |= VIR_CONNECT_COMPARE_CPU_VALIDATE_XML;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "virttype", &virttype) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "emulator", &emulator) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "arch", &arch) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "machine", &machine) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0 ||
+ vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
+ vshCommandOptString(ctl, cmd, "emulator", &emulator) < 0 ||
+ vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||
+ vshCommandOptString(ctl, cmd, "machine", &machine) < 0)
return false;
if (!(cpus = vshExtractCPUDefXMLs(ctl, from)))
if (vshCommandOptBool(cmd, "migratable"))
flags |= VIR_CONNECT_BASELINE_CPU_MIGRATABLE;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "virttype", &virttype) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "emulator", &emulator) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "arch", &arch) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "machine", &machine) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "model", &model) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0 ||
+ vshCommandOptString(ctl, cmd, "virttype", &virttype) < 0 ||
+ vshCommandOptString(ctl, cmd, "emulator", &emulator) < 0 ||
+ vshCommandOptString(ctl, cmd, "arch", &arch) < 0 ||
+ vshCommandOptString(ctl, cmd, "machine", &machine) < 0 ||
+ vshCommandOptString(ctl, cmd, "model", &model) < 0)
return false;
VSH_ALTERNATIVE_OPTIONS_EXPR("file", from, "model", model);
if (!optname)
optname = "interface";
- if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
+ if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "validate"))
}
/* Name for new bridge device */
- if (vshCommandOptStringReq(ctl, cmd, "bridge", &br_name) < 0)
+ if (vshCommandOptString(ctl, cmd, "bridge", &br_name) < 0)
goto cleanup;
/* make sure "new" device doesn't already exist */
virCheckFlags(VIRSH_BYUUID | VIRSH_BYNAME, NULL);
- if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
+ if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
const char *n = NULL;
const char *optname = "port";
- if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
+ if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "validate"))
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "validate"))
if (!(net = virshCommandOptNetwork(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "uri", &uri) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "key", &key) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "set", &set) < 0)
+ if (vshCommandOptString(ctl, cmd, "uri", &uri) < 0 ||
+ vshCommandOptString(ctl, cmd, "key", &key) < 0 ||
+ vshCommandOptString(ctl, cmd, "set", &set) < 0)
return false;
if ((set || edit) && !key) {
if (!(network = virshCommandOptNetwork(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "command", &commandStr) < 0)
+ if (vshCommandOptString(ctl, cmd, "command", &commandStr) < 0)
goto cleanup;
if (STREQ(commandStr, "add")) {
}
}
- if (vshCommandOptStringReq(ctl, cmd, "section", §ionStr) < 0)
+ if (vshCommandOptString(ctl, cmd, "section", §ionStr) < 0)
goto cleanup;
section = virshNetworkSectionTypeFromString(sectionStr);
* the desired xml.
*/
- if (vshCommandOptStringReq(ctl, cmd, "xml", &xml) < 0)
+ if (vshCommandOptString(ctl, cmd, "xml", &xml) < 0)
goto cleanup;
if (*xml != '<') {
return true;
}
- if (vshCommandOptStringReq(ctl, cmd, "event", &eventName) < 0)
+ if (vshCommandOptString(ctl, cmd, "event", &eventName) < 0)
return false;
if (!eventName) {
vshError(ctl, "%s", _("either --list or --event <type> is required"));
g_autoptr(virshNetwork) network = NULL;
g_autoptr(vshTable) table = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "mac", &mac) < 0)
+ if (vshCommandOptString(ctl, cmd, "mac", &mac) < 0)
return false;
if (!(network = virshCommandOptNetwork(ctl, cmd, &name)))
if (network == NULL)
goto cleanup;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
goto cleanup;
if (vshCommandOptBool(cmd, "validate"))
virshControl *priv = ctl->privData;
unsigned int flags = 0;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0)
g_autoptr(virshNodeDevice) dev = NULL;
const char *device_value = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "device", &device_value) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &device_value) < 0)
return false;
dev = vshFindNodeDevice(ctl, device_value);
bool wrap = vshCommandOptBool(cmd, "wrap");
const char *xpath = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "device", &device_value) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &device_value) < 0)
return false;
if (vshCommandOptStringQuiet(ctl, cmd, "xpath", &xpath) < 0)
bool ret = true;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "device", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &name) < 0)
return false;
ignore_value(vshCommandOptStringQuiet(ctl, cmd, "driver", &driverName));
bool ret = true;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "device", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &name) < 0)
return false;
if (!(device = virNodeDeviceLookupByName(priv->conn, name))) {
bool ret = true;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "device", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &name) < 0)
return false;
if (!(device = virNodeDeviceLookupByName(priv->conn, name))) {
return true;
}
- if (vshCommandOptStringReq(ctl, cmd, "event", &eventName) < 0)
+ if (vshCommandOptString(ctl, cmd, "event", &eventName) < 0)
return false;
if (!eventName) {
vshError(ctl, "%s", _("either --list or --event <type> is required"));
data.cb = &virshNodeDeviceEventCallbacks[event];
if (vshCommandOptTimeoutToMs(ctl, cmd, &timeout) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "device", &device_value) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &device_value) < 0)
return false;
if (device_value) {
g_autoptr(virshNodeDevice) dev = NULL;
const char *device_value = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "device", &device_value) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &device_value) < 0)
return false;
dev = vshFindNodeDevice(ctl, device_value);
virshControl *priv = ctl->privData;
unsigned int flags = 0;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0)
bool ret = true;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "device", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &name) < 0)
return false;
if (!(device = virNodeDeviceLookupByName(priv->conn, name))) {
const char *name = NULL;
int autostart;
- if (vshCommandOptStringReq(ctl, cmd, "device", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &name) < 0)
return false;
dev = vshFindNodeDevice(ctl, name);
int autostart;
const char *parent = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "device", &device_value) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &device_value) < 0)
return false;
device = vshFindNodeDevice(ctl, device_value);
VSH_EXCLUSIVE_OPTIONS("current", "live");
VSH_EXCLUSIVE_OPTIONS("current", "config");
- if (vshCommandOptStringReq(ctl, cmd, "device", &device_value) < 0)
+ if (vshCommandOptString(ctl, cmd, "device", &device_value) < 0)
return false;
device = vshFindNodeDevice(ctl, device_value);
if (!device)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
goto cleanup;
if (virFileReadAll(from, VSH_MAX_XML_FILE, &xml) < 0)
virCheckFlags(VIRSH_BYUUID | VIRSH_BYNAME, NULL);
- if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
+ if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "validate"))
virCheckFlags(0, NULL);
- if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
+ if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "validate"))
virCheckFlags(VIRSH_BYUUID | VIRSH_BYNAME, NULL);
- if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
+ if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
if (cmd->skipChecks && !n)
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
build = vshCommandOptBool(cmd, "build");
VSH_EXCLUSIVE_OPTIONS("secret-usage", "secret-uuid");
- if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "name", &name) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
+ if (vshCommandOptString(ctl, cmd, "type", &type) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "source-host", &srcHost) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-path", &srcPath) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-dev", &srcDev) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-name", &srcName) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-format", &srcFormat) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "target", &target) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "auth-type", &authType) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "auth-username", &authUsername) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "secret-usage", &secretUsage) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "secret-uuid", &secretUUID) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "adapter-name", &adapterName) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "adapter-wwnn", &adapterWwnn) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "adapter-wwpn", &adapterWwpn) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "adapter-parent", &adapterParent) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwnn", &adapterParentWwnn) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "adapter-parent-wwpn", &adapterParentWwpn) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "adapter-parent-fabric-wwn", &adapterParentFabricWwn) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-protocol-ver", &protoVer) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "source-initiator", &srcInitiator) < 0) {
+ if (vshCommandOptString(ctl, cmd, "source-host", &srcHost) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-path", &srcPath) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-dev", &srcDev) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-name", &srcName) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-format", &srcFormat) < 0 ||
+ vshCommandOptString(ctl, cmd, "target", &target) < 0 ||
+ vshCommandOptString(ctl, cmd, "auth-type", &authType) < 0 ||
+ vshCommandOptString(ctl, cmd, "auth-username", &authUsername) < 0 ||
+ vshCommandOptString(ctl, cmd, "secret-usage", &secretUsage) < 0 ||
+ vshCommandOptString(ctl, cmd, "secret-uuid", &secretUUID) < 0 ||
+ vshCommandOptString(ctl, cmd, "adapter-name", &adapterName) < 0 ||
+ vshCommandOptString(ctl, cmd, "adapter-wwnn", &adapterWwnn) < 0 ||
+ vshCommandOptString(ctl, cmd, "adapter-wwpn", &adapterWwpn) < 0 ||
+ vshCommandOptString(ctl, cmd, "adapter-parent", &adapterParent) < 0 ||
+ vshCommandOptString(ctl, cmd, "adapter-parent-wwnn", &adapterParentWwnn) < 0 ||
+ vshCommandOptString(ctl, cmd, "adapter-parent-wwpn", &adapterParentWwpn) < 0 ||
+ vshCommandOptString(ctl, cmd, "adapter-parent-fabric-wwn", &adapterParentFabricWwn) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-protocol-ver", &protoVer) < 0 ||
+ vshCommandOptString(ctl, cmd, "source-initiator", &srcInitiator) < 0) {
return false;
}
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "validate"))
if (vshCommandOptBool(cmd, "name"))
name = true;
- if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
+ if (vshCommandOptString(ctl, cmd, "type", &type) < 0)
return false;
VSH_EXCLUSIVE_OPTIONS("details", "uuid");
const char *initiator = NULL;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "host", &host) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "initiator", &initiator) < 0)
+ if (vshCommandOptString(ctl, cmd, "type", &type) < 0 ||
+ vshCommandOptString(ctl, cmd, "host", &host) < 0 ||
+ vshCommandOptString(ctl, cmd, "initiator", &initiator) < 0)
return false;
if (host) {
const char *port = NULL;
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
- if (vshCommandOptStringReq(ctl, cmd, "port", &port) < 0) {
+ if (vshCommandOptString(ctl, cmd, "port", &port) < 0) {
vshError(ctl, "%s", _("missing argument"));
return false;
}
char *srcSpec = NULL, *srcList;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "type", &type) < 0)
+ if (vshCommandOptString(ctl, cmd, "type", &type) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "srcSpec", &srcSpecFile) < 0)
+ if (vshCommandOptString(ctl, cmd, "srcSpec", &srcSpecFile) < 0)
return false;
if (srcSpecFile && virFileReadAll(srcSpecFile, VSH_MAX_XML_FILE,
return true;
}
- if (vshCommandOptStringReq(ctl, cmd, "event", &eventName) < 0)
+ if (vshCommandOptString(ctl, cmd, "event", &eventName) < 0)
return false;
if (!eventName) {
vshError(ctl, "%s", _("either --list or --event <type> is required"));
const char *optname = "secret";
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
+ if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
vshDebug(ctl, VSH_ERR_DEBUG,
unsigned int flags = 0;
virshControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (vshCommandOptBool(cmd, "validate"))
if (!(secret = virshCommandOptSecret(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "base64", &base64) < 0)
+ if (vshCommandOptString(ctl, cmd, "base64", &base64) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &filename) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &filename) < 0)
return false;
if (base64) {
return true;
}
- if (vshCommandOptStringReq(ctl, cmd, "event", &eventName) < 0)
+ if (vshCommandOptString(ctl, cmd, "event", &eventName) < 0)
return false;
if (!eventName) {
vshError(ctl, "%s", _("either --list or --event <type> is required"));
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "xmlfile", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "xmlfile", &from) < 0)
return false;
if (!from) {
buffer = g_strdup("<domainsnapshot/>");
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "description", &desc) < 0)
+ if (vshCommandOptString(ctl, cmd, "name", &name) < 0 ||
+ vshCommandOptString(ctl, cmd, "description", &desc) < 0)
return false;
virBufferAddLit(&buf, "<domainsnapshot>\n");
virBufferEscapeString(&buf, "<name>%s</name>\n", name);
virBufferEscapeString(&buf, "<description>%s</description>\n", desc);
- if (vshCommandOptStringReq(ctl, cmd, "memspec", &memspec) < 0)
+ if (vshCommandOptString(ctl, cmd, "memspec", &memspec) < 0)
return false;
if (memspec && virshParseSnapshotMemspec(ctl, &buf, memspec) < 0)
bool current = vshCommandOptBool(cmd, "current");
const char *snapname = NULL;
- if (vshCommandOptStringReq(ctl, cmd, arg, &snapname) < 0)
+ if (vshCommandOptString(ctl, cmd, arg, &snapname) < 0)
return -1;
if (exclusive && current && snapname) {
if (!(dom = virshCommandOptDomain(ctl, cmd, &domname)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "snapshotname", &snapshotname) < 0)
+ if (vshCommandOptString(ctl, cmd, "snapshotname", &snapshotname) < 0)
goto cleanup;
if (snapshotname) {
if (vshCommandOptBool(cmd, "security-info"))
flags |= VIR_DOMAIN_XML_SECURE;
- if (vshCommandOptStringReq(ctl, cmd, "snapshotname", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "snapshotname", &name) < 0)
return false;
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
const char *n = NULL;
const char *optname = "domain";
- if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
+ if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
virCheckFlags(VIRSH_BYUUID | VIRSH_BYNAME, NULL);
- if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
+ if (vshCommandOptString(ctl, cmd, optname, &n) < 0)
return NULL;
if (pooloptname != NULL &&
- vshCommandOptStringReq(ctl, cmd, pooloptname, &p) < 0)
+ vshCommandOptString(ctl, cmd, pooloptname, &p) < 0)
return NULL;
if (p) {
if (!(pool = virshCommandOptPool(ctl, cmd, "pool", NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "name", &name) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "capacity", &capacityStr) < 0)
+ if (vshCommandOptString(ctl, cmd, "capacity", &capacityStr) < 0)
return false;
if (virshVolSize(capacityStr, &capacity) < 0) {
return false;
}
- if (vshCommandOptStringReq(ctl, cmd, "format", &format) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "backing-vol", &snapshotStrVol) < 0 ||
- vshCommandOptStringReq(ctl, cmd, "backing-vol-format",
- &snapshotStrFormat) < 0)
+ if (vshCommandOptString(ctl, cmd, "format", &format) < 0 ||
+ vshCommandOptString(ctl, cmd, "backing-vol", &snapshotStrVol) < 0 ||
+ vshCommandOptString(ctl, cmd, "backing-vol-format", &snapshotStrFormat) < 0)
return false;
virBufferAddLit(&buf, "<volume>\n");
if (!(pool = virshCommandOptPool(ctl, cmd, "pool", NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0) {
if (vshCommandOptBool(cmd, "validate"))
flags |= VIR_STORAGE_VOL_CREATE_VALIDATE;
- if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &from) < 0)
return false;
if (!(inputvol = virshCommandOptVol(ctl, cmd, "vol", "inputpool", NULL)))
return false;
}
- if (vshCommandOptStringReq(ctl, cmd, "newname", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "newname", &name) < 0)
return false;
if (!(origxml = virStorageVolGetXMLDesc(origvol, 0)))
if (!(vol = virshCommandOptVol(ctl, cmd, "vol", "pool", &name)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &file) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &file) < 0)
return false;
if ((fd = open(file, O_RDONLY)) < 0) {
if (!(vol = virshCommandOptVol(ctl, cmd, "vol", "pool", &name)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "file", &file) < 0)
+ if (vshCommandOptString(ctl, cmd, "file", &file) < 0)
goto cleanup;
if (vshCommandOptBool(cmd, "sparse"))
if (!(vol = virshCommandOptVol(ctl, cmd, "vol", "pool", &name)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "algorithm", &algorithm_str) < 0)
+ if (vshCommandOptString(ctl, cmd, "algorithm", &algorithm_str) < 0)
return false;
if (algorithm_str &&
if (!(vol = virshCommandOptVol(ctl, cmd, "vol", "pool", NULL)))
return false;
- if (vshCommandOptStringReq(ctl, cmd, "capacity", &capacityStr) < 0)
+ if (vshCommandOptString(ctl, cmd, "capacity", &capacityStr) < 0)
return false;
virSkipSpaces(&capacityStr);
if (*capacityStr == '-') {
bool ro = vshCommandOptBool(cmd, "readonly");
const char *name = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "name", &name) < 0)
return false;
if (virshReconnect(ctl, name, ro, true) < 0)
vshAdmControl *priv = ctl->privData;
bool connected = priv->conn;
- if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
+ if (vshCommandOptString(ctl, cmd, "name", &name) < 0)
return false;
if (name) {
virAdmServerPtr srv = NULL;
vshAdmControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0)
+ if (vshCommandOptString(ctl, cmd, "server", &srvname) < 0)
return false;
if (!(srv = virAdmConnectLookupServer(priv->conn, srvname, 0)))
virAdmServerPtr srv = NULL;
vshAdmControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0)
+ if (vshCommandOptString(ctl, cmd, "server", &srvname) < 0)
return false;
#define PARSE_CMD_TYPED_PARAM(NAME, FIELD) \
vshAdmControl *priv = ctl->privData;
g_autoptr(vshTable) table = NULL;
- if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0)
+ if (vshCommandOptString(ctl, cmd, "server", &srvname) < 0)
return false;
if (!(srv = virAdmConnectLookupServer(priv->conn, srvname, 0)))
if (vshCommandOptULongLong(ctl, cmd, "client", &id) < 0)
return false;
- if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0)
+ if (vshCommandOptString(ctl, cmd, "server", &srvname) < 0)
return false;
if (!(srv = virAdmConnectLookupServer(priv->conn, srvname, 0)) ||
virAdmClientPtr client = NULL;
vshAdmControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0)
+ if (vshCommandOptString(ctl, cmd, "server", &srvname) < 0)
return false;
if (vshCommandOptULongLongWrap(ctl, cmd, "client", &id) < 0)
virAdmServerPtr srv = NULL;
vshAdmControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0)
+ if (vshCommandOptString(ctl, cmd, "server", &srvname) < 0)
return false;
if (!(srv = virAdmConnectLookupServer(priv->conn, srvname, 0)))
virTypedParameterPtr params = NULL;
vshAdmControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0)
+ if (vshCommandOptString(ctl, cmd, "server", &srvname) < 0)
return false;
#define PARSE_CMD_TYPED_PARAM(NAME, FIELD) \
virAdmServerPtr srv = NULL;
vshAdmControl *priv = ctl->privData;
- if (vshCommandOptStringReq(ctl, cmd, "server", &srvname) < 0)
+ if (vshCommandOptString(ctl, cmd, "server", &srvname) < 0)
return false;
if (!(srv = virAdmConnectLookupServer(priv->conn, srvname, 0)))
if (vshCommandOptBool(cmd, "filters")) {
const char *filters = NULL;
- if ((vshCommandOptStringReq(ctl, cmd, "filters", &filters) < 0 ||
+ if ((vshCommandOptString(ctl, cmd, "filters", &filters) < 0 ||
virAdmConnectSetLoggingFilters(priv->conn, filters, 0) < 0)) {
vshError(ctl, _("Unable to change daemon logging settings"));
return false;
if (vshCommandOptBool(cmd, "outputs")) {
const char *outputs = NULL;
- if ((vshCommandOptStringReq(ctl, cmd, "outputs", &outputs) < 0 ||
+ if ((vshCommandOptString(ctl, cmd, "outputs", &outputs) < 0 ||
virAdmConnectSetLoggingOutputs(priv->conn, outputs, 0) < 0)) {
vshError(ctl, _("Unable to change daemon logging settings"));
return false;
}
/**
- * vshCommandOptStringReq:
+ * vshCommandOptString:
* @ctl virtshell control structure
* @cmd command structure
* @name option name
* returned and error message printed.
*/
int
-vshCommandOptStringReq(vshControl *ctl,
- const vshCmd *cmd,
- const char *name,
- const char **value)
+vshCommandOptString(vshControl *ctl,
+ const vshCmd *cmd,
+ const char *name,
+ const char **value)
{
vshCmdOpt *arg;
int ret;
int vshCommandOptStringQuiet(vshControl *ctl, const vshCmd *cmd,
const char *name, const char **value)
ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT;
-int vshCommandOptStringReq(vshControl *ctl, const vshCmd *cmd,
- const char *name, const char **value)
+int vshCommandOptString(vshControl *ctl, const vshCmd *cmd,
+ const char *name, const char **value)
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3)
ATTRIBUTE_NONNULL(4) G_GNUC_WARN_UNUSED_RESULT;
int vshCommandOptLongLong(vshControl *ctl, const vshCmd *cmd,