]> git.proxmox.com Git - qemu.git/commit
block: fix aio_flush segfaults for read-only protocols (e.g. curl)
authorAvi Kivity <avi@redhat.com>
Sun, 16 May 2010 11:59:57 +0000 (14:59 +0300)
committerAurelien Jarno <aurelien@aurel32.net>
Thu, 27 May 2010 11:58:57 +0000 (13:58 +0200)
commit74bcc51b993c7a5835ad6a8e35f8b79b7513f072
tree87a7f52ef44040d5a3e4f20541bfe280d0211be9
parent7e4f956056398f1dd3eb694177ef80cdab7c2f64
block: fix aio_flush segfaults for read-only protocols (e.g. curl)

Not all block format drivers expose an io_flush method (reasonable for
read-only protocols), so calling io_flush there will immediately segfault.

Fix by checking for the method's existence before calling it.

Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit c53a7285b4377e91f30b7742c7e12c16d6bf86f0)
aio.c