virtio_blk - Fix capacity calculation, when host sets large disk block size.
authorImre Vadász <imre@vdsz.com>
Mon, 16 Oct 2017 22:00:32 +0000 (00:00 +0200)
committerImre Vadász <imre@vdsz.com>
Mon, 16 Oct 2017 22:10:11 +0000 (00:10 +0200)
commit4846c10471333bbb8549928a19e1928788509360
tree086862490f6528f8ad6f1798a9ec85f269f1edef
parentafd7f1247cb20d5b03f8ccddb470de6a55afc530
virtio_blk - Fix capacity calculation, when host sets large disk block size.

* The disk capacity in the virtio configuration space is always specified
  in 512 byte sectors, so info.d_media_blksize should be 512.

* Also check for VIRTIO_BLK_F_GEOMETRY feature before reading the disk
  geometry from configuration space.

* Add some device_printf calls to report the disk size and (if available)
  geometry during bootup.
sys/dev/virtual/virtio/block/virtio_blk.c