[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 17/37] machine: use class base init generated nam
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v2 17/37] machine: use class base init generated name |
Date: |
Thu, 28 Jul 2016 18:37:48 +0400 |
From: Marc-André Lureau <address@hidden>
Remove machine class name initialization from DEFINE_PC_MACHINE, rely on
class base init name generation instead. Get rid of some leaks that way.
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/core/machine.c | 1 +
include/hw/boards.h | 2 +-
include/hw/i386/pc.h | 1 -
3 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index e5a456f..00fbe3e 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -561,6 +561,7 @@ static void machine_class_finalize(ObjectClass *klass, void
*data)
if (mc->compat_props) {
g_array_free(mc->compat_props, true);
}
+ g_free(mc->name);
}
void machine_register_compat_props(MachineState *machine)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 3e69eca..e46a744 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -93,7 +93,7 @@ struct MachineClass {
/*< public >*/
const char *family; /* NULL iff @name identifies a standalone machtype */
- const char *name;
+ char *name;
const char *alias;
const char *desc;
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index eb1d414..afd025a 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -903,7 +903,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
{ \
MachineClass *mc = MACHINE_CLASS(oc); \
optsfn(mc); \
- mc->name = namestr; \
mc->init = initfn; \
} \
static const TypeInfo pc_machine_type_##suffix = { \
--
2.9.0
- [Qemu-devel] [PATCH v2 08/37] qdist: fix entries memory leak, (continued)
- [Qemu-devel] [PATCH v2 08/37] qdist: fix entries memory leak, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 09/37] tests: fix check-qom-interface leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 10/37] tests: fix check-qom-proplist leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 11/37] tests: fix small leak in test-io-channel-command, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 12/37] tests: fix leak in test-string-input-visitor, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 13/37] portio: keep references on portio, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 15/37] pc: simplify passing qemu_irq, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 14/37] numa: do not leak NumaOptions, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 16/37] pc: don't leak a20_line, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 17/37] machine: use class base init generated name,
marcandre . lureau <=
- [Qemu-devel] [PATCH v2 18/37] acpi-build: fix array leak, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 19/37] char: disconnect peer when qemu_chr_free(), marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 20/37] char: free MuxDriver when closing, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 21/37] tests: fix qom-test leaks, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 22/37] pc: free i8259, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 23/37] pc: keep gsi reference, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 24/37] ahci: free irqs array, marcandre . lureau, 2016/07/28
- [Qemu-devel] [PATCH v2 25/37] sd: free timer, marcandre . lureau, 2016/07/28