2007-11-17 18:14:51 +01:00
|
|
|
/* Declarations for use by board files for creating devices. */
|
|
|
|
|
|
|
|
#ifndef HW_BOARDS_H
|
|
|
|
#define HW_BOARDS_H
|
|
|
|
|
2012-12-17 18:20:04 +01:00
|
|
|
#include "sysemu/blockdev.h"
|
2013-02-04 15:40:22 +01:00
|
|
|
#include "hw/qdev.h"
|
2014-03-05 18:30:45 +01:00
|
|
|
#include "qom/object.h"
|
2009-07-15 13:48:21 +02:00
|
|
|
|
2012-10-15 22:22:02 +02:00
|
|
|
typedef struct QEMUMachineInitArgs {
|
2013-10-30 13:56:39 +01:00
|
|
|
const QEMUMachine *machine;
|
2012-10-15 22:22:02 +02:00
|
|
|
ram_addr_t ram_size;
|
hw: Clean up bogus default boot order
We set default boot order "cad" in every single machine definition
except "pseries" and "moxiesim", even though very few boards actually
care for boot order, and "cad" makes sense for even fewer.
Machines that care:
* pc and its variants
Accept up to three letters 'a', 'b' (undocumented alias for 'a'),
'c', 'd' and 'n'. Reject all others (fatal with -boot).
* nseries (n800, n810)
Check whether order starts with 'n'. Silently ignored otherwise.
* prep, g3beige, mac99
Extract the first character the machine understands (subset of
'a'..'f'). Silently ignored otherwise.
* spapr
Accept an arbitrary string (vl.c restricts it to contain only
'a'..'p', no duplicates).
* sun4[mdc]
Use the first character. Silently ignored otherwise.
Strip characters these machines ignore from their default boot order.
For all other machines, remove the unused default boot order
alltogether.
Note that my rename of QEMUMachine member boot_order to
default_boot_order and QEMUMachineInitArgs member boot_device to
boot_order has a welcome side effect: it makes every use of boot
orders visible in this patch, for easy review.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-08-16 13:13:50 +02:00
|
|
|
const char *boot_order;
|
2012-10-15 22:22:02 +02:00
|
|
|
const char *kernel_filename;
|
|
|
|
const char *kernel_cmdline;
|
|
|
|
const char *initrd_filename;
|
|
|
|
const char *cpu_model;
|
|
|
|
} QEMUMachineInitArgs;
|
|
|
|
|
|
|
|
typedef void QEMUMachineInitFunc(QEMUMachineInitArgs *args);
|
2007-11-17 18:14:51 +01:00
|
|
|
|
2012-08-07 08:41:51 +02:00
|
|
|
typedef void QEMUMachineResetFunc(void);
|
|
|
|
|
2013-04-30 15:41:24 +02:00
|
|
|
typedef void QEMUMachineHotAddCPUFunc(const int64_t id, Error **errp);
|
|
|
|
|
2013-12-23 16:40:40 +01:00
|
|
|
typedef int QEMUMachineGetKvmtypeFunc(const char *arg);
|
|
|
|
|
2013-10-30 13:56:39 +01:00
|
|
|
struct QEMUMachine {
|
2007-11-17 18:14:51 +01:00
|
|
|
const char *name;
|
2009-07-22 11:02:50 +02:00
|
|
|
const char *alias;
|
2007-11-17 18:14:51 +01:00
|
|
|
const char *desc;
|
|
|
|
QEMUMachineInitFunc *init;
|
2012-08-07 08:41:51 +02:00
|
|
|
QEMUMachineResetFunc *reset;
|
2013-04-30 15:41:24 +02:00
|
|
|
QEMUMachineHotAddCPUFunc *hot_add_cpu;
|
2013-12-23 16:40:40 +01:00
|
|
|
QEMUMachineGetKvmtypeFunc *kvm_type;
|
2012-11-20 15:30:34 +01:00
|
|
|
BlockInterfaceType block_default_type;
|
2008-10-07 22:39:39 +02:00
|
|
|
int max_cpus;
|
2009-12-25 17:12:26 +01:00
|
|
|
unsigned int no_serial:1,
|
2009-12-08 13:11:54 +01:00
|
|
|
no_parallel:1,
|
|
|
|
use_virtcon:1,
|
2013-01-24 12:18:52 +01:00
|
|
|
use_sclp:1,
|
2009-12-16 14:25:39 +01:00
|
|
|
no_floppy:1,
|
|
|
|
no_cdrom:1,
|
|
|
|
no_sdcard:1;
|
2009-05-22 03:41:01 +02:00
|
|
|
int is_default;
|
2010-11-22 16:44:15 +01:00
|
|
|
const char *default_machine_opts;
|
hw: Clean up bogus default boot order
We set default boot order "cad" in every single machine definition
except "pseries" and "moxiesim", even though very few boards actually
care for boot order, and "cad" makes sense for even fewer.
Machines that care:
* pc and its variants
Accept up to three letters 'a', 'b' (undocumented alias for 'a'),
'c', 'd' and 'n'. Reject all others (fatal with -boot).
* nseries (n800, n810)
Check whether order starts with 'n'. Silently ignored otherwise.
* prep, g3beige, mac99
Extract the first character the machine understands (subset of
'a'..'f'). Silently ignored otherwise.
* spapr
Accept an arbitrary string (vl.c restricts it to contain only
'a'..'p', no duplicates).
* sun4[mdc]
Use the first character. Silently ignored otherwise.
Strip characters these machines ignore from their default boot order.
For all other machines, remove the unused default boot order
alltogether.
Note that my rename of QEMUMachine member boot_order to
default_boot_order and QEMUMachineInitArgs member boot_device to
boot_order has a welcome side effect: it makes every use of boot
orders visible in this patch, for easy review.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2013-08-16 13:13:50 +02:00
|
|
|
const char *default_boot_order;
|
2009-12-08 13:11:33 +01:00
|
|
|
GlobalProperty *compat_props;
|
2007-11-17 18:14:51 +01:00
|
|
|
struct QEMUMachine *next;
|
2012-05-30 05:35:51 +02:00
|
|
|
const char *hw_version;
|
2013-10-30 13:56:39 +01:00
|
|
|
};
|
2007-11-17 18:14:51 +01:00
|
|
|
|
2014-03-05 18:30:46 +01:00
|
|
|
#define TYPE_MACHINE_SUFFIX "-machine"
|
2007-11-17 18:14:51 +01:00
|
|
|
int qemu_register_machine(QEMUMachine *m);
|
2009-02-11 16:21:54 +01:00
|
|
|
|
2014-03-05 18:30:45 +01:00
|
|
|
#define TYPE_MACHINE "machine"
|
2014-03-18 16:26:35 +01:00
|
|
|
#undef MACHINE /* BSD defines it and QEMU does not use it */
|
2014-03-05 18:30:45 +01:00
|
|
|
#define MACHINE(obj) \
|
|
|
|
OBJECT_CHECK(MachineState, (obj), TYPE_MACHINE)
|
|
|
|
#define MACHINE_GET_CLASS(obj) \
|
|
|
|
OBJECT_GET_CLASS(MachineClass, (obj), TYPE_MACHINE)
|
|
|
|
#define MACHINE_CLASS(klass) \
|
|
|
|
OBJECT_CLASS_CHECK(MachineClass, (klass), TYPE_MACHINE)
|
|
|
|
|
|
|
|
typedef struct MachineState MachineState;
|
|
|
|
typedef struct MachineClass MachineClass;
|
|
|
|
|
2014-03-05 18:30:47 +01:00
|
|
|
MachineClass *find_default_machine(void);
|
|
|
|
extern MachineState *current_machine;
|
|
|
|
|
2014-03-05 18:30:45 +01:00
|
|
|
/**
|
|
|
|
* MachineClass:
|
|
|
|
* @qemu_machine: #QEMUMachine
|
|
|
|
*/
|
|
|
|
struct MachineClass {
|
|
|
|
/*< private >*/
|
|
|
|
ObjectClass parent_class;
|
|
|
|
/*< public >*/
|
|
|
|
|
|
|
|
QEMUMachine *qemu_machine;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MachineState:
|
|
|
|
*/
|
|
|
|
struct MachineState {
|
|
|
|
/*< private >*/
|
|
|
|
Object parent_obj;
|
|
|
|
/*< public >*/
|
|
|
|
|
|
|
|
char *accel;
|
|
|
|
bool kernel_irqchip;
|
|
|
|
int kvm_shadow_mem;
|
|
|
|
char *kernel;
|
|
|
|
char *initrd;
|
|
|
|
char *append;
|
|
|
|
char *dtb;
|
|
|
|
char *dumpdtb;
|
|
|
|
int phandle_start;
|
|
|
|
char *dt_compatible;
|
|
|
|
bool dump_guest_core;
|
|
|
|
bool mem_merge;
|
|
|
|
bool usb;
|
|
|
|
char *firmware;
|
|
|
|
|
|
|
|
QEMUMachineInitArgs init_args;
|
|
|
|
};
|
|
|
|
|
2007-11-17 18:14:51 +01:00
|
|
|
#endif
|