Support enabling vsock connections with a launcher flag.
vsock connections are a guest/host communication channel.
This is gated on a flag as it requires user access to /dev/vhost-vsock
on the host as well as guest kernel support, neither of which are
guaranteed by Cuttlefish at the moment. The flag is enabled when the
capability "vsock" is detected.
Bug: 121166534
Change-Id: I46cf79d12af9ec0cfb68b0fde810efe8b1abc386
Test: launch_cvd -kernel=...cf-4.14... -vsock_guest_cid=3
diff --git a/host/libs/config/cuttlefish_config.h b/host/libs/config/cuttlefish_config.h
index fd1a26e..0ecc9be 100644
--- a/host/libs/config/cuttlefish_config.h
+++ b/host/libs/config/cuttlefish_config.h
@@ -173,6 +173,9 @@
std::string entropy_source() const;
void set_entropy_source(const std::string& entropy_source);
+ void set_vsock_guest_cid(int vsock_guest_cid);
+ int vsock_guest_cid() const;
+
std::string uuid() const;
void set_uuid(const std::string& uuid);
@@ -237,6 +240,7 @@
std::string GetDefaultPerInstanceDir();
std::string GetDefaultMempath();
+int GetDefaultPerInstanceVsockCid();
std::string DefaultHostArtifactsPath(const std::string& file);
std::string DefaultGuestImagePath(const std::string& file);
@@ -244,4 +248,5 @@
// Whether the installed host packages support calling qemu directly instead of
// through libvirt
bool HostSupportsQemuCli();
+bool HostSupportsVsock();
} // namespace vsoc