Statistics
| Branch: | Revision:

root / block / nbd.c @ 7371d56f

History | View | Annotate | Download (16.3 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 <>

1d7d2a9d 11/12/2012 03:38 pm Paolo Bonzini

nbd: accept URIs

The URI syntax is consistent with the Gluster syntax. Export names
are specified in the path, preceded by one or more (otherwise unused)
slashes.

Signed-off-by: Paolo Bonzini <>

d04b0bbb 11/12/2012 12:33 pm Paolo Bonzini

nbd: accept relative path to Unix socket

Adding the "is_unix" member now will simplify the parsing of NBD URIs.

Signed-off-by: Paolo Bonzini <>

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

b3adf53a 04/26/2012 06:54 pm Kevin Wolf

nbd: Fix uninitialised use of s->sock

s->sock is assigned only afterwards, so we're really registering an
aio_fd_handler for file descriptor 0 here. Not exactly what we intended.

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

1f8bcac0 04/23/2012 10:27 pm Anthony Liguori

Merge remote-tracking branch 'kwolf/for-anthony' into staging

  • kwolf/for-anthony: (38 commits)
    qemu-iotests: Fix test 031 for qcow2 v3 support
    qemu-iotests: Add -o and make v3 the default for qcow2
    qcow2: Zero write support
    qemu-iotests: Test backing file COW with zero clusters...
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 <>

fc19f8a0 04/19/2012 05:36 pm Paolo Bonzini

nbd: consistently check for <0 or >=0

This prepares for the following patch, which changes -1 return values
to negative errno.

Signed-off-by: Paolo Bonzini <>

185b4338 04/19/2012 05:36 pm Paolo Bonzini

nbd: consistently return negative errno values

In the next patch we need to look at the return code of nbd_wr_sync.
To avoid percolating the socket_error() ugliness all around, let's
handle errors by returning negative errno values.

Signed-off-by: Paolo Bonzini <>

7fe7b68b 04/19/2012 05:36 pm Paolo Bonzini

nbd: do not block in nbd_wr_sync if no data at all is available

Right now, nbd_wr_sync will hang if no data at all is available on the
socket and the other side is not going to provide any. Relax this by
making it loop only for writes or partial reads. This fixes a race...

dd3e8ac4 04/19/2012 05:36 pm Paolo Bonzini

nbd: avoid out of bounds access to recv_coroutine array

This can happen with a buggy or malicious server.

Reported-by: Michael Tokarev <>
Signed-off-by: Paolo Bonzini <>

ae255e52 12/22/2011 12:53 pm Paolo Bonzini

nbd: switch to asynchronous operation

Signed-off-by: Paolo Bonzini <>

d9b09f13 12/22/2011 12:53 pm Paolo Bonzini

nbd: split requests

qemu-nbd has a limit of slightly less than 1M per request. Work
around this in the nbd block driver.

Signed-off-by: Paolo Bonzini <>

ecda3447 12/22/2011 12:53 pm Paolo Bonzini

nbd: allow multiple in-flight requests

Allow sending up to 16 requests, and drive the replies to the coroutine
that did the request. The code is written to be exactly the same as
before this patch when MAX_NBD_REQUESTS == 1 (modulo the extra mutex
and state)....

2c7989a9 12/22/2011 12:53 pm Paolo Bonzini

nbd: add support for NBD_CMD_FLAG_FUA

Signed-off-by: Paolo Bonzini <>

1486d04a 12/22/2011 12:53 pm Paolo Bonzini

nbd: add support for NBD_CMD_FLUSH

Signed-off-by: Paolo Bonzini <>

7a706633 12/22/2011 12:53 pm Paolo Bonzini

nbd: add support for NBD_CMD_TRIM

Signed-off-by: Paolo Bonzini <>

3a93113a 12/06/2011 11:56 am Dong Xu Wang

fix typo: delete redundant semicolon

Double semicolons should be single.

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

2914caa0 10/21/2011 06:34 pm Paolo Bonzini

block: take lock around bdrv_read implementations

This does the first part of the conversion to coroutines, by
wrapping bdrv_read implementations to take the mutex.

Drivers that implement bdrv_read rather than bdrv_co_readv can
then benefit from asynchronous operation (at least if the underlying...

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

block: take lock around bdrv_write implementations

This does the first part of the conversion to coroutines, by
wrapping bdrv_write implementations to take the mutex.

Drivers that implement bdrv_write rather than bdrv_co_writev can
then benefit from asynchronous operation (at least if the underlying...

848c66e8 10/21/2011 06:34 pm Paolo Bonzini

block: add a CoMutex to synchronous read drivers

The big conversion of bdrv_read/write to coroutines caused the two
homonymous callbacks in BlockDriver to become reentrant. It goes
like this:

1) bdrv_read is now called in a coroutine, and calls bdrv_read or...

b90fb4b8 09/19/2011 12:34 pm Paolo Bonzini

nbd: support feature negotiation

nbd supports writing flags in bytes 24...27 of the header,
and uses that for the read-only flag. Add support for it
in qemu-nbd.

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

ab359cd1 09/12/2011 04:17 pm Markus Armbruster

nbd: Clean up use of block_int.h

Signed-off-by: Markus Armbruster <>
Signed-off-by: Kevin Wolf <>

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

d2d979c6 05/03/2011 12:29 pm Nick Thomas

NBD: Avoid leaking a couple of strings when the NBD device is closed

Signed-off-by: Nick Thomas <>
Signed-off-by: Kevin Wolf <>

33897dc7 04/07/2011 02:51 pm Nick Thomas

NBD device: Separate out parsing configuration and opening sockets.

We also change the way the file parameter is parsed so IPv6 IP
addresses can be used, e.g.: "drive=nbd:[::1]:5000"

Signed-off-by: Nick Thomas <>
Signed-off-by: Kevin Wolf <>

c2e2872b 09/21/2010 04:39 pm Laurent Vivier

nbd: correctly manage default port

block/nbd.c: use default port number when none is specified
qemu-nbd.c: use IANA-assigned port number: 10809

Signed-off-by: Laurent Vivier <>
Signed-off-by: Kevin Wolf <>

1d45f8b5 08/30/2010 07:29 pm Laurent Vivier

nbd: Introduce NBD named exports.

This patch allows to connect Qemu using NBD protocol to an nbd-server
using named exports.

For instance, if on the host "isoserver", in /etc/nbd-server/config, you have:

[generic]
[debian-500-ppc-netinst]
exportname = /ISO/debian-500-powerpc-netinst.iso...

66f82cee 05/03/2010 11:07 am Kevin Wolf

block: Open the underlying image file in generic code

Format drivers shouldn't need to bother with things like file names, but rather
just get an open BlockDriverState for the underlying protocol. This patch
introduces this behaviour for bdrv_open implementation. For protocols which...

9a2d77ad 01/26/2010 11:42 pm Christoph Hellwig

block: kill BDRV_O_CREAT

The BDRV_O_CREAT option is unused inside qemu and partially duplicates
the bdrv_create method. Remove it, and the -C option to qemu-io which
isn't used in qemu-iotests anyway.

Signed-off-by: Christoph Hellwig <>
Signed-off-by: Anthony Liguori <>

019d6b8f 05/15/2009 12:13 am Anthony Liguori

Move block drivers into their own directory

Signed-off-by: Anthony Liguori <>