[libvirt] [PATCH] Expose SLIRP attributes

Richard W.M. Jones rjones at redhat.com
Fri Mar 28 10:26:10 UTC 2014


On Fri, Mar 28, 2014 at 08:47:48AM +0000, Richard W.M. Jones wrote:
> On Fri, Mar 28, 2014 at 10:33:39AM +0200, Laine Stump wrote:
> > Beyond that, a question not with your patch, but with qemu's
> > implemenation - does it always assume that the gateway address is
> > $network.1 ?
> 
> Actually network.2.  The default addresses are:
> 
>                            network: 10.0.2.0/24 (ie. mask 255.255.255.0)
>                    default gateway: 10.0.2.2
>                         dns server: 10.0.2.3
>  dhcp start / normal guest address: 10.0.2.15
> 
> It _is_ possible to change the gateway address, by specifying the
> (confusingly named) 'host=' parameter.  As you suggested I think this
> could be mapped to a gateway XML attribute, although libguestfs would
> not need to use it.

Another couple of thoughts on this patch.

(1) Qemu rejects impossible network configurations -- for example, if
you specify a default gateway address which is outside the network
address range.  However it does so without giving any specific error
messages, see:

http://git.qemu.org/?p=qemu.git;a=blob;f=net/slirp.c;h=cce026bf12bbead8a2bc8b5d0a1af67877266dd9;hb=HEAD#l208

Is there a case for making libvirt do the same checks and give proper
error messages (and/or should we fix qemu)?

(2) IPv6 is impossible with qemu's SLIRP.  SLIRP is ancient BSD code
and was written long before IPv6 existed, and not updated since.  It
looks as if this patch would allow you to do specify IPv6 addresses,
but it should probably reject them at the libvirt level.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




More information about the libvir-list mailing list