mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-02-10 10:59:28 -07:00
machine: use class base init generated name
machine_class_base_init() member name is allocated by machine_class_base_init(), but not freed by machine_class_finalize(). Simply freeing there doesn't work, because DEFINE_PC_MACHINE() overwrites it with a literal string. Fix DEFINE_PC_MACHINE() not to overwrite it, and add the missing free to machine_class_finalize(). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
ac64c5fdf8
commit
8ea753718b
3 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = { \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue