Statistics
| Branch: | Revision:

root / block / sheepdog.c @ 7371d56f

History | View | Annotate | Download (54.7 kB)

# Date Author Comment
f700f8e3 01/15/2013 02:40 pm Liu Yuan

sheepdog: clean up sd_aio_setup()

The last two parameters of sd_aio_setup() are never used, so remove them.

Cc: MORITA Kazutaka <>
Cc: Kevin Wolf <>
Cc: Stefan Hajnoczi <>
Signed-off-by: Liu Yuan <>...

47783072 01/15/2013 12:18 pm Liu Yuan

sheepdog: multiplex the rw FD to flush cache

This will reduce sockfds connected to the sheep server to one, which simply the
future hacks.

Cc: MORITA Kazutaka <>
Cc: Kevin Wolf <>
Cc: Stefan Hajnoczi <>...

0e7106d8 01/14/2013 11:06 am Liu Yuan

sheepdog: implement direct write semantics

Sheepdog supports both writeback/writethrough write but has not yet supported
DIRECTIO semantics which bypass the cache completely even if Sheepdog daemon is
set up with cache enabled.

Suppose cache is enabled on Sheepdog daemon size, the new cache control is...

d6b1ef89 01/02/2013 05:09 pm Liu Yuan

sheepdog: pass oid directly to send_pending_req()

Cc: MORITA Kazutaka <>
Cc: Kevin Wolf <>
Signed-off-by: Liu Yuan <>
Reviewed-by: MORITA Kazutaka <>
Signed-off-by: Stefan Hajnoczi <>

bd751f22 01/02/2013 05:08 pm Liu Yuan

sheepdog: don't update inode when create_and_write fails

For the error case such as SD_RES_NO_SPACE, we shouldn't update the inode bitmap
to avoid the scenario that the object is allocated but wasn't created at the
server side. This will result in VM's IO error on the failed object....

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

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

2f536801 10/12/2012 11:47 am MORITA Kazutaka

sheepdog: use bool for boolean variables

This improves readability.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Stefan Hajnoczi <>

3178e275 10/05/2012 03:58 pm Jim Meyering

sheepdog: avoid a few buffer overruns

  • parse_vdiname: Use pstrcpy, not strncpy, when the destination
    buffer must be NUL-terminated.
  • sd_open: Likewise, avoid buffer overrun.
  • do_sd_create: Likewise. Leave the preceding memset, since
    pstrcpy does not NUL-fill, and filename needs that....
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 <>...

1f7a48de 09/12/2012 04:50 pm MORITA Kazutaka

sheepdog: fix savevm and loadvm

This patch sets data to be sent to Sheepdog correctly and fixes savevm
and loadvm operations on a Sheepdog image.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

a7e47d4b 08/22/2012 06:47 pm Jim Meyering

sheepdog: don't leak socket file descriptor upon connection failure

Signed-off-by: Jim Meyering <>
Signed-off-by: Anthony Liguori <>

cddd4ac7 07/17/2012 05:48 pm MORITA Kazutaka

sheepdog: always use coroutine-based network functions

This reduces some code duplication.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

19db9b90 07/17/2012 05:48 pm Christoph Hellwig

sheepdog: do not blindly memset all read buffers

Only buffers that map to unallocated blocks need to be zeroed.

Signed-off-by: Christoph Hellwig <>
Acked-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

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...
c292ee6a 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: split outstanding list into inflight and pending

outstanding_list_head is used for both pending and inflight requests.
This patch splits it and improves readability.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

7dc1cde0 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: traverse pending_list from the first for each time

The pending list can be modified in other coroutine context
sd_co_rw_vector, so we need to traverse the list from the first again
after we send the pending request.

Signed-off-by: MORITA Kazutaka <>...

1b6ac998 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: fix dprintf format strings

This fixes warnings about dprintf format in debug mode.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

2dfcca3b 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: restart I/O when socket becomes ready in do_co_req()

Currently, no one reenters the yielded coroutine. This fixes it.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

b97564f4 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: use coroutine based socket functions in coroutine context

