Example #1
0
static int cmd_vcpu_list(struct vmm_chardev *cdev, int dummy)
{
	int id, count;
	char state[10];
	char path[256];
	struct vmm_vcpu *vcpu;
	vmm_cprintf(cdev, "----------------------------------------"
			  "----------------------------------------\n");
	vmm_cprintf(cdev, "| %-5s| %-6s| %-9s| %-16s| %-33s|\n", 
		   "ID ", "Prio", "State", "Name", "Device Path");
	vmm_cprintf(cdev, "----------------------------------------"
			  "----------------------------------------\n");
	count = vmm_manager_vcpu_count();
	for (id = 0; id < count; id++) {
		vcpu = vmm_manager_vcpu(id);
		switch (vcpu->state) {
		case VMM_VCPU_STATE_UNKNOWN:
			vmm_strcpy(state, "Unknown");
			break;
		case VMM_VCPU_STATE_RESET:
			vmm_strcpy(state, "Reset");
			break;
		case VMM_VCPU_STATE_READY:
			vmm_strcpy(state, "Ready");
			break;
		case VMM_VCPU_STATE_RUNNING:
			vmm_strcpy(state, "Running");
			break;
		case VMM_VCPU_STATE_PAUSED:
			vmm_strcpy(state, "Paused");
			break;
		case VMM_VCPU_STATE_HALTED:
			vmm_strcpy(state, "Halted");
			break;
		default:
			vmm_strcpy(state, "Invalid");
			break;
		}
		if (vcpu->node) {
			vmm_devtree_getpath(path, vcpu->node);
			vmm_cprintf(cdev, "| %-5d| %-6d| %-9s| %-16s| %-33s|\n", 
					  id, vcpu->priority, 
					  state, vcpu->name, path);
		} else {
			vmm_cprintf(cdev, "| %-5d| %-6d| %-9s| %-16s| %-33s|\n", 
					  id, vcpu->priority, 
					  state, vcpu->name, "(NA)");
		}
	}
	vmm_cprintf(cdev, "----------------------------------------"
			  "----------------------------------------\n");
	return VMM_OK;
}
Example #2
0
void cmd_blockdev_list(struct vmm_chardev *cdev)
{
	int num, count;
	char path[1024];
	struct vmm_blockdev *bdev;
	count = vmm_blockdev_count();
	for (num = 0; num < count; num++) {
		bdev = vmm_blockdev_get(num);
		if (!bdev->dev) {
			vmm_cprintf(cdev, "%s: ---\n", bdev->name);
		} else {
			vmm_devtree_getpath(path, bdev->dev->node);
			vmm_cprintf(cdev, "%s: %s\n", bdev->name, path);
		}
	}
}
Example #3
0
static int cmd_rtcdev_list_iter(struct rtc_device *rd, void *data)
{
	int rc;
	char path[256];
	struct vmm_chardev *cdev = data;

	if (rd->dev.parent && rd->dev.parent->of_node) {
		rc = vmm_devtree_getpath(path, sizeof(path),
				    rd->dev.parent->of_node);
		if (rc) {
			vmm_snprintf(path, sizeof(path),
				     "----- (error %d)", rc);
		}
	} else {
		strcpy(path, "-----");
	}
	vmm_cprintf(cdev, " %-24s %-53s\n", rd->name, path);

	return VMM_OK;
}
Example #4
0
void cmd_fb_list(struct vmm_chardev *cdev)
{
	int num, count;
	char path[1024];
	struct vmm_fb_info *info;
	vmm_cprintf(cdev, "----------------------------------------"
			  "----------------------------------------\n");
	vmm_cprintf(cdev, " %-16s %-20s %-40s\n", 
			  "Name", "ID", "Device Path");
	vmm_cprintf(cdev, "----------------------------------------"
			  "----------------------------------------\n");
	count = vmm_fb_count();
	for (num = 0; num < count; num++) {
		info = vmm_fb_get(num);
		vmm_devtree_getpath(path, info->dev->node);
		vmm_cprintf(cdev, " %-16s %-20s %-40s\n", 
				  info->dev->node->name, info->fix.id, path);
	}
	vmm_cprintf(cdev, "----------------------------------------"
			  "----------------------------------------\n");
}
Example #5
0
static void cmd_chardev_list(struct vmm_chardev *cdev)
{
	int num, count;
	char path[1024];
	struct vmm_chardev *cd;
	vmm_cprintf(cdev, "----------------------------------------"
			  "----------------------------------------\n");
	vmm_cprintf(cdev, " %-24s %-53s\n", 
			  "Name", "Device Path");
	vmm_cprintf(cdev, "----------------------------------------"
			  "----------------------------------------\n");
	count = vmm_chardev_count();
	for (num = 0; num < count; num++) {
		cd = vmm_chardev_get(num);
		if (cd->dev.parent && cd->dev.parent->node) {
			vmm_devtree_getpath(path, cd->dev.parent->node);
		} else {
			strcpy(path, "-----");
		}
		vmm_cprintf(cdev, " %-24s %-53s\n", cd->name, path);
	}
	vmm_cprintf(cdev, "----------------------------------------"
			  "----------------------------------------\n");
}