acrn-hypervisor/devicemodel/core
Vijay Dhanraj 71b56e0eed DM: Virtio-Blk Rescan
This patch adds support to trigger rescan of virtio-blk device by the
guest VM. This is an alternate to hot-plugging virtio-blk device.
This feature stems from the kata requirement, which hot-plugs container
rootfs after the VM is launched.

As part of virtio-blk rescan,
1. Update the backing file for the virtio-blk device with valid file.
   Basically update the empty file (with dummy bctxt) that was passed
   during VM launch.
2. Update virtio-blk device configurations for udpated backing file.
3. Update size associated with valid backing file in the config space.
4. Notify guest OS, of the new config change.
5. On this notification, guest will do the following.
	(i). Update virtio-blk capacity.
 	(ii). Revalidate the disk.
 	(iii). Identify the newly plugged block device.

v5 -> v6:
- Removed use of dummy file and added a new parameter "nodisk"
  to virtio-blk which indicates user wants to create a virtio-blk
  device with dummy backend.
- Moved vm_monitor_rescan from pci core to virtio-blk as it currently
  applies to only virtio-blk.

v4 -> v5:
- Reverted back logic, so that blkrescan is only supported when
  VM is launched with empty backend file.

v3 -> v4:
- Close block context before allocating a new one
- Allow backend filepath  with additional options to be more generic
- Remove blank lines introduced as part of previous patches.

v2 -> v3:
- Renamed vdev ops vdev_blk rescan to vdev_rescan
- Renamed montior ops virtio_blkrescan_ops to virtio_rescan_ops
- Consolidated virtio-blk configuration specific part into
  a separate function
- Removed size requirement in acrnctl command.

v1 -> v2:
- Added more comments in the code.
- Renamed APIs from displug to blkrescan, inline with acrnctl cmd.
- Split the patch into two. This corresponds to changes in acrn-dm.

Tracked-On: #3051
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
2019-05-07 09:08:50 +08:00
..
console.c DM: cleanup for header inclusions 2018-06-07 14:35:30 +08:00
gc.c DM: cleanup for header inclusions 2018-06-07 14:35:30 +08:00
hugetlb.c dm: add support of high MMIO mapping 2019-02-28 18:33:11 +08:00
inout.c dm: completely remove enable_bar()/disable_bar() functions 2019-04-22 15:18:21 +08:00
main.c DM: use log macro/func to output log info 2019-05-05 19:13:07 +08:00
mem.c dm: safely access MMIO hint in MMIO emulation 2019-04-22 15:18:21 +08:00
mevent.c dm: create mevent's pipe in non-blocking mode 2019-01-23 10:33:28 +08:00
monitor.c DM: Virtio-Blk Rescan 2019-05-07 09:08:50 +08:00
mptbl.c dm: adapt mptable generation for VM with lapic pt 2019-01-28 19:47:33 +08:00
pm.c DM: register pm ops to monitor 2018-08-02 13:14:03 +08:00
post.c DM: cleanup for header inclusions 2018-06-07 14:35:30 +08:00
sw_load_bzimage.c dm: use strncpy to replace strcpy 2018-12-25 18:40:04 +08:00
sw_load_common.c dm: leave a gap for 32-bit PCI hole in E820 map 2019-03-25 13:49:48 +08:00
sw_load_elf.c dm: fix possible memory leak in 'load_elf32()' 2019-04-15 17:33:42 +08:00
sw_load_ovmf.c dm: build E820 map for OVMF 2019-03-21 10:28:17 +08:00
sw_load_vsbl.c dm: use strncpy to replace strcpy 2018-12-25 18:40:04 +08:00
timer.c dm: provide timer callback handlers the number of expirations 2019-01-23 10:33:28 +08:00
vmmapi.c DM: use log macro/func to output log info 2019-05-05 19:13:07 +08:00
vrpmb.c DM: generate random virtual RPMB key 2018-10-29 11:07:45 +08:00