diff options
Diffstat (limited to 'target')
-rw-r--r-- | target/arm/idau.h | 4 | ||||
-rw-r--r-- | target/i386/cpu.c | 2 | ||||
-rw-r--r-- | target/i386/hax-all.c | 17 |
3 files changed, 6 insertions, 17 deletions
diff --git a/target/arm/idau.h b/target/arm/idau.h index cac27b95fa..7c0e4e3776 100644 --- a/target/arm/idau.h +++ b/target/arm/idau.h @@ -38,9 +38,7 @@ #define IDAU_INTERFACE_GET_CLASS(obj) \ OBJECT_GET_CLASS(IDAUInterfaceClass, (obj), TYPE_IDAU_INTERFACE) -typedef struct IDAUInterface { - Object parent; -} IDAUInterface; +typedef struct IDAUInterface IDAUInterface; #define IREGION_NOTVALID -1 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index 12f559b6af..677a3bd5fb 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -4065,7 +4065,7 @@ arch_query_cpu_model_expansion(CpuModelExpansionType type, x86_cpu_to_dict_full(xc, props); break; default: - error_setg(&err, "Unsupportted expansion type"); + error_setg(&err, "Unsupported expansion type"); goto out; } diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c index d2e512856b..b978a9b821 100644 --- a/target/i386/hax-all.c +++ b/target/i386/hax-all.c @@ -154,13 +154,7 @@ int hax_vcpu_create(int id) return 0; } - vcpu = g_malloc(sizeof(struct hax_vcpu_state)); - if (!vcpu) { - fprintf(stderr, "Failed to alloc vcpu state\n"); - return -ENOMEM; - } - - memset(vcpu, 0, sizeof(struct hax_vcpu_state)); + vcpu = g_new0(struct hax_vcpu_state, 1); ret = hax_host_create_vcpu(hax_global.vm->fd, id); if (ret) { @@ -211,7 +205,7 @@ int hax_vcpu_destroy(CPUState *cpu) } /* - * 1. The hax_tunnel is also destroied when vcpu destroy + * 1. The hax_tunnel is also destroyed when vcpu is destroyed * 2. close fd will cause hax module vcpu be cleaned */ hax_close_fd(vcpu->fd); @@ -250,11 +244,8 @@ struct hax_vm *hax_vm_create(struct hax_state *hax) return hax->vm; } - vm = g_malloc(sizeof(struct hax_vm)); - if (!vm) { - return NULL; - } - memset(vm, 0, sizeof(struct hax_vm)); + vm = g_new0(struct hax_vm, 1); + ret = hax_host_create_vm(hax, &vm_id); if (ret) { fprintf(stderr, "Failed to create vm %x\n", ret); |