[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 06/25] migration: switch to use QIOChannelNull for dummy channel
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 06/25] migration: switch to use QIOChannelNull for dummy channel |
Date: |
Thu, 23 Jun 2022 17:53:35 +0100 |
From: Daniel P. Berrangé <berrange@redhat.com>
This removes one further custom impl of QEMUFile, in favour of a
QIOChannel based impl.
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
migration/ram.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/migration/ram.c b/migration/ram.c
index 5f5e37f64d..89082716d6 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -32,11 +32,13 @@
#include "qemu/bitmap.h"
#include "qemu/madvise.h"
#include "qemu/main-loop.h"
+#include "io/channel-null.h"
#include "xbzrle.h"
#include "ram.h"
#include "migration.h"
#include "migration/register.h"
#include "migration/misc.h"
+#include "migration/qemu-file-channel.h"
#include "qemu-file.h"
#include "postcopy-ram.h"
#include "page_cache.h"
@@ -457,8 +459,6 @@ static QemuThread *compress_threads;
*/
static QemuMutex comp_done_lock;
static QemuCond comp_done_cond;
-/* The empty QEMUFileOps will be used by file in CompressParam */
-static const QEMUFileOps empty_ops = { };
static QEMUFile *decomp_file;
static DecompressParam *decomp_param;
@@ -569,7 +569,8 @@ static int compress_threads_save_setup(void)
/* comp_param[i].file is just used as a dummy buffer to save data,
* set its ops to empty.
*/
- comp_param[i].file = qemu_fopen_ops(NULL, &empty_ops, false);
+ comp_param[i].file = qemu_fopen_channel_output(
+ QIO_CHANNEL(qio_channel_null_new()));
comp_param[i].done = true;
comp_param[i].quit = false;
qemu_mutex_init(&comp_param[i].mutex);
--
2.36.1
- [PULL 00/25] migration queue, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 02/25] QIOChannelSocket: Introduce assert and reduce ifdefs to improve readability, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 01/25] migration: Remove RDMA_UNREGISTRATION_EXAMPLE, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 03/25] QIOChannelSocket: Fix zero-copy send so socket flush works, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 05/25] io: add a QIOChannelNull equivalent to /dev/null, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 07/25] migration: remove unreachble RDMA code in save_hook impl, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 06/25] migration: switch to use QIOChannelNull for dummy channel,
Dr. David Alan Gilbert (git) <=
- [PULL 10/25] migration: rename qemu_ftell to qemu_file_total_transferred, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 09/25] migration: rename 'pos' field in QEMUFile to 'bytes_processed', Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 11/25] migration: rename qemu_update_position to qemu_file_credit_transfer, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 04/25] migration: Change zero_copy_send from migration parameter to migration capability, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 15/25] migration: stop passing 'opaque' parameter to QEMUFile hooks, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 14/25] migration: convert savevm to use QIOChannelBlock for VMState, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 18/25] migration: remove unused QEMUFileGetFD typedef / qemu_get_fd method, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 17/25] migration: introduce new constructors for QEMUFile, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 21/25] migration: remove the QEMUFileOps 'close' callback, Dr. David Alan Gilbert (git), 2022/06/23
- [PULL 22/25] migration: remove the QEMUFileOps 'get_buffer' callback, Dr. David Alan Gilbert (git), 2022/06/23