mirror of
https://gitlab.com/qemu-project/qemu.git
synced 2026-10-28 14:04:39 +08:00
hw/core/boards: Remove MachineClass::smbus_no_migration_support field
The MachineClass::smbus_no_migration_support boolean was only used by the pc-q35-3.1 and pc-i440fx-3.1 machines, which got removed. Remove it, along with pm_smbus_vmstate_needed(). Use the unconditional VMSTATE_BOOL() and VMSTATE_STRUCT() macros. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Acked-by: Corey Minyard <corey@minyard.net> Message-Id: <20260307152635.83893-5-philmd@linaro.org>
This commit is contained in:
1 parent
b31f41d724
commit
7d1e9bcfe9
6 files changed
+4
-33
No files matched your search
+1
-7
@@ -205,11 +205,6 @@ static const VMStateDescription vmstate_cpuhp_state = {
|
||||
}
|
||||
};
|
||||
|
||||
static bool piix4_vmstate_need_smbus(void *opaque, int version_id)
|
||||
{
|
||||
return pm_smbus_vmstate_needed();
|
||||
}
|
||||
|
||||
/*
|
||||
* This is a fudge to turn off the acpi_index field,
|
||||
* whose test was always broken on piix4 with 6.2 and older machine types.
|
||||
@@ -238,8 +233,7 @@ static const VMStateDescription vmstate_acpi = {
|
||||
VMSTATE_UINT16(ar.pm1.evt.en, PIIX4PMState),
|
||||
VMSTATE_UINT16(ar.pm1.cnt.cnt, PIIX4PMState),
|
||||
VMSTATE_STRUCT(apm, PIIX4PMState, 0, vmstate_apm, APMState),
|
||||
VMSTATE_STRUCT_TEST(smb, PIIX4PMState, piix4_vmstate_need_smbus, 3,
|
||||
pmsmb_vmstate, PMSMBus),
|
||||
VMSTATE_STRUCT(smb, PIIX4PMState, 3, pmsmb_vmstate, PMSMBus),
|
||||
VMSTATE_TIMER_PTR(ar.tmr.timer, PIIX4PMState),
|
||||
VMSTATE_INT64(ar.tmr.overflow_time, PIIX4PMState),
|
||||
VMSTATE_STRUCT(ar.gpe, PIIX4PMState, 2, vmstate_gpe, ACPIGPE),
|
||||
|
||||
@@ -443,13 +443,6 @@ static const MemoryRegionOps pm_smbus_ops = {
|
||||
.endianness = DEVICE_LITTLE_ENDIAN,
|
||||
};
|
||||
|
||||
bool pm_smbus_vmstate_needed(void)
|
||||
{
|
||||
MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
|
||||
|
||||
return !mc->smbus_no_migration_support;
|
||||
}
|
||||
|
||||
const VMStateDescription pmsmb_vmstate = {
|
||||
.name = "pmsmb",
|
||||
.version_id = 1,
|
||||
|
||||
@@ -88,11 +88,9 @@ static int eeprom_write_data(SMBusDevice *dev, uint8_t *buf, uint8_t len)
|
||||
|
||||
static bool smbus_eeprom_vmstate_needed(void *opaque)
|
||||
{
|
||||
MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
|
||||
SMBusEEPROMDevice *eeprom = opaque;
|
||||
|
||||
return (eeprom->accessed || smbus_vmstate_needed(&eeprom->smbusdev)) &&
|
||||
!mc->smbus_no_migration_support;
|
||||
return eeprom->accessed || smbus_vmstate_needed(&eeprom->smbusdev);
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_smbus_eeprom = {
|
||||
|
||||
+2
-8
@@ -41,20 +41,14 @@ struct ICH9SMBState {
|
||||
PMSMBus smb;
|
||||
};
|
||||
|
||||
static bool ich9_vmstate_need_smbus(void *opaque, int version_id)
|
||||
{
|
||||
return pm_smbus_vmstate_needed();
|
||||
}
|
||||
|
||||
static const VMStateDescription vmstate_ich9_smbus = {
|
||||
.name = "ich9_smb",
|
||||
.version_id = 1,
|
||||
.minimum_version_id = 1,
|
||||
.fields = (const VMStateField[]) {
|
||||
VMSTATE_PCI_DEVICE(dev, ICH9SMBState),
|
||||
VMSTATE_BOOL_TEST(irq_enabled, ICH9SMBState, ich9_vmstate_need_smbus),
|
||||
VMSTATE_STRUCT_TEST(smb, ICH9SMBState, ich9_vmstate_need_smbus, 1,
|
||||
pmsmb_vmstate, PMSMBus),
|
||||
VMSTATE_BOOL(irq_enabled, ICH9SMBState),
|
||||
VMSTATE_STRUCT(smb, ICH9SMBState, 1, pmsmb_vmstate, PMSMBus),
|
||||
VMSTATE_END_OF_LIST()
|
||||
}
|
||||
};
|
||||
|
||||
@@ -314,7 +314,6 @@ struct MachineClass {
|
||||
bool auto_enable_numa_with_memhp;
|
||||
bool auto_enable_numa_with_memdev;
|
||||
bool ignore_boot_device_suffixes;
|
||||
bool smbus_no_migration_support;
|
||||
bool nvdimm_supported;
|
||||
bool numa_mem_supported;
|
||||
bool auto_enable_numa;
|
||||
|
||||
@@ -44,13 +44,6 @@ typedef struct PMSMBus {
|
||||
|
||||
void pm_smbus_init(DeviceState *parent, PMSMBus *smb, bool force_aux_blk);
|
||||
|
||||
/*
|
||||
* For backwards compatibility on migration, older versions don't have
|
||||
* working migration for pm_smbus, this lets us ignore the migrations
|
||||
* for older machine versions.
|
||||
*/
|
||||
bool pm_smbus_vmstate_needed(void);
|
||||
|
||||
extern const VMStateDescription pmsmb_vmstate;
|
||||
|
||||
#endif /* PM_SMBUS_H */
|
||||
Reference in new issue
Block a user