On Wed, Jan 06, 2010 at 08:59:37PM +0100, Paolo Bonzini wrote: > >>>> We have ones that require read/write, ones that require send/recv, and >>>> ones that require vhost interaction. Really, the first two are the same >>>> but the distinction is necessary for Windows. >>> >>> Not necessarily, you can open sockets on Windows so that they support >>> read/write. Just create it with >>> >>> fh = WSASocket (domain, type, protocol, NULL, 0, 0); >>> >>> instead of socket. Since Windows already has enough problems passing >>> file descriptors to processes, imposing the above on an external >>> management interface is not a huge chore. >>> >>> Paolo >> >> For linux read/write often isn't a good idea :) > > Yeah, only for "normal" raw sockets.
You mean TCP? We really need a UDP option BTW, and that also needs special handling. >> E.g. for packet sockets you really need to use sendmsg and set msg_name >> with the proper protocol. You also must use recvmsg and set MSG_TRUNC >> otherwise packets can get truncatred silently. > > The situation for packet sockets is more similar to vnet headers no > (just learning all this stuff)? They require code in qemu anyway, so > the helper would do only the set up/tear down. > > Paolo Yes. And in that case, it does not make sense to force helper usage where option to call 'socket' is just as easy. -- MST