savevm: define qemu_get_byte() using qemu_peek_byte()
Signed-off-by: Juan Quintela<quintela@redhat.com>
This commit is contained in:
parent
b9ce1454e1
commit
65f3bb3da3
15
savevm.c
15
savevm.c
|
@ -578,17 +578,14 @@ static int qemu_peek_byte(QEMUFile *f)
|
||||||
|
|
||||||
int qemu_get_byte(QEMUFile *f)
|
int qemu_get_byte(QEMUFile *f)
|
||||||
{
|
{
|
||||||
if (f->is_write) {
|
int result;
|
||||||
abort();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (f->buf_index >= f->buf_size) {
|
result = qemu_peek_byte(f);
|
||||||
qemu_fill_buffer(f);
|
|
||||||
if (f->buf_index >= f->buf_size) {
|
if (f->buf_index < f->buf_size) {
|
||||||
return 0;
|
f->buf_index++;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return f->buf[f->buf_index++];
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t qemu_ftell(QEMUFile *f)
|
int64_t qemu_ftell(QEMUFile *f)
|
||||||
|
|
Loading…
Reference in a new issue