Statistics
| Branch: | Revision:

root / block / rbd.c @ 7371d56f

History | View | Annotate | Download (24.6 kB)

# Date Author Comment
1de7afc9 12/19/2012 09:32 am Paolo Bonzini

misc: move include files to include/qemu/

Signed-off-by: Paolo Bonzini <>

737e150e 12/19/2012 09:31 am Paolo Bonzini

block: move include files to include/block/

Signed-off-by: Paolo Bonzini <>

473c7f02 12/11/2012 12:05 pm Stefan Priebe

rbd: Fix race between aio completition and aio cancel

This one fixes a race which qemu had also in iscsi block driver
between cancellation and io completition.

qemu_rbd_aio_cancel was not synchronously waiting for the end of
the command.

To archieve this it introduces a new status flag which uses...

08448d51 11/21/2012 10:43 am Stefan Priebe

use int64_t for return values from rbd instead of int

rbd / rados tends to return pretty often length of writes
or discarded blocks. These values might be bigger than int.

The steps to reproduce are:

mkfs.xfs -f a whole device bigger than int in bytes. mkfs.xfs sends...
d7331bed 11/14/2012 07:19 pm Stefan Hajnoczi

aio: rename AIOPool to AIOCBInfo

Now that AIOPool no longer keeps a freelist, it isn't really a "pool"
anymore. Rename it to AIOCBInfo and make it const since it no longer
needs to be modified.

Signed-off-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

39c9fb95 09/24/2012 04:15 pm Jeff Cody

block: do not parse BDRV_O_CACHE_WB in block drivers

Block drivers should ignore BDRV_O_CACHE_WB in .bdrv_open flags,
and in the bs->open_flags.

This patch removes the code, leaving the behaviour behind as if
BDRV_O_CACHE_WB was set.

Signed-off-by: Jeff Cody <>...

23797df3 07/09/2012 08:35 pm Anthony Liguori

Merge remote-tracking branch 'mjt/mjt-iov2' into staging

  • mjt/mjt-iov2:
    rewrite iov_send_recv() and move it to iov.c
    cleanup qemu_co_sendv(), qemu_co_recvv() and friends
    export iov_send_recv() and use it in iov_send() and iov_recv()
    rename qemu_sendv to iov_send, change proto and move declarations to iov.h...
b11f38fc 06/15/2012 03:03 pm Josh Durgin

rbd: hook up cache options

Writeback caching was added in Ceph 0.46, and writethrough will be in
0.47. These are controlled by general config options, so there's no
need to check for librbd version.

Signed-off-by: Josh Durgin <>
Signed-off-by: Kevin Wolf <>

03396148 06/11/2012 10:12 pm Michael Tokarev

allow qemu_iovec_from_buffer() to specify offset from which to start copying

Similar to
qemu_iovec_memset(QEMUIOVector *qiov, size_t offset,
int c, size_t bytes);
the new prototype is:
qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset,...

d5e6b161 06/11/2012 10:12 pm Michael Tokarev

change qemu_iovec_to_buf() to match other to,from_buf functions

It now allows specifying offset within qiov to start from and
amount of bytes to copy. Actual implementation is just a call
to iov_to_buf().

Signed-off-by: Michael Tokarev <>

787f3133 05/02/2012 07:41 pm Josh Durgin

rbd: add discard support

Change the write flag to an operation type in RBDAIOCB, and make the
buffer optional since discard doesn't use it.

Discard is first included in librbd 0.1.2 (which is in Ceph 0.46).
If librbd is too old, leave out qemu_rbd_aio_discard entirely,...

bafbd6a1 04/19/2012 05:37 pm Paolo Bonzini

aio: remove process_queue callback and qemu_aio_process_queue

Both unused after the previous patch.

Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

bd603247 01/26/2012 12:39 pm Gregory Farnum

rbd: wire up snapshot removal and rollback functionality

Signed-off-by: Greg Farnum <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

6b620ca3 01/13/2012 06:55 pm Paolo Bonzini

prepare for future GPLv2+ relicensing

All files under GPLv2 will get GPLv2+ changes starting tomorrow.
event_notifier.c and exec-obsolete.h were only ever touched by Red Hat
employees and can be relicensed now.

Signed-off-by: Paolo Bonzini <>...

91977c2e 12/15/2011 01:40 pm Paolo Bonzini

block: qemu_aio_get does not return NULL

Initially done with the following semantic patch:

rule1
expression E;
statement S;
@@
E = qemu_aio_get (...);
(
- if (E == NULL) { ... } |
- if (E) { <... S ...> }
)

which however missed occurrences in linux-aio.c and posix-aio-compat.c....

b9c53290 12/15/2011 01:40 pm Josh Durgin

rbd: always set out parameter in qemu_rbd_snap_list

The caller expects psn_tab to be NULL when there are no snapshots or
an error occurs. This results in calling g_free on an invalid address.

