Add qemu_get_counted_string to read a string prefixed by a count byte
commitb3af1bc9d21e6bec7dfd283d91b465c9f815b6d6
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Thu, 21 May 2015 12:24:11 +0000 (21 13:24 +0100)
committerJuan Quintela <quintela@redhat.com>
Fri, 12 Jun 2015 04:54:01 +0000 (12 06:54 +0200)
tree9028a74e25ff75501161298d9495d78bcd54b40b
parent5cd8cadae8db905afcbf877cae568c27d1d55a8a
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>
include/migration/qemu-file.h
migration/qemu-file.c
migration/savevm.c