mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
hw/i386: Make pit a property of common x86 base machine type
Both pc and microvm have pit property individually. Let's just make it the property of common x86 base machine type. Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> Reviewed-by: Sergio Lopez <slp@redhat.com> Message-Id: <20220310122811.807794-2-xiaoyao.li@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
1f1a7b2269
commit
9dee7e5109
6 changed files with 31 additions and 51 deletions
|
@ -257,7 +257,7 @@ static void microvm_devices_init(MicrovmMachineState *mms)
|
|||
g_free(i8259);
|
||||
}
|
||||
|
||||
if (mms->pit == ON_OFF_AUTO_ON || mms->pit == ON_OFF_AUTO_AUTO) {
|
||||
if (x86ms->pit == ON_OFF_AUTO_ON || x86ms->pit == ON_OFF_AUTO_AUTO) {
|
||||
if (kvm_pit_in_kernel()) {
|
||||
kvm_pit_init(isa_bus, 0x40);
|
||||
} else {
|
||||
|
@ -508,23 +508,6 @@ static void microvm_machine_set_pic(Object *obj, Visitor *v, const char *name,
|
|||
visit_type_OnOffAuto(v, name, &mms->pic, errp);
|
||||
}
|
||||
|
||||
static void microvm_machine_get_pit(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
MicrovmMachineState *mms = MICROVM_MACHINE(obj);
|
||||
OnOffAuto pit = mms->pit;
|
||||
|
||||
visit_type_OnOffAuto(v, name, &pit, errp);
|
||||
}
|
||||
|
||||
static void microvm_machine_set_pit(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
MicrovmMachineState *mms = MICROVM_MACHINE(obj);
|
||||
|
||||
visit_type_OnOffAuto(v, name, &mms->pit, errp);
|
||||
}
|
||||
|
||||
static void microvm_machine_get_rtc(Object *obj, Visitor *v, const char *name,
|
||||
void *opaque, Error **errp)
|
||||
{
|
||||
|
@ -650,7 +633,6 @@ static void microvm_machine_initfn(Object *obj)
|
|||
|
||||
/* Configuration */
|
||||
mms->pic = ON_OFF_AUTO_AUTO;
|
||||
mms->pit = ON_OFF_AUTO_AUTO;
|
||||
mms->rtc = ON_OFF_AUTO_AUTO;
|
||||
mms->pcie = ON_OFF_AUTO_AUTO;
|
||||
mms->ioapic2 = ON_OFF_AUTO_AUTO;
|
||||
|
@ -709,13 +691,6 @@ static void microvm_class_init(ObjectClass *oc, void *data)
|
|||
object_class_property_set_description(oc, MICROVM_MACHINE_PIC,
|
||||
"Enable i8259 PIC");
|
||||
|
||||
object_class_property_add(oc, MICROVM_MACHINE_PIT, "OnOffAuto",
|
||||
microvm_machine_get_pit,
|
||||
microvm_machine_set_pit,
|
||||
NULL, NULL);
|
||||
object_class_property_set_description(oc, MICROVM_MACHINE_PIT,
|
||||
"Enable i8254 PIT");
|
||||
|
||||
object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto",
|
||||
microvm_machine_get_rtc,
|
||||
microvm_machine_set_rtc,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue