patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: colbyt <colby@colbyt.com>
Cc: devel@spectrum-os.org
Subject: Re: [PATCH 3/6] vm: use vhost-user networking for crosvm
Date: Fri, 26 Jun 2026 16:45:32 +0200	[thread overview]
Message-ID: <87echtfjhv.fsf@alyssa.is> (raw)
In-Reply-To: <1f9b01987e964c245ada51ca0f87500bef54bc96.1782409229.git.colby@colbyt.com>

[-- Attachment #1: Type: text/plain, Size: 3698 bytes --]

colbyt <colby@colbyt.com> 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 <colby@colbyt.com>
> ---
>  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?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  reply	other threads:[~2026-06-26 14:45 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 17:48 [PATCH 0/6] cloud-hypervisor v52 and VM runtime fixes colbyt
2026-06-25 17:48 ` [PATCH 1/6] pkgs/skaware: vendor backported patches colbyt
2026-06-26 13:39   ` Alyssa Ross
2026-06-25 17:48 ` [PATCH 2/6] pkgs/cloud-hypervisor: update GPU patchset to v52 colbyt
2026-06-26 14:06   ` Alyssa Ross
2026-06-25 17:48 ` [PATCH 3/6] vm: use vhost-user networking for crosvm colbyt
2026-06-26 14:45   ` Alyssa Ross [this message]
2026-07-02  9:07   ` Alyssa Ross
2026-06-25 17:48 ` [PATCH 4/6] Documentation: use crosvm GPU socket-path option colbyt
2026-06-26 14:18   ` Alyssa Ross
2026-06-25 17:48 ` [PATCH 5/6] installer: suppress boot console status noise colbyt
2026-06-26 14:46   ` Alyssa Ross
2026-06-26 19:09     ` colby
2026-07-02 11:44       ` Alyssa Ross
2026-06-25 17:48 ` [PATCH 6/6] start-vmm: test GPU socket configuration colbyt
2026-06-26 14:18   ` Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87echtfjhv.fsf@alyssa.is \
    --to=hi@alyssa.is \
    --cc=colby@colbyt.com \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).