OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b9ce145
)
savevm: define qemu_get_byte() using qemu_peek_byte()
author
Juan Quintela
<quintela@redhat.com>
Thu, 6 Oct 2011 12:29:32 +0000
(14:29 +0200)
committer
Juan Quintela
<quintela@redhat.com>
Thu, 20 Oct 2011 11:23:11 +0000
(13:23 +0200)
Signed-off-by: Juan Quintela<quintela@redhat.com>
savevm.c
patch
|
blob
|
history
diff --git
a/savevm.c
b/savevm.c
index
6e4bb3a
..
0380999
100644
(file)
--- a/
savevm.c
+++ b/
savevm.c
@@
-578,17
+578,14
@@
static int qemu_peek_byte(QEMUFile *f)
int qemu_get_byte(QEMUFile *f)
{
- if (f->is_write) {
- abort();
- }
+ int result;
- if (f->buf_index >= f->buf_size) {
- qemu_fill_buffer(f);
- if (f->buf_index >= f->buf_size) {
- return 0;
- }
+ result = qemu_peek_byte(f);
+
+ if (f->buf_index < f->buf_size) {
+ f->buf_index++;
}
- return
f->buf[f->buf_index++]
;
+ return
result
;
}
int64_t qemu_ftell(QEMUFile *f)