Instead of the custom error:
error: iothreadpin: invalid cpulist.
use vshCommandOptStringReq and let it report a more specific error:
error: Failed to get option 'cpulist': Option argument is empty
if (vshCommandOptUInt(ctl, cmd, "iothread", &iothread_id) < 0)
goto cleanup;
- if (vshCommandOptString(ctl, cmd, "cpulist", &cpulist) < 0) {
- vshError(ctl, "%s", _("iothreadpin: invalid cpulist."));
+ if (vshCommandOptStringReq(ctl, cmd, "cpulist", &cpulist) < 0)
goto cleanup;
- }
if ((maxcpu = virshNodeGetCPUCount(priv->conn)) < 0)
goto cleanup;