@@ -20,3 +20,5 @@ GTAGS
*.swp
*.patch
*.gcov
+.idea
+buildDir
@@ -475,6 +475,16 @@ static void machine_set_usb(Object *obj, bool value, Error **errp)
ms->usb_disabled = !value;
}
+static bool machine_get_defaults(Object *obj, __attribute__((unused)) Error **errp) {
+ MachineState *ms = MACHINE(obj);
+ return ms->has_defaults;
+}
+
+static void machine_set_defaults(Object *obj, bool val, __attribute__((unused)) Error **errp) {
+ MachineState *ms = MACHINE(obj);
+ ms->has_defaults = val;
+}
+
static bool machine_get_graphics(Object *obj, Error **errp)
{
MachineState *ms = MACHINE(obj);
@@ -1083,6 +1093,11 @@ static void machine_class_init(ObjectClass *oc, void *data)
object_class_property_set_description(oc, "usb",
"Set on/off to enable/disable usb");
+ object_class_property_add_bool(oc, "defaults",
+ machine_get_defaults, machine_set_defaults);
+ object_class_property_set_description(oc, "defaults",
+ "Set on/off to enable/disable hardware defaults");
+
object_class_property_add_bool(oc, "graphics",
machine_get_graphics, machine_set_graphics);
object_class_property_set_description(oc, "graphics",
@@ -262,13 +262,13 @@ static void q800_machine_init(MachineState *machine)
const char *initrd_filename = machine->initrd_filename;
const char *kernel_cmdline = machine->kernel_cmdline;
const char *bios_name = machine->firmware ?: MACROM_FILENAME;
+ const bool has_defaults = m->parent_obj.has_defaults;
hwaddr parameters_base;
CPUState *cs;
DeviceState *dev;
SysBusESPState *sysbus_esp;
ESPState *esp;
SysBusDevice *sysbus;
- BusState *adb_bus;
NubusBus *nubus;
DriveInfo *dinfo;
NICInfo *nd;
@@ -354,12 +354,13 @@ static void q800_machine_init(MachineState *machine)
qdev_connect_gpio_out(DEVICE(&m->via1), 0,
qdev_get_gpio_in_named(DEVICE(&m->glue),
"auxmode", 0));
-
- adb_bus = qdev_get_child_bus(DEVICE(&m->via1), "adb.0");
- dev = qdev_new(TYPE_ADB_KEYBOARD);
- qdev_realize_and_unref(dev, adb_bus, &error_fatal);
- dev = qdev_new(TYPE_ADB_MOUSE);
- qdev_realize_and_unref(dev, adb_bus, &error_fatal);
+ if (has_defaults) {
+ BusState *adb_bus = qdev_get_child_bus(DEVICE(&m->via1), "adb.0");
+ dev = qdev_new(TYPE_ADB_KEYBOARD);
+ qdev_realize_and_unref(dev, adb_bus, &error_fatal);
+ dev = qdev_new(TYPE_ADB_MOUSE);
+ qdev_realize_and_unref(dev, adb_bus, &error_fatal);
+ }
/* VIA 2 */
object_initialize_child(OBJECT(machine), "via2", &m->via2,
@@ -387,6 +387,7 @@ struct MachineState {
bool mem_merge;
bool usb;
bool usb_disabled;
+ bool has_defaults;
char *firmware;
bool iommu;
bool suppress_vmdesc;
@@ -2122,7 +2122,7 @@ static void qemu_create_machine(QDict *qdict)
object_property_add_child(container_get(OBJECT(current_machine),
"/unattached"),
"sysbus", OBJECT(sysbus_get_default()));
-
+ current_machine->has_defaults = defaults_enabled();
if (machine_class->minimum_page_bits) {
if (!set_preferred_target_page_bits(machine_class->minimum_page_bits)) {
/* This would be a board error: specifying a minimum smaller than