Proxy --acpi-table, --device-tree-overlay, and --file-backed-mapping to crosvm run - #2960
Proxy --acpi-table, --device-tree-overlay, and --file-backed-mapping to crosvm run#2960erjiaqing wants to merge 3 commits into
Conversation
…to crosvm run Introduce new gflags and cuttlefish config properties to allow proxying user provided ACPI tables, device tree overlays, and file-backed mappings to crosvm run command. These options are passed when starting the main crosvm runner command. Assisted-by: Antigravity:Gemini-Next TAG=agy CONV=2a93473d-f5c9-4f0d-89a1-b07cb069a790
| std::vector<std::string> crosvm_file_backed_mapping_vec = | ||
| CF_EXPECT(GET_FLAG_STR_VALUE(crosvm_file_backed_mapping)); |
There was a problem hiding this comment.
The suggested arguments of addr=NUM,size=NUM,path=PATH,offset=NUM,rw,sync,align,ram will interact badly with GET_FLAG_STR_VALUE, which separates arguments to different by splitting on commas.
Specifically,
cvd create --crosvm_file_backed_mapping=addr=NUM,size=NUM --num_instances=2
will result in two invocations of crosvm:
$ crosvm --file-backed-mapping=addr=NUM
$ crosvm --file-backed-mapping=size=NUM
which I assume is not the intended behavior.
The easy option is to put this in CuttlefishConfig rather than CuttlefishConfig::InstanceSpecific and declare that all instances launched concurrently must use the same value.
Another route we've gone is e.g. extra_bootconfig_args_base64 which expects the arguments to be base64-encoded so that GET_FLAG_STR_VALUE can correctly divide the arguments between instances.
There was a problem hiding this comment.
Thanks for the insight.
For our usecase, we are passing the opendice handover to the memory, which does not make sense to have multiple instances using the same handover file. So I added the crosvm_file_backed_mapping_base64. To allow multiple instances using different buffer.
GET_FLAG_STR_VALUE splits on commas to separate arguments for different instances. This interacts badly with crosvm_file_backed_mapping's comma-separated arguments (addr=NUM,size=NUM...). Support base64-encoded crosvm_file_backed_mapping to allow correct argument division between instances in multi-device clusters. TAG=agy CONV=d50a8a3c-a4cd-4ba2-97cc-cfaf7a4ec28c
This CL Introduce new command line arguments and cuttlefish config properties to allow proxying user provided ACPI tables, device tree overlays, and file-backed mappings to
crosvm runcommand.Assisted-by: Antigravity:Gemini-Next
Bug: 510177847