Cleanup virBuffer usage in qemdBuildCommandLine

* src/qemu_qemu_conf.c: Cleanup usage of virBuffer in qemudBuildCommandLine
This commit is contained in:
Matthew Booth 2009-11-06 12:19:21 +01:00 committed by Daniel Veillard
parent 649bcd72fe
commit 8f67f6448b

View File

@ -2182,7 +2182,6 @@ int qemudBuildCommandLine(virConnectPtr conn,
for (i = 0 ; i < def->nchannels ; i++) {
virBuffer buf = VIR_BUFFER_INITIALIZER;
const char *argStr;
char id[16];
virDomainChrDefPtr channel = def->channels[i];
@ -2199,24 +2198,18 @@ int qemudBuildCommandLine(virConnectPtr conn,
}
qemudBuildCommandLineChrDevChardevStr(channel, id, &buf);
argStr = virBufferContentAndReset(&buf);
if (argStr == NULL)
if (virBufferError(&buf))
goto error;
ADD_ARG_LIT("-chardev");
ADD_ARG_LIT(argStr);
VIR_FREE(argStr);
ADD_ARG(virBufferContentAndReset(&buf));
qemudBuildCommandLineChrDevTargetStr(channel, id, &buf);
argStr = virBufferContentAndReset(&buf);
if (argStr == NULL)
if (virBufferError(&buf))
goto error;
ADD_ARG_LIT("-net");
ADD_ARG_LIT(argStr);
VIR_FREE(argStr);
ADD_ARG(virBufferContentAndReset(&buf));
}
}