Reported-by: Oliver Francke <>
Signed-off-by: Josh Durgin <>...

c68b89ac 11/11/2011 03:02 pm Kevin Wolf

block: Rename bdrv_co_flush to bdrv_co_flush_to_disk

There are two different types of flush that you can do: Flushing one level up
to the OS (i.e. writing data to the host page cache) or flushing it all the way
down to the disk. The existing functions flush to the disk, reflect this in the...

8b94ff85 10/21/2011 06:34 pm Paolo Bonzini

block: change flush to co_flush

Since coroutine operation is now mandatory, convert all bdrv_flush
implementations to coroutines. For qcow2, this means taking the lock.
Other implementations are simpler and just forward bdrv_flush to the
underlying protocol, so they can avoid the lock....

16a06b24 09/20/2011 03:34 pm Sage Weil

rbd: allow escaping in config string

The config string is variously delimited by =, @, and /, depending on the
field. Allow these characters to be escaped by preceeding them with \.

Signed-off-by: Sage Weil <>
Signed-off-by: Kevin Wolf <>

f9fe18ec 09/20/2011 01:27 pm Sage Weil

rbd: ignore failures when reading from default conf location

If we are reading from the default config location, ignore any failures.
It is perfectly legal for the user to specify exactly the options they need
and to not rely on any config file.

Signed-off-by: Sage Weil <>...

9e1fbcde 09/20/2011 01:27 pm Sage Weil

rbd: update comment heading

Properly document the configuration string syntax and semantics. Remove
(out of date) details about the librbd implementation.

Signed-off-by: Sage Weil <>
Signed-off-by: Kevin Wolf <>

7a3f5fe9 09/20/2011 01:27 pm Sage Weil

rbd: call flush, if available

librbd recently added async writeback and flush support. If the new
rbd_flush() call is available, call it.

Signed-off-by: Sage Weil <>
Signed-off-by: Kevin Wolf <>

dfe80b07 09/12/2011 04:17 pm Sage Weil

rbd: clean up, fix style

No assignment in condition. Remove duplicate ret > 0 check.

Signed-off-by: Sage Weil <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

eb93d5d9 09/12/2011 04:17 pm Sage Weil

rbd: fix leak in qemu_rbd_open failure paths

Fix leak of s->snap in failure path. Simplify error paths for the whole
function.

Reported-by: Stefan Hajnoczi <>
Signed-off-by: Sage Weil <>
Reviewed-by: Stefan Hajnoczi <>...

7c7e9df0 09/12/2011 04:17 pm Sage Weil

rbd: allow client id to be specified in config string

Allow the client id to be specified in the config string via 'id=' so that
users can control who they authenticate as. Currently they are stuck with
the default ('admin'). This is necessary for anyone using authentication...

7267c094 08/21/2011 07:01 am Anthony Liguori

Use glib memory allocation and free functions

qemu_malloc/qemu_free no longer exist after this commit.

Signed-off-by: Anthony Liguori <>

7bf4162a 06/14/2011 11:01 am Stefan Weil

block/rbd: Remove unused local variable

Variable 'snap' is assigned a value that is never used.
Remove snap and the related code.

Cc: Christian Brunner <>
Cc: Josh Durgin <>
Cc: Kevin Wolf <>
Signed-off-by: Stefan Weil <>...

fab5cf59 06/08/2011 12:56 pm Josh Durgin

rbd: allow configuration of rados from the rbd filename

The new format is rbd:pool/image[@snapshot][:option1=value1[:option2=value2...]]
Each option is used to configure rados, and may be any Ceph option, or "conf".
The "conf" option specifies a Ceph configuration file to read....

51a13528 06/08/2011 12:56 pm Josh Durgin

rbd: check return values when scheduling aio

If scheduling fails, the number of outstanding I/Os must be correct,
or there will be a hang when waiting for everything to be flushed.

Reviewed-by: Christian Brunner <>
Reported-by: Stefan Hajnoczi <>...

30cdc48c 06/08/2011 12:56 pm Josh Durgin

rbd: Add bdrv_truncate implementation

Reviewed-by: Christian Brunner <>
Signed-off-by: Josh Durgin <>
Signed-off-by: Kevin Wolf <>

ad32e9c0 06/08/2011 12:56 pm Josh Durgin

rbd: use the higher level librbd instead of just librados

librbd stacks on top of librados to provide access
to rbd images.

Using librbd simplifies the qemu code, and allows
qemu to use new versions of the rbd format
with few (if any) changes.

Reviewed-by: Christian Brunner <>...

f27aaf4b 12/14/2010 04:44 pm Christian Brunner

ceph/rbd block driver for qemu-kvm

RBD is an block driver for the distributed file system Ceph
(http://ceph.newdream.net/). This driver uses librados (which is part
of the Ceph server) for direct access to the Ceph object store and is
running entirely in userspace (Yehuda also wrote a driver for the...