7575#include  " host/libs/vm_manager/qemu_manager.h" 
7676#include  " host/libs/vm_manager/vm_manager.h" 
7777
78- using  cuttlefish::DefaultHostArtifactsPath;
79- using  cuttlefish::HostBinaryPath;
80- using  cuttlefish::TempDir;
81- using  cuttlefish::vm_manager::CrosvmManager;
82- using  google::FlagSettingMode::SET_FLAGS_DEFAULT;
83- using  google::FlagSettingMode::SET_FLAGS_VALUE;
84- 
85- //  https://cs.android.com/android/platform/superproject/main/+/main:device/google/cuttlefish/Android.bp;l=122;drc=6f7d6a4db58efcc2ddd09eda07e009c6329414cd
86- #define  USERDATA_FILE_SYSTEM_TYPE  " f2fs" 
87- 
8878#define  DEFINE_vec  DEFINE_string
8979#define  DEFINE_proto  DEFINE_string
9080#define  GET_FLAG_STR_VALUE (name ) GetFlagStrValueForInstances(FLAGS_ ##name, instances_size, #name, name_to_default_value)
@@ -551,7 +541,7 @@ DEFINE_vec(
551541DEFINE_vec (vhost_user_block, CF_DEFAULTS_VHOST_USER_BLOCK ? " true"   : " false"  ,
552542 " (experimental) use crosvm vhost-user block device implementation "  );
553543
554- DEFINE_string (early_tmp_dir, TempDir(),
544+ DEFINE_string (early_tmp_dir, cuttlefish:: TempDir(),
555545 "Parent directory to use for temporary files in early startup");
556546
557547DEFINE_vec (enable_tap_devices, " true"  ,
@@ -2150,13 +2140,13 @@ Result<void> SetDefaultFlagsForQemu(
21502140 //  This is the 1st place to set "start_webrtc" flag value
21512141 //  for now, we don't set non-default options for QEMU
21522142 SetCommandLineOptionWithMode (" start_webrtc"  , default_start_webrtc.c_str (),
2153-  SET_FLAGS_DEFAULT);
2143+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
21542144
21552145 SetCommandLineOptionWithMode (" bootloader"  , default_bootloader.c_str (),
2156-  SET_FLAGS_DEFAULT);
2146+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
21572147 SetCommandLineOptionWithMode (" android_efi_loader"  ,
21582148 default_android_efi_loader.c_str (),
2159-  SET_FLAGS_DEFAULT);
2149+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
21602150 return  {};
21612151}
21622152
@@ -2231,35 +2221,39 @@ Result<void> SetDefaultFlagsForCrosvm(
22312221 }
22322222 }
22332223 SetCommandLineOptionWithMode (" bootloader"  , default_bootloader.c_str (),
2234-  SET_FLAGS_DEFAULT);
2224+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
22352225 SetCommandLineOptionWithMode (" android_efi_loader"  ,
22362226 default_android_efi_loader.c_str (),
2237-  SET_FLAGS_DEFAULT);
2227+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
22382228 //  This is the 1st place to set "start_webrtc" flag value
22392229 SetCommandLineOptionWithMode (" start_webrtc"  , default_start_webrtc.c_str (),
2240-  SET_FLAGS_DEFAULT);
2230+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
22412231 //  This is the 1st place to set "enable_sandbox" flag value
2242-  SetCommandLineOptionWithMode (
2243-  " enable_sandbox"  , default_enable_sandbox_str.c_str (), SET_FLAGS_DEFAULT);
2244-  SetCommandLineOptionWithMode (
2245-  " enable_virtiofs"  , default_enable_sandbox_str.c_str (), SET_FLAGS_DEFAULT);
2232+  SetCommandLineOptionWithMode (" enable_sandbox"  ,
2233+  default_enable_sandbox_str.c_str (),
2234+  google::FlagSettingMode::SET_FLAGS_DEFAULT);
2235+  SetCommandLineOptionWithMode (" enable_virtiofs"  ,
2236+  default_enable_sandbox_str.c_str (),
2237+  google::FlagSettingMode::SET_FLAGS_DEFAULT);
22462238 return  {};
22472239}
22482240
22492241void  SetDefaultFlagsForGem5 () {
22502242 //  TODO: Add support for gem5 gpu models
22512243 SetCommandLineOptionWithMode (" gpu_mode"  , kGpuModeGuestSwiftshader ,
2252-  SET_FLAGS_DEFAULT);
2244+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
22532245
2254-  SetCommandLineOptionWithMode (" cpus"  , " 1"  , SET_FLAGS_DEFAULT);
2246+  SetCommandLineOptionWithMode (" cpus"  , " 1"  ,
2247+  google::FlagSettingMode::SET_FLAGS_DEFAULT);
22552248}
22562249
22572250void  SetDefaultFlagsForMcu () {
22582251 auto  path = DefaultHostArtifactsPath (" etc/mcu_config.json"  );
22592252 if  (!CanAccess (path, R_OK)) {
22602253 return ;
22612254 }
2262-  SetCommandLineOptionWithMode (" mcu_config_path"  , path.c_str (), SET_FLAGS_DEFAULT);
2255+  SetCommandLineOptionWithMode (" mcu_config_path"  , path.c_str (),
2256+  google::FlagSettingMode::SET_FLAGS_DEFAULT);
22632257}
22642258
22652259void  SetDefaultFlagsForOpenwrt (Arch target_arch) {
@@ -2268,23 +2262,23 @@ void SetDefaultFlagsForOpenwrt(Arch target_arch) {
22682262 " ap_kernel_image"  ,
22692263 DefaultHostArtifactsPath (" etc/openwrt/images/openwrt_kernel_x86_64"  )
22702264 .c_str (),
2271-  SET_FLAGS_DEFAULT);
2265+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
22722266 SetCommandLineOptionWithMode (
22732267 " ap_rootfs_image"  ,
22742268 DefaultHostArtifactsPath (" etc/openwrt/images/openwrt_rootfs_x86_64"  )
22752269 .c_str (),
2276-  SET_FLAGS_DEFAULT);
2270+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
22772271 } else  if  (target_arch == Arch::Arm64) {
22782272 SetCommandLineOptionWithMode (
22792273 " ap_kernel_image"  ,
22802274 DefaultHostArtifactsPath (" etc/openwrt/images/openwrt_kernel_aarch64"  )
22812275 .c_str (),
2282-  SET_FLAGS_DEFAULT);
2276+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
22832277 SetCommandLineOptionWithMode (
22842278 " ap_rootfs_image"  ,
22852279 DefaultHostArtifactsPath (" etc/openwrt/images/openwrt_rootfs_aarch64"  )
22862280 .c_str (),
2287-  SET_FLAGS_DEFAULT);
2281+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
22882282 }
22892283}
22902284
@@ -2355,11 +2349,11 @@ Result<std::vector<GuestConfig>> GetGuestConfigAndSetDefaults() {
23552349 SetCommandLineOptionWithMode (
23562350 " start_webrtc_sig_server"  ,
23572351 start_webrtc && !host_operator_present ? " true"   : " false"  ,
2358-  SET_FLAGS_DEFAULT);
2352+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
23592353 SetCommandLineOptionWithMode (
23602354 " webrtc_sig_server_addr"  ,
23612355 host_operator_present ? HOST_OPERATOR_SOCKET_PATH : " 0.0.0.0"  ,
2362-  SET_FLAGS_DEFAULT);
2356+  google::FlagSettingMode:: SET_FLAGS_DEFAULT);
23632357 }
23642358
23652359 SetDefaultFlagsForOpenwrt (guest_configs[0 ].target_arch );
@@ -2376,10 +2370,4 @@ std::string GetConfigFilePath(const CuttlefishConfig& config) {
23762370 return  config.AssemblyPath (" cuttlefish_config.json"  );
23772371}
23782372
2379- std::string GetSeccompPolicyDir () {
2380-  std::string kSeccompDir  =
2381-  " usr/share/crosvm/"   + HostArchStr () + " -linux-gnu/seccomp"  ;
2382-  return  DefaultHostArtifactsPath (kSeccompDir );
2383- }
2384- 
23852373} //  namespace cuttlefish
0 commit comments