Android-cuttlefish cvd tool
|
Classes | |
class | CuttlefishEnvironment |
struct | FlagVaules |
class | InstanceLifecycle |
struct | StatusFlags |
struct | WebAccessUrlParam |
Functions | |
android::base::LogSeverity | CvdVerbosityOption (const int argc, char **argv) |
Result< void > | KillOldServer () |
Result< void > | EnsureCvdDirectoriesExist () |
void | TryInheritServerDatabase () |
void | IncreaseFileLimit () |
Result< void > | CvdMain (int argc, char **argv, char **envp) |
std::string | ColoredUrl (const std::string &url) |
bool | ContainHelpOption (int argc, char **argv) |
Result< void > | CvdEnvMain (int argc, char **argv) |
int | ImportLocationsCvdMain (int argc, char **argv) |
void | SendDisclosure (SharedFD fd) |
int | SendIdDisclosureMain (int argc, char **argv) |
int | SendSmsMain (int argc, char **argv) |
int | UpdateLocationCvdMain (int argc, char **argv) |
void | UpdateSecurityAlgorithm (SharedFD fd) |
int | UpdateSecurityAlgorithmMain (int argc, char **argv) |
template<typename T > | |
void | LogError (Result< T > res) |
Result< void > | AddNetsimdLogs (WritableZip &archive) |
Result< void > | CreateDeviceBugreport (const CuttlefishConfig::InstanceSpecific &ins, const std::string &out_dir) |
Result< void > | AddAdbBugreport (const CuttlefishConfig::InstanceSpecific &instance, WritableZip &archive) |
void | TakeHostBugreport (const CuttlefishConfig *config, WritableZip &archive) |
Result< void > | CvdHostBugreportMain (int argc, char **argv) |
static bool | ShouldRestartProcess (siginfo_t const &info, const Parser &parsed) |
std::string_view | ExecutableShortName (std::string_view short_name) |
Result< SubprocessOptions > | OptionsForExecutable (std::string_view name) |
Result< int > | RunProcessRestarter (std::vector< std::string > args) |
fruit::Component | runCvdComponent (const CuttlefishConfig *config, const CuttlefishConfig::EnvironmentSpecific *environment, const CuttlefishConfig::InstanceSpecific *instance) |
Result< void > | StdinValid () |
void | ConfigureLogs (const CuttlefishConfig &config, const CuttlefishConfig::InstanceSpecific &instance) |
Result< std::string > | ToAbsolutePath (const std::string &snapshot_path) |
Result< void > | BroadcastLauncherAction (const CuttlefishConfig &config, const Parsed &parsed, run_cvd::ExtendedLauncherAction extended_action) |
Result< void > | SnapshotCvdMain (std::vector< std::string > args) |
std::string | GetHostToolPath () |
std::string | SubtoolPath (const std::string &subtool_base) |
std::string | AssemblerPath () |
std::string | RunnerPath () |
int | InvokeAssembler (const std::string &assembler_stdin, std::string &assembler_stdout, const std::vector< std::string > &argv) |
Subprocess | StartRunner (SharedFD runner_stdin, const CuttlefishConfig::InstanceSpecific &instance, const std::vector< std::string > &argv) |
std::string | WriteFiles (FetcherConfig fetcher_config) |
bool | HostToolsUpdated () |
const std::unordered_set< std::string > & | BoolFlags () |
int | CvdInternalStartMain (int argc, char **argv) |
Result< StatusFlags > | GetFlagValues (int argc, char **argv) |
std::string | CalcWebAccessUrl (const WebAccessUrlParam &web_access_url_param) |
Json::Value | PopulateDevicesInfoFromInstance (const CuttlefishConfig &config, const CuttlefishConfig::InstanceSpecific &instance_config) |
Result< void > | CvdStatusMain (const StatusFlags &flag_values) |
std::set< std::string > | FallbackDirs () |
std::set< std::string > | DirsForInstance (const CuttlefishConfig &config, const CuttlefishConfig::InstanceSpecific instance) |
std::set< pid_t > | GetCandidateProcessGroups (const std::set< std::string > &dirs) |
int | FallBackStop (const std::set< std::string > &dirs) |
Result< void > | CleanStopInstance (const CuttlefishConfig::InstanceSpecific &instance_config, const std::int32_t wait_for_launcher) |
int | StopInstance (const CuttlefishConfig &config, const CuttlefishConfig::InstanceSpecific &instance, const std::int32_t wait_for_launcher) |
void | ReleaseAllocdResources (SharedFD allocd_sock, uint32_t session_id) |
Send a StopSession request to allocd. More... | |
int | StopCvdMain (const std::int32_t wait_for_launcher, const bool clear_instance_dirs) |
Variables | |
constexpr char | kCvdEnvHelpMessage [] |
constexpr char | kServiceControlEnvProxy [] = "ControlEnvProxyService" |
constexpr int | kFallbackErrorBit = 1 << 2 |
Result< void > cuttlefish::anonymous_namespace{main.cc}::AddAdbBugreport | ( | const CuttlefishConfig::InstanceSpecific & | instance, |
WritableZip & | archive | ||
) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::AddNetsimdLogs | ( | WritableZip & | archive | ) |
std::string cuttlefish::anonymous_namespace{main.cc}::AssemblerPath | ( | ) |
const std::unordered_set< std::string > & cuttlefish::anonymous_namespace{main.cc}::BoolFlags | ( | ) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::BroadcastLauncherAction | ( | const CuttlefishConfig & | config, |
const Parsed & | parsed, | ||
run_cvd::ExtendedLauncherAction | extended_action | ||
) |
std::string cuttlefish::anonymous_namespace{main.cc}::CalcWebAccessUrl | ( | const WebAccessUrlParam & | web_access_url_param | ) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::CleanStopInstance | ( | const CuttlefishConfig::InstanceSpecific & | instance_config, |
const std::int32_t | wait_for_launcher | ||
) |
std::string cuttlefish::anonymous_namespace{main.cc}::ColoredUrl | ( | const std::string & | url | ) |
Returns the URL as a colored string
If stderr is not terminal, no color. If stderr is a tty, tries to use ".deb" file color If .deb is not available in LS_COLORS, uses .zip color. If none are available, use a default color that is red.
void cuttlefish::anonymous_namespace{main.cc}::ConfigureLogs | ( | const CuttlefishConfig & | config, |
const CuttlefishConfig::InstanceSpecific & | instance | ||
) |
bool cuttlefish::anonymous_namespace{main.cc}::ContainHelpOption | ( | int | argc, |
char ** | argv | ||
) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::CreateDeviceBugreport | ( | const CuttlefishConfig::InstanceSpecific & | ins, |
const std::string & | out_dir | ||
) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::CvdEnvMain | ( | int | argc, |
char ** | argv | ||
) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::CvdHostBugreportMain | ( | int | argc, |
char ** | argv | ||
) |
int cuttlefish::anonymous_namespace{main.cc}::CvdInternalStartMain | ( | int | argc, |
char ** | argv | ||
) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::CvdMain | ( | int | argc, |
char ** | argv, | ||
char ** | envp | ||
) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::CvdStatusMain | ( | const StatusFlags & | flag_values | ) |
android::base::LogSeverity cuttlefish::anonymous_namespace{main.cc}::CvdVerbosityOption | ( | const int | argc, |
char ** | argv | ||
) |
Returns –verbosity value if ever exist in the entire commandline args
Note that this will also pick up from the subtool arguments: e.g. cvd start –verbosity=DEBUG
This may be incorrect as the verbosity should be ideally applied to the launch_cvd/cvd_internal_start only.
However, parsing the –verbosity flag only from the driver is quite complicated as we do not know the full list of the subcommands, the subcommands flags, and even the selector/driver flags.
Thus, we live with the corner case for now.
std::set< std::string > cuttlefish::anonymous_namespace{main.cc}::DirsForInstance | ( | const CuttlefishConfig & | config, |
const CuttlefishConfig::InstanceSpecific | instance | ||
) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::EnsureCvdDirectoriesExist | ( | ) |
std::string_view cuttlefish::anonymous_namespace{main.cc}::ExecutableShortName | ( | std::string_view | short_name | ) |
std::set< std::string > cuttlefish::anonymous_namespace{main.cc}::FallbackDirs | ( | ) |
int cuttlefish::anonymous_namespace{main.cc}::FallBackStop | ( | const std::set< std::string > & | dirs | ) |
std::set< pid_t > cuttlefish::anonymous_namespace{main.cc}::GetCandidateProcessGroups | ( | const std::set< std::string > & | dirs | ) |
FlagVaules cuttlefish::anonymous_namespace{main.cc}::GetFlagValues | ( | int | argc, |
char ** | argv | ||
) |
std::string cuttlefish::anonymous_namespace{main.cc}::GetHostToolPath | ( | ) |
bool cuttlefish::anonymous_namespace{main.cc}::HostToolsUpdated | ( | ) |
int cuttlefish::anonymous_namespace{main.cc}::ImportLocationsCvdMain | ( | int | argc, |
char ** | argv | ||
) |
void cuttlefish::anonymous_namespace{main.cc}::IncreaseFileLimit | ( | ) |
Increase the file descriptor limit for this process and its descendants.
Crosvm tends to use many file descriptors, especially when running in sandbox mode, sometimes exceeding the default limit.
int cuttlefish::anonymous_namespace{main.cc}::InvokeAssembler | ( | const std::string & | assembler_stdin, |
std::string & | assembler_stdout, | ||
const std::vector< std::string > & | argv | ||
) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::KillOldServer | ( | ) |
Terminates a cvd server listening on "cvd_server"
So far, the server processes across users were listing on the "cvd_server" socket. And, so far, we had one user. Now, we have multiple users. Each server listens to cvd_server_<uid>. The thing is if there is a server process started out of an old executable it will be listening to "cvd_server," and thus we should kill the server process first.
void cuttlefish::anonymous_namespace{main.cc}::LogError | ( | Result< T > | res | ) |
Result< SubprocessOptions > cuttlefish::anonymous_namespace{main.cc}::OptionsForExecutable | ( | std::string_view | name | ) |
Json::Value cuttlefish::anonymous_namespace{main.cc}::PopulateDevicesInfoFromInstance | ( | const CuttlefishConfig & | config, |
const CuttlefishConfig::InstanceSpecific & | instance_config | ||
) |
void cuttlefish::anonymous_namespace{main.cc}::ReleaseAllocdResources | ( | SharedFD | allocd_sock, |
uint32_t | session_id | ||
) |
Send a StopSession request to allocd.
fruit::Component cuttlefish::anonymous_namespace{main.cc}::runCvdComponent | ( | const CuttlefishConfig * | config, |
const CuttlefishConfig::EnvironmentSpecific * | environment, | ||
const CuttlefishConfig::InstanceSpecific * | instance | ||
) |
std::string cuttlefish::anonymous_namespace{main.cc}::RunnerPath | ( | ) |
Result< int > cuttlefish::anonymous_namespace{main.cc}::RunProcessRestarter | ( | std::vector< std::string > | args | ) |
void cuttlefish::anonymous_namespace{main.cc}::SendDisclosure | ( | SharedFD | fd | ) |
int cuttlefish::anonymous_namespace{main.cc}::SendIdDisclosureMain | ( | int | argc, |
char ** | argv | ||
) |
int cuttlefish::anonymous_namespace{main.cc}::SendSmsMain | ( | int | argc, |
char ** | argv | ||
) |
|
static |
Result< void > cuttlefish::anonymous_namespace{main.cc}::SnapshotCvdMain | ( | std::vector< std::string > | args | ) |
Subprocess cuttlefish::anonymous_namespace{main.cc}::StartRunner | ( | SharedFD | runner_stdin, |
const CuttlefishConfig::InstanceSpecific & | instance, | ||
const std::vector< std::string > & | argv | ||
) |
Result< void > cuttlefish::anonymous_namespace{main.cc}::StdinValid | ( | ) |
int cuttlefish::anonymous_namespace{main.cc}::StopCvdMain | ( | const std::int32_t | wait_for_launcher, |
const bool | clear_instance_dirs | ||
) |
int cuttlefish::anonymous_namespace{main.cc}::StopInstance | ( | const CuttlefishConfig & | config, |
const CuttlefishConfig::InstanceSpecific & | instance, | ||
const std::int32_t | wait_for_launcher | ||
) |
std::string cuttlefish::anonymous_namespace{main.cc}::SubtoolPath | ( | const std::string & | subtool_base | ) |
void cuttlefish::anonymous_namespace{main.cc}::TakeHostBugreport | ( | const CuttlefishConfig * | config, |
WritableZip & | archive | ||
) |
Result< std::string > cuttlefish::anonymous_namespace{main.cc}::ToAbsolutePath | ( | const std::string & | snapshot_path | ) |
void cuttlefish::anonymous_namespace{main.cc}::TryInheritServerDatabase | ( | ) |
Persist a running server's instance database to the file.
It works by asking the server to restart itself using our executable file.
int cuttlefish::anonymous_namespace{main.cc}::UpdateLocationCvdMain | ( | int | argc, |
char ** | argv | ||
) |
void cuttlefish::anonymous_namespace{main.cc}::UpdateSecurityAlgorithm | ( | SharedFD | fd | ) |
int cuttlefish::anonymous_namespace{main.cc}::UpdateSecurityAlgorithmMain | ( | int | argc, |
char ** | argv | ||
) |
std::string cuttlefish::anonymous_namespace{main.cc}::WriteFiles | ( | FetcherConfig | fetcher_config | ) |
|
constexpr |
|
constexpr |
|
constexpr |