Add a new "virtual disk" feature.
It's extremely difficult to test storage related logic on devices
that don't have physical SD card slots. So to support better
debugging and testing, add a new "virtual disk" feature which mounts
a 512MB file through loop device.
It relies on the kernel having the "loop.max_part" value set to
something other than 0 via the boot command line, since that allows
all the existing partition logic to fall into place.
Bug: 34903607
Test: builds, boots, virtual disk works
Change-Id: I04c5b33e37319d867542985a56b7999a9b7cf35d
diff --git a/VolumeManager.h b/VolumeManager.h
index dd9f09d..796a91d 100644
--- a/VolumeManager.h
+++ b/VolumeManager.h
@@ -176,6 +176,7 @@
int unmountLoopImage(const char *containerId, const char *loopId,
const char *fileName, const char *mountPoint, bool force);
+ int updateVirtualDisk();
int setDebug(bool enable);
void setBroadcaster(SocketListener *sl) { mBroadcaster = sl; }
@@ -211,6 +212,8 @@
std::unordered_map<userid_t, int> mAddedUsers;
std::unordered_set<userid_t> mStartedUsers;
+ std::string mVirtualDiskPath;
+ std::shared_ptr<android::vold::Disk> mVirtualDisk;
std::shared_ptr<android::vold::VolumeBase> mInternalEmulated;
std::shared_ptr<android::vold::VolumeBase> mPrimary;
};