char *tmpstr;
const vshCmdOpt *opt = NULL;
virBuffer buf = VIR_BUFFER_INITIALIZER;
- bool pad = false;
bool ret = false;
unsigned int flags = VIR_DOMAIN_AFFECT_CURRENT;
if ((state = virshDomainState(ctl, dom, NULL)) < 0)
goto cleanup;
- while ((opt = vshCommandOptArgv(ctl, cmd, opt))) {
- if (pad)
- virBufferAddChar(&buf, ' ');
- pad = true;
- virBufferAdd(&buf, opt->data, -1);
- }
-
if (title)
type = VIR_DOMAIN_METADATA_TITLE;
else
type = VIR_DOMAIN_METADATA_DESCRIPTION;
+ while ((opt = vshCommandOptArgv(ctl, cmd, opt)))
+ virBufferAsprintf(&buf, "%s ", opt->data);
+
+ virBufferTrim(&buf, " ", -1);
+
if (virBufferError(&buf)) {
vshError(ctl, "%s", _("Failed to collect new description/title"));
goto cleanup;