dm: add new ioctl to create and destroy a device

Add IC_CREATE_DEVICE and IC_DESTROY_DEVICE ioctls to create and
destroy an emulated device in hypervisor

v3: change IC_CREATE_DEVICE and IC_DESTROY_DEVICE to IC_CREATE_HV_VDEV
    and IC_DESTROY_HV_VDEV

Tracked-On: #4853

Signed-off-by: Yuan Liu <yuan1.liu@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
Yuan Liu
2020-08-24 10:08:08 +08:00
committed by wenlingz
parent 1b711ed629
commit a977d35e0c
3 changed files with 59 additions and 0 deletions

View File

@@ -616,6 +616,18 @@ vm_unmap_ptdev_mmio(struct vmctx *ctx, int bus, int slot, int func,
return ioctl(ctx->fd, IC_UNSET_MEMSEG, &memmap);
}
int
vm_create_hv_vdev(struct vmctx *ctx, struct acrn_emul_dev *dev)
{
return ioctl(ctx->fd, IC_CREATE_HV_VDEV, dev);
}
int
vm_destroy_hv_vdev(struct vmctx *ctx, struct acrn_emul_dev *dev)
{
return ioctl(ctx->fd, IC_DESTROY_HV_VDEV, dev);
}
int
vm_set_ptdev_intx_info(struct vmctx *ctx, uint16_t virt_bdf, uint16_t phys_bdf,
int virt_pin, int phys_pin, bool pic_pin)