Android-cuttlefish cvd tool
start.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#pragma once
18
19#include <optional>
20#include <string>
21
28
29namespace cuttlefish {
30
32 public:
33 CvdStartCommandHandler(InstanceManager& instance_manager);
34
35 Result<void> Handle(const CommandRequest& request) override;
36 std::vector<std::string> CmdList() const override;
37 std::string SummaryHelp() const override {
38 return "Start all Cuttlefish Instances in a group";
39 }
40 std::vector<HelpParagraph> Description() const override;
42
43 bool RequiresDeviceExists() const override { return true; }
44 bool RequiresHostConfiguration() const override { return true; }
45
46 private:
48 LocalInstanceGroup& group,
49 const CommandRequest& request);
50
52 Command command, LocalInstanceGroup& group,
53 const std::unordered_map<std::string, std::string>& envs,
54 const CommandRequest& request);
55
57 Command command, LocalInstanceGroup& group,
58 const std::unordered_map<std::string, std::string>& envs,
59 const CommandRequest& request);
60
61 // Flags handled by `cvd start` itself, not cvd_internal_start.
62 std::vector<Flag> BuildOwnFlags();
63
66 struct {
67 std::vector<std::string> host_substitutions;
68 bool daemon;
69 std::string print_group_format;
71};
72
73} // namespace cuttlefish
Definition: command_request.h:33
Definition: command.h:38
Definition: command_handler.h:28
std::vector< HelpParagraph > Description() const override
Definition: start.cpp:672
std::string print_group_format
Definition: start.h:69
std::string SummaryHelp() const override
Definition: start.h:37
std::vector< Flag > BuildOwnFlags()
Definition: start.cpp:704
Result< void > LaunchSingleInstance(LocalInstance &instance, LocalInstanceGroup &group, const CommandRequest &request)
Definition: start.cpp:605
std::vector< std::string > CmdList() const override
Definition: start.cpp:539
bool RequiresHostConfiguration() const override
Definition: start.h:44
struct cuttlefish::CvdStartCommandHandler::@16 own_flags_
std::vector< std::string > host_substitutions
Definition: start.h:67
bool RequiresDeviceExists() const override
Definition: start.h:43
SubprocessWaiter subprocess_waiter_
Definition: start.h:65
Result< std::vector< Flag > > Flags(const CommandRequest &) override
Definition: start.cpp:690
Result< void > Handle(const CommandRequest &request) override
Definition: start.cpp:376
bool daemon
Definition: start.h:68
InstanceManager & instance_manager_
Definition: start.h:64
Result< void > LaunchDevice(Command command, LocalInstanceGroup &group, const std::unordered_map< std::string, std::string > &envs, const CommandRequest &request)
Definition: start.cpp:543
Result< void > LaunchDeviceInterruptible(Command command, LocalInstanceGroup &group, const std::unordered_map< std::string, std::string > &envs, const CommandRequest &request)
Definition: start.cpp:579
CvdStartCommandHandler(InstanceManager &instance_manager)
Definition: start.cpp:369
Definition: instance_manager.h:50
Definition: local_instance_group.h:32
Definition: local_instance.h:36
Definition: subprocess_waiter.h:27
Definition: alloc_driver.h:20
tl::expected< T, StackTraceError > Result
Definition: result_type.h:30