@@ -80,6 +80,7 @@ int qemu_get_byte(QEMUFile *f);
int qemu_peek_byte(QEMUFile *f, int offset);
int qemu_peek_buffer(QEMUFile *f, uint8_t *buf, int size, size_t offset);
void qemu_file_skip(QEMUFile *f, int size);
+int qemu_pending_size(const QEMUFile *f);
static inline unsigned int qemu_get_ubyte(QEMUFile *f)
{
@@ -593,6 +593,11 @@ void qemu_file_skip(QEMUFile *f, int size)
}
}
+int qemu_pending_size(const QEMUFile *f)
+{
+ return f->buf_size - f->buf_index;
+}
+
int qemu_peek_buffer(QEMUFile *f, uint8_t *buf, int size, size_t offset)
{
int pending;
This will be used later by postcopy migration. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> --- hw/hw.h | 1 + savevm.c | 5 +++++ 2 files changed, 6 insertions(+), 0 deletions(-)