mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 20:45:18 +00:00
Cleanup virBuffer usage in qemdBuildCommandLine
* src/qemu_qemu_conf.c: Cleanup usage of virBuffer in qemudBuildCommandLine
This commit is contained in:
parent
649bcd72fe
commit
8f67f6448b
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user