From 99e49bc0bea13150e2893db330871db6869709c2 Mon Sep 17 00:00:00 2001 From: Dipen Pradhan Date: Wed, 1 Jul 2026 17:45:16 -0700 Subject: [PATCH] Add sdv_media and sdv_ivi templates --- .../cvd/cli/parser/launch_cvd_templates.cpp | 67 ++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/base/cvd/cuttlefish/host/commands/cvd/cli/parser/launch_cvd_templates.cpp b/base/cvd/cuttlefish/host/commands/cvd/cli/parser/launch_cvd_templates.cpp index ac34d079250..d81d5f33cce 100644 --- a/base/cvd/cuttlefish/host/commands/cvd/cli/parser/launch_cvd_templates.cpp +++ b/base/cvd/cuttlefish/host/commands/cvd/cli/parser/launch_cvd_templates.cpp @@ -232,6 +232,69 @@ static constexpr std::string_view kFoldableInstanceTemplate = R""""( } )""""; +// Definition of sdv_media instance template in Json format +static constexpr std::string_view kSdvMediaTemplate = R""""( +{ + "vm": { + "cpus": 4, + "memory_mb": 4096 + }, + "boot": { + "extra_bootconfig_args": "androidboot.sdv.instance_name=instance1 androidboot.virt.address=3 androidboot.sdv.boot_mode=unlocked" + }, + "security": { + "guest_enforce_security": false + }, + "graphics":{ + "gpu_mode": "gfxstream_guest_angle_host_swiftshader", + "displays":[ + { + "width": 1920, + "height": 1080, + "dpi": 160 + }, + { + "width": 1920, + "height": 720, + "dpi": 160 + } + ] + } +} + )""""; + +// Definition of sdv_ivi instance template in Json format +static constexpr std::string_view kSdvIviTemplate = R""""( +{ + "vm": { + "cpus": 4, + "memory_mb": 8192, + "setupwizard_mode": "OPTIONAL" + }, + "boot": { + "extra_bootconfig_args": "androidboot.sdv.instance_name=instance2 androidboot.virt.address=4 androidboot.sdv.boot_mode=unlocked" + }, + "security": { + "guest_enforce_security": false + }, + "graphics":{ + "gpu_mode": "guest_swiftshader", + "displays":[ + { + "width": 1920, + "height": 1080, + "dpi": 160 + }, + { + "width": 1920, + "height": 720, + "dpi": 160 + } + ] + } +} + )""""; + static Result LoadTemplateByName( const std::string& template_name) { static auto* kSupportedTemplatesKeyMap = @@ -243,7 +306,9 @@ static Result LoadTemplateByName( {"auto", kAutoInstanceTemplate}, {"slim", kSlimInstanceTemplate}, {"go", kGoInstanceTemplate}, - {"foldable", kFoldableInstanceTemplate}}; + {"foldable", kFoldableInstanceTemplate}, + {"sdv_media", kSdvMediaTemplate}, + {"sdv_ivi", kSdvIviTemplate}}; auto template_it = kSupportedTemplatesKeyMap->find(template_name); CF_EXPECTF(template_it != kSupportedTemplatesKeyMap->end(),