static int nand_dev_state_load(QEMUFile* f, void* opaque, int version_id) { nand_dev_state* s = opaque; if (version_id != NAND_DEV_STATE_SAVE_VERSION) return -1; return qemu_get_struct(f, nand_dev_state_fields, s); }
static int goldfish_mmc_load(QEMUFile* f, void* opaque, int version_id) { struct goldfish_mmc_state* s = opaque; if (version_id != GOLDFISH_MMC_SAVE_VERSION) return -1; return qemu_get_struct(f, goldfish_mmc_fields, s); }
static int events_state_load(QEMUFile* f, void* opaque, int version_id) { events_state* s = opaque; if (version_id != EVENTS_STATE_SAVE_VERSION) return -1; return qemu_get_struct(f, events_state_fields, s); }
static int goldfish_battery_load(QEMUFile* f, void* opaque, int version_id) { struct goldfish_battery_state* s = opaque; if (version_id != BATTERY_STATE_SAVE_VERSION) return -1; return qemu_get_struct(f, goldfish_battery_fields, s); }
static int goldfish_sensor_load(QEMUFile* f, void* opaque, int version_id) { struct goldfish_sensor_state* s = opaque; if (version_id != SENSOR_STATE_SAVE_VERSION) return -1; return qemu_get_struct(f, goldfish_sensor_fields, s); }
static int goldfish_nfc_load(QEMUFile* f, void* opaque, int version_id) { struct nfc_state* s = opaque; if (version_id != NCIDEV_STATE_SAVE_VERSION) return -1; return qemu_get_struct(f, goldfish_nfc_fields, s); }
static int goldfish_rfkill_load(QEMUFile* f, void* opaque, int version_id) { struct rfkill_state* s = opaque; if (version_id != RFKILL_STATE_SAVE_VERSION) return -1; return qemu_get_struct(f, goldfish_rfkill_fields, s); }
static int goldfish_mmc_load(QEMUFile* f, void* opaque, int version_id) { struct goldfish_mmc_state* s = opaque; if (version_id == GOLDFISH_MMC_SAVE_VERSION) { s->buffer_address = qemu_get_be64(f); } else if (version_id == GOLDFISH_MMC_SAVE_VERSION_LEGACY) { s->buffer_address = qemu_get_be32(f); } else { // Unsupported version! return -1; } return qemu_get_struct(f, goldfish_mmc_fields, s); }
static int nand_dev_controller_state_load(QEMUFile *f, void *opaque, int version_id) { nand_dev_controller_state* s = opaque; int ret; if (version_id != NAND_DEV_STATE_SAVE_VERSION) return -1; if ((ret = qemu_get_struct(f, nand_dev_controller_state_fields, s))) return ret; if ((ret = nand_dev_load_disks(f))) return ret; return 0; }
static int audio_state_load( QEMUFile* f, void* opaque, int version_id ) { struct goldfish_audio_state* s = opaque; int ret; if (version_id != AUDIO_STATE_SAVE_VERSION) return -1; ret = qemu_get_struct(f, audio_state_fields, s); if (!ret) { goldfish_audio_buff_get( s->out_buff1, f ); goldfish_audio_buff_get( s->out_buff2, f ); goldfish_audio_buff_get (s->in_buff, f); } return ret; }