Ejemplo n.º 1
0
int xen_init(QEMUMachine *machine)
{
    xen_xc = xen_xc_interface_open(0, 0, 0);
    if (xen_xc == XC_HANDLER_INITIAL_VALUE) {
        xen_be_printf(NULL, 0, "can't open xen interface\n");
        return -1;
    }
    qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);

    return 0;
}
Ejemplo n.º 2
0
static int xen_init(MachineState *ms)
{
    xen_xc = xen_xc_interface_open(0, 0, 0);
    if (xen_xc == XC_HANDLER_INITIAL_VALUE) {
        xen_be_printf(NULL, 0, "can't open xen interface\n");
        return -1;
    }
    xen_fmem = xenforeignmemory_open(0, 0);
    if (xen_fmem == NULL) {
        xen_be_printf(NULL, 0, "can't open xen fmem interface\n");
        xc_interface_close(xen_xc);
        return -1;
    }
    qemu_add_vm_change_state_handler(xen_change_state_handler, NULL);

    global_state_set_optional();
    savevm_skip_configuration();
    savevm_skip_section_footers();

    return 0;
}
Ejemplo n.º 3
0
    }

    xc_gnttab_close(xcg);
    return p;
}


void
alloc_vmfb(struct drm_i915_gem_userptr *create, int vmid)
{
    uint64_t nb_pfn = ((1680*1050*4)+XC_PAGE_SIZE-1) >> XC_PAGE_SHIFT;
    uint64_t err_bits[nb_pfn];
    XenXC xen_xc;
    unsigned long long mem;

    xen_xc = xen_xc_interface_open(0, 0, 0);

    if (xen_xc == XC_HANDLER_INITIAL_VALUE) {
        abort();
    }

    create->user_size = nb_pfn << XC_PAGE_SHIFT;
//    mem = memalign(XC_PAGE_SIZE, nb_pfn << XC_PAGE_SHIFT);
//    mem = (uint64_t)malloc(create->user_size);
//    posix_memalign((void **)&mem, XC_PAGE_SIZE, create->user_size);
    mem = (unsigned long)framebuffer_grant_test(vmid, nb_pfn);
#if 0
    xc_domain_add_to_physmap2(xen_xc, vmid, 0,
                              XENMAPSPACE_gmfn_foreign, mem, nb_pfn,
                              0xC0000000);
#endif