
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@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org