Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
---
hw/nvram/eeprom93xx.c | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/hw/nvram/eeprom93xx.c b/hw/nvram/eeprom93xx.c
index a8fd60a8fb..32dab854fa 100644
--- a/hw/nvram/eeprom93xx.c
+++ b/hw/nvram/eeprom93xx.c
@@ -39,6 +39,7 @@
#include "hw/nvram/eeprom93xx.h"
#include "migration/qemu-file-types.h"
#include "migration/vmstate.h"
+#include "qapi/error.h"
/* Debug EEPROM emulation. */
//~ #define DEBUG_EEPROM
@@ -95,28 +96,28 @@ struct _eeprom_t {
This is a Big hack, but it is how the old state did it.
*/
-static int get_uint16_from_uint8(QEMUFile *f, void *pv, size_t size,
- const VMStateField *field)
+static bool get_uint16_from_uint8(QEMUFile *f, void *pv, size_t size,
+ const VMStateField *field, Error **errp)
{
uint16_t *v = pv;
*v = qemu_get_ubyte(f);
- return 0;
+ return true;
}
-static int put_unused(QEMUFile *f, void *pv, size_t size,
- const VMStateField *field, JSONWriter *vmdesc)
+static bool put_unused(QEMUFile *f, void *pv, size_t size,
+ const VMStateField *field, JSONWriter *vmdesc,
+ Error **errp)
{
- fprintf(stderr, "uint16_from_uint8 is used only for backwards compatibility.\n");
- fprintf(stderr, "Never should be used to write a new state.\n");
- exit(0);
-
- return 0;
+ error_setg(errp,
+ "uint16_from_uint8 is used only for backwards compatibility. "
+ "Never should be used to write a new state.");
+ return false;
}
static const VMStateInfo vmstate_hack_uint16_from_uint8 = {
.name = "uint16_from_uint8",
- .get = get_uint16_from_uint8,
- .put = put_unused,
+ .load = get_uint16_from_uint8,
+ .save = put_unused,
};
#define VMSTATE_UINT16_HACK_TEST(_f, _s, _t) \
--
2.48.1