From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Subject: [PATCH v3 4/6] vm: add support for testing in crosvm
Date: Fri, 21 Jul 2023 18:00:17 +0000 [thread overview]
Message-ID: <20230721180015.597099-5-hi@alyssa.is> (raw)
In-Reply-To: <20230721180015.597099-1-hi@alyssa.is>
From: Alyssa Ross <alyssa.ross@unikie.com>
This is useful because it allows comparing how our patched
cloud-hypervisor behaves against crosvm's implementation.
Signed-off-by: Alyssa Ross <alyssa.ross@unikie.com>
Co-authored-by: Alyssa Ross <hi@alyssa.is>
Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
img/app/Makefile | 12 ++++++++++++
lib/common.mk | 1 +
vm/sys/net/Makefile | 11 +++++++++++
vm/sys/net/shell.nix | 2 +-
4 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/img/app/Makefile b/img/app/Makefile
index 0742440..35db476 100644
--- a/img/app/Makefile
+++ b/img/app/Makefile
@@ -125,6 +125,18 @@ run-cloud-hypervisor: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-vi
--serial pty
.PHONY: run-cloud-hypervisor
+run-crosvm: $(imgdir)/appvm/blk/root.img start-vhost-user-gpu start-virtiofsd
+ $(CROSVM_RUN) \
+ --disk $(imgdir)/appvm/blk/root.img \
+ --disk $(RUN_IMG) \
+ -p "console=ttyS0 root=PARTLABEL=root" \
+ --vhost-user-fs build/virtiofsd.sock:virtiofs0 \
+ --vhost-user-gpu build/vhost-user-gpu.sock \
+ --serial type=file,hardware=serial,path=build/crosvm.log \
+ --serial type=stdout,hardware=virtio-console,stdin=true \
+ $(KERNEL)
+.PHONY: run-crosvm
+
run: run-$(VMM)
.PHONY: run
diff --git a/lib/common.mk b/lib/common.mk
index 81754b9..bba7f22 100644
--- a/lib/common.mk
+++ b/lib/common.mk
@@ -13,6 +13,7 @@ CPIO = cpio
CPIOFLAGS = --reproducible -R +0:+0 -H newc
CROSVM = crosvm
CROSVM_DEVICE_GPU = $(CROSVM) device gpu
+CROSVM_RUN = $(CROSVM) run
MCOPY = mcopy
MKFS_FAT = mkfs.fat
MMD = mmd
diff --git a/vm/sys/net/Makefile b/vm/sys/net/Makefile
index bbeb40b..d31477a 100644
--- a/vm/sys/net/Makefile
+++ b/vm/sys/net/Makefile
@@ -119,6 +119,17 @@ run-cloud-hypervisor: build/host/data/netvm/blk/root.img
--serial pty
.PHONY: run-cloud-hypervisor
+run-crosvm: build/host/data/netvm/blk/root.img
+ $(CROSVM_RUN) \
+ --disk build/host/data/netvm/blk/root.img \
+ -p "console=ttyS0 root=PARTLABEL=root" \
+ --net tap-name=tap0 \
+ --net tap-name=tap1,mac=0A:B3:EC:80:00:00 \
+ --serial type=file,hardware=serial,path=build/crosvm.log \
+ --serial type=stdout,hardware=virtio-console,stdin=true \
+ $(KERNEL)
+.PHONY: run-crosvm
+
run: run-$(VMM)
.PHONY: run
diff --git a/vm/sys/net/shell.nix b/vm/sys/net/shell.nix
index 7710438..39ba520 100644
--- a/vm/sys/net/shell.nix
+++ b/vm/sys/net/shell.nix
@@ -7,5 +7,5 @@ import ../../../lib/eval-config.nix ({ config, ... }: with config.pkgs;
{ nativeBuildInputs ? [], ... }:
{
- nativeBuildInputs = nativeBuildInputs ++ [ cloud-hypervisor jq qemu_kvm reuse ];
+ nativeBuildInputs = nativeBuildInputs ++ [ cloud-hypervisor crosvm jq qemu_kvm reuse ];
}))
--
2.40.1
next prev parent reply other threads:[~2023-07-21 18:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-21 18:00 [PATCH v3 0/6] Initial support for VM Wayland Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 1/6] img/app: allow waiting for GPU to appear Alyssa Ross
2023-07-28 12:10 ` Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 2/6] vm-lib: add mesa drivers to VM Alyssa Ross
2023-07-28 12:10 ` Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 3/6] img/app: add support for testing virtio-gpu Alyssa Ross
2023-07-28 12:10 ` Alyssa Ross
2023-07-21 18:00 ` Alyssa Ross [this message]
2023-07-28 12:10 ` [PATCH v3 4/6] vm: add support for testing in crosvm Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 5/6] host: add support for Wayland in VMs Alyssa Ross
2023-07-28 12:10 ` Alyssa Ross
2023-07-21 18:00 ` [PATCH v3 6/6] vm/app: add hello-wayland demo VM Alyssa Ross
2023-07-28 12:10 ` 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=20230721180015.597099-5-hi@alyssa.is \
--to=hi@alyssa.is \
--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).