1. 29 8月, 2014 3 次提交
  2. 15 8月, 2014 1 次提交
  3. 16 6月, 2014 1 次提交
  4. 04 6月, 2014 1 次提交
    • S
      curl: implement .bdrv_detach/attach_aio_context() · 63f0f45f
      Stefan Hajnoczi 提交于
      The curl block driver uses fd handlers, timers, and BHs.  The fd
      handlers and timers are managed on behalf of libcurl, which controls
      them using callback functions that the block driver implements.
      
      The simplest way to implement .bdrv_detach/attach_aio_context() is to
      clean up libcurl in the old event loop and initialize it again in the
      new event loop.  We do not need to keep track of anything since there
      are no pending requests when the AioContext is changed.
      
      Also make sure to use aio_set_fd_handler() instead of
      qemu_aio_set_fd_handler() and aio_bh_new() instead of qemu_bh_new() so
      the current AioContext is passed in.
      
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Fam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      63f0f45f
  5. 19 5月, 2014 3 次提交
  6. 30 4月, 2014 8 次提交
  7. 22 4月, 2014 1 次提交
  8. 01 4月, 2014 1 次提交
  9. 22 2月, 2014 1 次提交
  10. 18 2月, 2014 1 次提交
  11. 24 1月, 2014 1 次提交
  12. 07 1月, 2014 1 次提交
  13. 12 9月, 2013 1 次提交
  14. 01 9月, 2013 1 次提交
  15. 19 8月, 2013 2 次提交
  16. 05 7月, 2013 1 次提交
    • F
      curl: refuse to open URL from HTTP server without range support · 3494d650
      Fam Zheng 提交于
      CURL driver requests partial data from server on guest IO req. For HTTP
      and HTTPS, it uses "Range: ***" in requests, and this will not work if
      server not accepting range. This patch does this check when open.
      
       * Removed curl_size_cb, which is not used: On one hand it's registered to
         libcurl as CURLOPT_WRITEFUNCTION, instead of CURLOPT_HEADERFUNCTION,
         which will get called with *data*, not *header*. On the other hand the
         s->len is assigned unconditionally later.
      
         In this gone function, the sscanf for "Content-Length: %zd", on
         (void *)ptr, which is not guaranteed to be zero-terminated, is
         potentially a security bug. So this patch fixes it as a side-effect. The
         bug is reported as: https://bugs.launchpad.net/qemu/+bug/1188943
         (Note the bug is marked "private" so you might not be able to see it)
      
       * Introduced curl_header_cb, which is used to parse header and mark the
         server as accepting range if "Accept-Ranges: bytes" line is seen from
         response header. If protocol is HTTP or HTTPS, but server response has
         no not this support, refuse to open this URL.
      
      Note that python builtin module SimpleHTTPServer is an example of not
      supporting range, if you need to test this driver, get a better server
      or use internet URLs.
      Signed-off-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      3494d650
  17. 17 6月, 2013 2 次提交
  18. 12 6月, 2013 1 次提交
  19. 22 4月, 2013 2 次提交
  20. 23 3月, 2013 1 次提交
  21. 14 2月, 2013 1 次提交
  22. 09 2月, 2013 1 次提交
  23. 19 12月, 2012 1 次提交
  24. 15 11月, 2012 1 次提交
  25. 12 9月, 2012 1 次提交
  26. 12 6月, 2012 1 次提交
    • M
      allow qemu_iovec_from_buffer() to specify offset from which to start copying · 03396148
      Michael Tokarev 提交于
      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,
                           const void *buf, size_t bytes);
      
      The processing starts at offset bytes within qiov.
      
      This way, we may copy a bounce buffer directly to
      a middle of qiov.
      
      This is exactly the same function as iov_from_buf() from
      iov.c, so use the existing implementation and rename it
      to qemu_iovec_from_buf() to be shorter and to match the
      utility function.
      
      As with utility implementation, we now assert that the
      offset is inside actual iovec.  Nothing changed for
      current callers, because `offset' parameter is new.
      
      While at it, stop using "bounce-qiov" in block/qcow2.c
      and copy decrypted data directly from cluster_data
      instead of recreating a temp qiov for doing that.
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      03396148