migration: switch to use QIOChannelNull for dummy channel
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>
This commit is contained in:
		
							parent
							
								
									87e4276449
								
							
						
					
					
						commit
						c0e0825c98
					
				@ -32,11 +32,13 @@
 | 
				
			|||||||
#include "qemu/bitmap.h"
 | 
					#include "qemu/bitmap.h"
 | 
				
			||||||
#include "qemu/madvise.h"
 | 
					#include "qemu/madvise.h"
 | 
				
			||||||
#include "qemu/main-loop.h"
 | 
					#include "qemu/main-loop.h"
 | 
				
			||||||
 | 
					#include "io/channel-null.h"
 | 
				
			||||||
#include "xbzrle.h"
 | 
					#include "xbzrle.h"
 | 
				
			||||||
#include "ram.h"
 | 
					#include "ram.h"
 | 
				
			||||||
#include "migration.h"
 | 
					#include "migration.h"
 | 
				
			||||||
#include "migration/register.h"
 | 
					#include "migration/register.h"
 | 
				
			||||||
#include "migration/misc.h"
 | 
					#include "migration/misc.h"
 | 
				
			||||||
 | 
					#include "migration/qemu-file-channel.h"
 | 
				
			||||||
#include "qemu-file.h"
 | 
					#include "qemu-file.h"
 | 
				
			||||||
#include "postcopy-ram.h"
 | 
					#include "postcopy-ram.h"
 | 
				
			||||||
#include "page_cache.h"
 | 
					#include "page_cache.h"
 | 
				
			||||||
@ -457,8 +459,6 @@ static QemuThread *compress_threads;
 | 
				
			|||||||
 */
 | 
					 */
 | 
				
			||||||
static QemuMutex comp_done_lock;
 | 
					static QemuMutex comp_done_lock;
 | 
				
			||||||
static QemuCond comp_done_cond;
 | 
					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 QEMUFile *decomp_file;
 | 
				
			||||||
static DecompressParam *decomp_param;
 | 
					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,
 | 
					        /* comp_param[i].file is just used as a dummy buffer to save data,
 | 
				
			||||||
         * set its ops to empty.
 | 
					         * 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].done = true;
 | 
				
			||||||
        comp_param[i].quit = false;
 | 
					        comp_param[i].quit = false;
 | 
				
			||||||
        qemu_mutex_init(&comp_param[i].mutex);
 | 
					        qemu_mutex_init(&comp_param[i].mutex);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user