diff options
| author | Juan Quintela <quintela@redhat.com> | 2011-10-04 15:28:31 +0200 |
|---|---|---|
| committer | Juan Quintela <quintela@redhat.com> | 2011-10-20 13:23:11 +0200 |
| commit | c63807244fb55071675907460a0ecf228c1766c8 (patch) | |
| tree | 40e84a912c1cd8904478dcc3d692b5a0f9ff80e5 /hw/ds1225y.c | |
| parent | 65f3bb3da3d5b46daebbfc54bd41ee493fdaba86 (diff) | |
| download | focaccia-qemu-c63807244fb55071675907460a0ecf228c1766c8.tar.gz focaccia-qemu-c63807244fb55071675907460a0ecf228c1766c8.zip | |
savevm: improve subsections detection on load
We add qemu_peek_buffer, that is identical to qemu_get_buffer, just that it don't update f->buf_index. We add a paramenter to qemu_peek_byte() to be able to peek more than one byte. Once this is done, to see if we have a subsection we look: - 1st byte is QEMU_VM_SUBSECTION - 2nd byte is a length, and is bigger than section name - 3rd element is a string that starts with section_name So, we shouldn't have false positives (yes, content could still get us wrong but probabilities are really low). v2: - Alex Williamsom found that we could get negative values on index. - Rework code to fix that part. - Rewrite qemu_get_buffer() using qemu_peek_buffer() v3: - return "done" on error case v4: - fix qemu_file_skip() off by one. Signed-off-by: Juan Quintela <quintela@redhat.com>
Diffstat (limited to 'hw/ds1225y.c')
0 files changed, 0 insertions, 0 deletions