GVM User Suite
User tools for the GVM open source project.
Functions | Variables
manager.c File Reference
#include <gpu/nvidia/device.h>
#include <gpu/nvidia/resman/api.h>
#include <gpu/nvidia/resman/classes.h>
#include <gpu/nvidia/resman/types.h>
#include <gvm/nvidia/init.h>
#include <gvm/nvidia/manager.h>
#include <sys/select.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
Include dependency graph for manager.c:

Go to the source code of this file.

Functions

static uint32_t compose_vm_id (uint32_t t, uint32_t i)
 Inline function to create VM specific Event IDs. More...
 
static int event_init (int ctl_fd, struct NvResource *res, uint32_t event, uint32_t notify, uint32_t flags)
 Code to initialize events for the VM manager. More...
 
struct VmMgr init_nv_vm_mgr (struct NvMdev *mgr)
 Initializes a NVIDIA VM manager to connect to a VM. More...
 
void handle_vm_start (struct VmMgr *mgr, struct NvMdev *mdev_mgr)
 Handles a start request. More...
 
void start_vm (struct VmMgr *mgr, struct NvMdev *mdev_mgr)
 Connects the VM to the user program. More...
 

Variables

const uint32_t RM_EVENT = 4
 RM Event ID. More...
 

Function Documentation

◆ compose_vm_id()

static uint32_t compose_vm_id ( uint32_t  t,
uint32_t  i 
)
inlinestatic

Inline function to create VM specific Event IDs.

Definition at line 37 of file manager.c.

◆ event_init()

static int event_init ( int  ctl_fd,
struct NvResource res,
uint32_t  event,
uint32_t  notify,
uint32_t  flags 
)
static

Code to initialize events for the VM manager.

This makes a event handler for the VM manager.

Parameters
ctl_fd- Control file descriptor.
res- Parent resource on the base of the system.
event- Event id.
notify- Notification settings.
flags- Flags to use for the event.
Returns
Returns a file descriptor to associate to the event.

Definition at line 53 of file manager.c.

Here is the call graph for this function:

◆ handle_vm_start()

void handle_vm_start ( struct VmMgr mgr,
struct NvMdev mdev_mgr 
)

Handles a start request.

Todo:
Proper logging.

Definition at line 119 of file manager.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_nv_vm_mgr()

struct VmMgr init_nv_vm_mgr ( struct NvMdev mgr)

Initializes a NVIDIA VM manager to connect to a VM.

Todo:
Proper logging.

Definition at line 53 of file manager.c.

Here is the caller graph for this function:

◆ start_vm()

void start_vm ( struct VmMgr mgr,
struct NvMdev mdev_mgr 
)

Connects the VM to the user program.

Todo:
Proper logging.

Definition at line 143 of file manager.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ RM_EVENT

const uint32_t RM_EVENT = 4

RM Event ID.

Definition at line 34 of file manager.c.