History | View | Annotate | Download (18.5 kB)
bdrv: Use "Error" for opening images
Add an Error ** parameter to BlockDriver.bdrv_open andBlockDriver.bdrv_file_open to allow more specific error messages.
Signed-off-by: Max Reitz <mreitz@redhat.com>
curl: qemu_bh_new() can never return NULL
Drop error code path which cannot be taken since qemu_bh_new() does notreturn NULL.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
aio: drop io_flush argument
The .io_flush() handler no longer exists and has no users. Drop theio_flush argument to aio_set_fd_handler() and related functions.
The AioFlushEventNotifierHandler and AioFlushHandler typedefs are nolonger used and are dropped too....
block/curl: drop curl_aio_flush()
.io_flush() is no longer called so drop curl_aio_flush(). The acb[]array that the function checks is still used in other parts ofblock/curl.c. Therefore we cannot remove acb[], it is needed.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
curl: refuse to open URL from HTTP server without range support
CURL driver requests partial data from server on guest IO req. For HTTPand HTTPS, it uses "Range: ***" in requests, and this will not work ifserver not accepting range. This patch does this check when open....
block/curl.c: Refuse to open the handle for writes.
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>Signed-off-by: Fam Zheng <famz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
curl: Don't set curl options on the handle just before it's going to be deleted.
(Found by Kamil Dudka)
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>Cc: Michael Tokarev <mjt@tls.msk.ru>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
curl: Whitespace only changes.
Trivial patch to remove odd whitespace.
Signed-off-by: Richard W.M. Jones <rjones@redhat.com>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
block: Remove filename parameter from .bdrv_file_open()
It is unused now in all block drivers.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
curl: Use bdrv_open options instead of filename
As a bonus, going through the QemuOpts QEMU_OPT_SIZE parser for thereadahead option gives us proper error reporting that the previous useof atoi() lacked.
block: Add options QDict to bdrv_file_open() prototypes
The new parameter is unused yet.
block/curl: only restrict protocols with libcurl>=7.19.4
The curl_easy_setopt(state->curl, CURLOPT_PROTOCOLS, ...) interface wasintroduced in libcurl 7.19.4. Therefore we cannot protect againstCVE-2013-0249 when linking against an older libcurl.
This fixes the build failure introduced by...
block/curl: disable extra protocols to prevent CVE-2013-0249
There is a buffer overflow in libcurl POP3/SMTP/IMAP. The workaround issimple: disable extra protocols so that they cannot be exploited. Fulldetails here:
http://curl.haxx.se/docs/adv_20130206.html...
block: move include files to include/block/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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 longerneeds to be modified.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/curl: Fix wrong free statement
Report from smatch:block/curl.c:546 curl_close(21) info: redundant null check on s->url calling free()
The check was redundant, and free was also wrong because the memorywas allocated using g_strdup.
Signed-off-by: Stefan Weil <sw@weilnetz.de>...
allow qemu_iovec_from_buffer() to specify offset from which to start copying
Similar to qemu_iovec_memset(QEMUIOVector *qiov, size_t offset, int c, size_t bytes);the new prototype is: qemu_iovec_from_buf(QEMUIOVector *qiov, size_t offset,...
aio: remove process_queue callback and qemu_aio_process_queue
Both unused after the previous patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/curl: Replace usleep by g_usleep
The function usleep is not available for all supported platforms:at least some versions of MinGW don't support it.
usleep was also declared obsolete by POSIX.1-2001.
The function g_usleep is part of glib2.0, so it is available for...
block: qemu_aio_get does not return NULL
Initially done with the following semantic patch:
rule1 expression E;statement S;@@ E = qemu_aio_get (...);(- if (E == NULL) { ... } |- if (E) { <... S ...> })
rule1
which however missed occurrences in linux-aio.c and posix-aio-compat.c....
block/curl: Don't finish AIOCBs too early
The previous behaviour was to finish AIOCBs inside curl_aio_readv()if the data was cached. This caused the following failed assertionat hw/ide/pci.c:314: bmdma_cmd_writeb
"Assertion `bm->bus->dma->aiocb == ((void *)0)' failed."...
block/curl: Implement a flush function on the fd handlers
Signed-off-by: Nick Thomas <nick@bytemark.co.uk>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/curl: Handle failed reads gracefully.
Current behaviour if a read fails is for the acb to not get finished.This causes an infinite loop in bdrv_read_em (block.c). The read failurenever gets reported to the guest and if the error condition clears, the...
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix %lld or %llx printf format use
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
block: Open the underlying image file in generic code
Format drivers shouldn't need to bother with things like file names, but ratherjust get an open BlockDriverState for the underlying protocol. This patchintroduces this behaviour for bdrv_open implementation. For protocols which...
don't dereference NULL after failed strdup
Most of these are obvious NULL-deref bug fixes, for example,the ones in these files:
block/curl.c net.c slirp/misc.c
and the first one in block/vvfat.c.The others in block/vvfat.c may not lead to an immediate segfault, but I...
block/curl: %Z is not a valid conversion specifier
Signed-off-by: malc <av1474@comtv.ru>
Do not use dprintf
dprintf is already claimed by POSIX1, and on at least one systemis implemented as a macro
[1] http://www.opengroup.org/onlinepubs/9699919799/functions/dprintf.html
Add qemu_aio_process_queue()
We'll leave some AIO completions unhandled when we can't call the callback.qemu_aio_process_queue() is used later to run any callbacks that are left andcan be run then.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Fix Sparse warning about "expression using sizeof on a function"
Allow adjustment of http block device's readahead size, via a new":readahead=###:" suffix.
Signed-off-by: Nolan Leake <nolan <at> sigbus.net>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
fully split aio_pool from BlockDriver
Now that we have a separate aio pool structure we can remove thoseaio pool details from BlockDriver.
Every driver supporting AIO now needs to declare a static AIOPoolwith the aiocb size and the cancellation method. This cleans up the...
Add HTTP protocol using curl v6
Currently Qemu can read from posix I/O and NBD. This patch adds athird protocol to the game: HTTP.
In certain situations it can be useful to access HTTP data directly,for example if you want to try out an http provided OS image, but...