aboutsummaryrefslogtreecommitdiff
path: root/include/migration/qemu-file.h
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2015-05-21 13:24:11 +0100
committerJuan Quintela <quintela@redhat.com>2015-06-12 06:54:01 +0200
commitb3af1bc9d21e6bec7dfd283d91b465c9f815b6d6 (patch)
tree9028a74e25ff75501161298d9495d78bcd54b40b /include/migration/qemu-file.h
parent5cd8cadae8db905afcbf877cae568c27d1d55a8a (diff)
downloadqemu-b3af1bc9d21e6bec7dfd283d91b465c9f815b6d6.zip
qemu-b3af1bc9d21e6bec7dfd283d91b465c9f815b6d6.tar.gz
qemu-b3af1bc9d21e6bec7dfd283d91b465c9f815b6d6.tar.bz2
Add qemu_get_counted_string to read a string prefixed by a count byte
and use it in loadvm_state and ram_load. Where ever it's used, check the return and error if it failed. Minor: ram_load was using a 257 byte array for its string, the maximum length is 255 bytes + 0 terminator, so fix to 256 Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'include/migration/qemu-file.h')
-rw-r--r--include/migration/qemu-file.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/migration/qemu-file.h b/include/migration/qemu-file.h
index a01c5b8..318aa1e 100644
--- a/include/migration/qemu-file.h
+++ b/include/migration/qemu-file.h
@@ -312,4 +312,7 @@ static inline void qemu_get_sbe64s(QEMUFile *f, int64_t *pv)
{
qemu_get_be64s(f, (uint64_t *)pv);
}
+
+size_t qemu_get_counted_string(QEMUFile *f, char buf[256]);
+
#endif