char proc_file_name[128];
memset(proc_file_name, 0, 128);
- snprintf(proc_file_name, 128, "v3-mem%d", zone->node_id);
+ snprintf(proc_file_name, 128, "v3-mem%u", zone->node_id);
remove_proc_entry(proc_file_name, palacios_get_procdir());
}
}
return slot;
- return -1;
}
/*
link->sock_addr.sin_port = htons(link->dst_port);
- if ((err = link->sock->ops->connect(link->sock, (struct sockaddr *)&(link->sock_addr), sizeof(struct sockaddr), 0) < 0)) {
+ if ((err = link->sock->ops->connect(link->sock, (struct sockaddr *)&(link->sock_addr), sizeof(struct sockaddr), 0)) < 0) {
WARNING("Could not connect to remote VNET Server, error %d\n", err);
return -1;
}
static void
host_reset_timer(void * vnet_timer, unsigned long interval){
- struct host_timer * timer = (struct host_timer *)timer;
+ struct host_timer * timer = (struct host_timer *)vnet_timer;
timer->interval = interval;
}
}
}
+ if (prime_index==prime_table_len) {
+ // cannot build large enough hash table
+ return NULL;
+ }
+
htable = (struct hashtable *)palacios_alloc(sizeof(struct hashtable));
if (htable == NULL) {
uint64_t sys_rc, sys_errno, sys_code, a1,a2,a3,a4,a5,a6, bit_vec;
int host_mod_fd, fd_shared, i, val;
long long zero = 0;
- void* region;
void* unbacked_region;
fd_set readset;
int select_rc;
sprintf(unbacked_region,"helloworldhelloworldhelloworld");
DEBUG_PRINT("unbacked_region ptr: %p contents: %s\n",unbacked_region,(char*)unbacked_region);
- DEBUG_PRINT("Vadrr : %p ; Paddr : %p\n", unbacked_region, vtop((uint64_t)unbacked_region));
- DEBUG_PRINT("Persisting as a userspace for VM %s with address %p\n",argv[1], region);
+ DEBUG_PRINT("Vaddr : %p ; Paddr : %p\n", unbacked_region, vtop((uint64_t)unbacked_region));
+ DEBUG_PRINT("Persisting as a userspace for VM %s with address %p\n",argv[1], unbacked_region);
if (ioctl(host_mod_fd,INIT_IOCTL,vtop((uint64_t)unbacked_region))) {
perror("init ioctl");
perror("Failed Syscall: ");
}
- DEBUG_PRINT("Device File: System call rc %d, %016llu %016llx %016lld\n",(int)sys_rc,sys_rc);
+ DEBUG_PRINT("Device File: System call rc %d, errno %d\n",(int)sys_rc,sys_errno);
//put return value into shared region
store_args_to_shared_page((uint64_t*)unbacked_region, &sys_rc, &sys_errno);
// Now collect the region info
guest_cur=0;
+ i=0;
while (i<num_regions) {
if (!fgets(buf,MAXLINE,f)) {
fprintf(stderr,"Did not find all regions...\n");
m->block[i].hpa = (void*)start;
m->block[i].numpages = (end-start) / 4096 + !!((end-start) % 4096);
if ((end-start)%4096) {
- fprintf(stderr,"Odd, region %d is a non-integral number of pages");
+ fprintf(stderr,"Odd, region %d is a non-integral number of pages",i);
}
guest_cur+=end-start;
m->block[i].cumgpa=(void*)(guest_cur-1);
return -1;
}
- status_buf[BUF_SIZE]=0;
+ status_buf[BUF_SIZE-1]=0;
VPRINTF("Checking offlined block %d (%s)...", i + reg_start, fname);
fclose(off);
if (!(off=fopen(offname,"w+"))) { // truncate
- EPRINTF("Cannot open %s for writing!\n");
+ EPRINTF("Cannot open %s for writing!\n",offname);
return -1;
}
cmd.first_core = atoi(argv[3]);
cmd.num_cores = atoi(argv[4]);
}
+ } else {
+ usage();
+ return -1;
}
printf("Doing VM reset: %s ",
int do_work(struct palacios_host_dev_host_request_response *req,
struct palacios_host_dev_host_request_response **resp)
{
- uint64_t datasize;
+ uint64_t datasize=0;
//
//
int do_work(struct palacios_user_keyed_stream_op *req,
struct palacios_user_keyed_stream_op **resp)
{
- uint64_t datasize;
+ uint64_t datasize=0;
//
//
//
if (strncmp(url,"user:",5)) {
- fprintf(stderr, "URL %s is not a user: url\n");
+ fprintf(stderr, "URL %s is not a user: url\n",url);
exit(-1);
}