[libvirt] [PATCH libvirt master] interface type: add udp socket support

Laine Stump laine at laine.org
Mon Aug 10 05:28:32 UTC 2015


On 08/07/2015 06:14 PM, Jonathan Toppins wrote:
> Adds a new interface type using UDP sockets, this seems only applicable
> to QEMU but have edited tree-wide to support the new interface type.
>
> The interface type required the addition of a "destaddr" (destination
> address), this then maps into the following xml and qemu call.
>
> <interface type='udp'>
> 	<mac address='52:54:00:5c:67:56'/>
> 	<source address='127.0.0.1' port='11112'/>
> 	<model type='virtio'/>
> 	<dest address="127.0.0.1' port='22222'/>

I think I don't like the "dest" element. Historically, <source> has been
used to describe the resources used in the real world to backup the
emulated device, or maybe "the real world source of the data that's
going into the emulated device". What you're doing is kind of redefining
it to be "the local end of real world resources". Aside from that, for
mcast, client, and server interface types, <source address....> is where
the remote address for the socket is set.

I'd say that to make it fit in better with the existing types, the
remote address should be in <source address='blah'>, and the local
address should be a subelement of that, something like:

     <source address='remoteaddr' port='remoteport'>
       <local address='localaddr' port='localport'/>
     </source>

That makes source address exactly fit the same purpose as source address
for the existing mcast, server, and client interface types. (It may seem
a little odd until you start thinking of "source" as "the thing farthest
away from the virtual machine").


(I haven't had any time to look at the rest of the patch yet, as I'm
just back from vacation and chasing a nasty bug, but wanted to get this
thought out there sooner rather than later)




More information about the libvir-list mailing list