mirror of
https://github.com/qemu/qemu.git
synced 2025-08-14 20:31:47 +00:00
spapr: Add kvm-type property
The kvm-type machine option was left out when MachineState was introduced, preventing the kvm-type option from being used. Add the missing property to the sPAPR machine class, so it can be used. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
748abce94f
commit
23825581d7
@ -98,6 +98,9 @@ typedef struct SPAPRMachine SPAPRMachine;
|
|||||||
struct SPAPRMachine {
|
struct SPAPRMachine {
|
||||||
/*< private >*/
|
/*< private >*/
|
||||||
MachineState parent_obj;
|
MachineState parent_obj;
|
||||||
|
|
||||||
|
/*< public >*/
|
||||||
|
char *kvm_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1614,6 +1617,27 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char *spapr_get_kvm_type(Object *obj, Error **errp)
|
||||||
|
{
|
||||||
|
SPAPRMachine *sm = SPAPR_MACHINE(obj);
|
||||||
|
|
||||||
|
return g_strdup(sm->kvm_type);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void spapr_set_kvm_type(Object *obj, const char *value, Error **errp)
|
||||||
|
{
|
||||||
|
SPAPRMachine *sm = SPAPR_MACHINE(obj);
|
||||||
|
|
||||||
|
g_free(sm->kvm_type);
|
||||||
|
sm->kvm_type = g_strdup(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void spapr_machine_initfn(Object *obj)
|
||||||
|
{
|
||||||
|
object_property_add_str(obj, "kvm-type",
|
||||||
|
spapr_get_kvm_type, spapr_set_kvm_type, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void spapr_machine_class_init(ObjectClass *oc, void *data)
|
static void spapr_machine_class_init(ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
MachineClass *mc = MACHINE_CLASS(oc);
|
MachineClass *mc = MACHINE_CLASS(oc);
|
||||||
@ -1637,6 +1661,7 @@ static const TypeInfo spapr_machine_info = {
|
|||||||
.name = TYPE_SPAPR_MACHINE,
|
.name = TYPE_SPAPR_MACHINE,
|
||||||
.parent = TYPE_MACHINE,
|
.parent = TYPE_MACHINE,
|
||||||
.instance_size = sizeof(SPAPRMachine),
|
.instance_size = sizeof(SPAPRMachine),
|
||||||
|
.instance_init = spapr_machine_initfn,
|
||||||
.class_init = spapr_machine_class_init,
|
.class_init = spapr_machine_class_init,
|
||||||
.interfaces = (InterfaceInfo[]) {
|
.interfaces = (InterfaceInfo[]) {
|
||||||
{ TYPE_FW_PATH_PROVIDER },
|
{ TYPE_FW_PATH_PROVIDER },
|
||||||
|
Loading…
Reference in New Issue
Block a user