machine: Eliminate QEMUMachine and qemu_register_machine()

The struct is not used anymore and can be eliminated.

Backports commit 3b53e45f43825caaaf4fad6a5b85ce6a9949ff02 from qemu
This commit is contained in:
Eduardo Habkost 2018-03-11 15:21:38 -04:00 committed by Lioncash
parent 048aaf05ca
commit 7c7bb4c6d1
No known key found for this signature in database
GPG Key ID: 4E3C3CC1031BA9C7
3 changed files with 0 additions and 47 deletions

View File

@ -10,19 +10,6 @@
#include "qom/cpu.h"
#include "uc_priv.h"
typedef int QEMUMachineInitFunc(struct uc_struct *uc, MachineState *ms);
typedef void QEMUMachineResetFunc(void);
struct QEMUMachine {
const char *name;
QEMUMachineInitFunc *init;
int max_cpus;
int is_default;
int arch;
int minimum_page_bits;
};
/**
* memory_region_allocate_system_memory - Allocate a board's main memory
* @mr: the #MemoryRegion to be initialized
@ -55,9 +42,6 @@ void memory_region_allocate_system_memory(MemoryRegion *mr, Object *owner,
const char *name,
uint64_t ram_size);
void qemu_register_machine(struct uc_struct *uc, QEMUMachine *m, const char *type_machine,
void (*init)(struct uc_struct *uc, ObjectClass *oc, void *data));
#define TYPE_MACHINE_SUFFIX "-machine"
/* Machine class name that needs to be used for class-name-based machine
@ -78,7 +62,6 @@ MachineClass *find_default_machine(struct uc_struct *uc, int arch);
/**
* MachineClass:
* @qemu_machine: #QEMUMachine
* @minimum_page_bits:
* If non-zero, the board promises never to create a CPU with a page size
* smaller than this, so QEMU can use a more efficient larger page

View File

@ -63,7 +63,6 @@ typedef struct Property Property;
typedef struct PropertyInfo PropertyInfo;
typedef struct QEMUBH QEMUBH;
typedef struct QEMUFile QEMUFile;
typedef struct QEMUMachine QEMUMachine;
typedef struct QEMUSGList QEMUSGList;
typedef struct QEMUSizedBuffer QEMUSizedBuffer;
typedef struct QEMUTimer QEMUTimer;

View File

@ -176,32 +176,3 @@ void qemu_system_shutdown_request(void)
{
//shutdown_requested = 1;
}
static void machine_class_init(struct uc_struct *uc, ObjectClass *oc, void *data)
{
MachineClass *mc = MACHINE_CLASS(uc, oc);
QEMUMachine *qm = data;
mc->init = qm->init;
mc->max_cpus = qm->max_cpus;
mc->is_default = qm->is_default;
mc->arch = qm->arch;
mc->minimum_page_bits = qm->minimum_page_bits;
}
void qemu_register_machine(struct uc_struct *uc, QEMUMachine *m, const char *type_machine,
void (*init)(struct uc_struct *uc, ObjectClass *oc, void *data))
{
char *name = g_strdup_printf(MACHINE_TYPE_NAME("%s"), m->name);
TypeInfo ti = {0};
ti.name = name;
ti.parent = type_machine;
ti.class_init = init;
ti.class_data = (void *)m;
if (init == NULL)
ti.class_init = machine_class_init;
type_register(uc, &ti);
g_free(name);
}