OSDN Git Service

Support emulator's virtio-blk based SD card
authorYu Ning <yu.ning@intel.com>
Fri, 8 Jan 2016 09:36:47 +0000 (17:36 +0800)
committerPrathmesh Prabhu <pprabhu@google.com>
Tue, 8 Mar 2016 20:19:41 +0000 (12:19 -0800)
commit942d4e830b2057177fd2d47c51b788edd6e94398
tree33654832bdc3d291b0766a2c4e4fa4c141a24fe9
parentad8e26297b07f26376bd3125b11ae280304c22e8
Support emulator's virtio-blk based SD card

Currently, vold only supports MMC (for SD cards) and SCSI (for USB
drives) devices. It does not recognize any device whose major number is
not one of those used by MMC and SCSI. Unfortunately, virtio-blk is one
such device. It is used by the new Android emulator (a.k.a. qemu2,
featuring the "ranchu" virtual board) for SD card emulation.

In order to make this virtio-blk based SD card device appear in Android
and appear as an SD card (rather than a USB drive), changes have to be
made to both vold (wherever the device major number is checked) and
ranchu's storage configuration. This CL implements former.

This is a stop-gap solution for emulator in nyc.
A longer term solution in-tune with upstream kernel is in the pipes.

Updated from aosp/master version.

BUG:27431753

Change-Id: I5014edec73be7c5b565d91542464c82cbe58992c
Signed-off-by: Yu Ning <yu.ning@intel.com>
(cherry picked from commit 5b1d1c7dfa13b4dca75213581dc8351b841b76c8)
Disk.cpp
Utils.cpp
Utils.h
VolumeManager.cpp