- 16 1月, 2016 2 次提交
-
-
由 Fam Zheng 提交于
We have NBD server code and client code, all mixed in a file. Now split them into separate files under nbd/, and update MAINTAINERS. filter_nbd for iotest 083 is updated to keep the log filtered out. Signed-off-by: NFam Zheng <famz@redhat.com> Message-Id: <1452760863-25350-3-git-send-email-famz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Fam Zheng 提交于
Rename the parameter "close" to "close_fn" to disambiguous with close(2). This unifies error handling paths of NBDClient allocation: nbd_client_new will shutdown the socket and call the "close_fn" callback if negotiation failed, so the caller don't need a different path than the normal close. The returned pointer is never used, make it void in preparation for the next patch. Signed-off-by: NFam Zheng <famz@redhat.com> Message-Id: <1452760863-25350-2-git-send-email-famz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 24 10月, 2015 2 次提交
-
-
由 Fam Zheng 提交于
So we could distinguish it from internal used fds, thus avoid handling unwanted events in nested aio polls. Signed-off-by: NFam Zheng <famz@redhat.com> Reviewed-by: NJeff Cody <jcody@redhat.com> Reviewed-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Fam Zheng 提交于
All callers pass in false, and the real external ones will switch to true in coming patches. Signed-off-by: NFam Zheng <famz@redhat.com> Reviewed-by: NJeff Cody <jcody@redhat.com> Reviewed-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 20 10月, 2015 1 次提交
-
-
由 Daniel P. Berrange 提交于
The coroutine files are currently referenced by the block-obj-y variable. The coroutine functionality though is already used by more than just the block code. eg migration code uses coroutine yield. In the future the I/O channel code will also use the coroutine yield functionality. Since the coroutine code is nicely self-contained it can be easily built as part of the libqemuutil.a library, making it widely available. The headers are also moved into include/qemu, instead of the include/block directory, since they are now part of the util codebase, and the impl was never in the block/ directory either. Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
-
- 13 10月, 2015 1 次提交
-
-
由 Paolo Bonzini 提交于
Simplify memory allocation by sticking with a single API. GSlice is not that fast anyway (tcmalloc/jemalloc are better). Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 16 9月, 2015 1 次提交
-
-
由 Wen Congyang 提交于
If the socket fd is shutdown, there may be some data which is received before shutdown. We will read the data and do read/write in nbd_trip(). But the exp's blk is NULL, and it will cause qemu crashed. Reported-by: NLi Zhijian <lizhijian@cn.fujitsu.com> Signed-off-by: NWen Congyang <wency@cn.fujitsu.com> Message-Id: <55F929E2.1020501@cn.fujitsu.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 08 5月, 2015 1 次提交
-
-
由 Paolo Bonzini 提交于
Right now, NBD includes potentially platform-specific error values in the wire protocol. Luckily, most common error values are more or less universal: in particular, of all errno values <= 34 (up to ERANGE), they are all the same on supported platforms except for 11 (which is EAGAIN on Windows and Linux, but EDEADLK on Darwin and the *BSDs). So, in order to guarantee some portability, only keep a handful of possible error codes and squash everything else to EINVAL. This patch defines a limited set of errno values that are valid for the NBD protocol, and specifies recommendations for what error to return in specific corner cases. The set of errno values is roughly based on the errors listed in the read(2) and write(2) man pages, with some exceptions: - ENOMEM is added for servers that implement copy-on-write or other formats that require dynamic allocation. - EDQUOT is not part of the universal set of errors; it can be changed to ENOSPC on the wire format. - EFBIG is part of the universal set of errors, but it is also changed to ENOSPC because it is pretty similar to ENOSPC or EDQUOT. Incoming values will in general match system errno values, but not on the Hurd which has different errno values (they have a "subsystem code" equal to 0x10 in bits 24-31). The Hurd is probably not something to which QEMU has been ported, but still do the right thing and reverse-map the NBD errno values to the system errno values. The corresponding patch to the NBD protocol description can be found at http://article.gmane.org/gmane.linux.drivers.nbd.general/3154. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 29 4月, 2015 1 次提交
-
-
由 Bogdan Purcareata 提交于
This fixes ioctl behavior on powerpc e6500 platforms with 64bit kernel and 32bit userspace. The current type cast has no effect there and the value passed to the kernel is still 0. Probably an issue related to the compiler, since I'm assuming the same configuration works on a similar setup on x86. Also ensure consistency with previous type cast in TRACE message. Signed-off-by: NBogdan Purcareata <bogdan.purcareata@freescale.com> Message-Id: <1428058914-32050-1-git-send-email-bogdan.purcareata@freescale.com> Cc: qemu-stable@nongnu.org [Fix parens as noticed by Michael. - Paolo] Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 18 3月, 2015 7 次提交
-
-
由 Max Reitz 提交于
When requesting the list of exports, no data should be sent. If data is sent, the NBD server should not just inform the client of the invalid request, but also drop the data. Signed-off-by: NMax Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-22-git-send-email-mreitz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Max Reitz 提交于
The export flags are a 16 bit value, so be16_to_cpu() has to be used to interpret them correctly. This makes discard and flush actually work for named NBD exports (they did not work before, because the client always assumed them to be unsupported because of the bug fixed by this patch). Signed-off-by: NMax Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-20-git-send-email-mreitz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Max Reitz 提交于
The client flags are sent exactly once overall, not once per option. Signed-off-by: NMax Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-19-git-send-email-mreitz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Max Reitz 提交于
Signed-off-by: NMax Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-13-git-send-email-mreitz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Max Reitz 提交于
Signed-off-by: NMax Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-9-git-send-email-mreitz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Max Reitz 提交于
While it does not make a difference in practice, nbd_receive_options() generally returns -errno, so it should do that here as well; and the easiest way to achieve this is by passing on the value returned by nbd_handle_list(). Signed-off-by: NMax Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-7-git-send-email-mreitz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Yik Fang 提交于
The value of reply.error should be the type unsigned int. Signed-off-by: NYik Fang <eric.fangyi@huawei.com> Message-Id: <1423722111-12902-1-git-send-email-eric.fangyi@huawei.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 16 2月, 2015 1 次提交
-
-
由 Max Reitz 提交于
Before this patch, the "opaque" pointer in an NBD BDS points to a BDRVNBDState, which contains an NbdClientSession object, which in turn contains a pointer to the BDS. This pointer may become invalid due to bdrv_swap(), so drop it, and instead pass the BDS directly to the nbd-client.c functions which then retrieve the NbdClientSession object from there. Signed-off-by: NMax Reitz <mreitz@redhat.com> Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Message-id: 1423256778-3340-2-git-send-email-mreitz@redhat.com Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 07 2月, 2015 1 次提交
-
-
由 Max Reitz 提交于
This patch makes use of the Error object for nbd_receive_negotiate() so that errors during negotiation look nicer. Furthermore, this patch adds an additional error message if the received magic was wrong, but would be correct for the other protocol version, respectively: So if an export name was specified, but the NBD server magic corresponds to an old handshake, this condition is explicitly signaled to the user, and vice versa. As these messages are now part of the "Could not open image" error message, additional filtering has to be employed in iotest 083, which this patch does as well. Signed-off-by: NMax Reitz <mreitz@redhat.com> Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 10 12月, 2014 2 次提交
-
-
由 Max Reitz 提交于
With all externally visible functions changed to use BlockBackend, this patch makes nbd use BlockBackend for everything internally as well. While touching them, substitute 512 by BDRV_SECTOR_SIZE in the calls to blk_read(), blk_write() and blk_co_discard(). Signed-off-by: NMax Reitz <mreitz@redhat.com> Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Message-id: 1416309679-333-6-git-send-email-mreitz@redhat.com Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Max Reitz 提交于
Substitute BlockDriverState by BlockBackend in every globally visible function provided by nbd. Signed-off-by: NMax Reitz <mreitz@redhat.com> Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Message-id: 1416309679-333-5-git-send-email-mreitz@redhat.com Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 14 10月, 2014 1 次提交
-
-
由 Alexey Kardashevskiy 提交于
When migrated using libvirt with "--copy-storage-all", at the end of migration there is race between NBD mirroring task trying to do flush and migration completion, both end up invalidating cache. Since qcow2 driver does not handle this situation very well, random crashes happen. This disables the BDRV_O_INCOMING flag for the block device being migrated once the cache has been invalidated. Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> -- fixed parens by hand Signed-off-by: NJuan Quintela <quintela@redhat.com>
-
- 29 8月, 2014 3 次提交
-
-
由 Max Reitz 提交于
Keep the NBD server always in the same AIO context as the exported BDS by calling bdrv_add_aio_context_notifier() and implementing the required callbacks. Signed-off-by: NMax Reitz <mreitz@redhat.com> Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Max Reitz 提交于
There is no variant of aio_set_fd_handler() like qemu_set_fd_handler2(), so we cannot give a can_read() callback function. Instead, unregister the nbd_read() function whenever we cannot read and re-register it as soon as we can read again. All this is hidden behind the functions nbd_set_handlers() (which registers all handlers for the AIO context and file descriptor belonging to the given client), nbd_unset_handlers() (which unregisters them) and nbd_update_can_read() (which checks whether NBD can read for the given client and acts accordingly). Signed-off-by: NMax Reitz <mreitz@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 30 6月, 2014 2 次提交
-
-
由 Hani Benhabiles 提交于
Signed-off-by: NHani Benhabiles <kroosec@gmail.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Hani Benhabiles 提交于
When this flag is set, the server tells the client that it can send another option if the server received a request with an option that it doesn't understand instead of directly closing the connection. Also add link to the most up-to-date documentation. Signed-off-by: NHani Benhabiles <kroosec@gmail.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 27 6月, 2014 1 次提交
-
-
由 Hani Benhabiles 提交于
These values aren't used in this case. Currently, the from field in the request sent by the nbd kernel module leading to a false error message when ending the connection with the client. $ qemu-nbd some.img -v // After nbd-client -d /dev/nbd0 nbd.c:nbd_trip():L1031: From: 18446744073709551104, Len: 0, Size: 20971520, Offset: 0 nbd.c:nbd_trip():L1032: requested operation past EOF--bad client? nbd.c:nbd_receive_request():L638: read failed Signed-off-by: NHani Benhabiles <kroosec@gmail.com> Cc: qemu-stable@nongnu.org Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 24 5月, 2014 1 次提交
-
-
由 Hani Benhabiles 提交于
Signed-off-by: NHani Benhabiles <hani@linux.com> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
-
- 22 2月, 2014 3 次提交
-
-
由 Paolo Bonzini 提交于
qemu-nbd is one of the few valid users of qerror_report_err. Move the error-reporting socket wrappers there. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NFam Zheng <famz@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NFam Zheng <famz@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Paolo Bonzini 提交于
Before: $ ./qemu-io-old qemu-io-old> open -r -o file.driver=nbd one of path and host must be specified. qemu-io-old: can't open device (null): Could not open image: Invalid argument $ ./qemu-io-old qemu-io-old> open -r -o file.driver=nbd,file.host=foo,file.path=bar path and host may not be used at the same time. qemu-io-old: can't open device (null): Could not open image: Invalid argument After: $ ./qemu-io qemu-io> open -r -o file.driver=nbd qemu-io: can't open device (null): one of path and host must be specified. $ ./qemu-io qemu-io> open -r -o file.driver=nbd,file.host=foo,file.path=bar qemu-io: can't open device (null): path and host may not be used at the same time. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NFam Zheng <famz@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 16 12月, 2013 1 次提交
-
-
由 Marc-André Lureau 提交于
The caller might handle non-blocking using coroutine. Leave the choice to the caller to use a blocking or non-blocking negotiate. Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Acked-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
-
- 06 9月, 2013 1 次提交
-
-
由 Fam Zheng 提交于
Previously, nbd calls drive_get_ref() on the drive of bs. A BDS doesn't always have associated dinfo, which nbd doesn't care either. We already have BDS ref count, so use it to make it safe for a BDS w/o blockdev. Signed-off-by: NFam Zheng <famz@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 23 8月, 2013 1 次提交
-
-
由 Alex Bligh 提交于
include/qemu/timer.h has no need to include main-loop.h and doing so causes an issue for the next patch. Unfortunately various files assume including timers.h will pull in main-loop.h. Untangle this mess. Signed-off-by: NAlex Bligh <alex@alex.org.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 03 5月, 2013 2 次提交
-
-
由 Stefan Hajnoczi 提交于
The Linux nbd driver recently increased the maximum supported request size up to 32 MB: commit 078be02b80359a541928c899c2631f39628f56df Author: Michal Belczyk <belczyk@bsd.krakow.pl> Date: Tue Apr 30 15:28:28 2013 -0700 nbd: increase default and max request sizes Raise the default max request size for nbd to 128KB (from 127KB) to get it 4KB aligned. This patch also allows the max request size to be increased (via /sys/block/nbd<x>/queue/max_sectors_kb) to 32MB. QEMU's 1 MB buffers are too small to handle these requests. This patch allocates data buffers dynamically and allows up to 32 MB per request. Reported-by: NNick Thomas <nick@bytemark.co.uk> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Stefan Hajnoczi 提交于
Use GLib's efficient slice allocator instead of open-coding the request freelist. This patch simplifies the NBDRequest code. Now we qemu_blockalign() the req->data buffer each time but the next patch switches from a fixed size buffer to a dynamic size anyway. Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 02 4月, 2013 1 次提交
-
-
由 Stefan Hajnoczi 提交于
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: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
-
- 23 3月, 2013 2 次提交
-
-
由 Kevin Wolf 提交于
Signed-off-by: NKevin Wolf <kwolf@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
由 Kevin Wolf 提交于
The NBD block supports an URL syntax, for which a URL parser returns separate hostname and port fields. It also supports the traditional qemu syntax encoded in a filename. Until now, after parsing the URL to get each piece of information, a new string is built to be fed to socket functions. Instead of building a string in the URL case that is immediately parsed again, parse the string in both cases and use the QemuOpts interface to qemu-sockets.c. Signed-off-by: NKevin Wolf <kwolf@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com>
-
- 19 12月, 2012 1 次提交
-
-
由 Paolo Bonzini 提交于
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-