[libvirt] [PATCH] qemu: Fix -chardev udp if parameters are omitted
Eric Blake
eblake at redhat.com
Tue Mar 22 22:08:10 UTC 2011
On 03/22/2011 02:36 PM, Cole Robinson wrote:
> The following XML:
>
> <serial type='udp'>
> <source mode='connect' service='9999'/>
> </serial>
>
> is accepted by domain_conf.c but maps to the qemu command line:
>
> -chardev udp,host=127.0.0.1,port=2222,localaddr=(null),localport=(null)
>
> qemu can cope with everything omitting except the connection port, which
> seems to also be the intent of domain_conf validation, so let's not
> generate bogus command lines for that case.
In the past, I've been told that the qemu command line should be as
full-featured as possible - that is, if we know what qemu will be using
as a default, then we should explicitly provide that argument rather
than relying on the default (it helps us future-proof if not all
versions of qemu take the same defaults).
I agree that something needs to be done here to avoid the NULL
dereference (glibc is too kind by printing "(null)" instead of
crashing); but am not sure that making the qemu command line parameters
optional is right, if we instead know what qemu does when those
parameters are missing.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110322/672850f3/attachment-0001.sig>
More information about the libvir-list
mailing list