304 |
return(0); |
return(0); |
305 |
} |
} |
306 |
|
|
307 |
|
/* Show info about potential timer drift */ |
308 |
|
static int cmd_show_timer_drift(hypervisor_conn_t *conn, |
309 |
|
int argc,char *argv[]) |
310 |
|
{ |
311 |
|
vm_instance_t *vm; |
312 |
|
cpu_mips_t *cpu; |
313 |
|
|
314 |
|
if (!(vm = hypervisor_find_object(conn,argv[0],OBJ_TYPE_VM))) |
315 |
|
return(-1); |
316 |
|
|
317 |
|
if (!(cpu = find_cpu(conn,vm,atoi(argv[1])))) |
318 |
|
return(-1); |
319 |
|
|
320 |
|
hypervisor_send_reply(conn,HSC_INFO_MSG,0,"Timer Drift: %u", |
321 |
|
cpu->timer_drift); |
322 |
|
|
323 |
|
hypervisor_send_reply(conn,HSC_INFO_MSG,0,"Pending Timer IRQ: %u", |
324 |
|
cpu->timer_irq_pending); |
325 |
|
|
326 |
|
vm_release(vm); |
327 |
|
hypervisor_send_reply(conn,HSC_INFO_OK,1,"OK"); |
328 |
|
return(0); |
329 |
|
} |
330 |
|
|
331 |
/* Set the exec area size */ |
/* Set the exec area size */ |
332 |
static int cmd_set_exec_area(hypervisor_conn_t *conn,int argc,char *argv[]) |
static int cmd_set_exec_area(hypervisor_conn_t *conn,int argc,char *argv[]) |
333 |
{ |
{ |
343 |
return(0); |
return(0); |
344 |
} |
} |
345 |
|
|
346 |
|
/* Set ghost RAM file */ |
347 |
|
static int cmd_set_ghost_file(hypervisor_conn_t *conn,int argc,char *argv[]) |
348 |
|
{ |
349 |
|
vm_instance_t *vm; |
350 |
|
|
351 |
|
if (!(vm = hypervisor_find_object(conn,argv[0],OBJ_TYPE_VM))) |
352 |
|
return(-1); |
353 |
|
|
354 |
|
vm->ghost_ram_filename = strdup(argv[1]); |
355 |
|
|
356 |
|
vm_release(vm); |
357 |
|
hypervisor_send_reply(conn,HSC_INFO_OK,1,"OK"); |
358 |
|
return(0); |
359 |
|
} |
360 |
|
|
361 |
|
/* Set ghost RAM status */ |
362 |
|
static int cmd_set_ghost_status(hypervisor_conn_t *conn,int argc,char *argv[]) |
363 |
|
{ |
364 |
|
vm_instance_t *vm; |
365 |
|
|
366 |
|
if (!(vm = hypervisor_find_object(conn,argv[0],OBJ_TYPE_VM))) |
367 |
|
return(-1); |
368 |
|
|
369 |
|
vm->ghost_status = atoi(argv[1]); |
370 |
|
|
371 |
|
vm_release(vm); |
372 |
|
hypervisor_send_reply(conn,HSC_INFO_OK,1,"OK"); |
373 |
|
return(0); |
374 |
|
} |
375 |
|
|
376 |
|
|
377 |
/* Set PCMCIA ATA disk0 size */ |
/* Set PCMCIA ATA disk0 size */ |
378 |
static int cmd_set_disk0(hypervisor_conn_t *conn,int argc,char *argv[]) |
static int cmd_set_disk0(hypervisor_conn_t *conn,int argc,char *argv[]) |
379 |
{ |
{ |
586 |
return(0); |
return(0); |
587 |
} |
} |
588 |
|
|
589 |
|
/* Send a message on the console */ |
590 |
|
static int cmd_send_con_msg(hypervisor_conn_t *conn,int argc,char *argv[]) |
591 |
|
{ |
592 |
|
vm_instance_t *vm; |
593 |
|
|
594 |
|
if (!(vm = hypervisor_find_object(conn,argv[0],OBJ_TYPE_VM))) |
595 |
|
return(-1); |
596 |
|
|
597 |
|
vtty_store_str(vm->vtty_con,argv[1]); |
598 |
|
|
599 |
|
vm_release(vm); |
600 |
|
hypervisor_send_reply(conn,HSC_INFO_OK,1,"OK"); |
601 |
|
return(0); |
602 |
|
} |
603 |
|
|
604 |
|
/* Send a message on the AUX port */ |
605 |
|
static int cmd_send_aux_msg(hypervisor_conn_t *conn,int argc,char *argv[]) |
606 |
|
{ |
607 |
|
vm_instance_t *vm; |
608 |
|
|
609 |
|
if (!(vm = hypervisor_find_object(conn,argv[0],OBJ_TYPE_VM))) |
610 |
|
return(-1); |
611 |
|
|
612 |
|
vtty_store_str(vm->vtty_aux,argv[1]); |
613 |
|
|
614 |
|
vm_release(vm); |
615 |
|
hypervisor_send_reply(conn,HSC_INFO_OK,1,"OK"); |
616 |
|
return(0); |
617 |
|
} |
618 |
|
|
619 |
/* Show info about VM object */ |
/* Show info about VM object */ |
620 |
static void cmd_show_vm_list(registry_entry_t *entry,void *opt,int *err) |
static void cmd_show_vm_list(registry_entry_t *entry,void *opt,int *err) |
621 |
{ |
{ |
654 |
{ "show_idle_pc_prop", 2, 2, cmd_show_idle_pc_prop, NULL }, |
{ "show_idle_pc_prop", 2, 2, cmd_show_idle_pc_prop, NULL }, |
655 |
{ "set_idle_max", 3, 3, cmd_set_idle_max, NULL }, |
{ "set_idle_max", 3, 3, cmd_set_idle_max, NULL }, |
656 |
{ "set_idle_sleep_time", 3, 3, cmd_set_idle_sleep_time, NULL }, |
{ "set_idle_sleep_time", 3, 3, cmd_set_idle_sleep_time, NULL }, |
657 |
|
{ "show_timer_drift", 2, 2, cmd_show_timer_drift, NULL }, |
658 |
|
{ "set_ghost_file", 3, 3, cmd_set_ghost_file, NULL }, |
659 |
|
{ "set_ghost_status", 3, 3, cmd_set_ghost_status, NULL }, |
660 |
{ "set_con_tcp_port", 2, 2, cmd_set_con_tcp_port, NULL }, |
{ "set_con_tcp_port", 2, 2, cmd_set_con_tcp_port, NULL }, |
661 |
{ "set_aux_tcp_port", 2, 2, cmd_set_aux_tcp_port, NULL }, |
{ "set_aux_tcp_port", 2, 2, cmd_set_aux_tcp_port, NULL }, |
662 |
{ "extract_config", 1, 1, cmd_extract_config, NULL }, |
{ "extract_config", 1, 1, cmd_extract_config, NULL }, |
664 |
{ "cpu_info", 2, 2, cmd_show_cpu_info, NULL }, |
{ "cpu_info", 2, 2, cmd_show_cpu_info, NULL }, |
665 |
{ "suspend", 1, 1, cmd_suspend, NULL }, |
{ "suspend", 1, 1, cmd_suspend, NULL }, |
666 |
{ "resume", 1, 1, cmd_resume, NULL }, |
{ "resume", 1, 1, cmd_resume, NULL }, |
667 |
|
{ "send_con_msg", 2, 2, cmd_send_con_msg, NULL }, |
668 |
|
{ "send_aux_msg", 2, 2, cmd_send_aux_msg, NULL }, |
669 |
{ "list", 0, 0, cmd_vm_list, NULL }, |
{ "list", 0, 0, cmd_vm_list, NULL }, |
670 |
{ NULL, -1, -1, NULL, NULL }, |
{ NULL, -1, -1, NULL, NULL }, |
671 |
}; |
}; |