Conversation
Member
That was the original motivation for using |
Databean
reviewed
Sep 23, 2026
Databean
left a comment
Member
There was a problem hiding this comment.
There are presubmit errors:
FAIL: //cuttlefish/common/libs/utils:wait_for_unix_socket_clang_tidy (Exit 1) (see /home/runner/.cache/bazel/_bazel_runner/a1ea073c0d21ddc5ae89652639f74223/execroot/_main/bazel-out/k8-fastbuild/testlogs/cuttlefish/common/libs/utils/wait_for_unix_socket_clang_tidy/test.log)
==================== Test output for //cuttlefish/common/libs/utils:wait_for_unix_socket_clang_tidy:
37 warnings generated.
INFO: From Testing //cuttlefish/common/libs/utils:wait_for_unix_socket_clang_tidy:
warning: redefining builtin macro [clang-diagnostic-builtin-macro-redefined]
/home/runner/.cache/bazel/_bazel_runner/a1ea073c0d21ddc5ae89652639f74223/sandbox/processwrapper-sandbox/10928/execroot/_main/cuttlefish/common/libs/utils/wait_for_unix_socket.cpp:19:1: error: included header sched.h is not used directly [misc-include-cleaner,-warnings-as-errors]
19 | #include <sched.h>
| ^~~~~~~~~~~~~~~~~~
20 |
/home/runner/.cache/bazel/_bazel_runner/a1ea073c0d21ddc5ae89652639f74223/sandbox/processwrapper-sandbox/10928/execroot/_main/cuttlefish/common/libs/utils/wait_for_unix_socket.cpp:25:1: error: included header regex is not used directly [misc-include-cleaner,-warnings-as-errors]
25 | #include <regex>
| ^~~~~~~~~~~~~~~~
26 | #include <sstream>
/home/runner/.cache/bazel/_bazel_runner/a1ea073c0d21ddc5ae89652639f74223/sandbox/processwrapper-sandbox/10928/execroot/_main/cuttlefish/common/libs/utils/wait_for_unix_socket.cpp:29:1: error: included header utility is not used directly [misc-include-cleaner,-warnings-as-errors]
29 | #include <utility>
| ^~~~~~~~~~~~~~~~~~
30 |
/home/runner/.cache/bazel/_bazel_runner/a1ea073c0d21ddc5ae89652639f74223/sandbox/processwrapper-sandbox/10928/execroot/_main/cuttlefish/common/libs/utils/wait_for_unix_socket.cpp:31:1: error: included header log.h is not used directly [misc-include-cleaner,-warnings-as-errors]
31 | #include "absl/log/log.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~
32 |
/home/runner/.cache/bazel/_bazel_runner/a1ea073c0d21ddc5ae89652639f74223/sandbox/processwrapper-sandbox/10928/execroot/_main/cuttlefish/common/libs/utils/wait_for_unix_socket.cpp:37:1: error: included header command.h is not used directly [misc-include-cleaner,-warnings-as-errors]
37 | #include "cuttlefish/process/command.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 | #include "cuttlefish/process/managed_stdio.h"
/home/runner/.cache/bazel/_bazel_runner/a1ea073c0d21ddc5ae89652639f74223/sandbox/processwrapper-sandbox/10928/execroot/_main/cuttlefish/common/libs/utils/wait_for_unix_socket.cpp:38:1: error: included header managed_stdio.h is not used directly [misc-include-cleaner,-warnings-as-errors]
38 | #include "cuttlefish/process/managed_stdio.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39 | #include "cuttlefish/result/result.h"
Suppressed 28 warnings (28 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
6 warnings treated as errors
================================================================================
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, and let `auto` enable it for qemu_cli and riscv64 guests.
QEMU connects to the chardev once instead of retrying like crosvm, so
for QEMU wait for vhost.socket to listen first. The wait reads
/proc/net/unix rather than lsof, which isn't a dependency and doesn't
report unix socket state before 4.94.0. Both wait loops now sleep 20 ms
instead of spinning.
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.
dimorinny
force-pushed
the
qemu-vhost-user-vsock
branch
from
September 25, 2026 03:04
30c8f24 to
f4120d2
Compare
Contributor
Author
lsof itself does the right check, but it's a problem in practice:
lsof 4.94+ reads the same thing anyway: /proc/net/unix Flags & __SO_ACCEPTCON. The column layout is documented in proc(5), and the kernel has printed that bit there unchanged since 2.6.12. The new code does that check in process, still without connecting, so the aosp/3047934 constraint holds. Pushed:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
autonow 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.