Only build compatfd when using AIO and make sure to always init AIO
OpenBSD doesn't use AIO so don't try to build compatfd when not using AIO. Also make sure to call qemu_aio_init() from bdrv_init. Everything that uses bdrv calls bdrv_init so it makes sense to init aio from there instead of in every single tool. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5197 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
		
							parent
							
								
									5068cbd9e9
								
							
						
					
					
						commit
						a3392f9b10
					
				
							
								
								
									
										6
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								Makefile
									
									
									
									
									
								
							@ -177,7 +177,11 @@ QEMU_IMG_BLOCK_OBJS = $(BLOCK_OBJS)
 | 
				
			|||||||
ifdef CONFIG_WIN32
 | 
					ifdef CONFIG_WIN32
 | 
				
			||||||
QEMU_IMG_BLOCK_OBJS += qemu-img-block-raw-win32.o
 | 
					QEMU_IMG_BLOCK_OBJS += qemu-img-block-raw-win32.o
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
QEMU_IMG_BLOCK_OBJS += nbd.o qemu-img-block-raw-posix.o compatfd.o
 | 
					QEMU_IMG_BLOCK_OBJS += nbd.o qemu-img-block-raw-posix.o
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ifdef CONFIG_AIO
 | 
				
			||||||
 | 
					QEMU_IMG_BLOCK_OBJS += compatfd.o
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
######################################################################
 | 
					######################################################################
 | 
				
			||||||
 | 
				
			|||||||
@ -476,7 +476,11 @@ OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o net-checksum.o
 | 
				
			|||||||
ifdef CONFIG_WIN32
 | 
					ifdef CONFIG_WIN32
 | 
				
			||||||
OBJS+=block-raw-win32.o
 | 
					OBJS+=block-raw-win32.o
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
OBJS+=block-raw-posix.o compatfd.o
 | 
					OBJS+=block-raw-posix.o
 | 
				
			||||||
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ifdef CONFIG_AIO
 | 
				
			||||||
 | 
					OBJS+=compatfd.o
 | 
				
			||||||
endif
 | 
					endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LIBS+=-lz
 | 
					LIBS+=-lz
 | 
				
			||||||
 | 
				
			|||||||
@ -561,6 +561,9 @@ void qemu_aio_wait(void)
 | 
				
			|||||||
        return;
 | 
					        return;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if (!first_aio)
 | 
				
			||||||
 | 
					        return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    do {
 | 
					    do {
 | 
				
			||||||
        fd_set rdfds;
 | 
					        fd_set rdfds;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								block.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								block.c
									
									
									
									
									
								
							@ -1328,6 +1328,8 @@ void bdrv_init(void)
 | 
				
			|||||||
#ifndef _WIN32
 | 
					#ifndef _WIN32
 | 
				
			||||||
    bdrv_register(&bdrv_nbd);
 | 
					    bdrv_register(&bdrv_nbd);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    qemu_aio_init();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void *qemu_aio_get(BlockDriverState *bs, BlockDriverCompletionFunc *cb,
 | 
					void *qemu_aio_get(BlockDriverState *bs, BlockDriverCompletionFunc *cb,
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										1
									
								
								configure
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								configure
									
									
									
									
										vendored
									
									
								
							@ -1220,6 +1220,7 @@ if test "$brlapi" = "yes" ; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
if test "$aio" = "yes" ; then
 | 
					if test "$aio" = "yes" ; then
 | 
				
			||||||
  echo "#define CONFIG_AIO 1" >> $config_h
 | 
					  echo "#define CONFIG_AIO 1" >> $config_h
 | 
				
			||||||
 | 
					  echo "CONFIG_AIO=yes" >> $config_mak
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# XXX: suppress that
 | 
					# XXX: suppress that
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user