QEMU-Nyx-fork/nyx/snapshot/devices/nyx_device_state.h
Sergej Schumilo cd702b528c Initial Release of Nyx
Co-authored-by: Cornelius Aschermann <cornelius@hexgolems.com>
2021-11-14 22:20:53 +01:00

34 lines
995 B
C

#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "nyx/snapshot/devices/state_reallocation.h"
typedef struct nyx_device_state_s{
state_reallocation_t* qemu_state;
uint64_t tsc_value;
uint64_t tsc_value_incremental;
bool incremental_mode;
void* state_buf; /* QEMU's serialized state */
uint32_t state_buf_size;
} nyx_device_state_t;
nyx_device_state_t* nyx_device_state_init(void);
nyx_device_state_t* nyx_device_state_init_from_snapshot(const char* snapshot_folder, bool pre_snapshot);
void nyx_device_state_restore(nyx_device_state_t* self);
void nyx_device_state_post_restore(nyx_device_state_t* self);
void nyx_device_state_switch_incremental(nyx_device_state_t* self);
void nyx_device_state_disable_incremental(nyx_device_state_t* self);
void nyx_device_state_save_tsc(nyx_device_state_t* self);
void nyx_device_state_save_tsc_incremental(nyx_device_state_t* self);
void nyx_device_state_serialize(nyx_device_state_t* self, const char* snapshot_folder);