Statistics
| Branch: | Revision:

root / block / sheepdog.c @ feature-archipelago

History | View | Annotate | Download (69.6 kB)

# Date Author Comment
2e40134b 02/21/2014 10:02 pm Max Reitz

block: Make bdrv_file_open() static

Add the bdrv_open() option BDRV_O_PROTOCOL which results in passing the
call to bdrv_file_open(). Additionally, make bdrv_file_open() static and
therefore bdrv_open() the only way to call it.

Consequently, all existing calls to bdrv_file_open() have to be adjusted...

84d18f06 02/17/2014 06:57 pm Markus Armbruster

Use error_is_set() only when necessary

error_is_set(&var) is the same as var != NULL, but it takes
whole-program analysis to figure that out. Unnecessarily hard for
optimizers, static checkers, and human readers. Dumb it down to
obvious.

Gets rid of several dozen Coverity false positives....

9cd76737 01/24/2014 03:33 pm Liu Yuan

sheepdog: fix 'qemu-img map'

It was muted in the previous commit 4bc74be9. Let's revive it since nothing
prevents us to do it.

With this patch, following command will work as other formats:

$ qemu-img map sheepdog:image

Cc:
Cc: Kevin Wolf <>...

72daa72e 01/22/2014 01:07 pm Max Reitz

block: Allow reference for bdrv_file_open()

Allow specifying a reference to an existing block device (by name) for
bdrv_file_open() instead of a filename and/or options.

Signed-off-by: Max Reitz <>
Reviewed-by: Kevin Wolf <>...

9f23fce7 01/22/2014 01:07 pm Liu Yuan

sheepdog: fix clone operation by 'qemu-img create -b'

We should pass base_inode->vdi_id to base_vdi_id of SheepdogVdiReq so that sheep
can create a clone instead a fresh volume.

This fixes following command:

qemu-create -b sheepdog:base sheepdog:clone
...

133fe774 01/14/2014 04:10 am Edgar E. Iglesias

Merge remote branch 'luiz/queue/qmp' into qmpq

  • luiz/queue/qmp:
    migration: qmp_migrate(): keep working after syntax error
    qerror: Remove assert_no_error()
    qemu-option: Remove qemu_opts_create_nofail
    target-i386: Remove assert_no_error usage
    hw: Remove assert_no_error usages...
87ea75d5 01/06/2014 10:02 pm Peter Crosthwaite

qemu-option: Remove qemu_opts_create_nofail

This is a boiler-plate _nofail variant of qemu_opts_create. Remove and
use error_abort in call sites.

null/0 arguments needs to be added for the id and fail_if_exists fields
in affected callsites due to argument inconsistency between the normal and...

e50d7607 12/20/2013 10:11 am Liu Yuan

sheepdog: fix dynamic grow for running qcow2 format

When running qcow2 over sheepdog, we might meet following problem

qemu-system-x86_64: shrinking is not supported

And cause IO errors to Guest. This is because we abuse bs->total_sectors, which
is manipulated by generic block layer and race with sheepdog code....

a3120dee 12/13/2013 03:49 pm Liu Yuan

sheepdog: check if '-o redundancy' is passed from user

This fix a segfault (that is caused by b3af018f3) of following command:

$ qemu-img convert some_img sheepdog:some_img

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

c31d482f 11/29/2013 02:40 pm Liu Yuan

sheepdog: refactor do_sd_create()

We can actually use BDRVSheepdogState *s to pass most of the parameters.

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

b3af018f 11/29/2013 02:40 pm Liu Yuan

sheepdog: support user-defined redundancy option

Sheepdog support two kinds of redundancy, full replication and erasure coding.

  1. create a fully replicated vdi with x copies
    -o redundancy=x (1 <= x <= SD_MAX_COPIES)
  1. create a erasure coded vdi with x data strips and y parity strips...
85829722 11/28/2013 11:30 am Liu Yuan

sheepdog: implement .bdrv_get_allocated_file_size

With this patch, qemu-img info sheepdog:image will show disk size for sheepdog
images.

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

80308d33 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: check simultaneous create in resend_aioreq

After reconnection happens, all the inflight requests are moved to the
failed request list. As a result, sd_co_rw_vector() can send another
create request before resend_aioreq() resends a create request from...

35200687 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: cancel aio requests if possible

This patch tries to cancel aio requests in pending queue and failed
queue. When the sheepdog driver cannot cancel the requests, it waits
for them to be completed.

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

a37dcdf9 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: make add_aio_request and send_aioreq void functions

These functions no longer return errors. We can make them void
functions and simplify the codes.

Signed-off-by: MORITA Kazutaka <>
Tested-by: Liu Yuan <>...

011603ca 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: try to reconnect to sheepdog after network error

This introduces a failed request queue and links all the inflight
requests to the list after network error happens. After QEMU
reconnects to the sheepdog server successfully, the sheepdog block
driver will retry all the requests in the failed queue....

