[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 41/88] target/i386: use g_new() family of functions
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH 41/88] target/i386: use g_new() family of functions |
Date: |
Fri, 6 Oct 2017 20:49:36 -0300 |
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
[PMD: added more changes and hax]
---
target/i386/cpu.c | 6 +++---
target/i386/hax-all.c | 4 ++--
target/i386/hax-mem.c | 2 +-
target/i386/hyperv.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 98732cd65f..236a4115cd 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -2344,7 +2344,7 @@ static void x86_cpu_definition_entry(gpointer data,
gpointer user_data)
CpuDefinitionInfoList *entry;
CpuDefinitionInfo *info;
- info = g_malloc0(sizeof(*info));
+ info = g_new0(CpuDefinitionInfo, 1);
info->name = x86_cpu_class_get_model_name(cc);
x86_cpu_class_check_missing_features(cc, &info->unavailable_features);
info->has_unavailable_features = true;
@@ -2353,7 +2353,7 @@ static void x86_cpu_definition_entry(gpointer data,
gpointer user_data)
info->has_migration_safe = true;
info->q_static = cc->static_model;
- entry = g_malloc0(sizeof(*entry));
+ entry = g_new0(CpuDefinitionInfoList, 1);
entry->value = info;
entry->next = *cpu_list;
*cpu_list = entry;
@@ -3933,7 +3933,7 @@ static GuestPanicInformation
*x86_cpu_get_crash_info(CPUState *cs)
GuestPanicInformation *panic_info = NULL;
if (env->features[FEAT_HYPERV_EDX] & HV_GUEST_CRASH_MSR_AVAILABLE) {
- panic_info = g_malloc0(sizeof(GuestPanicInformation));
+ panic_info = g_new0(GuestPanicInformation, 1);
panic_info->type = GUEST_PANIC_INFORMATION_TYPE_HYPER_V;
diff --git a/target/i386/hax-all.c b/target/i386/hax-all.c
index 3ce6950296..8f4368fe01 100644
--- a/target/i386/hax-all.c
+++ b/target/i386/hax-all.c
@@ -155,7 +155,7 @@ int hax_vcpu_create(int id)
return 0;
}
- vcpu = g_malloc(sizeof(struct hax_vcpu_state));
+ vcpu = g_new(struct hax_vcpu_state, 1);
if (!vcpu) {
fprintf(stderr, "Failed to alloc vcpu state\n");
return -ENOMEM;
@@ -251,7 +251,7 @@ struct hax_vm *hax_vm_create(struct hax_state *hax)
return hax->vm;
}
- vm = g_malloc(sizeof(struct hax_vm));
+ vm = g_new(struct hax_vm, 1);
if (!vm) {
return NULL;
}
diff --git a/target/i386/hax-mem.c b/target/i386/hax-mem.c
index 27a0d214f2..826f7ca501 100644
--- a/target/i386/hax-mem.c
+++ b/target/i386/hax-mem.c
@@ -82,7 +82,7 @@ static void hax_insert_mapping_before(HAXMapping *next,
uint64_t start_pa,
{
HAXMapping *entry;
- entry = g_malloc0(sizeof(*entry));
+ entry = g_new0(HAXMapping, 1);
entry->start_pa = start_pa;
entry->size = size;
entry->host_va = host_va;
diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c
index a050c9d2d1..a427602e58 100644
--- a/target/i386/hyperv.c
+++ b/target/i386/hyperv.c
@@ -78,7 +78,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id,
uint32_t sint,
HvSintRoute *sint_route;
int r, gsi;
- sint_route = g_malloc0(sizeof(*sint_route));
+ sint_route = g_new0(HvSintRoute, 1);
r = event_notifier_init(&sint_route->sint_set_notifier, false);
if (r) {
goto err;
--
2.14.2
- Re: [Qemu-devel] [PATCH 34/88] qapi: use g_new() family of functions, (continued)
- [Qemu-devel] [PATCH 35/88] Record/replay: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 36/88] SLIRP: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 37/88] TCG: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 38/88] VFIO: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 39/88] hw/i386: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 40/88] hw/xen: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 42/88] XTFPGA: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 41/88] target/i386: use g_new() family of functions,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH 43/88] hw/core: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 44/88] hw/core/loader: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 45/88] hw/display: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 46/88] hw/display/vga: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 47/88] hw/i2c: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 48/88] hw/input: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 49/88] hw/misc: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06
- [Qemu-devel] [PATCH 50/88] ivshmem: use g_new() family of functions, Philippe Mathieu-Daudé, 2017/10/06