This will be used later by postcopy migration.
Signed-off-by: Isaku Yamahata <[email protected]>
---
hw/hw.h | 1 +
savevm.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/hw/hw.h b/hw/hw.h
index 0b481ba..d508b4e 100644
--- a/hw/hw.h
+++ b/hw/hw.h
@@ -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)
{
diff --git a/savevm.c b/savevm.c
index ff77846..1d9e218 100644
--- a/savevm.c
+++ b/savevm.c
@@ -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;
--
1.7.1.1
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html