72e0996c 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: reload inode outside of resend_aioreq

This prepares for using resend_aioreq() after reconnecting to the
sheepdog server.

Signed-off-by: MORITA Kazutaka <>
Tested-by: Liu Yuan <>
Reviewed-by: Liu Yuan <>...

2412aec7 10/30/2013 01:22 pm MORITA Kazutaka

sheepdog: handle vdi objects in resend_aio_req

The current resend_aio_req() doesn't work when the request is against
vdi objects. This fixes the problem.

Signed-off-by: MORITA Kazutaka <>
Tested-by: Liu Yuan <>...

80731d9d 10/30/2013 01:21 pm MORITA Kazutaka

sheepdog: check return values of qemu_co_recv/send correctly

If qemu_co_recv/send doesn't return the specified length, it means
that an error happened.

Signed-off-by: MORITA Kazutaka <>
Tested-by: Liu Yuan <>...

1841f880 10/28/2013 06:40 pm Liu Yuan

sheepdog: pass copy_policy in the request

Currently copy_policy isn't used. Recent sheepdog supports erasure coding, which
make use of copy_policy internally, but require client explicitly passing
copy_policy from base inode to newly creately inode for snapshot related...

29a67f7e 10/28/2013 06:39 pm Liu Yuan

sheepdog: explicitly set copies as type uint8_t

'copies' is actually uint8_t since day one, but request headers and some helper
functions parameterize it as uint32_t for unknown reasons and effectively
reserve 24 bytes for possible future use. This patch explicitly set the correct...

030be321 09/25/2013 05:21 pm Benoît Canet

block: introduce BlockDriver.bdrv_needs_filename to enable some drivers.

Some drivers will have driver specifics options but no filename.
This new bool allow the block layer to treat them correctly.

The .bdrv_needs_filename is set in drivers not having .bdrv_parse_filename and...

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

34b5d2c6 09/12/2013 11:12 am Max Reitz

block: Error parameter for open functions

Add an Error ** parameter to bdrv_open, bdrv_file_open and associated
functions 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 <>

b6b8a333 09/06/2013 04:25 pm Paolo Bonzini

block: introduce bdrv_get_block_status API

For now, bdrv_get_block_status is just another name for bdrv_is_allocated.
The next patches will add more flags.

This also touches all block drivers with a mostly mechanical rename. The
sole exception is cow; because it calls cow_co_is_allocated from the read...

4bc74be9 09/06/2013 04:25 pm Paolo Bonzini

block: return get_block_status data and flags for formats

Reviewed-by: Eric Blake <>
Signed-off-by: Paolo Bonzini <>
Signed-off-by: Stefan Hajnoczi <>

4f6fd349 09/06/2013 04:25 pm Fam Zheng

block: make bdrv_delete() static

Manage BlockDriverState lifecycle with refcnt, so bdrv_delete() is no
longer public and should be called by bdrv_unref() if refcnt is
decreased to 0.

This is an identical change because effectively, there's no multiple
reference of BDS now: no caller of bdrv_ref() yet, only bdrv_new() sets...

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

block/sheepdog: drop have_co_req() and aio_flush_request()

.io_flush() is no longer called so drop have_co_req() and
aio_flush_request().

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

e4f5c1bf 08/06/2013 11:41 am Liu Yuan

sheepdog: add missing .bdrv_has_zero_init

Commit 3ac21627 changed the behaviour of bdrv_has_zero_init() to default
to 0. In the review for Sheepdog it turned out that enabling it is safe,
so that commit updated one BlockDriver definition of sheepdog to use...

2440a2c3 07/30/2013 03:33 am Peter Maydell

block/sheepdog: Rename 'dprintf' to 'DPRINTF'

'dprintf' is the name of a POSIX standard function so we should not be
stealing it for our debug macro. Rename to 'DPRINTF' (in line with
a number of other source files.)

Signed-off-by: Peter Maydell <>...

98289620 07/15/2013 10:49 am Kevin Wolf

block: Don't parse protocol from file.filename

One of the major reasons for doing something new for -blockdev and
blockdev-add was that the old block layer code parses filenames instead
of just taking them literally. So we should really leave it untouched...

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

b579ffb3 06/17/2013 06:47 pm Liu Yuan

sheepdog: fix snapshot tag initialization

This is an old and obvious bug. We should pass snapshot_id to the
tag. Or simple command like 'qemu-img snapshot -a tag sheepdog:image' will fail

Cc:
Cc: MORITA Kazutaka <>...

cede621f 06/17/2013 06:47 pm Liu Yuan

sheepdog: support 'qemu-img snapshot -a'

Just call sd_create_branch() in the snapshot_goto to rollback the image is good
enough. With this patch, 'loadvm' process for sheepdog is modified:

