Skip to content

Support vhost-user-vsock with the QEMU VMM - #3198

Open
dimorinny wants to merge 1 commit into
google:mainfrom
dimorinny:qemu-vhost-user-vsock
Open

dimorinny wants to merge 1 commit into
google:mainfrom
dimorinny:qemu-vhost-user-vsock

Conversation

@dimorinny

Copy link
Copy Markdown
Contributor

The qemu_cli VMM only wired up the kernel's vhost-vsock device, so run_cvd's vsock servers fail in containers without AF_VSOCK. Emit a vhost-user-vsock-pci-non-transitional device backed by vhost_device_vsock instead. auto now keys off the guest target_arch and covers arm64 and riscv64, so x86_64 hosts running arm64 guests under qemu_cli switch to vhost-user vsock.

QEMU connects to the chardev once at startup instead of retrying like crosvm, so wait for vhost.socket to listen first. That wait reads /proc/net/unix instead of lsof, and must not connect: the backend would consume the probe as its one allowed frontend.

Bug: b/561671404
Test: cvd start --vm_manager=qemu_cli --vhost_user_vsock=true, for an
x86_64 guest on an x86_64 host and an arm64 guest on an x86_64
host. Both reach sys.boot_completed=1 with adb working over vsock.

The qemu_cli VMM only wired up the kernel's vhost-vsock device, so
run_cvd's vsock servers fail in containers without AF_VSOCK. Emit a
vhost-user-vsock-pci-non-transitional device backed by vhost_device_vsock
instead. `auto` now keys off the guest target_arch and covers arm64 and
riscv64, so x86_64 hosts running arm64 guests under qemu_cli switch to
vhost-user vsock.

QEMU connects to the chardev once at startup instead of retrying like
crosvm, so wait for vhost.socket to listen first. That wait reads
/proc/net/unix instead of lsof, and must not connect: the backend would
consume the probe as its one allowed frontend.

Bug: b/561671404
Test: cvd start --vm_manager=qemu_cli --vhost_user_vsock=true, for an
      x86_64 guest on an x86_64 host and an arm64 guest on an x86_64
      host. Both reach sys.boot_completed=1 with adb working over vsock.
@Databean

Databean commented Sep 19, 2026

Copy link
Copy Markdown
Member

and must not connect: the backend would consume the probe as its one allowed frontend.

That was the original motivation for using lsof, see aosp/3047934. Is there an issue using it now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants