2014-03-05 21:30:45 +04:00
|
|
|
/*
|
|
|
|
* QEMU Machine
|
|
|
|
*
|
|
|
|
* Copyright (C) 2014 Red Hat Inc
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Marcel Apfelbaum <marcel.a@redhat.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "hw/boards.h"
|
2014-05-26 16:40:58 +04:00
|
|
|
#include "qapi/visitor.h"
|
2014-07-01 18:14:41 +04:00
|
|
|
#include "hw/sysbus.h"
|
|
|
|
#include "sysemu/sysemu.h"
|
|
|
|
#include "qemu/error-report.h"
|
2014-05-26 16:40:58 +04:00
|
|
|
|
|
|
|
static char *machine_get_accel(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return g_strdup(ms->accel);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_accel(Object *obj, const char *value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2014-08-06 22:18:21 +04:00
|
|
|
g_free(ms->accel);
|
2014-05-26 16:40:58 +04:00
|
|
|
ms->accel = g_strdup(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_kernel_irqchip(Object *obj, bool value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2015-02-04 18:43:49 +03:00
|
|
|
ms->kernel_irqchip_allowed = value;
|
|
|
|
ms->kernel_irqchip_required = value;
|
2014-05-26 16:40:58 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_get_kvm_shadow_mem(Object *obj, Visitor *v,
|
|
|
|
void *opaque, const char *name,
|
|
|
|
Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
int64_t value = ms->kvm_shadow_mem;
|
|
|
|
|
|
|
|
visit_type_int(v, &value, name, errp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_kvm_shadow_mem(Object *obj, Visitor *v,
|
|
|
|
void *opaque, const char *name,
|
|
|
|
Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
Error *error = NULL;
|
|
|
|
int64_t value;
|
|
|
|
|
|
|
|
visit_type_int(v, &value, name, &error);
|
|
|
|
if (error) {
|
|
|
|
error_propagate(errp, error);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ms->kvm_shadow_mem = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *machine_get_kernel(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return g_strdup(ms->kernel_filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_kernel(Object *obj, const char *value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2014-08-06 22:18:21 +04:00
|
|
|
g_free(ms->kernel_filename);
|
2014-05-26 16:40:58 +04:00
|
|
|
ms->kernel_filename = g_strdup(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *machine_get_initrd(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return g_strdup(ms->initrd_filename);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_initrd(Object *obj, const char *value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2014-08-06 22:18:21 +04:00
|
|
|
g_free(ms->initrd_filename);
|
2014-05-26 16:40:58 +04:00
|
|
|
ms->initrd_filename = g_strdup(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *machine_get_append(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return g_strdup(ms->kernel_cmdline);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_append(Object *obj, const char *value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2014-08-06 22:18:21 +04:00
|
|
|
g_free(ms->kernel_cmdline);
|
2014-05-26 16:40:58 +04:00
|
|
|
ms->kernel_cmdline = g_strdup(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *machine_get_dtb(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return g_strdup(ms->dtb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_dtb(Object *obj, const char *value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2014-08-06 22:18:21 +04:00
|
|
|
g_free(ms->dtb);
|
2014-05-26 16:40:58 +04:00
|
|
|
ms->dtb = g_strdup(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *machine_get_dumpdtb(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return g_strdup(ms->dumpdtb);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_dumpdtb(Object *obj, const char *value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2014-08-06 22:18:21 +04:00
|
|
|
g_free(ms->dumpdtb);
|
2014-05-26 16:40:58 +04:00
|
|
|
ms->dumpdtb = g_strdup(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_get_phandle_start(Object *obj, Visitor *v,
|
|
|
|
void *opaque, const char *name,
|
|
|
|
Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
int64_t value = ms->phandle_start;
|
|
|
|
|
|
|
|
visit_type_int(v, &value, name, errp);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_phandle_start(Object *obj, Visitor *v,
|
|
|
|
void *opaque, const char *name,
|
|
|
|
Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
Error *error = NULL;
|
|
|
|
int64_t value;
|
|
|
|
|
|
|
|
visit_type_int(v, &value, name, &error);
|
|
|
|
if (error) {
|
|
|
|
error_propagate(errp, error);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
ms->phandle_start = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static char *machine_get_dt_compatible(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return g_strdup(ms->dt_compatible);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_dt_compatible(Object *obj, const char *value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2014-08-06 22:18:21 +04:00
|
|
|
g_free(ms->dt_compatible);
|
2014-05-26 16:40:58 +04:00
|
|
|
ms->dt_compatible = g_strdup(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool machine_get_dump_guest_core(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return ms->dump_guest_core;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_dump_guest_core(Object *obj, bool value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
ms->dump_guest_core = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool machine_get_mem_merge(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return ms->mem_merge;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_mem_merge(Object *obj, bool value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
ms->mem_merge = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool machine_get_usb(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return ms->usb;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_usb(Object *obj, bool value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
ms->usb = value;
|
2015-03-23 20:05:28 +03:00
|
|
|
ms->usb_disabled = !value;
|
2014-05-26 16:40:58 +04:00
|
|
|
}
|
|
|
|
|
2015-07-15 08:37:45 +03:00
|
|
|
static bool machine_get_igd_gfx_passthru(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return ms->igd_gfx_passthru;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_igd_gfx_passthru(Object *obj, bool value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
ms->igd_gfx_passthru = value;
|
|
|
|
}
|
|
|
|
|
2014-05-26 16:40:58 +04:00
|
|
|
static char *machine_get_firmware(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return g_strdup(ms->firmware);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_firmware(Object *obj, const char *value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2014-08-06 22:18:21 +04:00
|
|
|
g_free(ms->firmware);
|
2014-05-26 16:40:58 +04:00
|
|
|
ms->firmware = g_strdup(value);
|
|
|
|
}
|
|
|
|
|
2014-08-16 09:55:40 +04:00
|
|
|
static bool machine_get_iommu(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return ms->iommu;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_set_iommu(Object *obj, bool value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
ms->iommu = value;
|
|
|
|
}
|
|
|
|
|
2015-02-23 15:56:42 +03:00
|
|
|
static void machine_set_suppress_vmdesc(Object *obj, bool value, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
ms->suppress_vmdesc = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
static bool machine_get_suppress_vmdesc(Object *obj, Error **errp)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
return ms->suppress_vmdesc;
|
|
|
|
}
|
|
|
|
|
2014-07-01 18:14:41 +04:00
|
|
|
static int error_on_sysbus_device(SysBusDevice *sbdev, void *opaque)
|
|
|
|
{
|
|
|
|
error_report("Option '-device %s' cannot be handled by this machine",
|
|
|
|
object_class_get_name(object_get_class(OBJECT(sbdev))));
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_init_notify(Notifier *notifier, void *data)
|
|
|
|
{
|
|
|
|
Object *machine = qdev_get_machine();
|
|
|
|
ObjectClass *oc = object_get_class(machine);
|
|
|
|
MachineClass *mc = MACHINE_CLASS(oc);
|
|
|
|
|
|
|
|
if (mc->has_dynamic_sysbus) {
|
|
|
|
/* Our machine can handle dynamic sysbus devices, we're all good */
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Loop through all dynamically created devices and check whether there
|
|
|
|
* are sysbus devices among them. If there are, error out.
|
|
|
|
*/
|
|
|
|
foreach_dynamic_sysbus_device(error_on_sysbus_device, NULL);
|
|
|
|
}
|
|
|
|
|
2015-05-07 08:33:57 +03:00
|
|
|
static void machine_class_init(ObjectClass *oc, void *data)
|
|
|
|
{
|
|
|
|
MachineClass *mc = MACHINE_CLASS(oc);
|
|
|
|
|
|
|
|
/* Default 128 MB as guest ram size */
|
|
|
|
mc->default_ram_size = 128 * M_BYTE;
|
|
|
|
}
|
|
|
|
|
2015-08-21 00:54:35 +03:00
|
|
|
static void machine_class_base_init(ObjectClass *oc, void *data)
|
|
|
|
{
|
|
|
|
if (!object_class_is_abstract(oc)) {
|
2015-08-21 00:54:36 +03:00
|
|
|
MachineClass *mc = MACHINE_CLASS(oc);
|
2015-08-21 00:54:35 +03:00
|
|
|
const char *cname = object_class_get_name(oc);
|
|
|
|
assert(g_str_has_suffix(cname, TYPE_MACHINE_SUFFIX));
|
2015-08-21 00:54:36 +03:00
|
|
|
mc->name = g_strndup(cname,
|
|
|
|
strlen(cname) - strlen(TYPE_MACHINE_SUFFIX));
|
2015-08-21 00:54:35 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-05-26 16:40:58 +04:00
|
|
|
static void machine_initfn(Object *obj)
|
|
|
|
{
|
2014-07-01 18:14:41 +04:00
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
2015-02-04 18:43:49 +03:00
|
|
|
ms->kernel_irqchip_allowed = true;
|
2015-02-04 18:43:52 +03:00
|
|
|
ms->kvm_shadow_mem = -1;
|
2015-02-04 18:43:54 +03:00
|
|
|
ms->dump_guest_core = true;
|
2015-02-04 18:43:55 +03:00
|
|
|
ms->mem_merge = true;
|
2015-02-04 18:43:49 +03:00
|
|
|
|
2014-05-26 16:40:58 +04:00
|
|
|
object_property_add_str(obj, "accel",
|
|
|
|
machine_get_accel, machine_set_accel, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "accel",
|
|
|
|
"Accelerator list",
|
|
|
|
NULL);
|
2014-07-18 20:32:37 +04:00
|
|
|
object_property_add_bool(obj, "kernel-irqchip",
|
2015-02-04 18:43:49 +03:00
|
|
|
NULL,
|
2014-05-26 16:40:58 +04:00
|
|
|
machine_set_kernel_irqchip,
|
|
|
|
NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "kernel-irqchip",
|
|
|
|
"Use KVM in-kernel irqchip",
|
|
|
|
NULL);
|
2014-07-18 20:32:37 +04:00
|
|
|
object_property_add(obj, "kvm-shadow-mem", "int",
|
2014-05-26 16:40:58 +04:00
|
|
|
machine_get_kvm_shadow_mem,
|
|
|
|
machine_set_kvm_shadow_mem,
|
|
|
|
NULL, NULL, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "kvm-shadow-mem",
|
|
|
|
"KVM shadow MMU size",
|
|
|
|
NULL);
|
2014-05-26 16:40:58 +04:00
|
|
|
object_property_add_str(obj, "kernel",
|
|
|
|
machine_get_kernel, machine_set_kernel, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "kernel",
|
|
|
|
"Linux kernel image file",
|
|
|
|
NULL);
|
2014-05-26 16:40:58 +04:00
|
|
|
object_property_add_str(obj, "initrd",
|
|
|
|
machine_get_initrd, machine_set_initrd, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "initrd",
|
|
|
|
"Linux initial ramdisk file",
|
|
|
|
NULL);
|
2014-05-26 16:40:58 +04:00
|
|
|
object_property_add_str(obj, "append",
|
|
|
|
machine_get_append, machine_set_append, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "append",
|
|
|
|
"Linux kernel command line",
|
|
|
|
NULL);
|
2014-05-26 16:40:58 +04:00
|
|
|
object_property_add_str(obj, "dtb",
|
|
|
|
machine_get_dtb, machine_set_dtb, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "dtb",
|
|
|
|
"Linux kernel device tree file",
|
|
|
|
NULL);
|
2014-05-26 16:40:58 +04:00
|
|
|
object_property_add_str(obj, "dumpdtb",
|
|
|
|
machine_get_dumpdtb, machine_set_dumpdtb, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "dumpdtb",
|
|
|
|
"Dump current dtb to a file and quit",
|
|
|
|
NULL);
|
2014-07-18 20:32:37 +04:00
|
|
|
object_property_add(obj, "phandle-start", "int",
|
2014-05-26 16:40:58 +04:00
|
|
|
machine_get_phandle_start,
|
|
|
|
machine_set_phandle_start,
|
|
|
|
NULL, NULL, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "phandle-start",
|
|
|
|
"The first phandle ID we may generate dynamically",
|
|
|
|
NULL);
|
2014-07-18 20:32:37 +04:00
|
|
|
object_property_add_str(obj, "dt-compatible",
|
2014-05-26 16:40:58 +04:00
|
|
|
machine_get_dt_compatible,
|
|
|
|
machine_set_dt_compatible,
|
|
|
|
NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "dt-compatible",
|
|
|
|
"Overrides the \"compatible\" property of the dt root node",
|
|
|
|
NULL);
|
2014-05-26 16:40:58 +04:00
|
|
|
object_property_add_bool(obj, "dump-guest-core",
|
|
|
|
machine_get_dump_guest_core,
|
|
|
|
machine_set_dump_guest_core,
|
|
|
|
NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "dump-guest-core",
|
|
|
|
"Include guest memory in a core dump",
|
|
|
|
NULL);
|
2014-05-26 16:40:58 +04:00
|
|
|
object_property_add_bool(obj, "mem-merge",
|
2014-08-16 09:55:41 +04:00
|
|
|
machine_get_mem_merge,
|
|
|
|
machine_set_mem_merge, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "mem-merge",
|
|
|
|
"Enable/disable memory merge support",
|
|
|
|
NULL);
|
2014-08-16 09:55:41 +04:00
|
|
|
object_property_add_bool(obj, "usb",
|
|
|
|
machine_get_usb,
|
|
|
|
machine_set_usb, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "usb",
|
|
|
|
"Set on/off to enable/disable usb",
|
|
|
|
NULL);
|
2015-07-15 08:37:45 +03:00
|
|
|
object_property_add_bool(obj, "igd-passthru",
|
|
|
|
machine_get_igd_gfx_passthru,
|
|
|
|
machine_set_igd_gfx_passthru, NULL);
|
|
|
|
object_property_set_description(obj, "igd-passthru",
|
|
|
|
"Set on/off to enable/disable igd passthrou",
|
|
|
|
NULL);
|
2014-05-26 16:40:58 +04:00
|
|
|
object_property_add_str(obj, "firmware",
|
2014-08-16 09:55:41 +04:00
|
|
|
machine_get_firmware,
|
|
|
|
machine_set_firmware, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "firmware",
|
|
|
|
"Firmware image",
|
|
|
|
NULL);
|
2014-08-16 09:55:40 +04:00
|
|
|
object_property_add_bool(obj, "iommu",
|
|
|
|
machine_get_iommu,
|
|
|
|
machine_set_iommu, NULL);
|
2014-12-16 19:58:05 +03:00
|
|
|
object_property_set_description(obj, "iommu",
|
|
|
|
"Set on/off to enable/disable Intel IOMMU (VT-d)",
|
|
|
|
NULL);
|
2015-02-23 15:56:42 +03:00
|
|
|
object_property_add_bool(obj, "suppress-vmdesc",
|
|
|
|
machine_get_suppress_vmdesc,
|
|
|
|
machine_set_suppress_vmdesc, NULL);
|
|
|
|
object_property_set_description(obj, "suppress-vmdesc",
|
|
|
|
"Set on to disable self-describing migration",
|
|
|
|
NULL);
|
2014-07-01 18:14:41 +04:00
|
|
|
|
|
|
|
/* Register notifier when init is done for sysbus sanity checks */
|
|
|
|
ms->sysbus_notifier.notify = machine_init_notify;
|
|
|
|
qemu_add_machine_init_done_notifier(&ms->sysbus_notifier);
|
2014-05-26 16:40:58 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
static void machine_finalize(Object *obj)
|
|
|
|
{
|
|
|
|
MachineState *ms = MACHINE(obj);
|
|
|
|
|
|
|
|
g_free(ms->accel);
|
|
|
|
g_free(ms->kernel_filename);
|
|
|
|
g_free(ms->initrd_filename);
|
|
|
|
g_free(ms->kernel_cmdline);
|
|
|
|
g_free(ms->dtb);
|
|
|
|
g_free(ms->dumpdtb);
|
|
|
|
g_free(ms->dt_compatible);
|
|
|
|
g_free(ms->firmware);
|
|
|
|
}
|
2014-03-05 21:30:45 +04:00
|
|
|
|
2015-01-06 16:29:13 +03:00
|
|
|
bool machine_usb(MachineState *machine)
|
|
|
|
{
|
|
|
|
return machine->usb;
|
|
|
|
}
|
|
|
|
|
2015-02-04 18:43:48 +03:00
|
|
|
bool machine_iommu(MachineState *machine)
|
|
|
|
{
|
|
|
|
return machine->iommu;
|
|
|
|
}
|
|
|
|
|
2015-02-04 18:43:49 +03:00
|
|
|
bool machine_kernel_irqchip_allowed(MachineState *machine)
|
|
|
|
{
|
|
|
|
return machine->kernel_irqchip_allowed;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool machine_kernel_irqchip_required(MachineState *machine)
|
|
|
|
{
|
|
|
|
return machine->kernel_irqchip_required;
|
|
|
|
}
|
|
|
|
|
2015-02-04 18:43:52 +03:00
|
|
|
int machine_kvm_shadow_mem(MachineState *machine)
|
|
|
|
{
|
|
|
|
return machine->kvm_shadow_mem;
|
|
|
|
}
|
|
|
|
|
2015-02-04 18:43:53 +03:00
|
|
|
int machine_phandle_start(MachineState *machine)
|
|
|
|
{
|
|
|
|
return machine->phandle_start;
|
|
|
|
}
|
|
|
|
|
2015-02-04 18:43:54 +03:00
|
|
|
bool machine_dump_guest_core(MachineState *machine)
|
|
|
|
{
|
|
|
|
return machine->dump_guest_core;
|
|
|
|
}
|
|
|
|
|
2015-02-04 18:43:55 +03:00
|
|
|
bool machine_mem_merge(MachineState *machine)
|
|
|
|
{
|
|
|
|
return machine->mem_merge;
|
|
|
|
}
|
|
|
|
|
2014-03-05 21:30:45 +04:00
|
|
|
static const TypeInfo machine_info = {
|
|
|
|
.name = TYPE_MACHINE,
|
|
|
|
.parent = TYPE_OBJECT,
|
|
|
|
.abstract = true,
|
|
|
|
.class_size = sizeof(MachineClass),
|
2015-05-07 08:33:57 +03:00
|
|
|
.class_init = machine_class_init,
|
2015-08-21 00:54:35 +03:00
|
|
|
.class_base_init = machine_class_base_init,
|
2014-03-05 21:30:45 +04:00
|
|
|
.instance_size = sizeof(MachineState),
|
2014-05-26 16:40:58 +04:00
|
|
|
.instance_init = machine_initfn,
|
|
|
|
.instance_finalize = machine_finalize,
|
2014-03-05 21:30:45 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
static void machine_register_types(void)
|
|
|
|
{
|
|
|
|
type_register_static(&machine_info);
|
|
|
|
}
|
|
|
|
|
|
|
|
type_init(machine_register_types)
|