mirror of
https://github.com/mii443/qemu.git
synced 2025-12-07 21:18:22 +00:00
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>
This commit is contained in:
committed by
Juan Quintela
parent
5cd8cadae8
commit
b3af1bc9d2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user