qemu-e2k/block
Peter Maydell 031fd1be56 block/curl: Implement the libcurl timer callback interface
libcurl versions 7.16.0 and later have a timer callback interface which
must be implemented in order for libcurl to make forward progress (it
will sometimes rely on being called back on the timeout if there are
no file descriptors registered). Implement the callback, and use a
QEMU AIO timer to ensure we prod libcurl again when it asks us to.

Based on Peter's original patch plus my fix to add curl_multi_timeout_do.
Should compile just fine even on older versions of libcurl.

I also tried copy-on-read and streaming:

    $ ./qemu-img create -f qcow2 -o \
         backing_file=http://download.fedoraproject.org/pub/fedora/linux/releases/20/Live/x86_64/Fedora-Live-Desktop-x86_64-20-1.iso \
         foo.qcow2 1G
    $ x86_64-softmmu/qemu-system-x86_64 \
         -drive if=none,file=foo.qcow2,copy-on-read=on,id=cd \
         -device ide-cd,drive=cd --enable-kvm -m 1024

Direct http usage is probably too slow, but with copy-on-read ultimately
the image does boot!

After some time, streaming gets canceled by an EIO, which needs further
investigation.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-01-24 16:07:08 +01:00
..
Makefile.objs Split nbd block client code 2013-12-16 10:12:20 +01:00
backup.c block: introduce BDRV_REQ_MAY_UNMAP request flag 2013-11-28 10:30:51 +01:00
blkdebug.c blkdebug: Allow command-line file configuration 2014-01-22 12:07:18 +01:00
blkverify.c block: Create authorizations mechanism for external snapshot and resize. 2014-01-24 16:07:08 +01:00
bochs.c bdrv: Use "Error" for opening images 2013-09-12 10:12:47 +02:00
cloop.c bdrv: Use "Error" for opening images 2013-09-12 10:12:47 +02:00
commit.c commit: Remove unused check 2013-12-20 16:26:16 +01:00
cow.c block: Allow reference for bdrv_file_open() 2014-01-22 12:07:17 +01:00
curl.c block/curl: Implement the libcurl timer callback interface 2014-01-24 16:07:08 +01:00
dmg.c bdrv: Use "Error" for opening images 2013-09-12 10:12:47 +02:00
gluster.c gluster: Add support for creating zero-filled image 2014-01-22 12:07:16 +01:00
iscsi.c block/iscsi: return -ENOMEM if an async call fails immediately 2014-01-22 12:07:16 +01:00
linux-aio.c aio: drop io_flush argument 2013-08-19 15:52:19 +02:00
mirror.c drive mirror:fix memory leak 2014-01-24 14:33:00 +01:00
nbd-client.c nbd: avoid uninitialized warnings 2013-12-16 10:12:20 +01:00
nbd-client.h nbd: pass export name as init argument 2013-12-16 10:12:20 +01:00
nbd.c qemu-option: Remove qemu_opts_create_nofail 2014-01-06 15:02:30 -05:00
parallels.c bdrv: Use "Error" for opening images 2013-09-12 10:12:47 +02:00
qapi.c qmp: Add QMP query-named-block-nodes to list the named BlockDriverState nodes. 2014-01-24 16:07:08 +01:00
qcow.c block: Allow reference for bdrv_file_open() 2014-01-22 12:07:17 +01:00
qcow2-cache.c qcow2: Use negated overflow check mask 2013-10-11 16:50:00 +02:00
qcow2-cluster.c qcow2: use start_of_cluster() and offset_into_cluster() everywhere 2013-12-06 16:53:50 +01:00
qcow2-refcount.c qcow2: use start_of_cluster() and offset_into_cluster() everywhere 2013-12-06 16:53:50 +01:00
qcow2-snapshot.c snapshot: distinguish id and name in load_tmp 2013-12-04 15:19:00 +01:00
qcow2.c block: Allow reference for bdrv_file_open() 2014-01-22 12:07:17 +01:00
qcow2.h qcow2: fix wrong value of L1E_OFFSET_MASK, L2E_OFFSET_MASK and REFT_OFFSET_MASK 2014-01-24 14:33:00 +01:00
qed-check.c qed: mark image clean after repair succeeds 2012-08-10 10:25:12 +02:00
qed-cluster.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
qed-gencb.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
qed-l2-cache.c qed: do not evict in-use L2 table cache entries 2012-03-12 15:14:06 +01:00
qed-table.c misc: move include files to include/qemu/ 2012-12-19 08:32:39 +01:00
qed.c block: Allow reference for bdrv_file_open() 2014-01-22 12:07:17 +01:00
qed.h block: qed - use QEMU_PACKED for on-disk structures 2013-09-25 20:51:15 +02:00
raw-aio.h raw-posix: add support for write_zeroes on XFS and block devices 2013-12-03 15:26:49 +01:00
raw-posix.c qemu-option: Remove qemu_opts_create_nofail 2014-01-06 15:02:30 -05:00
raw-win32.c qemu-option: Remove qemu_opts_create_nofail 2014-01-06 15:02:30 -05:00
raw_bsd.c block/raw: copy BlockLimits on raw_open 2013-11-28 10:30:51 +01:00
rbd.c rbd: switch from pipe to QEMUBH completion notification 2014-01-22 12:07:16 +01:00
sheepdog.c sheepdog: fix 'qemu-img map' 2014-01-24 14:33:00 +01:00
snapshot.c qemu-nbd: support internal snapshot export 2013-12-04 15:19:00 +01:00
ssh.c bdrv: Use "Error" for creating images 2013-09-12 10:12:48 +02:00
stream.c block/stream: Don't stream unbacked devices 2013-11-28 11:39:31 +01:00
vdi.c block drivers: add discard/write_zeroes properties to bdrv_get_info implementation 2013-12-03 15:26:49 +01:00
vhdx-endian.c block: vhdx - move more endian translations to vhdx-endian.c 2013-11-07 13:58:59 +01:00
vhdx-log.c block: vhdx - improve error message, and .bdrv_check implementation 2013-12-20 09:11:58 +01:00
vhdx.c block: Allow reference for bdrv_file_open() 2014-01-22 12:07:17 +01:00
vhdx.h block: vhdx - improve error message, and .bdrv_check implementation 2013-12-20 09:11:58 +01:00
vmdk.c vmdk: Fix format specific information (create type) for streamOptimized 2014-01-24 14:33:00 +01:00
vpc.c block drivers: add discard/write_zeroes properties to bdrv_get_info implementation 2013-12-03 15:26:49 +01:00
vvfat.c qemu-option: Remove qemu_opts_create_nofail 2014-01-06 15:02:30 -05:00
win32-aio.c win32-aio: drop win32_aio_flush_cb() 2013-08-22 22:05:04 +02:00