static int vfio_container_do_ioctl(AddressSpace *as, int32_t groupid,

                                   int req, void *param)

{

    VFIOGroup *group;

    VFIOContainer *container;

    int ret = -1;



    group = vfio_get_group(groupid, as);

    if (!group) {

        error_report("vfio: group %d not registered", groupid);

        return ret;

    }



    container = group->container;

    if (group->container) {

        ret = ioctl(container->fd, req, param);

        if (ret < 0) {

            error_report("vfio: failed to ioctl %d to container: ret=%d, %s",

                         _IOC_NR(req) - VFIO_BASE, ret, strerror(errno));

        }

    }



    vfio_put_group(group);



    return ret;

}

static int vfio_container_do_ioctl(AddressSpace *as, int32_t groupid,

                                   int req, void *param)

{

    VFIOGroup *group;

    VFIOContainer *container;

    int ret = -1;



    group = vfio_get_group(groupid, as);

    if (!group) {

        error_report("vfio: group %d not registered", groupid);

        return ret;

    }



    container = group->container;

    if (group->container) {

        ret = ioctl(container->fd, req, param);

        if (ret < 0) {

            error_report("vfio: failed to ioctl %d to container: ret=%d, %s",

                         _IOC_NR(req) - VFIO_BASE, ret, strerror(errno));

        }

    }



    vfio_put_group(group);



    return ret;

}

static int FUNC_0(AddressSpace *VAR_0, int32_t VAR_1,

                                   int VAR_2, void *VAR_3)

{

    VFIOGroup *group;

    VFIOContainer *container;

    int VAR_4 = -1;



    group = vfio_get_group(VAR_1, VAR_0);

    if (!group) {

        error_report("vfio: group %d not registered", VAR_1);

        return VAR_4;

    }



    container = group->container;

    if (group->container) {

        VAR_4 = ioctl(container->fd, VAR_2, VAR_3);

        if (VAR_4 < 0) {

            error_report("vfio: failed to ioctl %d to container: VAR_4=%d, %s",

                         _IOC_NR(VAR_2) - VFIO_BASE, VAR_4, strerror(errno));

        }

    }



    vfio_put_group(group);



    return VAR_4;

}

static int FUNC_0(AddressSpace *VAR_0, int32_t VAR_1,
int VAR_2, void *VAR_3)
{ VFIOGroup *group; VFIOContainer *container; int VAR_4 = -1; group = vfio_get_group(VAR_1, VAR_0); if (!group) { error_report("vfio: group %d not registered", VAR_1); return VAR_4; } container = group->container; if (group->container) { VAR_4 = ioctl(container->fd, VAR_2, VAR_3); if (VAR_4 < 0) { error_report("vfio: failed to ioctl %d to container: VAR_4=%d, %s",
_IOC_NR(VAR_2) - VFIO_BASE, VAR_4, strerror(errno)); } } vfio_put_group(group); return VAR_4; }