This removes blocking network I/Os in coroutine context.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

1d732d7d 07/09/2012 04:53 pm MORITA Kazutaka

sheepdog: make sure we don't free aiocb before sending all requests

This patch increments the pending counter before sending requests, and
make sures that aiocb is not freed while sending them.

Signed-off-by: MORITA Kazutaka <>...

e0d93a89 06/15/2012 03:03 pm MORITA Kazutaka

sheepdog: add coroutine_fn markers to coroutine functions

Signed-off-by: MORITA Kazutaka <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

2fc8ae1d 06/11/2012 10:12 pm Michael Tokarev

cleanup qemu_co_sendv(), qemu_co_recvv() and friends

The same as for non-coroutine versions in previous
patches: rename arguments to be more obvious, change
type of arguments from int to size_t where appropriate,
and use common code for send and receive paths (with...

6f3c714e 05/30/2012 10:58 am MORITA Kazutaka

sheepdog: fix return value of do_load_save_vm_state

bdrv_save_vmstate and bdrv_load_vmstate should return the vmstate size
on success, and -errno on error.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

622b6057 05/25/2012 07:12 pm MORITA Kazutaka

sheepdog: mark image as snapshot when tag is specified

When a snapshot tag is specified in the filename, the opened image is
a snapshot.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

cb595887 05/25/2012 07:12 pm MORITA Kazutaka

sheepdog: return -errno on error

On error, BlockDriver APIs should return -errno instead of -1.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

b6fc8245 05/25/2012 07:12 pm MORITA Kazutaka

sheepdog: use heap instead of stack for BDRVSheepdogState

bdrv_create() is called in coroutine context now, so we cannot use
more stack than 1 MB in the function if we use ucontext coroutine.
This patch allocates BDRVSheepdogState, whose size is 4 MB, on the...

115c2b5a 05/07/2012 08:33 pm MORITA Kazutaka

sheepdog: switch to writethrough mode if cluster doesn't support flush

This is necessary for qemu to work with the older version of Sheepdog
which doesn't support SD_OP_FLUSH_VDI.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

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

47622c44 04/05/2012 03:54 pm Liu Yuan

sheepdog: implement SD_OP_FLUSH_VDI operation

Flush operation is supposed to flush the write-back cache of
sheepdog cluster.

By issuing flush operation, we can assure the Guest of data
reaching the sheepdog cluster storage.

Cc: Kevin Wolf <>...

eb092180 04/05/2012 03:54 pm Liu Yuan

sheepdog: fix send req helpers

We should return if reading of the header fails.

Cc: Kevin Wolf <>
Cc: MORITA Kazutaka <>
Signed-off-by: Liu Yuan <>
Acked-by: MORITA Kazutaka <>...

6d1acda8 02/09/2012 05:17 pm MORITA Kazutaka

sheepdog: fix co_recv coroutine context

The co_recv coroutine has two things that will try to enter it:

1. The select(2) read callback on the sheepdog socket.
2. The aio_add_request() blocking operations, including a coroutine
mutex.

This patch fixes it by setting NULL to co_recv before sending data....

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

128aa589 12/22/2011 12:53 pm Paolo Bonzini

move corking functions to osdep.c

Signed-off-by: Paolo Bonzini <>

8c5135f9 12/22/2011 12:53 pm Paolo Bonzini

sheepdog: move coroutine send/recv function to generic code

Outside coroutines, avoid busy waiting on EAGAIN by temporarily
making the socket blocking.

The API of qemu_recvv/qemu_sendv is slightly different from
do_readv/do_writev because they do not handle coroutines. It...

a968168c 12/05/2011 03:51 pm Dong Xu Wang

block: Add coroutine_fn marker to coroutine functions

Looks better when reviewing these source files.

Signed-off-by: Dong Xu Wang <>
Reviewed-by: Stefan Hajnoczi <>
Signed-off-by: Kevin Wolf <>

c3fecea5 11/22/2011 11:33 am Dong Xu Wang

sheepdog: Avoid deadlock in error path

s->lock should be unlocked before leaving add_aio_request.

Signed-off-by: Dong Xu Wang <>
Signed-off-by: Kevin Wolf <>

d8716b41 10/21/2011 06:34 pm Paolo Bonzini

sheepdog: add coroutine_fn markers

This makes the following patch easier to review.

Cc: MORITA Kazutaka <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Kevin Wolf <>

7acae208 10/14/2011 04:46 pm Dong Xu Wang

sheepdog: correct spelling

Reviewed-by: Andreas Färber <>
Signed-off-by: Dong Xu Wang <>
Signed-off-by: Stefan Hajnoczi <>

2df46246 08/24/2011 03:53 pm MORITA Kazutaka

sheepdog: use coroutines

This makes the sheepdog block driver support bdrv_co_readv/writev
instead of bdrv_aio_readv/writev.

With this patch, Sheepdog network I/O becomes fully asynchronous. The
block driver yields back when send/recv returns EAGAIN, and is resumed...

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

00aa0040 07/25/2011 05:38 pm Blue Swirl

Wrap recv to avoid warnings

Avoid warnings like these by wrapping recv():
CC slirp/ip_icmp.o
/src/qemu/slirp/ip_icmp.c: In function 'icmp_receive':
/src/qemu/slirp/ip_icmp.c:418:5: error: passing argument 2 of 'recv' from incompatible pointer type [-Werror]...

a8e0fdd7 07/18/2011 05:06 pm MORITA Kazutaka

sheepdog: add full data preallocation support

This introduces qemu-img create option for sheepdog which allows the
data to be fully preallocated (note that sheepdog always preallocates
metadata).

The option is disabled by default and you need to enable it like the...

db78ef5b 06/24/2011 11:13 am Markus Armbruster

sheepdog: qemu_bh_new() can't return null pointer, drop check

Signed-off-by: Markus Armbruster <>
Signed-off-by: Stefan Hajnoczi <>

6daf194d 06/24/2011 11:13 am Markus Armbruster

Strip trailing '\n' from error_report()'s first argument

error_report() prepends location, and appends a newline. The message
constructed from the arguments should not contain a newline. Fix the
obvious offenders.

Signed-off-by: Markus Armbruster <>...

ebabb67a 05/06/2011 10:19 am Stefan Weil

Fix typo in code and comments

Replace writeable -> writable

Signed-off-by: Stefan Weil <>
Signed-off-by: Stefan Hajnoczi <>

8cffde73 04/01/2011 11:23 pm Michael Tokarev

get rid of private bitmap functions in block/sheepdog.c, use generic ones

qemu now has generic bitmap functions,
so don't redefine them in sheepdog.c,
use common header instead. A small cleanup.

Here's only one function which is actually
used in sheepdog and gets replaced with...

b4447363 01/31/2011 11:03 am MORITA Kazutaka

sheepdog: support creating images on remote hosts

This patch parses the input filename in sd_create(), and enables us
specifying a target server to create sheepdog images.

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Kevin Wolf <>

010cb2b3 08/30/2010 07:29 pm Izumi Tsutsui

sheepdog: remove unnecessary includes

"qemu_socket.h" includes all necessary files and
including <netinet/tcp.h> without <netinet/in.h>
could cause errors on some systems.

Signed-off-by: Izumi Tsutsui <>
Signed-off-by: Kevin Wolf <>

6defcc37 07/07/2010 08:54 pm MORITA Kazutaka

sheepdog: fix compile error on systems without TCP_CORK

WIN32 is not only the system which doesn't have TCP_CORK (e.g. OS X).

Signed-off-by: MORITA Kazutaka <>
Signed-off-by: Blue Swirl <>

33b1db1c 07/06/2010 06:05 pm MORITA Kazutaka

block: add sheepdog driver for distributed storage support

Sheepdog is a distributed storage system for QEMU. It provides highly
available block level storage volumes to VMs like Amazon EBS. This
patch adds a qemu block driver for Sheepdog.

Sheepdog features are:...