return false;
if ((rv = vshCommandOptInt(cmd, "weight", &weight)) < 0) {
- vshError(ctl, "%s", _("Unable to parse integer parameter"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "weight");
goto cleanup;
} else if (rv > 0) {
if (weight <= 0) {
goto cleanup;
if (vshCommandOptULWrap(cmd, "bandwidth", &bandwidth) < 0) {
- vshError(ctl, "%s", _("bandwidth must be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "bandwidth");
goto cleanup;
}
* than trying to guess which value will work well across both
* APIs with their different sizes and scales. */
if (vshCommandOptULWrap(cmd, "bandwidth", &bandwidth) < 0) {
- vshError(ctl, "%s", _("bandwidth must be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "bandwidth");
goto cleanup;
}
if (vshCommandOptUInt(cmd, "granularity", &granularity) < 0) {
- vshError(ctl, "%s", _("granularity must be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "granularity");
goto cleanup;
}
if (vshCommandOptULongLong(cmd, "buf-size", &buf_size) < 0) {
- vshError(ctl, "%s", _("buf-size must be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "buf-size");
goto cleanup;
}
return false;
if (vshCommandOptScaledInt(cmd, "size", &size, 1024, ULLONG_MAX) < 0) {
- vshError(ctl, "%s", _("Unable to parse integer"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "size");
return false;
}
return false;
if (vshCommandOptULongLong(cmd, "duration", &duration) < 0) {
- vshError(ctl, _("Invalid duration argument"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "duration");
goto cleanup;
}
return false;
if (vshCommandOptUInt(cmd, "screen", &screen) < 0) {
- vshError(ctl, "%s", _("invalid screen ID"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "screen");
return false;
}
VSH_EXCLUSIVE_OPTIONS_VAR(live, config);
if ((got_vcpu = vshCommandOptUInt(cmd, "vcpu", &vcpu)) < 0) {
- vshError(ctl, "%s", _("vcpupin: Invalid vCPU number."));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "vcpu");
return false;
}
return false;
if (vshCommandOptInt(cmd, "count", &count) < 0 || count <= 0) {
- vshError(ctl, "%s", _("Invalid number of virtual CPUs"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "count");
goto cleanup;
}
return false;
if (vshCommandOptUInt(cmd, "iothread", &iothread_id) < 0) {
- vshError(ctl, "%s", _("iothreadpin: Invalid IOThread number."));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "iothread");
goto cleanup;
}
return false;
if (vshCommandOptInt(cmd, "id", &iothread_id) < 0) {
- vshError(ctl, "%s", _("Unable to parse integer parameter"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "id");
goto cleanup;
}
if (iothread_id <= 0) {
return false;
if (vshCommandOptInt(cmd, "id", &iothread_id) < 0) {
- vshError(ctl, "%s", _("Unable to parse integer parameter"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "id");
goto cleanup;
}
if (iothread_id <= 0) {
show_total = vshCommandOptBool(cmd, "total");
if ((rv = vshCommandOptInt(cmd, "start", &cpu)) < 0) {
- vshError(ctl, "%s", _("Unable to parse integer parameter for start"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "start");
goto cleanup;
} else if (rv > 0) {
if (cpu < 0) {
}
if ((rv = vshCommandOptInt(cmd, "count", &show_count)) < 0) {
- vshError(ctl, "%s",
- _("Unable to parse integer parameter for CPUs to show"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "count");
goto cleanup;
} else if (rv > 0) {
if (show_count < 0) {
codeset_option = "linux";
if (vshCommandOptUInt(cmd, "holdtime", &holdtime) < 0) {
- vshError(ctl, _("invalid value of --holdtime"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "holdtime");
goto cleanup;
}
else
max = ULONG_MAX;
if (vshCommandOptScaledInt(cmd, "size", &bytes, 1024, max) < 0) {
- vshError(ctl, "%s", _("memory size has to be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "size");
virDomainFree(dom);
return false;
}
else
max = ULONG_MAX;
if (vshCommandOptScaledInt(cmd, "size", &bytes, 1024, max) < 0) {
- vshError(ctl, "%s", _("memory size has to be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "size");
virDomainFree(dom);
return false;
}
unsigned int pid_value; /* API uses unsigned int, not pid_t */
if (vshCommandOptUInt(cmd, "pid", &pid_value) <= 0) {
- vshError(ctl, "%s", _("missing pid value"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "pid");
goto cleanup;
}
judge = vshCommandOptInt(cmd, "timeout", &timeout);
if (judge < 0) {
- vshError(ctl, "%s", _("timeout number has to be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "timeout");
goto cleanup;
} else if (judge > 0) {
judge = 1;
if (!(dom = vshCommandOptDomain(ctl, cmd, NULL)))
return false;
- if (vshCommandOptLongLong(cmd, "downtime", &downtime) < 0 ||
- downtime < 1) {
+ if (vshCommandOptLongLong(cmd, "downtime", &downtime) < 0) {
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "downtime");
+ goto done;
+ }
+ if (downtime < 1) {
vshError(ctl, "%s", _("migrate: Invalid downtime"));
goto done;
}
rc = vshCommandOptULongLong(cmd, "size", &size);
if (rc < 0) {
- vshError(ctl, "%s", _("Unable to parse size parameter"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "size");
goto cleanup;
} else if (rc != 0) {
if (virDomainMigrateSetCompressionCache(dom, size, 0) < 0)
return false;
if (vshCommandOptULWrap(cmd, "bandwidth", &bandwidth) < 0) {
- vshError(ctl, "%s", _("migrate: Invalid bandwidth"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "bandwidth");
goto done;
}
return ret;
if (vshCommandOptULongLong(cmd, "minimum", &minimum) < 0) {
- vshError(ctl, _("Unable to parse integer parameter minimum"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "minimum");
goto cleanup;
}
VSH_EXCLUSIVE_OPTIONS_VAR(all, cellno);
if (cellno && vshCommandOptInt(cmd, "cellno", &cell) < 0) {
- vshError(ctl, "%s", _("cell number has to be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "cellno");
return false;
}
VSH_EXCLUSIVE_OPTIONS_VAR(all, cellno);
if (vshCommandOptScaledInt(cmd, "pagesize", &bytes, 1024, UINT_MAX) < 0) {
- vshError(ctl, "%s", _("page size has to be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "pagesize");
goto cleanup;
}
kibibytes = VIR_DIV_UP(bytes, 1024);
}
if (vshCommandOptInt(cmd, "cellno", &cell) < 0) {
- vshError(ctl, "%s", _("Invalid cellno argument"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "cellno");
goto cleanup;
}
VSH_EXCLUSIVE_OPTIONS_VAR(all, cellno);
if (cellno && vshCommandOptInt(cmd, "cellno", &startCell) < 0) {
- vshError(ctl, "%s", _("cell number has to be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "cellno");
return false;
}
if (vshCommandOptScaledInt(cmd, "pagesize", &tmp, 1024, UINT_MAX) < 0) {
- vshError(ctl, "%s", _("pagesize has to be a number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "cellno");
return false;
}
pageSizes[0] = VIR_DIV_UP(tmp, 1024);
bool present[VSH_CPU_LAST] = { false };
if (vshCommandOptInt(cmd, "cpu", &cpuNum) < 0) {
- vshError(ctl, "%s", _("Invalid value of cpuNum"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "cpu");
return false;
}
bool ret = false;
if (vshCommandOptInt(cmd, "cell", &cellNum) < 0) {
- vshError(ctl, "%s", _("Invalid value of cellNum"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "cell");
return false;
}
return false;
if (vshCommandOptLongLong(cmd, "duration", &duration) < 0) {
- vshError(ctl, _("Invalid duration argument"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "duration");
return false;
}
size_t i;
if ((rc = vshCommandOptUInt(cmd, "shm-pages-to-scan", &value)) < 0) {
- vshError(ctl, "%s", _("invalid shm-pages-to-scan number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "shm-pages-to-scan");
goto cleanup;
} else if (rc > 0) {
if (virTypedParamsAddUInt(¶ms, &nparams, &maxparams,
}
if ((rc = vshCommandOptUInt(cmd, "shm-sleep-millisecs", &value)) < 0) {
- vshError(ctl, "%s", _("invalid shm-sleep-millisecs number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "shm-sleep-millisecs");
goto cleanup;
} else if (rc > 0) {
if (virTypedParamsAddUInt(¶ms, &nparams, &maxparams,
}
if ((rc = vshCommandOptUInt(cmd, "shm-merge-across-nodes", &value)) < 0) {
- vshError(ctl, "%s", _("invalid shm-merge-across-nodes number"));
+ vshError(ctl,
+ _("Numeric value for <%s> option is malformed or out of range"),
+ "shm-merge-across-nodes");
goto cleanup;
} else if (rc > 0) {
if (virTypedParamsAddUInt(¶ms, &nparams, &maxparams,