diff options
| author | Alistair Delva <adelva@google.com> | 2020-05-14 16:35:03 -0700 |
|---|---|---|
| committer | doc HD <doc.divxm@gmail.com> | 2020-06-06 23:33:55 +0300 |
| commit | d8999d77d60b933ada9098569bd38e6181bcafbd (patch) | |
| tree | a60bd2895599cb465ec604bdc493fd969b964c97 /Utils.h | |
| parent | 420ae89c626ddea6e63362f5627abfe580d4e45b (diff) | |
The Android Emulator isn't the only virtual device the virtio-block
detection code is useful for, and those platforms might not set any
discriminating properties to indicate that they are virtual.
Rework the virtio-block major detection to use /proc/devices instead
of hardcoding the assumption that any virtual platform can have
virtio-block at any experimental major; the new code permits only the
exact experimental major assigned to virtio-block.
The new code runs everywhere, but it will only run once and could be
expanded later to detect dynamic or experimental majors.
Bug: 156286088
Change-Id: Ieae805d08fddd0124a397636f04d99194a9ef7e5
Merged-In: Ieae805d08fddd0124a397636f04d99194a9ef7e5
(cherry picked from commit d3c230b5c9ba6e242c0a6b290a185517f2c118e8)
Diffstat (limited to 'Utils.h')
| -rw-r--r-- | Utils.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -133,8 +133,8 @@ status_t RestoreconRecursive(const std::string& path); // TODO: promote to android::base bool Readlinkat(int dirfd, const std::string& path, std::string* result); -/* Checks if Android is running in QEMU */ -bool IsRunningInEmulator(); +// Handles dynamic major assignment for virtio-block +bool IsVirtioBlkDevice(unsigned int major); status_t UnmountTreeWithPrefix(const std::string& prefix); status_t UnmountTree(const std::string& mountPoint); |
