Move File operations to qemu-file.c
PATCH v4 1/1 Move File operations to qemu-file.c
This patch reorganizes qemu file operations to be in their own source file instead of being lumped in savevm.c. Besides being more logical for maintenance it also makes it easier for future users of the file functions to add tests.
v4 move qemu-file.c into util/ , leave the bdrv functions where they are for now v3 forward port to resolve conflicts
v2 forward port to resolve conflicts, strip trailing whitespace during move
Cc Paolo Bonzini <[email protected]>
Cc Michael Tsirkin <[email protected]>
Signed-off-by Stefan Berger <[email protected]>
Signed-off-by Joel Schopp <[email protected]>
--- include/migration/qemu-file.h | 5 + savevm.c | 656 +-------------------------------------- util/Makefile.objs | 1 + util/qemu-file.c | 682 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 689 insertions(+), 655 deletions(-) create mode 100644 util/qemu-file.c
include/migration/qemu-file.h +5 -0
@@ -98,6 +98,11 @@ void qemu_file_reset_rate_limit(QEMUFile *f);void qemu_file_set_rate_limit (QEMUFile *f,int64_t new_rate);int64_t qemu_file_get_rate_limit (QEMUFile *f);int qemu_file_get_error (QEMUFile *f); +void qemu_file_set_error (QEMUFile *f,int ret); +int qemu_peek_buffer (QEMUFile *f,uint8_t *buf,int size,size_t offset); +int qemu_peek_byte (QEMUFile *f,int offset); +void qemu_file_skip (QEMUFile *f,int size); +void qemu_fflush (QEMUFile *f);static inline void qemu_put_be64s (QEMUFile *f,const uint64_t *pv) {
savevm.c +1 -655
668 lines not on this page · raw message
util/Makefile.objs +1 -0
@@ -9,3 +9,4 @@ util-obj-y += error.o qemu-error.o util-obj-$(CONFIG_POSIX) += compatfd.o util-obj-y += iov.o aes.o qemu-config.o qemu-sockets.o uri.o notify.o util-obj-y += qemu-option.o qemu-progress.o +util-obj-y += qemu-file.o
util/qemu-file.c new file +682 -0
682 lines not on this page · raw message
Signature · 1 line
1.7.10.4