]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
rbd: add an asynchronous flush
authorJosh Durgin <josh.durgin@inktank.com>
Wed, 15 May 2013 18:31:01 +0000 (11:31 -0700)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Fri, 17 May 2013 20:52:55 +0000 (15:52 -0500)
commit0182df5ae55a30058b8851dfaa2c4cc065d1b126
treee31df6d8d558d2fc33409705e29072b0f0e52107
parent7f28f0f1f6735a25e5e2a028adccc54f3143fac9
rbd: add an asynchronous flush

The existing bdrv_co_flush_to_disk implementation uses rbd_flush(),
which is sychronous and causes the main qemu thread to block until it
is complete. This results in unresponsiveness and extra latency for
the guest.

Fix this by using an asynchronous version of flush.  This was added to
librbd with a special #define to indicate its presence, since it will
be backported to stable versions. Thus, there is no need to check the
version of librbd.

Implement this as bdrv_aio_flush, since it matches other aio functions
in the rbd block driver, and leave out bdrv_co_flush_to_disk when the
asynchronous version is available.

Reported-by: Oliver Francke <oliver@filoo.de>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
(cherry picked from commit dc7588c1eb3008bda53dde1d6b890cd299758155)
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/rbd.c