file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)

{

    HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(backend);



    if (!backend->size) {

        error_setg(errp, "can't create backend with size 0");

        return;

    }

    if (!fb->mem_path) {

        error_setg(errp, "mem-path property not set");

        return;

    }

#ifndef CONFIG_LINUX

    error_setg(errp, "-mem-path not supported on this host");

#else

    if (!memory_region_size(&backend->mr)) {

        backend->force_prealloc = mem_prealloc;

        memory_region_init_ram_from_file(&backend->mr, OBJECT(backend),

                                 object_get_canonical_path(OBJECT(backend)),

                                 backend->size, fb->share,

                                 fb->mem_path, errp);

    }

#endif

}

file_backend_memory_alloc(HostMemoryBackend *backend, Error **errp)

{

    HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(backend);



    if (!backend->size) {

        error_setg(errp, "can't create backend with size 0");

        return;

    }

    if (!fb->mem_path) {

        error_setg(errp, "mem-path property not set");

        return;

    }

#ifndef CONFIG_LINUX

    error_setg(errp, "-mem-path not supported on this host");

#else

    if (!memory_region_size(&backend->mr)) {

        backend->force_prealloc = mem_prealloc;

        memory_region_init_ram_from_file(&backend->mr, OBJECT(backend),

                                 object_get_canonical_path(OBJECT(backend)),

                                 backend->size, fb->share,

                                 fb->mem_path, errp);

    }

#endif

}

                                 object_get_canonical_path(OBJECT(backend)),
FUNC_0(HostMemoryBackend *VAR_0, Error **VAR_1)

{

    HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(VAR_0);



    if (!VAR_0->size) {

        error_setg(VAR_1, "can't create VAR_0 with size 0");

        return;

    }

    if (!fb->mem_path) {

        error_setg(VAR_1, "mem-path property not set");

        return;

    }

#ifndef CONFIG_LINUX

    error_setg(VAR_1, "-mem-path not supported on this host");

#else

    if (!memory_region_size(&VAR_0->mr)) {

        VAR_0->force_prealloc = mem_prealloc;

        memory_region_init_ram_from_file(&VAR_0->mr, OBJECT(VAR_0),

                                 object_get_canonical_path(OBJECT(VAR_0)),

                                 VAR_0->size, fb->share,

                                 fb->mem_path, VAR_1);

    }

#endif

}

FUNC_0(HostMemoryBackend *VAR_0, Error **VAR_1)
{ HostMemoryBackendFile *fb = MEMORY_BACKEND_FILE(VAR_0); if (!VAR_0->size) { error_setg(VAR_1, "can't create VAR_0 with size 0"); return; } if (!fb->mem_path) { error_setg(VAR_1, "mem-path property not set"); return; } #ifndef CONFIG_LINUX
error_setg(VAR_1, "-mem-path not supported on this host"); #else
if (!memory_region_size(&VAR_0->mr)) { VAR_0->force_prealloc = mem_prealloc; memory_region_init_ram_from_file(&VAR_0->mr, OBJECT(VAR_0),
object_get_canonical_path(OBJECT(VAR_0)),
VAR_0->size, fb->share,
fb->mem_path, VAR_1); } #endif
}