Tools: New ACRNCTL command "blkrescan"

This patch adds support for new acrnctl command blkrescan.
Purpose: To add a virtio-blk device to guest VM after launch.
Use case:
1. Anticipate number of block devices that will be needed
   and add empty backend file while launching VM.
   e.g: -s 5, virtio-blk,nodisk
2. Use the following acrnctl command to trigger
   a rescan of virtio-blk device by guest VM, to
   revalidate and update the backend file.
   “acrnctl blkrescan VMname slot,newfilepath”

v5 -> v6:
- Removed unsed #define
- Reduced the size of param len of blkrescan command
  from 512 to 256.

v2 -> v5:
- No change

v1 -> v2:
- Renamed the acrnctl command and APIs from diskplug
  to blkrescan.
- Split the patch into two. This corresponds to
  changes in tools.

Tracked-On: #3051
Signed-off-by: Vijay Dhanraj <vijay.dhanraj@intel.com>
Reviewed-by: Yu Wang <yu1.wang@intel.com>
This commit is contained in:
Vijay Dhanraj
2019-04-17 17:44:53 -07:00
committed by wenlingz
parent 30de7e8e34
commit f178788d7c
4 changed files with 66 additions and 1 deletions

View File

@@ -59,5 +59,6 @@ int pause_vm(const char *vmname);
int continue_vm(const char *vmname);
int suspend_vm(const char *vmname);
int resume_vm(const char *vmname, unsigned reason);
int blkrescan_vm(const char *vmname, char *devargs);
#endif /* _ACRNCTL_H_ */