diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2014-02-26 22:31:10 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2014-02-26 22:31:10 +0000 |
| commit | 6f6831f61a44fde832ee6fab0cc5632de34cf6b7 (patch) | |
| tree | 47e59106156748bef6ef87537ad230ae7bec6044 /vmstate.c | |
| parent | bc3fbad816961a5b4a7f51a37472c4ac01effb92 (diff) | |
| parent | 41310c68781d742fa9bbfd5fcb1df9b7f23f5759 (diff) | |
| download | focaccia-qemu-6f6831f61a44fde832ee6fab0cc5632de34cf6b7.tar.gz focaccia-qemu-6f6831f61a44fde832ee6fab0cc5632de34cf6b7.zip | |
Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20140225' into staging
migration/next for 20140225 # gpg: Signature made Tue 25 Feb 2014 14:04:31 GMT using RSA key ID 5872D723 # gpg: Can't check signature: public key not found * remotes/juanquintela/tags/migration/20140225: rdma: rename 'x-rdma' => 'rdma' Fix two XBZRLE corruption issues Fix vmstate_info_int32_le comparison/assign qemu_file: use fwrite() correctly Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'vmstate.c')
| -rw-r--r-- | vmstate.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/vmstate.c b/vmstate.c index 284b080f46..d1f5eb0e6a 100644 --- a/vmstate.c +++ b/vmstate.c @@ -321,23 +321,24 @@ const VMStateInfo vmstate_info_int32_equal = { .put = put_int32, }; -/* 32 bit int. See that the received value is the less or the same - than the one in the field */ +/* 32 bit int. Check that the received value is less than or equal to + the one in the field */ static int get_int32_le(QEMUFile *f, void *pv, size_t size) { - int32_t *old = pv; - int32_t new; - qemu_get_sbe32s(f, &new); + int32_t *cur = pv; + int32_t loaded; + qemu_get_sbe32s(f, &loaded); - if (*old <= new) { + if (loaded <= *cur) { + *cur = loaded; return 0; } return -EINVAL; } const VMStateInfo vmstate_info_int32_le = { - .name = "int32 equal", + .name = "int32 le", .get = get_int32_le, .put = put_int32, }; |