colbyt writes: > The crosvm VM test paths used raw tap networking for their primary > network device, while the Cloud Hypervisor paths already used Spectrum's > passt-backed vhost-user-net helper. > > Start the existing helper for crosvm and pass it to crosvm with > --vhost-user net,socket=build/vhost-user-net.sock. The net VM still > keeps tap1 for its downstream interface, and the start-vhost-user-net > targets are marked phony like the other service-start targets. > > Signed-off-by: colbyt > --- > img/app/Makefile | 7 ++++--- > vm/sys/net/Makefile | 5 +++-- > 2 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/img/app/Makefile b/img/app/Makefile > index fd75e6e..915db3d 100644 > --- a/img/app/Makefile > +++ b/img/app/Makefile > @@ -84,6 +84,7 @@ start-vhost-user-gpu: > start-vhost-user-net: > mkdir -p build > ../../scripts/start-passt.elb > +.PHONY: start-vhost-user-net > > start-virtiofsd: scripts/start-virtiofsd.elb > mkdir -p build > @@ -127,11 +128,11 @@ run-cloud-hypervisor: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-vh > --serial file=build/serial.log > .PHONY: run-cloud-hypervisor > > -run-crosvm: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-virtiofsd > - ../../scripts/with-taps.elb $(CROSVM_RUN) \ > +run-crosvm: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-vhost-user-net start-virtiofsd > + $(CROSVM_RUN) \ > -b path=$(imgdir)/appvm/blk/root.img,ro=true \ > -p "console=ttyS0 root=PARTLABEL=root" \ > - --net tap-name=tap0,mac=02:00:00:00:00:01 \ > + --vhost-user net,socket=build/vhost-user-net.sock \ > --vhost-user fs,socket=build/virtiofsd.sock \ > --vhost-user gpu,socket=build/vhost-user-gpu.sock \ > --vsock cid=3 \ I'm not sure about this. If we lose the ability to set the MAC, the VM can't recognize this as a Spectrum internal interface, and configure it appropriately. At present the only configuration involved is setting the interface up, but I'm not sure it's so useful to test with an interface that to the VM looks like a passed through physical interface, which would be an unusual (but not impossible) thing for an app VM to have. > diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile > index 653ef13..e37fe8c 100644 > --- a/vm/sys/net/Makefile > +++ b/vm/sys/net/Makefile > @@ -63,6 +63,7 @@ debug: > start-vhost-user-net: > mkdir -p build > ../../../scripts/start-passt.elb > +.PHONY: start-vhost-user-net > > run-qemu: $(vmdir)/netvm/blk/root.img > @../../../scripts/run-qemu.sh -m 256 -cpu max -kernel $(KERNEL) -vga none \ > @@ -93,11 +94,11 @@ run-cloud-hypervisor: $(vmdir)/netvm/blk/root.img start-vhost-user-net > --serial file=build/serial.log > .PHONY: run-cloud-hypervisor > > -run-crosvm: $(vmdir)/netvm/blk/root.img > +run-crosvm: $(vmdir)/netvm/blk/root.img start-vhost-user-net > ../../../scripts/with-taps.elb $(CROSVM_RUN) \ > -b path=$(vmdir)/netvm/blk/root.img,ro=true \ > -p "console=ttyS0 root=PARTLABEL=root" \ > - --net tap-name=tap0 \ > + --vhost-user net,socket=build/vhost-user-net.sock \ > --net tap-name=tap1,mac=02:01:00:00:00:01 \ > --serial type=file,hardware=serial,path=build/serial.log \ > --serial type=stdout,hardware=virtio-console,stdin=true \ This is fine though, since here we're using passt to simulate a physical device that wouldn't have a special MAC. The .PHONY additions are of course also correct, so I propose applying this patch minus the change to run-crosvm in img/app. What do you think?