Move delete to VirtualMachineManager

This allows us to make sure we can delete a VM even if it is corrupted
(e.g. missing or malformed config file). Also delete all files in the
VM directory, even ones we don't expect to be there, as otherwise the
VM name can never be reused.

For consistency, modify load() to return null iff the VM directory
doesn't exist; other missing files cause an exception to be thrown.

While I'm here, move the vm files under getDataDir (which the app
shouldn't be touching) rather than getFilesDir (where it might want to
create its own directory called "vm").

Add tests. Modify test & demo APKs to match.

Bug: 242999384
Bug: 257474585
Test: atest MicrodroidTests
Change-Id: I3525e4c7c208a9bd1a7c41d6475327038073d6e6
5 files changed
tree: eb66072fa12a5c005da5b5a2886355d1bbad9576
  1. apex/
  2. apkdmverity/
  3. authfs/
  4. avmd/
  5. compos/
  6. demo/
  7. docs/
  8. javalib/
  9. launcher/
  10. libs/
  11. microdroid/
  12. microdroid_manager/
  13. pvmfw/
  14. rialto/
  15. tests/
  16. virtualizationservice/
  17. vm/
  18. vmbase/
  19. vmclient/
  20. zipfuse/
  21. .clang-format
  22. .gitignore
  23. Android.bp
  24. OWNERS
  25. PREUPLOAD.cfg
  26. README.md
  27. 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.