Move config validation to the builder

And remove it from the constructor. This allows us to fail earlier and
reject invalid values immediately. In some cases throw
IllegalArgumentException etc rather than the checked
VirtualMachineException, following API guidelines.

Don't allow memory or encrypted storage size of 0 to be specified
explicitly.

Use the builder when deserializing, to ensure we validate there too.

Fix one test to match (we throw the exception at a different place).

Bug: 261037705
Test: atest MicrodroidTests
Change-Id: If788a1832f9718fa6713f35cb869517d5d7c8a34
3 files changed
tree: 29eb3a55e5021d4629490127dde1e7cc0ded0e59
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. avmd/
  5. compos/
  6. demo/
  7. docs/
  8. encryptedstore/
  9. javalib/
  10. launcher/
  11. libs/
  12. microdroid/
  13. microdroid_manager/
  14. pvmfw/
  15. rialto/
  16. tests/
  17. virtualizationservice/
  18. vm/
  19. vm_payload/
  20. vmbase/
  21. vmclient/
  22. zipfuse/
  23. .clang-format
  24. .gitignore
  25. Android.bp
  26. OWNERS
  27. PREUPLOAD.cfg
  28. README.md
  29. TEST_MAPPING
README.md

Virtualization

This repository contains userspace services related to running virtual machines on Android, especially protected virtual machines. See the getting started documentation and Microdroid README for more information.