- 12 2月, 2017 1 次提交
-
-
由 Peter Lieven 提交于
parse_uint_full wants to put the parsed value into the variable passed via its second argument which is NULL. Fixes: 94d6a7a7 Cc: qemu-stable@nongnu.org Signed-off-by: NPeter Lieven <pl@kamp.de> Reviewed-by: NEric Blake <eblake@redhat.com> Message-id: 1485942829-10756-2-git-send-email-pl@kamp.de Signed-off-by: NMax Reitz <mreitz@redhat.com>
-
- 04 1月, 2017 1 次提交
-
-
由 Stefan Hajnoczi 提交于
The new AioPollFn io_poll() argument to aio_set_fd_handler() and aio_set_event_handler() is used in the next patch. Keep this code change separate due to the number of files it touches. Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com> Message-id: 20161201192652.9509-3-stefanha@redhat.com Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 06 12月, 2016 1 次提交
-
-
由 Prasanna Kumar Kalever 提交于
The QMP definition of BlockdevOptionsNfs: { 'struct': 'BlockdevOptionsNfs', 'data': { 'server': 'NFSServer', 'path': 'str', '*user': 'int', '*group': 'int', '*tcp-syn-count': 'int', '*readahead-size': 'int', '*page-cache-size': 'int', '*debug-level': 'int' } } To make this consistent with other block protocols like gluster, lets change s/debug-level/debug/ Suggested-by: NEric Blake <eblake@redhat.com> Signed-off-by: NPrasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NJeff Cody <jcody@redhat.com>
-
- 11 11月, 2016 1 次提交
-
-
由 Kevin Wolf 提交于
The leak was introduced in commit 94d6a7a7. Signed-off-by: NKevin Wolf <kwolf@redhat.com> Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 31 10月, 2016 1 次提交
-
-
由 Ashijeet Acharya 提交于
Make NFS block driver use various fine grained runtime_opts. Set .bdrv_parse_filename() to nfs_parse_filename() and introduce two new functions nfs_parse_filename() and nfs_parse_uri() to help parsing the URI. Add a new option "server" which then accepts a new struct NFSServer. Signed-off-by: NAshijeet Acharya <ashijeetacharya@gmail.com> [ kwolf: Fixed client->path ] Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 28 10月, 2016 3 次提交
-
-
由 Paolo Bonzini 提交于
aio_poll is not thread safe; for example bdrv_drain can hang if the last in-flight I/O operation is completed in the I/O thread after the main thread has checked bs->in_flight. The bug remains latent as long as all of it is called within aio_context_acquire/aio_context_release, but this will change soon. To fix this, if bdrv_drain is called from outside the I/O thread, signal the main AioContext through a dummy bottom half. The event loop then only runs in the I/O thread. Reviewed-by: NFam Zheng <famz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Message-Id: <1477565348-5458-18-git-send-email-pbonzini@redhat.com> Signed-off-by: NFam Zheng <famz@redhat.com>
-
由 Paolo Bonzini 提交于
This will make it possible to use nfs_get_allocated_file_size on a file that is not in the main AioContext. Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NFam Zheng <famz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Message-Id: <1477565348-5458-10-git-send-email-pbonzini@redhat.com> Signed-off-by: NFam Zheng <famz@redhat.com>
-
由 Paolo Bonzini 提交于
nfs_set_events only needs to be called once before entering the while loop; afterwards, nfs_process_read and nfs_process_write take care of it. Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NFam Zheng <famz@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Message-Id: <1477565348-5458-9-git-send-email-pbonzini@redhat.com> Signed-off-by: NFam Zheng <famz@redhat.com>
-
- 07 10月, 2016 1 次提交
-
-
由 Paolo Bonzini 提交于
This simplifies bottom half handlers by removing calls to qemu_bh_delete and thus removing the need to stash the bottom half pointer in the opaque datum. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 13 7月, 2016 1 次提交
-
-
由 Paolo Bonzini 提交于
In practice the entry argument is always known at creation time, and it is confusing that sometimes qemu_coroutine_enter is used with a non-NULL argument to re-enter a coroutine (this happens in block/sheepdog.c and tests/test-coroutine.c). So pass the opaque value at creation time, for consistency with e.g. aio_bh_new. Mostly done with the following semantic patch: @ entry1 @ expression entry, arg, co; @@ - co = qemu_coroutine_create(entry); + co = qemu_coroutine_create(entry, arg); ... - qemu_coroutine_enter(co, arg); + qemu_coroutine_enter(co); @ entry2 @ expression entry, arg; identifier co; @@ - Coroutine *co = qemu_coroutine_create(entry); + Coroutine *co = qemu_coroutine_create(entry, arg); ... - qemu_coroutine_enter(co, arg); + qemu_coroutine_enter(co); @ entry3 @ expression entry, arg; @@ - qemu_coroutine_enter(qemu_coroutine_create(entry), arg); + qemu_coroutine_enter(qemu_coroutine_create(entry, arg)); @ reentry @ expression co; @@ - qemu_coroutine_enter(co, NULL); + qemu_coroutine_enter(co); except for the aforementioned few places where the semantic patch stumbled (as expected) and for test_co_queue, which would otherwise produce an uninitialized variable warning. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Reviewed-by: NFam Zheng <famz@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 29 6月, 2016 2 次提交
-
-
由 Peter Lieven 提交于
upcoming libnfs will have support for a read cache that can significantly help to speed up requests since libnfs by design circumvents the kernel cache. Example: qemu -cdrom nfs://127.0.0.1/iso/my.iso?pagecache=1024 The pagecache parameters takes the maximum amount of pages to cache. A page in libnfs is always the NFS_BLKSIZE which is 4KB. Signed-off-by: NPeter Lieven <pl@kamp.de> Reviewed-by: NJeff Cody <jcody@redhat.com> Message-id: 1463662083-20814-3-git-send-email-pl@kamp.de Signed-off-by: NJeff Cody <jcody@redhat.com>
-
由 Peter Lieven 提交于
if we open a NFS export with disabled cache we should refuse the readahead feature as it will cache data inside libnfs. If a export was opened with readahead enabled it should futher not be allowed to disable the cache while running. Cc: qemu-stable@nongnu.org Signed-off-by: NPeter Lieven <pl@kamp.de> Reviewed-by: NJeff Cody <jcody@redhat.com> Message-id: 1463662083-20814-2-git-send-email-pl@kamp.de Signed-off-by: NJeff Cody <jcody@redhat.com>
-
- 31 3月, 2016 2 次提交
-
-
由 Stefan Hajnoczi 提交于
parse_uint_full() used to be included from qemu-common.h but was moved to qemu/cutils.h in commit f348b6d1 ("util: move declarations out of qemu-common.h"). Cc: Veronia Bahaa <veroniabahaa@gmail.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Message-id: 1459341994-20567-3-git-send-email-stefanha@redhat.com Signed-off-by: NJeff Cody <jcody@redhat.com>
-
由 Stefan Hajnoczi 提交于
error_setg() used to be included indirectly through qemu/osdep.h. Since commit da34e65c ("include/qemu/osdep.h: Don't include qapi/error.h") it requires an explicit include. Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Message-id: 1459341994-20567-2-git-send-email-stefanha@redhat.com Signed-off-by: NJeff Cody <jcody@redhat.com>
-
- 01 3月, 2016 1 次提交
-
-
由 Peter Lieven 提交于
recent libnfs versions support logging debug messages. Add support for it in qemu through an URL parameter. Example: qemu -cdrom nfs://127.0.0.1/iso/my.iso?debug=2Signed-off-by: NPeter Lieven <pl@kamp.de> Reviewed-by: NFam Zheng <famz@redhat.com> Message-id: 1447052973-14513-1-git-send-email-pl@kamp.de Signed-off-by: NJeff Cody <jcody@redhat.com>
-
- 20 1月, 2016 1 次提交
-
-
由 Peter Maydell 提交于
Clean up includes so that osdep.h is included first and headers which it implies are not included manually. This commit was created with scripts/clean-includes. Signed-off-by: NPeter Maydell <peter.maydell@linaro.org> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 24 10月, 2015 1 次提交
-
-
由 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>
-
- 25 9月, 2015 2 次提交
-
-
由 Peter Lieven 提交于
If the file is readonly its not expected to grow so save the blocking call to nfs_fstat_async and use the value saved at connection time. Also important the monitor (and thus the main loop) will not hang if block device info is queried and the NFS share is unresponsive. Signed-off-by: NPeter Lieven <pl@kamp.de> Reviewed-by: NJeff Cody <jcody@redhat.com> Reviewed-by: NMax Reitz <mreitz@redhat.com> Message-id: 1440671441-7978-1-git-send-email-pl@kamp.de Signed-off-by: NJeff Cody <jcody@redhat.com>
-
由 Peter Lieven 提交于
st.st_blocks is always counted in 512 byte units. Do not use st.st_blksize as multiplicator which may be larger. Cc: qemu-stable@nongnu.org Signed-off-by: NPeter Lieven <pl@kamp.de> Reviewed-by: NMax Reitz <mreitz@redhat.com> Reviewed-by: NJeff Cody <jcody@redhat.com> Message-id: 1440067607-14547-1-git-send-email-pl@kamp.de Signed-off-by: NJeff Cody <jcody@redhat.com>
-
- 02 7月, 2015 1 次提交
-
-
由 Peter Lieven 提交于
a malicious caller could otherwise specify a very large value via the URI and force libnfs to allocate a large amount of memory for the readahead buffer. Cc: qemu-stable@nongnu.org Signed-off-by: NPeter Lieven <pl@kamp.de> Message-id: 1435317241-25585-1-git-send-email-pl@kamp.de Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 10 12月, 2014 1 次提交
-
-
由 Max Reitz 提交于
The nfs protocol driver is capable of creating images, but did not specify any creation options. Fix it. A way to test this issue is the following: $ qemu-img create -f nfs nfs://127.0.0.1/foo.qcow2 64M Without this patch, it segfaults. With this patch, it does not. However, this is not something that should really work; qemu-img should check whether the parameter for the -f option (and -O for convert) is indeed a format, and error out if it is not. Therefore, I am not making it an iotest. Cc: qemu-stable@nongnu.org Signed-off-by: NMax Reitz <mreitz@redhat.com> Reviewed-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 12 9月, 2014 1 次提交
-
-
由 Hu Tao 提交于
Currently the file size requested by user is rounded down to nearest sector, causing the actual file size could be a bit less than the size user requested. Since some formats (like qcow2) record virtual disk size in bytes, this can make the last few bytes cannot be accessed. This patch fixes it by rounding up file size to nearest sector so that the actual file size is no less than the requested file size. Signed-off-by: NHu Tao <hutao@cn.fujitsu.com> Reviewed-by: NKevin Wolf <kwolf@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Reviewed-by: NMax Reitz <mreitz@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 30 8月, 2014 1 次提交
-
-
由 Fam Zheng 提交于
Signed-off-by: NFam Zheng <famz@redhat.com> Reviewed-by: NBenoît Canet <benoit.canet@nodalink.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 20 8月, 2014 1 次提交
-
-
由 Markus Armbruster 提交于
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. Patch created with Coccinelle, with two manual changes on top: * Add const to bdrv_iterate_format() to keep the types straight * Convert the allocation in bdrv_drop_intermediate(), which Coccinelle inexplicably misses Coccinelle semantic patch: @@ type T; @@ -g_malloc(sizeof(T)) +g_new(T, 1) @@ type T; @@ -g_try_malloc(sizeof(T)) +g_try_new(T, 1) @@ type T; @@ -g_malloc0(sizeof(T)) +g_new0(T, 1) @@ type T; @@ -g_try_malloc0(sizeof(T)) +g_try_new0(T, 1) @@ type T; expression n; @@ -g_malloc(sizeof(T) * (n)) +g_new(T, n) @@ type T; expression n; @@ -g_try_malloc(sizeof(T) * (n)) +g_try_new(T, n) @@ type T; expression n; @@ -g_malloc0(sizeof(T) * (n)) +g_new0(T, n) @@ type T; expression n; @@ -g_try_malloc0(sizeof(T) * (n)) +g_try_new0(T, n) @@ type T; expression p, n; @@ -g_realloc(p, sizeof(T) * (n)) +g_renew(T, p, n) @@ type T; expression p, n; @@ -g_try_realloc(p, sizeof(T) * (n)) +g_try_renew(T, p, n) Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Reviewed-by: NMax Reitz <mreitz@redhat.com> Reviewed-by: NJeff Cody <jcody@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 15 8月, 2014 1 次提交
-
-
由 Kevin Wolf 提交于
Some code in the block layer makes potentially huge allocations. Failure is not completely unexpected there, so avoid aborting qemu and handle out-of-memory situations gracefully. This patch addresses the allocations in the nfs block driver. Signed-off-by: NKevin Wolf <kwolf@redhat.com> Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NBenoit Canet <benoit@irqsave.net>
-
- 26 6月, 2014 2 次提交
-
-
由 Peter Lieven 提交于
upcoming libnfs will feature internal readahead support. Add a knob to pass the optional readahead value as a URL parameter. Signed-off-by: NPeter Lieven <pl@kamp.de> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Peter Lieven 提交于
this patch fixes the incorrect usage of strncmp and adds simple error checking by means of parse_uint_full instead of atoi for the supplied URL parameters. Signed-off-by: NPeter Lieven <pl@kamp.de> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 16 6月, 2014 3 次提交
-
-
由 Chunyan Liu 提交于
Now that all backend drivers are using QemuOpts, remove all QEMUOptionParameter related codes. Signed-off-by: NDong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: NChunyan Liu <cyliu@suse.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Chunyan Liu 提交于
Reviewed-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NEric Blake <eblake@redhat.com> Signed-off-by: NChunyan Liu <cyliu@suse.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
由 Peter Lieven 提交于
it will happen in the future that the callback of a libnfs call directly invokes the callback. In this case we end up in a segfault because the NFSRPC is gone when we the BH is scheduled. Signed-off-by: NPeter Lieven <pl@kamp.de> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 04 6月, 2014 1 次提交
-
-
由 Stefan Hajnoczi 提交于
Drop the assumption that we're using the main AioContext. The following functions need to be converted: * qemu_bh_new() -> aio_bh_new() * qemu_aio_set_fd_handler() -> aio_set_fd_handler() * qemu_aio_wait() -> aio_poll() The .bdrv_detach/attach_aio_context() interfaces also need to be implemented to move the fd handler from the old to the new AioContext. Cc: Peter Lieven <pl@kamp.de> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com> Reviewed-by: NPeter Lieven <pl@kamp.de>
-
- 09 5月, 2014 1 次提交
-
-
由 Max Reitz 提交于
After the URL has been parsed make sure the server part is valid in order to avoid a segmentation fault when calling nfs_mount(). Signed-off-by: NMax Reitz <mreitz@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 26 4月, 2014 1 次提交
-
-
由 Markus Armbruster 提交于
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. Commit 84d18f06 dumbed it down to obvious, but a few more have crept in since, and documentation was overlooked. Dumb these down, too. Signed-off-by: NMarkus Armbruster <armbru@redhat.com> Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
-
- 19 3月, 2014 1 次提交
-
-
由 Peter Lieven 提交于
if an NFS operation fails we should report what libnfs knows about the failure. It is likely more than just an error code. Signed-off-by: NPeter Lieven <pl@kamp.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 09 2月, 2014 1 次提交
-
-
由 Peter Lieven 提交于
This patch adds native support for accessing images on NFS shares without the requirement to actually mount the entire NFS share on the host. NFS Images can simply be specified by an url of the form: nfs://<host>/<export>/<filename>[?param=value[¶m2=value2[&...]]] For example: qemu-img create -f qcow2 nfs://10.0.0.1/qemu-images/test.qcow2 You need LibNFS from Ronnie Sahlberg available at: git://github.com/sahlberg/libnfs.git for this to work. During configure it is automatically probed for libnfs and support is enabled on-the-fly. You can forbid or enforce libnfs support with --disable-libnfs or --enable-libnfs respectively. Due to NFS restrictions you might need to execute your binaries as root, allow them to open priviledged ports (<1024) or specify insecure option on the NFS server. For additional information on ROOT vs. non-ROOT operation and URL format + parameters see: https://raw.github.com/sahlberg/libnfs/master/README Supported by qemu are the uid, gid and tcp-syncnt URL parameters. LibNFS currently support NFS version 3 only. Signed-off-by: NPeter Lieven <pl@kamp.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-