goto save_error;
}
- rv = vshCommandOptString(ctl, cmd, "device-weights", &device_weight);
+ rv = vshCommandOptStringQuiet(ctl, cmd, "device-weights", &device_weight);
if (rv < 0) {
vshError(ctl, "%s", _("Unable to parse string parameter"));
goto cleanup;
goto save_error;
}
- rv = vshCommandOptString(ctl, cmd, "device-read-iops-sec", &device_riops);
+ rv = vshCommandOptStringQuiet(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(ctl, cmd, "device-write-iops-sec", &device_wiops);
+ rv = vshCommandOptStringQuiet(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(ctl, cmd, "device-read-bytes-sec", &device_rbps);
+ rv = vshCommandOptStringQuiet(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(ctl, cmd, "device-write-bytes-sec", &device_wbps);
+ rv = vshCommandOptStringQuiet(ctl, cmd, "device-write-bytes-sec", &device_wbps);
if (rv < 0) {
vshError(ctl, "%s", _("Unable to parse string parameter"));
goto cleanup;
size_t j;
virshControlPtr priv = ctl->privData;
- ignore_value(vshCommandOptString(ctl, cmd, "storage", &vol_string));
+ ignore_value(vshCommandOptStringQuiet(ctl, cmd, "storage", &vol_string));
if (!(vol_string || remove_all_storage) && wipe_storage) {
vshError(ctl,
*nfdsret = 0;
*fdsret = NULL;
- if (vshCommandOptString(ctl, cmd, "pass-fds", &fdopt) <= 0)
+ if (vshCommandOptStringQuiet(ctl, cmd, "pass-fds", &fdopt) <= 0)
return 0;
if (!(fdlist = virStringSplit(fdopt, ",", -1))) {
goto out;
}
- if (vshCommandOptString(ctl, cmd, "format", &format) > 0) {
+ if (vshCommandOptStringQuiet(ctl, cmd, "format", &format) > 0) {
if (STREQ(format, "kdump-zlib")) {
dumpformat = VIR_DOMAIN_CORE_DUMP_FORMAT_KDUMP_ZLIB;
} else if (STREQ(format, "kdump-lzo")) {
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptString(ctl, cmd, "codeset", &codeset_option) <= 0)
+ if (vshCommandOptStringQuiet(ctl, cmd, "codeset", &codeset_option) <= 0)
codeset_option = "linux";
if (vshCommandOptUInt(ctl, cmd, "holdtime", &holdtime) < 0)
const char *str;
char *end;
- ret = vshCommandOptString(ctl, cmd, name, &str);
+ ret = vshCommandOptStringQuiet(ctl, cmd, name, &str);
if (ret <= 0)
return ret;
if (virStrToLong_ll(str, &end, 10, value) < 0)
virshNodeDeviceListPtr list = NULL;
int cap_type = -1;
- ignore_value(vshCommandOptString(ctl, cmd, "cap", &cap_str));
+ ignore_value(vshCommandOptStringQuiet(ctl, cmd, "cap", &cap_str));
if (cap_str) {
if (tree) {
if (vshCommandOptStringReq(ctl, cmd, "device", &name) < 0)
return false;
- ignore_value(vshCommandOptString(ctl, cmd, "driver", &driverName));
+ ignore_value(vshCommandOptStringQuiet(ctl, cmd, "driver", &driverName));
if (!(device = virNodeDeviceLookupByName(priv->conn, name))) {
vshError(ctl, _("Could not find matching device '%s'"), name);
}
/**
- * vshCommandOptString:
+ * vshCommandOptStringQuiet:
* @ctl virtshell control structure
* @cmd command reference
* @name option name
* @value result
*
- * Returns option as STRING
+ * Returns option as STRING. On error -1 is returned but no error is set.
* Return value:
* >0 if option found and valid (@value updated)
* 0 if option not found and not required (@value untouched)
* <0 in all other cases (@value untouched)
*/
int
-vshCommandOptString(vshControl *ctl ATTRIBUTE_UNUSED, const vshCmd *cmd,
- const char *name, const char **value)
+vshCommandOptStringQuiet(vshControl *ctl ATTRIBUTE_UNUSED, const vshCmd *cmd,
+ const char *name, const char **value)
{
vshCmdOpt *arg;
int ret;
{
const char *name = NULL;
- if (vshCommandOptString(ctl, cmd, "command", &name) <= 0) {
+ if (vshCommandOptStringQuiet(ctl, cmd, "command", &name) <= 0) {
const vshCmdGrp *grp;
const vshCmdDef *def;
return false;
}
- if (vshCommandOptString(ctl, cmd, "dir", &dir) <= 0)
+ if (vshCommandOptStringQuiet(ctl, cmd, "dir", &dir) <= 0)
dir = dir_malloced = virGetUserDirectory();
if (!dir)
dir = "/";
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)
+int vshCommandOptStringQuiet(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)