Statistics
| Branch: | Revision:

root / block / rbd.c @ 34b5d2c6

History | View | Annotate | Download (26.6 kB)

# Date Author Comment
d5124c00 09/12/2013 11:12 am Max Reitz

bdrv: Use "Error" for creating images

Add an Error ** parameter to BlockDriver.bdrv_create to allow more
specific error messages.

Signed-off-by: Max Reitz <>

a89d89d3 09/12/2013 11:12 am Wenchao Xia

snapshot: distinguish id and name in snapshot delete

Snapshot creation actually already distinguish id and name since it take
a structured parameter *sn, but delete can't. Later an accurate delete
is needed in qmp_transaction abort and blockdev-snapshot-delete-sync,...

015a1036 09/12/2013 11:12 am Max Reitz

bdrv: Use "Error" for opening images

Add an Error ** parameter to BlockDriver.bdrv_open and
BlockDriver.bdrv_file_open to allow more specific error messages.

Signed-off-by: Max Reitz <>

5d289cc7 08/19/2013 04:52 pm Stefan Hajnoczi

block/rbd: drop qemu_rbd_aio_flush_cb()

.io_flush() is no longer called so drop qemu_rbd_aio_flush_cb().
qemu_aio_count is unused now so drop it too.

Signed-off-by: Stefan Hajnoczi <>

f2e5dca4 08/19/2013 04:52 pm Stefan Hajnoczi

aio: drop io_flush argument

The .io_flush() handler no longer exists and has no users. Drop the
io_flush argument to aio_set_fd_handler() and related functions.

The AioFlushEventNotifierHandler and AioFlushHandler typedefs are no
longer used and are dropped too....

3ac21627 06/28/2013 02:52 pm Peter Lieven

block: change default of .has_zero_init to 0

.has_zero_init defaults to 1 for all formats and protocols.

this is a dangerous default since this means that all
new added drivers need to manually overwrite it to 0 if
they do not ensure that a device is zero initialized...

c3ca988d 04/26/2013 02:26 pm Kevin Wolf

rbd: Fix use after free in rbd_open()

Commit a9ccedc3 frees the QemuOpts for the driver-specific options
immediately, even though it still needs the filename string that is
contained there. This doesn't work. Move the deletion of the QemuOpts to
the end of the function where its content isn't needed any more....

56d1b4d2 04/22/2013 12:34 pm Kevin Wolf

block: Remove filename parameter from .bdrv_file_open()

It is unused now in all block drivers.

Signed-off-by: Kevin Wolf <>
Reviewed-by: Eric Blake <>

a9ccedc3 04/22/2013 11:27 am Kevin Wolf

rbd: Use bdrv_open options instead of filename

This is only to convert the internal interface that is used for passing
the "filename" to be parsed, but converting to actual fine grained
options is left for another day, as it doesn't look trivial.

Signed-off-by: Kevin Wolf <>...

dc7588c1 04/15/2013 11:18 am Josh Durgin

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...

d43731c7 03/25/2013 10:51 am Liu Yuan

rbd: fix compile error

Commit 787e4a85 [block: Add options QDict to bdrv_file_open() prototypes] didn't
update rbd.c accordingly.

Cc: Kevin Wolf <>
Cc: Stefan Hajnoczi <>
Signed-off-by: Liu Yuan <>
Reviewed-by: Stefan Weil <>...

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...