Exemple #1
0
void ppc_compat_add_property(Object *obj, const char *name,
                             uint32_t *compat_pvr, const char *basedesc,
                             Error **errp)
{
    Error *local_err = NULL;
    gchar *namesv[ARRAY_SIZE(compat_table) + 1];
    gchar *names, *desc;
    int i;

    object_property_add(obj, name, "string",
                        ppc_compat_prop_get, ppc_compat_prop_set, NULL,
                        compat_pvr, &local_err);
    if (local_err) {
        goto out;
    }

    for (i = 0; i < ARRAY_SIZE(compat_table); i++) {
        /*
         * Have to discard const here, because g_strjoinv() takes
         * (gchar **), not (const gchar **) :(
         */
        namesv[i] = (gchar *)compat_table[i].name;
    }
    namesv[ARRAY_SIZE(compat_table)] = NULL;

    names = g_strjoinv(", ", namesv);
    desc = g_strdup_printf("%s. Valid values are %s.", basedesc, names);
    object_property_set_description(obj, name, desc, &local_err);

    g_free(names);
    g_free(desc);

out:
    error_propagate(errp, local_err);
}
Exemple #2
0
static inline void s390_machine_initfn(Object *obj)
{
    object_property_add_bool(obj, "aes-key-wrap",
                             machine_get_aes_key_wrap,
                             machine_set_aes_key_wrap, NULL);
    object_property_set_description(obj, "aes-key-wrap",
            "enable/disable AES key wrapping using the CPACF wrapping key",
            NULL);
    object_property_set_bool(obj, true, "aes-key-wrap", NULL);

    object_property_add_bool(obj, "dea-key-wrap",
                             machine_get_dea_key_wrap,
                             machine_set_dea_key_wrap, NULL);
    object_property_set_description(obj, "dea-key-wrap",
            "enable/disable DEA key wrapping using the CPACF wrapping key",
            NULL);
    object_property_set_bool(obj, true, "dea-key-wrap", NULL);
}
Exemple #3
0
void s390_cpu_model_register_props(Object *obj)
{
    S390FeatGroup group;
    S390Feat feat;

    for (feat = 0; feat < S390_FEAT_MAX; feat++) {
        const S390FeatDef *def = s390_feat_def(feat);
        object_property_add(obj, def->name, "bool", get_feature,
                            set_feature, NULL, (void *) feat, NULL);
        object_property_set_description(obj, def->name, def->desc , NULL);
    }
    for (group = 0; group < S390_FEAT_GROUP_MAX; group++) {
        const S390FeatGroupDef *def = s390_feat_group_def(group);
        object_property_add(obj, def->name, "bool", get_feature_group,
                            set_feature_group, NULL, (void *) group, NULL);
        object_property_set_description(obj, def->name, def->desc , NULL);
    }
}
Exemple #4
0
static inline void xbox_machine_initfn(Object *obj)
{
    object_property_add_str(obj, "bootrom", machine_get_bootrom,
                            machine_set_bootrom, NULL);
    object_property_set_description(obj, "bootrom",
                                    "Xbox bootrom file", NULL);

    object_property_add_str(obj, "eeprom", machine_get_eeprom,
                            machine_set_eeprom, NULL);
    object_property_set_description(obj, "eeprom",
                                    "Xbox EEPROM file", NULL);

    object_property_add_bool(obj, "short-animation",
                             machine_get_short_animation,
                             machine_set_short_animation, NULL);
    object_property_set_description(obj, "short-animation",
                                    "Skip Xbox boot animation",
                                    NULL);
    object_property_set_bool(obj, false, "short-animation", NULL);

}
Exemple #5
0
static void vexpress_instance_init(Object *obj)
{
    VexpressMachineState *vms = VEXPRESS_MACHINE(obj);

    /* EL3 is enabled by default on vexpress */
    vms->secure = true;
    object_property_add_bool(obj, "secure", vexpress_get_secure,
                             vexpress_set_secure, NULL);
    object_property_set_description(obj, "secure",
                                    "Set on/off to enable/disable the ARM "
                                    "Security Extensions (TrustZone)",
                                    NULL);
}
Exemple #6
0
static void xlnx_zcu102_machine_instance_init(Object *obj)
{
    XlnxZCU102 *s = ZCU102_MACHINE(obj);

    /* Default to secure mode being disabled */
    s->secure = false;
    object_property_add_bool(obj, "secure", zcu102_get_secure,
                             zcu102_set_secure, NULL);
    object_property_set_description(obj, "secure",
                                    "Set on/off to enable/disable the ARM "
                                    "Security Extensions (TrustZone)",
                                    NULL);

    /* Default to virt (EL2) being disabled */
    s->virt = false;
    object_property_add_bool(obj, "virtualization", zcu102_get_virt,
                             zcu102_set_virt, NULL);
    object_property_set_description(obj, "virtualization",
                                    "Set on/off to enable/disable emulating a "
                                    "guest CPU which implements the ARM "
                                    "Virtualization Extensions",
                                    NULL);
}
Exemple #7
0
static void core99_instance_init(Object *obj)
{
    Core99MachineState *cms = CORE99_MACHINE(obj);

    /* Default via_config is CORE99_VIA_CONFIG_CUDA */
    cms->via_config = CORE99_VIA_CONFIG_CUDA;
    object_property_add_str(obj, "via", core99_get_via_config,
                            core99_set_via_config, NULL);
    object_property_set_description(obj, "via",
                                    "Set VIA configuration. "
                                    "Valid values are cuda, pmu and pmu-adb",
                                    NULL);

    return;
}
Exemple #8
0
static void machine_initfn(Object *obj)
{
    MachineState *ms = MACHINE(obj);

    ms->kernel_irqchip_allowed = true;
    ms->kvm_shadow_mem = -1;
    ms->dump_guest_core = true;
    ms->mem_merge = true;

    object_property_add_str(obj, "accel",
                            machine_get_accel, machine_set_accel, NULL);
    object_property_set_description(obj, "accel",
                                    "Accelerator list",
                                    NULL);
    object_property_add_bool(obj, "kernel-irqchip",
                             NULL,
                             machine_set_kernel_irqchip,
                             NULL);
    object_property_set_description(obj, "kernel-irqchip",
                                    "Use KVM in-kernel irqchip",
                                    NULL);
    object_property_add(obj, "kvm-shadow-mem", "int",
                        machine_get_kvm_shadow_mem,
                        machine_set_kvm_shadow_mem,
                        NULL, NULL, NULL);
    object_property_set_description(obj, "kvm-shadow-mem",
                                    "KVM shadow MMU size",
                                    NULL);
    object_property_add_str(obj, "kernel",
                            machine_get_kernel, machine_set_kernel, NULL);
    object_property_set_description(obj, "kernel",
                                    "Linux kernel image file",
                                    NULL);
    object_property_add_str(obj, "initrd",
                            machine_get_initrd, machine_set_initrd, NULL);
    object_property_set_description(obj, "initrd",
                                    "Linux initial ramdisk file",
                                    NULL);
    object_property_add_str(obj, "append",
                            machine_get_append, machine_set_append, NULL);
    object_property_set_description(obj, "append",
                                    "Linux kernel command line",
                                    NULL);
    object_property_add_str(obj, "dtb",
                            machine_get_dtb, machine_set_dtb, NULL);
    object_property_set_description(obj, "dtb",
                                    "Linux kernel device tree file",
                                    NULL);
    object_property_add_str(obj, "dumpdtb",
                            machine_get_dumpdtb, machine_set_dumpdtb, NULL);
    object_property_set_description(obj, "dumpdtb",
                                    "Dump current dtb to a file and quit",
                                    NULL);
    object_property_add(obj, "phandle-start", "int",
                        machine_get_phandle_start,
                        machine_set_phandle_start,
                        NULL, NULL, NULL);
    object_property_set_description(obj, "phandle-start",
                                    "The first phandle ID we may generate dynamically",
                                    NULL);
    object_property_add_str(obj, "dt-compatible",
                            machine_get_dt_compatible,
                            machine_set_dt_compatible,
                            NULL);
    object_property_set_description(obj, "dt-compatible",
                                    "Overrides the \"compatible\" property of the dt root node",
                                    NULL);
    object_property_add_bool(obj, "dump-guest-core",
                             machine_get_dump_guest_core,
                             machine_set_dump_guest_core,
                             NULL);
    object_property_set_description(obj, "dump-guest-core",
                                    "Include guest memory in  a core dump",
                                    NULL);
    object_property_add_bool(obj, "mem-merge",
                             machine_get_mem_merge,
                             machine_set_mem_merge, NULL);
    object_property_set_description(obj, "mem-merge",
                                    "Enable/disable memory merge support",
                                    NULL);
    object_property_add_bool(obj, "usb",
                             machine_get_usb,
                             machine_set_usb, NULL);
    object_property_set_description(obj, "usb",
                                    "Set on/off to enable/disable usb",
                                    NULL);
    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);
    object_property_add_str(obj, "firmware",
                            machine_get_firmware,
                            machine_set_firmware, NULL);
    object_property_set_description(obj, "firmware",
                                    "Firmware image",
                                    NULL);
    object_property_add_bool(obj, "iommu",
                             machine_get_iommu,
                             machine_set_iommu, NULL);
    object_property_set_description(obj, "iommu",
                                    "Set on/off to enable/disable Intel IOMMU (VT-d)",
                                    NULL);
    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);
    object_property_add_bool(obj, "enforce-config-section",
                             machine_get_enforce_config_section,
                             machine_set_enforce_config_section, NULL);
    object_property_set_description(obj, "enforce-config-section",
                                    "Set on to enforce configuration section migration",
                                    NULL);

    /* 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);
}
Exemple #9
0
static void machine_initfn(Object *obj)
{
    MachineState *ms = MACHINE(obj);

    object_property_add_str(obj, "accel",
                            machine_get_accel, machine_set_accel, NULL);
    object_property_set_description(obj, "accel",
                                    "Accelerator list",
                                    NULL);
    object_property_add_bool(obj, "kernel-irqchip",
                             machine_get_kernel_irqchip,
                             machine_set_kernel_irqchip,
                             NULL);
    object_property_set_description(obj, "kernel-irqchip",
                                    "Use KVM in-kernel irqchip",
                                    NULL);
    object_property_add(obj, "kvm-shadow-mem", "int",
                        machine_get_kvm_shadow_mem,
                        machine_set_kvm_shadow_mem,
                        NULL, NULL, NULL);
    object_property_set_description(obj, "kvm-shadow-mem",
                                    "KVM shadow MMU size",
                                    NULL);
    object_property_add_str(obj, "kernel",
                            machine_get_kernel, machine_set_kernel, NULL);
    object_property_set_description(obj, "kernel",
                                    "Linux kernel image file",
                                    NULL);
    object_property_add_str(obj, "initrd",
                            machine_get_initrd, machine_set_initrd, NULL);
    object_property_set_description(obj, "initrd",
                                    "Linux initial ramdisk file",
                                    NULL);
    object_property_add_str(obj, "append",
                            machine_get_append, machine_set_append, NULL);
    object_property_set_description(obj, "append",
                                    "Linux kernel command line",
                                    NULL);
    object_property_add_str(obj, "dtb",
                            machine_get_dtb, machine_set_dtb, NULL);
    object_property_set_description(obj, "dtb",
                                    "Linux kernel device tree file",
                                    NULL);
    object_property_add_str(obj, "hw-dtb",
                            machine_get_hw_dtb, machine_set_hw_dtb, NULL);
    object_property_set_description(obj, "hw-dtb",
                                    "Dump current dtb to a file and quit",
                                    NULL);
    object_property_add_str(obj, "dumpdtb",
                            machine_get_dumpdtb, machine_set_dumpdtb, NULL);
    object_property_set_description(obj, "dumpdtb",
                                    "Dump current dtb to a file and quit",
                                    NULL);
    object_property_add(obj, "phandle-start", "int",
                        machine_get_phandle_start,
                        machine_set_phandle_start,
                        NULL, NULL, NULL);
    object_property_set_description(obj, "phandle-start",
                                    "The first phandle ID we may generate dynamically",
                                    NULL);
    object_property_add_str(obj, "dt-compatible",
                            machine_get_dt_compatible,
                            machine_set_dt_compatible,
                            NULL);
    object_property_set_description(obj, "dt-compatible",
                                    "Overrides the \"compatible\" property of the dt root node",
                                    NULL);
    object_property_add_bool(obj, "dump-guest-core",
                             machine_get_dump_guest_core,
                             machine_set_dump_guest_core,
                             NULL);
    object_property_set_description(obj, "dump-guest-core",
                                    "Include guest memory in  a core dump",
                                    NULL);
    object_property_add_bool(obj, "linux",
                             machine_get_linux, machine_set_linux, NULL);
    object_property_set_description(obj, "linux",
                                    "Force a Linux style boot",
                                    NULL);
    object_property_add_bool(obj, "mem-merge",
                             machine_get_mem_merge,
                             machine_set_mem_merge, NULL);
    object_property_set_description(obj, "mem-merge",
                                    "Enable/disable memory merge support",
                                    NULL);
    object_property_add_bool(obj, "usb",
                             machine_get_usb,
                             machine_set_usb, NULL);
    object_property_set_description(obj, "usb",
                                    "Set on/off to enable/disable usb",
                                    NULL);
    object_property_add_str(obj, "firmware",
                            machine_get_firmware,
                            machine_set_firmware, NULL);
    object_property_set_description(obj, "firmware",
                                    "Firmware image",
                                    NULL);
    object_property_add_bool(obj, "iommu",
                             machine_get_iommu,
                             machine_set_iommu, NULL);
    object_property_set_description(obj, "iommu",
                                    "Set on/off to enable/disable Intel IOMMU (VT-d)",
                                    NULL);

    /* 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);
}