On Thu, Jul 13, 2017 at 01:33:43AM +0300, Michael S. Tsirkin wrote:
On Wed, Jul 12, 2017 at 11:13:05PM +0200, Jens Freimann wrote:
> On Wed, Jul 12, 2017 at 06:10:05PM +0300, Michael S. Tsirkin wrote:
> > On Wed, Jul 12, 2017 at 11:41:46AM +0200, Jens Freimann wrote:
> > > This implements a testcase for pxe-test using the vhost-user interface.
Spawn a
> > > vhost-user-bridge process and connect it to the qemu process.
> > >
> > > It is send as an RFC because:
> > > - Patch 3/3: there must be cleaner way to do this.
> > > - Does Patch 1/3 make sense or should I just redirect all output to
/dev/null?
> > > - don't hardcode port numbers in qemu cmdline, create socket and pass
> > > fd to -netdev (need to figure out how to do this)
> >
> > Doesn't this work?
> >
> > -netdev socket,id=str[,fd=h]
>
> It should. But I get this:
>
> dded sock 5 for watching. max_sock: 5
> Sock 3 removed from dispatcher watch.
> qemu: error: specified mcastaddr "127.0.0.1" (0x7f000001) does not
contain a multicast address
> qemu-system-x86_64: -netdev socket,id=n1,fd=3: Device 'socket' could
not be initialized
> Broken pipe
Not sure what's wrong with it, should not be too hard to debug.
Jens asked me this question on IRC. I didn't know the answer either but
git-log(1) shows what happened:
-net socket,fd= was broken for SOCK_DGRAM from the moment mcast was
introduced by commit 3d830459b1eccdb61b75e2712fd364012ce5a115 ("'-net
socket,mcast=' option support (initial patch by Juan Jose Ciarlante)").
The issue is probably that the fd init code doesn't know whether the
user wanted mcast or not. Right now it's hardcoded to assume that mcast
is desired. It may be necessary to extend the command-line syntax to
specify mcast explicitly with fd=.