-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuma_ext.c
51 lines (46 loc) · 1.1 KB
/
numa_ext.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* numa_text.c
*
* Created on: Jun 5, 2013
* Author: samuel
*
* Compile with: gcc -g -Wall ex1.c -o ex -lvirt
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libvirt/libvirt.h>
#include <string.h>
#include "numa_ext.h"
#include "scheduler.h"
#include "selector.h"
#include "numax_getinfo.h"
int main(int argc, char *argv[])
{
int i;
virConnectPtr conn;
virDomainPtr domPtr_sche_lst[MAX_DOMS_NR];
int domPtr_sche_lst_nxt = 0;
if ((conn = virConnectOpen("xen:///"))== NULL){
perror("failed to execute virConnectOpen function");
return ERROR;
}
memset(domPtr_sche_lst, 0, sizeof domPtr_sche_lst);
while(1){
if(default_selector(conn, domPtr_sche_lst, &domPtr_sche_lst_nxt) == ERROR){
perror("failed to execute the default_selector");
return ERROR;
}
if(default_scheduler(domPtr_sche_lst, domPtr_sche_lst_nxt) == ERROR){
perror("failed to execute the default_scheduler");
return ERROR;
}
for(i = 0; i < domPtr_sche_lst_nxt; i++)
free(domPtr_sche_lst[i]);
break;
}
virConnectClose(conn);
return SUCCESS;
}