Laurent Vivier wrote: > This patch adds a new parameter to "-drive" > > Using "cache=off" with "-drive" will open the disk image file using > "O_DIRECT". > > By default, "cache" is set to "on" to keep original behavior of qemu. > > example: > > "-drive file=my_disk.qcow2,cache=off" > --- > block-raw-posix.c | 8 ++++++++ > block-raw-win32.c | 4 ++++ > block.c | 2 +- > block.h | 1 + > hw/fdc.c | 7 ++++++- > hw/ide.c | 18 ++++++++++++++---- > hw/scsi-disk.c | 3 ++- > hw/sd.c | 11 ++++++++++- > osdep.c | 20 ++++++++++++++++++++ > osdep.h | 1 + > vl.c | 28 ++++++++++++++++++++++++---- > 11 files changed, 91 insertions(+), 12 deletions(-) > [...]
I suggest trying to remove the malloc/free which are done at every blk_read/write for sd.c. Fabrice.