static int cmd_vcpu_exec(vmm_chardev_t *cdev, int argc, char **argv) { int id = -1; int index = 0; if (argc > 3) { cmd_vcpu_usage(cdev); return VMM_EFAIL; } if (argc == 3) { id = vmm_str2int(argv[2], 10); } while (command[index].name) { if (vmm_strcmp(argv[1], command[index].name) == 0) { return command[index].function(cdev, id); } index++; } cmd_vcpu_usage(cdev); return VMM_EFAIL; }
static int cmd_vcpu_help(struct vmm_chardev *cdev, int argc, char **argv) { cmd_vcpu_usage(cdev); return VMM_OK; }
static int cmd_vcpu_help(vmm_chardev_t *cdev, int dummy) { cmd_vcpu_usage(cdev); return VMM_OK; }