Skip to content

Commit 7a66c31

Browse files
KaigeFulijinxia
authored andcommitted
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>
1 parent 31cdf8c commit 7a66c31

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

hypervisor/arch/x86/guest/vm.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,6 @@ int create_vm(struct vm_description *vm_desc, struct vm **rtn_vm)
102102
if (bitmap_test_and_set(id, &vmid_bitmap) == 0)
103103
break;
104104
vm->attr.id = vm->attr.boot_idx = id;
105-
snprintf(&vm->attr.name[0], MAX_VM_NAME_LEN, "vm_%d",
106-
vm->attr.id);
107105

108106
atomic_store(&vm->hw.created_vcpus, 0);
109107

hypervisor/debug/shell_internal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ int shell_list_vm(struct shell *p_shell,
474474
/* Create output string consisting of VM name and VM id
475475
*/
476476
snprintf(temp_str, MAX_STR_SIZE,
477-
"%-24s %-16d %-8s\r\n", vm->attr.name,
477+
"vm_%-24d %-16d %-8s\r\n", vm->attr.id,
478478
vm->attr.id, state);
479479

480480
/* Output information for this task */

hypervisor/include/arch/x86/guest/vm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ enum vm_privilege_level {
1616

1717
#define MAX_VM_NAME_LEN 16
1818
struct vm_attr {
19-
char name[MAX_VM_NAME_LEN]; /* Virtual machine name string */
2019
int id; /* Virtual machine identifier */
2120
int boot_idx; /* Index indicating the boot sequence for this VM */
2221
};

0 commit comments

Comments
 (0)