mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-17 23:08:07 +00:00
dm: remove vm_get_config() API
This API depends on GET_PLATFORM_INFO ioctl command, which will not be supported from ACRN HSM anymore. This patch removes the definition of it and also cleans related data structure. Tracked-On: #6690 Signed-off-by: Yonghua Huang <yonghua.huang@intel.com> Acked-by: Wang, Yu1 <yu1.wang@intel.com>
This commit is contained in:
committed by
acrnsi-robot
parent
e0a01a12d9
commit
dd2d1a5610
@@ -643,61 +643,3 @@ vm_irqfd(struct vmctx *ctx, struct acrn_irqfd *args)
|
||||
{
|
||||
return ioctl(ctx->fd, ACRN_IOCTL_IRQFD, args);
|
||||
}
|
||||
|
||||
int
|
||||
vm_get_config(struct vmctx *ctx, struct acrn_vm_config_header *vm_cfg, struct acrn_platform_info *plat_info)
|
||||
{
|
||||
int i, err = 0;
|
||||
int configs_size;
|
||||
uint8_t *configs_buff = NULL;
|
||||
struct acrn_vm_config_header *pcfg;
|
||||
struct acrn_platform_info platform_info;
|
||||
|
||||
if ((ctx == NULL) || (vm_cfg == NULL))
|
||||
return -1;
|
||||
|
||||
/* The first IOCTL to get max_vm and vm_config size of a VM */
|
||||
bzero(&platform_info, sizeof(platform_info));
|
||||
err = ioctl(ctx->fd, ACRN_IOCTL_GET_PLATFORM_INFO, &platform_info);
|
||||
if (err) {
|
||||
pr_err("%s: IOCTL first time failed!\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
configs_size = platform_info.sw.max_vms * platform_info.sw.vm_config_size;
|
||||
configs_buff = calloc(1, configs_size);
|
||||
if (configs_buff == NULL) {
|
||||
pr_err("%s, Allocate memory fail.\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
platform_info.sw.vm_configs_addr = configs_buff;
|
||||
err = ioctl(ctx->fd, ACRN_IOCTL_GET_PLATFORM_INFO, &platform_info);
|
||||
if (err) {
|
||||
pr_err("%s: IOCTL second time failed!\n", __func__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
for (i = 0; i < platform_info.sw.max_vms; i++) {
|
||||
pcfg = (struct acrn_vm_config_header *)(configs_buff + (i * platform_info.sw.vm_config_size));
|
||||
if (!strncmp(ctx->name, pcfg->name, strnlen(ctx->name, MAX_VM_NAME_LEN)))
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == platform_info.sw.max_vms) {
|
||||
pr_err("%s, Not found target VM.\n", __func__);
|
||||
err = -1;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
memcpy((void *)vm_cfg, (void *)pcfg, sizeof(struct acrn_vm_config_header));
|
||||
if (plat_info != NULL) {
|
||||
memcpy((void *)plat_info, (void *)&platform_info, sizeof(struct acrn_platform_info));
|
||||
pr_info("%s, l2_cat_shift=%u, l3_cat_shift=%u\n",
|
||||
__func__, platform_info.hw.l2_cat_shift, platform_info.hw.l3_cat_shift);
|
||||
}
|
||||
|
||||
exit:
|
||||
free(configs_buff);
|
||||
return err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user