Revision 9122a8fe

b/hw/hw.h
343 343
extern const VMStateInfo vmstate_info_uint8_equal;
344 344
extern const VMStateInfo vmstate_info_uint16_equal;
345 345
extern const VMStateInfo vmstate_info_int32_equal;
346
extern const VMStateInfo vmstate_info_uint32_equal;
346 347
extern const VMStateInfo vmstate_info_int32_le;
347 348

  
348 349
extern const VMStateInfo vmstate_info_uint8;
......
704 705
#define VMSTATE_INT32_EQUAL(_f, _s)                                   \
705 706
    VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_equal, int32_t)
706 707

  
708
#define VMSTATE_UINT32_EQUAL(_f, _s)                                   \
709
    VMSTATE_SINGLE(_f, _s, 0, vmstate_info_uint32_equal, uint32_t)
710

  
707 711
#define VMSTATE_INT32_LE(_f, _s)                                   \
708 712
    VMSTATE_SINGLE(_f, _s, 0, vmstate_info_int32_le, int32_t)
709 713

  
b/savevm.c
882 882
    .put  = put_uint32,
883 883
};
884 884

  
885
/* 32 bit uint. See that the received value is the same than the one
886
   in the field */
887

  
888
static int get_uint32_equal(QEMUFile *f, void *pv, size_t size)
889
{
890
    uint32_t *v = pv;
891
    uint32_t v2;
892
    qemu_get_be32s(f, &v2);
893

  
894
    if (*v == v2) {
895
        return 0;
896
    }
897
    return -EINVAL;
898
}
899

  
900
const VMStateInfo vmstate_info_uint32_equal = {
901
    .name = "uint32 equal",
902
    .get  = get_uint32_equal,
903
    .put  = put_uint32,
904
};
905

  
885 906
/* 64 bit unsigned int */
886 907

  
887 908
static int get_uint64(QEMUFile *f, void *pv, size_t size)

Also available in: Unified diff