HV: Remove vm->attr.name

We define attr.name in struct vm and named as ("vm_%d", attr.id). attr.name only
be used in debug tool vm_list. It does't deserve to do so in OS created flow
(aka function create_vm). It's better to handle this in vm_list tool.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Acked-by: Eddie Dong <eddie.dong@inte.com>
This commit is contained in:
Kaige Fu 2018-06-29 15:46:53 +08:00 committed by lijinxia
parent 31cdf8c7e8
commit 7a66c317b5
3 changed files with 1 additions and 4 deletions

View File

@ -102,8 +102,6 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm)
if (bitmap_test_and_set(id, &vmid_bitmap) == 0) if (bitmap_test_and_set(id, &vmid_bitmap) == 0)
break; break;
vm->attr.id = vm->attr.boot_idx = id; vm->attr.id = vm->attr.boot_idx = id;
snprintf(&vm->attr.name[0], MAX_VM_NAME_LEN, "vm_%d",
vm->attr.id);
atomic_store(&vm->hw.created_vcpus, 0); atomic_store(&vm->hw.created_vcpus, 0);

View File

@ -474,7 +474,7 @@ int shell_list_vm(struct shell *p_shell,
/* Create output string consisting of VM name and VM id /* Create output string consisting of VM name and VM id
*/ */
snprintf(temp_str, MAX_STR_SIZE, snprintf(temp_str, MAX_STR_SIZE,
"%-24s %-16d %-8s\r\n", vm->attr.name, "vm_%-24d %-16d %-8s\r\n", vm->attr.id,
vm->attr.id, state); vm->attr.id, state);
/* Output information for this task */ /* Output information for this task */

View File

@ -16,7 +16,6 @@ enum vm_privilege_level {
#define MAX_VM_NAME_LEN 16 #define MAX_VM_NAME_LEN 16
struct vm_attr { struct vm_attr {
char name[MAX_VM_NAME_LEN]; /* Virtual machine name string */
int id; /* Virtual machine identifier */ int id; /* Virtual machine identifier */
int boot_idx; /* Index indicating the boot sequence for this VM */ int boot_idx; /* Index indicating the boot sequence for this VM */
}; };