]> git.proxmox.com Git - qemu.git/commit
rbd: add an asynchronous flush
authorJosh Durgin <josh.durgin@inktank.com>
Fri, 29 Mar 2013 20:03:23 +0000 (13:03 -0700)
committerStefan Hajnoczi <stefanha@redhat.com>
Mon, 15 Apr 2013 08:18:05 +0000 (10:18 +0200)
commitdc7588c1eb3008bda53dde1d6b890cd299758155
tree013e43ffc24d04e9d47b74ce52923aa1efc6a030
parent342809e807ecb55551e579942f535966251cbe27
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>
block/rbd.c