print that all CPU models are accepted for these architectures and the actual
list of supported CPU models can be checked in the domain capabilities XML.
-=item B<echo> [I<--shell>] [I<--xml>] [I<arg>...]
+=item B<echo> [I<--shell>] [I<--xml>] [I<err>...] [I<arg>...]
Echo back each I<arg>, separated by space. If I<--shell> is
specified, then the output will be single-quoted where needed, so that
it is suitable for reuse in a shell context. If I<--xml> is
specified, then the output will be escaped for use in XML.
+If I<--err> is specified, prefix B<"error: "> and output to stderr
+instead of stdout.
=item B<hypervisor-cpu-compare> I<FILE> [I<virttype>] [I<emulator>] [I<arch>]
[I<machine>] [I<--error>]
.type = VSH_OT_BOOL,
.help = N_("escape for XML use")
},
+ {.name = "err",
+ .type = VSH_OT_BOOL,
+ .help = N_("output to stderr"),
+ },
{.name = "str",
.type = VSH_OT_ALIAS,
.help = "string"
{
bool shell = false;
bool xml = false;
+ bool err = false;
int count = 0;
const vshCmdOpt *opt = NULL;
char *arg;
shell = true;
if (vshCommandOptBool(cmd, "xml"))
xml = true;
+ if (vshCommandOptBool(cmd, "err"))
+ err = true;
while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
char *str;
return false;
}
arg = virBufferContentAndReset(&buf);
- if (arg)
- vshPrint(ctl, "%s", arg);
+ if (arg) {
+ if (err)
+ vshError(ctl, "%s", arg);
+ else
+ vshPrint(ctl, "%s", arg);
+ }
VIR_FREE(arg);
return true;
}