635 |
return(0); |
return(0); |
636 |
} |
} |
637 |
|
|
638 |
|
/* Show console TCP port info about VM object */ |
639 |
|
static void cmd_show_vm_list_con_ports(registry_entry_t *entry,void *opt, |
640 |
|
int *err) |
641 |
|
{ |
642 |
|
hypervisor_conn_t *conn = opt; |
643 |
|
vm_instance_t *vm = entry->data; |
644 |
|
|
645 |
|
if (vm->vtty_con_type == VTTY_TYPE_TCP) |
646 |
|
hypervisor_send_reply(conn,HSC_INFO_MSG,0,"%s (%d)", |
647 |
|
vm->name,vm->vtty_con_tcp_port); |
648 |
|
} |
649 |
|
|
650 |
|
/* VM console TCP port list */ |
651 |
|
static int cmd_vm_list_con_ports(hypervisor_conn_t *conn,int argc,char *argv[]) |
652 |
|
{ |
653 |
|
int err = 0; |
654 |
|
registry_foreach_type(OBJ_TYPE_VM,cmd_show_vm_list_con_ports,conn,&err); |
655 |
|
hypervisor_send_reply(conn,HSC_INFO_OK,1,"OK"); |
656 |
|
return(0); |
657 |
|
} |
658 |
|
|
659 |
/* VM commands */ |
/* VM commands */ |
660 |
static hypervisor_cmd_t vm_cmd_array[] = { |
static hypervisor_cmd_t vm_cmd_array[] = { |
661 |
{ "set_debug_level", 2, 2, cmd_set_debug_level, NULL }, |
{ "set_debug_level", 2, 2, cmd_set_debug_level, NULL }, |
688 |
{ "send_con_msg", 2, 2, cmd_send_con_msg, NULL }, |
{ "send_con_msg", 2, 2, cmd_send_con_msg, NULL }, |
689 |
{ "send_aux_msg", 2, 2, cmd_send_aux_msg, NULL }, |
{ "send_aux_msg", 2, 2, cmd_send_aux_msg, NULL }, |
690 |
{ "list", 0, 0, cmd_vm_list, NULL }, |
{ "list", 0, 0, cmd_vm_list, NULL }, |
691 |
|
{ "list_con_ports", 0, 0, cmd_vm_list_con_ports, NULL }, |
692 |
{ NULL, -1, -1, NULL, NULL }, |
{ NULL, -1, -1, NULL, NULL }, |
693 |
}; |
}; |
694 |
|
|