Suppose we have a snapshot chain A --> B --> C, we do 'loadvm A' so as to get...

859e5553 04/26/2013 02:37 pm Liu Yuan

sheepdog: fix loadvm operation

Currently the 'loadvm' opertaion works as following:
1. switch to the snapshot
2. mark current working VDI as a snapshot
3. rely on sd_create_branch to create a new working VDI based on the snapshot

This works not the same as other format as QCOW2. For e.g,...

e8bfaa2f 04/26/2013 02:26 pm Liu Yuan

sheepdog: use BDRV_SECTOR_SIZE

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

8d71c631 04/26/2013 02:26 pm Liu Yuan

sheepdog: implement .bdrv_co_is_allocated()

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

982dcbf4 04/26/2013 02:26 pm MORITA Kazutaka

sheepdog: cleanup find_vdi_name

This makes 'filename' and 'tag' constant variables, and renames
'for_snapshot' to 'lock' to clear how it works.

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

6a0b5490 04/26/2013 02:26 pm MORITA Kazutaka

sheepdog: add SD_RES_READONLY result code

Sheepdog returns SD_RES_READONLY when qemu sends write requests to the
snapshot vdi. This adds the result code and makes sd_strerror() print
its error reason.

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

9ff53a0e 04/26/2013 02:26 pm MORITA Kazutaka

sheepdog: add helper function to reload inode

This adds a helper function to update the current inode state with the
specified vdi object.

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

13c31de2 04/26/2013 02:26 pm MORITA Kazutaka

sheepdog: resend write requests when SD_RES_READONLY is received

When a snapshot is taken from out side of qemu (e.g. qemu-img
snapshot), write requests to the current vdi return SD_RES_READONLY.
In this case, the sheepdog block driver needs to update the current...

cac8f4a6 04/26/2013 02:26 pm Liu Yuan

sheepdog: add discard/trim support for sheepdog

The 'TRIM' command from VM that is to release underlying data storage for
better thin-provision is already supported by the Sheepdog.

This patch adds the TRIM support at QEMU part.

For older Sheepdog that doesn't support it, we return 0(success) to upper layer....

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

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

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

cf8074b3 04/15/2013 09:26 am Kevin Wolf

block: Introduce bdrv_writev_vmstate

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

f9e8cacc 04/02/2013 06:47 pm Stefan Hajnoczi

oslib-posix: rename socket_set_nonblock() to qemu_set_nonblock()

The fcntl(fd, F_SETFL, O_NONBLOCK) flag is not specific to sockets.
Rename to qemu_set_nonblock() just like qemu_set_cloexec().

Signed-off-by: Stefan Hajnoczi <>
Reviewed-by: Eric Blake <>...

787e4a85 03/22/2013 06:51 pm Kevin Wolf

block: Add options QDict to bdrv_file_open() prototypes

The new parameter is unused yet.

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

fca23f0a 03/19/2013 12:48 pm Liu Yuan

sheepdog: show error message for halt status

Sheepdog (neither quorum nor unsafe mode) will refuse to serve IO requests when
number of alive nodes is less than that of copies specified by users. This will
return 0x19 to QEMU client which currently doesn't recognize it....

0d6db300 03/15/2013 05:07 pm MORITA Kazutaka

sheepdog: use non-blocking fd in coroutine context

Using a blocking socket in the coroutine context reduces the chance of
switching to other work. This patch makes the sheepdog driver use a
non-blocking fd always.

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

ed9ba724 03/15/2013 05:07 pm MORITA Kazutaka

sheepdog: set io_flush handler in do_co_req

If an io_flush handler is not set, qemu_aio_wait doesn't invoke
callbacks.

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

bf1c852a 03/04/2013 10:54 am MORITA Kazutaka

move socket_set_nodelay to osdep.c

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

5d6768e3 03/04/2013 10:54 am MORITA Kazutaka

sheepdog: accept URIs

The URI syntax is consistent with the NBD and Gluster syntax. The
syntax is

sheepdog[+tcp]://[host:port]/vdiname[#snapid|#tag]

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

25af257d 03/04/2013 10:54 am MORITA Kazutaka

sheepdog: use inet_connect to simplify connect code

This uses the form "<host>:<port>" for the representation of the
sheepdog server to use inet_connect.

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

1b8bbb46 03/04/2013 10:54 am MORITA Kazutaka

sheepdog: add support for connecting to unix domain socket

This patch adds support for a unix domain socket for a connection
between qemu and local sheepdog server. You can use the unix domain
socket with the following syntax:

$ qemu sheepdog+unix:///&lt;vdiname&gt;?socket=&lt;socket path&gt;[#snapid]...
6f74c260 02/01/2013 03:58 pm Liu Yuan

sheepdog: pass vdi_id to sheep daemon for sd_close()

Sheep daemon needs vdi_id to identify which vdi is closed to release resources
such as object cache.

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

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