[libvirt] [PATCH] Make QEMU driver use -chardev everywhere when it's available
Matthew Booth
mbooth at redhat.com
Tue Nov 17 09:58:40 UTC 2009
On 16/11/09 13:30, Daniel P. Berrange wrote:
>> diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
>> index c807688..4f4b3db 100644
>> --- a/src/qemu/qemu_conf.c
>> +++ b/src/qemu/qemu_conf.c
>> @@ -1844,12 +1844,36 @@ int qemudBuildCommandLine(virConnectPtr conn,
>> if (monitor_chr) {
>> virBuffer buf = VIR_BUFFER_INITIALIZER;
>>
>> - qemudBuildCommandLineChrDevStr(monitor_chr,&buf);
>> - if (virBufferError(&buf))
>> - goto error;
>> + /* Use -chardev if it's available */
>> + if (qemuCmdFlags& QEMUD_CMD_FLAG_CHARDEV) {
>> + char id[16];
>> +
>> + if (snprintf(id, sizeof(id), "monitor%i", i)> sizeof(id))
>> + goto error;
>
> This is using 'i' uninitialized I believe. Its a little overkill to do
> a printf here at all since there's only ever a single monitor called
> 'monitor0'
Whoops, cut/paste error. It doesn't sound like this is going to be
merged immediately, so I'll keep the fix locally for the moment.
Thanks,
Matt
--
Matthew Booth, RHCA, RHCSS
Red Hat Engineering, Virtualisation Team
M: +44 (0)7977 267231
GPG ID: D33C3490
GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
More information about the libvir-list
mailing list