All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Add HTTP protocol using curl v7
@ 2009-05-22 14:57 Alexander Graf
  2009-05-22 15:41 ` Laurent Vivier
  2009-05-27 14:49 ` Richard W.M. Jones
  0 siblings, 2 replies; 10+ messages in thread
From: Alexander Graf @ 2009-05-22 14:57 UTC (permalink / raw
  To: qemu-devel

Currently Qemu can read from posix I/O and NBD. This patch adds a
third 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
don't know if you want to download it yet.

Using this patch you can now try it on on the fly. Just use it like:

qemu -cdrom http://host/path/my.iso

In order to not reinvent the wheel, this patch uses libcurl.

Signed-off-by: Alexander Graf <agraf@suse.de>

v2 changes:

- fix the segfault (yay!)
- implement AIO

v3 changes:

- remove synchronous API
- implement caching

v4 changes:

- enable other protocols (HTTPS, FTP, FTPS, TFTP, SFTP, SCP)
  (I only tested FTP so far, but they _should_ work)

v5 changes:

- address Anthony's comments
- deactivate ssh protocols again

v6 changes:

- s/^I/        /g
- s/http/curl/g

v7 changes:

- add Signed-off-by again

---
 Makefile        |    6 +
 Makefile.target |    2 +-
 block-curl.c    |  540 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 block.c         |   12 ++
 block.h         |    7 +
 configure       |   25 +++
 6 files changed, 591 insertions(+), 1 deletions(-)
 create mode 100644 block-curl.c

diff --git a/Makefile b/Makefile
index 3c70068..421cd41 100644
--- a/Makefile
+++ b/Makefile
@@ -77,6 +77,10 @@ endif
 BLOCK_OBJS += block-raw-posix.o
 endif
 
+ifdef CONFIG_CURL
+BLOCK_OBJS += block-curl.o
+endif
+
 ######################################################################
 # libqemu_common.a: Target independent part of system emulation. The
 # long term path is to suppress *all* target specific code in case of
@@ -185,6 +189,8 @@ endif
 
 LIBS+=$(VDE_LIBS)
 
+LIBS+=$(CURL_LIBS)
+
 cocoa.o: cocoa.m
 
 keymaps.o: keymaps.c keymaps.h
diff --git a/Makefile.target b/Makefile.target
index f735105..3a9226c 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -735,7 +735,7 @@ endif
 
 vl.o: qemu-options.h
 
-$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
+$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
 
 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a
 	$(LINK)
diff --git a/block-curl.c b/block-curl.c
new file mode 100644
index 0000000..19767d4
--- /dev/null
+++ b/block-curl.c
@@ -0,0 +1,540 @@
+/*
+ * QEMU Block driver for CURL images
+ *
+ * Copyright (c) 2009 Alexander Graf <agraf@suse.de>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+#include "qemu-common.h"
+#include "block_int.h"
+#include <curl/curl.h>
+
+// #define DEBUG
+// #define DEBUG_VERBOSE
+
+#ifdef DEBUG_CURL
+#define dprintf(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)
+#else
+#define dprintf(fmt, ...) do { } while (0)
+#endif
+
+#define CURL_NUM_STATES 8
+#define CURL_NUM_ACB    8
+#define SECTOR_SIZE     512
+#define READ_AHEAD_SIZE (256 * 1024)
+
+#define FIND_RET_NONE   0
+#define FIND_RET_OK     1
+#define FIND_RET_WAIT   2
+
+struct BDRVCURLState;
+
+typedef struct CURLAIOCB {
+    BlockDriverAIOCB common;
+    QEMUIOVector *qiov;
+    size_t start;
+    size_t end;
+} CURLAIOCB;
+
+typedef struct CURLState
+{
+    struct BDRVCURLState *s;
+    CURLAIOCB *acb[CURL_NUM_ACB];
+    CURL *curl;
+    char *orig_buf;
+    size_t buf_start;
+    size_t buf_off;
+    size_t buf_len;
+    char range[128];
+    char errmsg[CURL_ERROR_SIZE];
+    char in_use;
+} CURLState;
+
+typedef struct BDRVCURLState {
+    CURLM *multi;
+    size_t len;
+    CURLState states[CURL_NUM_STATES];
+    char *url;
+} BDRVCURLState;
+
+static void curl_clean_state(CURLState *s);
+static void curl_multi_do(void *arg);
+
+static int curl_sock_cb(CURL *curl, curl_socket_t fd, int action,
+                        void *s, void *sp)
+{
+    dprintf("CURL (AIO): Sock action %d on fd %d\n", action, fd);
+    switch (action) {
+        case CURL_POLL_IN:
+            qemu_aio_set_fd_handler(fd, curl_multi_do, NULL, NULL, s);
+            break;
+        case CURL_POLL_OUT:
+            qemu_aio_set_fd_handler(fd, NULL, curl_multi_do, NULL, s);
+            break;
+        case CURL_POLL_INOUT:
+            qemu_aio_set_fd_handler(fd, curl_multi_do,
+                                    curl_multi_do, NULL, s);
+            break;
+        case CURL_POLL_REMOVE:
+            qemu_aio_set_fd_handler(fd, NULL, NULL, NULL, NULL);
+            break;
+    }
+
+    return 0;
+}
+
+static size_t curl_size_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
+{
+    CURLState *s = ((CURLState*)opaque);
+    size_t realsize = size * nmemb;
+    long long fsize;
+
+    if(sscanf(ptr, "Content-Length: %lld", &fsize) == 1)
+        s->s->len = fsize;
+
+    return realsize;
+}
+
+static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
+{
+    CURLState *s = ((CURLState*)opaque);
+    size_t realsize = size * nmemb;
+    int i;
+
+    dprintf("CURL: Just reading %lld bytes\n", (unsigned long long)realsize);
+
+    if (!s || !s->orig_buf)
+        goto read_end;
+
+    memcpy(s->orig_buf + s->buf_off, ptr, realsize);
+    s->buf_off += realsize;
+
+    for(i=0; i<CURL_NUM_ACB; i++) {
+        CURLAIOCB *acb = s->acb[i];
+
+        if (!acb)
+            continue;
+
+        if ((s->buf_off >= acb->end)) {
+            qemu_iovec_from_buffer(acb->qiov, s->orig_buf + acb->start,
+                                   acb->end - acb->start);
+            acb->common.cb(acb->common.opaque, 0);
+            qemu_aio_release(acb);
+            s->acb[i] = NULL;
+        }
+    }
+
+read_end:
+    return realsize;
+}
+
+static int curl_find_buf(BDRVCURLState *s, size_t start, size_t len,
+                         CURLAIOCB *acb)
+{
+    int i;
+    size_t end = start + len;
+
+    for (i=0; i<CURL_NUM_STATES; i++) {
+        CURLState *state = &s->states[i];
+        size_t buf_end = (state->buf_start + state->buf_off);
+        size_t buf_fend = (state->buf_start + state->buf_len);
+
+        if (!state->orig_buf)
+            continue;
+        if (!state->buf_off)
+            continue;
+
+        // Does the existing buffer cover our section?
+        if ((start >= state->buf_start) &&
+            (start <= buf_end) &&
+            (end >= state->buf_start) &&
+            (end <= buf_end))
+        {
+            char *buf = state->orig_buf + (start - state->buf_start);
+
+            qemu_iovec_from_buffer(acb->qiov, buf, len);
+            acb->common.cb(acb->common.opaque, 0);
+
+            return FIND_RET_OK;
+        }
+
+        // Wait for unfinished chunks
+        if ((start >= state->buf_start) &&
+            (start <= buf_fend) &&
+            (end >= state->buf_start) &&
+            (end <= buf_fend))
+        {
+            int j;
+
+            acb->start = start - state->buf_start;
+            acb->end = acb->start + len;
+
+            for (j=0; j<CURL_NUM_ACB; j++) {
+                if (!state->acb[j]) {
+                    state->acb[j] = acb;
+                    return FIND_RET_WAIT;
+                }
+            }
+        }
+    }
+
+    return FIND_RET_NONE;
+}
+
+static void curl_multi_do(void *arg)
+{
+    BDRVCURLState *s = (BDRVCURLState *)arg;
+    int running;
+    int r;
+    int msgs_in_queue;
+
+    if (!s->multi)
+        return;
+
+    do {
+        r = curl_multi_socket_all(s->multi, &running);
+    } while(r == CURLM_CALL_MULTI_PERFORM);
+
+    /* Try to find done transfers, so we can free the easy
+     * handle again. */
+    do {
+        CURLMsg *msg;
+        msg = curl_multi_info_read(s->multi, &msgs_in_queue);
+
+        if (!msg)
+            break;
+        if (msg->msg == CURLMSG_NONE)
+            break;
+
+        switch (msg->msg) {
+            case CURLMSG_DONE:
+            {
+                CURLState *state = NULL;
+                curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, (char**)&state);
+                curl_clean_state(state);
+                break;
+            }
+            default:
+                msgs_in_queue = 0;
+                break;
+        }
+    } while(msgs_in_queue);
+}
+
+static CURLState *curl_init_state(BDRVCURLState *s)
+{
+    CURLState *state = NULL;
+    int i, j;
+
+    do {
+        for (i=0; i<CURL_NUM_STATES; i++) {
+            for (j=0; j<CURL_NUM_ACB; j++)
+                if (s->states[i].acb[j])
+                    continue;
+            if (s->states[i].in_use)
+                continue;
+
+            state = &s->states[i];
+            state->in_use = 1;
+            break;
+        }
+        if (!state) {
+            usleep(100);
+            curl_multi_do(s);
+        }
+    } while(!state);
+
+    if (state->curl)
+        goto has_curl;
+
+    state->curl = curl_easy_init();
+    if (!state->curl)
+        return NULL;
+    curl_easy_setopt(state->curl, CURLOPT_URL, s->url);
+    curl_easy_setopt(state->curl, CURLOPT_TIMEOUT, 5);
+    curl_easy_setopt(state->curl, CURLOPT_WRITEFUNCTION, curl_read_cb);
+    curl_easy_setopt(state->curl, CURLOPT_WRITEDATA, (void *)state);
+    curl_easy_setopt(state->curl, CURLOPT_PRIVATE, (void *)state);
+    curl_easy_setopt(state->curl, CURLOPT_AUTOREFERER, 1);
+    curl_easy_setopt(state->curl, CURLOPT_FOLLOWLOCATION, 1);
+    curl_easy_setopt(state->curl, CURLOPT_NOSIGNAL, 1);
+    curl_easy_setopt(state->curl, CURLOPT_ERRORBUFFER, state->errmsg);
+    
+#ifdef DEBUG_VERBOSE
+    curl_easy_setopt(state->curl, CURLOPT_VERBOSE, 1);
+#endif
+
+has_curl:
+
+    state->s = s;
+
+    return state;
+}
+
+static void curl_clean_state(CURLState *s)
+{
+    if (s->s->multi)
+        curl_multi_remove_handle(s->s->multi, s->curl);
+    s->in_use = 0;
+}
+
+static int curl_open(BlockDriverState *bs, const char *filename, int flags)
+{
+    BDRVCURLState *s = bs->opaque;
+    CURLState *state = NULL;
+    double d;
+    static int inited = 0;
+
+    if (!inited) {
+        curl_global_init(CURL_GLOBAL_ALL);
+        inited = 1;
+    }
+
+    dprintf("CURL: Opening %s\n", filename);
+    s->url = strdup(filename);
+    state = curl_init_state(s);
+    if (!state)
+        goto out_noclean;
+
+    // Get file size
+
+    curl_easy_setopt(state->curl, CURLOPT_NOBODY, 1);
+    curl_easy_setopt(state->curl, CURLOPT_WRITEFUNCTION, curl_size_cb);
+    if (curl_easy_perform(state->curl))
+        goto out;
+    curl_easy_getinfo(state->curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &d);
+    curl_easy_setopt(state->curl, CURLOPT_WRITEFUNCTION, curl_read_cb);
+    curl_easy_setopt(state->curl, CURLOPT_NOBODY, 0);
+    if (d)
+        s->len = (size_t)d;
+    else if(!s->len)
+        goto out;
+    dprintf("CURL: Size = %lld\n", (long long)s->len);
+
+    curl_clean_state(state);
+    curl_easy_cleanup(state->curl);
+    state->curl = NULL;
+
+    // Now we know the file exists and its size, so let's
+    // initialize the multi interface!
+
+    s->multi = curl_multi_init();
+    curl_multi_setopt( s->multi, CURLMOPT_SOCKETDATA, s); 
+    curl_multi_setopt( s->multi, CURLMOPT_SOCKETFUNCTION, curl_sock_cb ); 
+    curl_multi_do(s);
+
+    return 0;
+
+out:
+    fprintf(stderr, "CURL: Error opening file: %s\n", state->errmsg);
+    curl_easy_cleanup(state->curl);
+    state->curl = NULL;
+out_noclean:
+    return -EINVAL;
+}
+
+static BlockDriverAIOCB *curl_aio_readv(BlockDriverState *bs,
+        int64_t sector_num, QEMUIOVector *qiov, int nb_sectors,
+        BlockDriverCompletionFunc *cb, void *opaque)
+{
+    BDRVCURLState *s = bs->opaque;
+    CURLAIOCB *acb;
+    size_t start = sector_num * SECTOR_SIZE;
+    size_t end;
+    CURLState *state;
+
+    acb = qemu_aio_get(bs, cb, opaque);
+    if (!acb)
+        return NULL;
+
+    acb->qiov = qiov;
+
+    // In case we have the requested data already (e.g. read-ahead),
+    // we can just call the callback and be done.
+
+    switch (curl_find_buf(s, start, nb_sectors * SECTOR_SIZE, acb)) {
+        case FIND_RET_OK:
+            qemu_aio_release(acb);
+            // fall through
+        case FIND_RET_WAIT:
+            return &acb->common;
+        default:
+            break;
+    }
+
+    // No cache found, so let's start a new request
+
+    state = curl_init_state(s);
+    if (!state)
+        return NULL;
+
+    acb->start = 0;
+    acb->end = (nb_sectors * SECTOR_SIZE);
+
+    state->buf_off = 0;
+    if (state->orig_buf)
+        qemu_free(state->orig_buf);
+    state->buf_start = start;
+    state->buf_len = acb->end + READ_AHEAD_SIZE;
+    end = MIN(start + state->buf_len, s->len) - 1;
+    state->orig_buf = qemu_malloc(state->buf_len);
+    state->acb[0] = acb;
+
+    snprintf(state->range, 127, "%lld-%lld", (long long)start, (long long)end);
+    dprintf("CURL (AIO): Reading %d at %lld (%s)\n", (nb_sectors * SECTOR_SIZE), start, state->range);
+    curl_easy_setopt(state->curl, CURLOPT_RANGE, state->range);
+
+    curl_multi_add_handle(s->multi, state->curl);
+    curl_multi_do(s);
+
+    return &acb->common;
+}
+
+static void curl_aio_cancel(BlockDriverAIOCB *blockacb)
+{
+    // Do we have to implement canceling? Seems to work without...
+}
+
+static void curl_close(BlockDriverState *bs)
+{
+    BDRVCURLState *s = bs->opaque;
+    int i;
+
+    dprintf("CURL: Close\n");
+    for (i=0; i<CURL_NUM_STATES; i++) {
+        if (s->states[i].in_use)
+            curl_clean_state(&s->states[i]);
+        if (s->states[i].curl) {
+            curl_easy_cleanup(s->states[i].curl);
+            s->states[i].curl = NULL;
+        }
+        if (s->states[i].orig_buf) {
+            qemu_free(s->states[i].orig_buf);
+            s->states[i].orig_buf = NULL;
+        }
+    }
+    if (s->multi)
+        curl_multi_cleanup(s->multi);
+    if (s->url)
+        free(s->url);
+}
+
+static int64_t curl_getlength(BlockDriverState *bs)
+{
+    BDRVCURLState *s = bs->opaque;
+    return s->len;
+}
+
+BlockDriver bdrv_http = {
+    .format_name     = "http",
+    .protocol_name   = "http",
+
+    .instance_size   = sizeof(BDRVCURLState),
+    .bdrv_open       = curl_open,
+    .bdrv_close      = curl_close,
+    .bdrv_getlength  = curl_getlength,
+
+    .aiocb_size      = sizeof(CURLAIOCB),
+    .bdrv_aio_readv  = curl_aio_readv,
+    .bdrv_aio_cancel = curl_aio_cancel,
+};
+
+BlockDriver bdrv_https = {
+    .format_name     = "https",
+    .protocol_name   = "https",
+
+    .instance_size   = sizeof(BDRVCURLState),
+    .bdrv_open       = curl_open,
+    .bdrv_close      = curl_close,
+    .bdrv_getlength  = curl_getlength,
+
+    .aiocb_size      = sizeof(CURLAIOCB),
+    .bdrv_aio_readv  = curl_aio_readv,
+    .bdrv_aio_cancel = curl_aio_cancel,
+};
+
+BlockDriver bdrv_ftp = {
+    .format_name     = "ftp",
+    .protocol_name   = "ftp",
+
+    .instance_size   = sizeof(BDRVCURLState),
+    .bdrv_open       = curl_open,
+    .bdrv_close      = curl_close,
+    .bdrv_getlength  = curl_getlength,
+
+    .aiocb_size      = sizeof(CURLAIOCB),
+    .bdrv_aio_readv  = curl_aio_readv,
+    .bdrv_aio_cancel = curl_aio_cancel,
+};
+
+BlockDriver bdrv_ftps = {
+    .format_name     = "ftps",
+    .protocol_name   = "ftps",
+
+    .instance_size   = sizeof(BDRVCURLState),
+    .bdrv_open       = curl_open,
+    .bdrv_close      = curl_close,
+    .bdrv_getlength  = curl_getlength,
+
+    .aiocb_size      = sizeof(CURLAIOCB),
+    .bdrv_aio_readv  = curl_aio_readv,
+    .bdrv_aio_cancel = curl_aio_cancel,
+};
+
+BlockDriver bdrv_sftp = {
+    .format_name     = "sftp",
+    .protocol_name   = "sftp",
+
+    .instance_size   = sizeof(BDRVCURLState),
+    .bdrv_open       = curl_open,
+    .bdrv_close      = curl_close,
+    .bdrv_getlength  = curl_getlength,
+
+    .aiocb_size      = sizeof(CURLAIOCB),
+    .bdrv_aio_readv  = curl_aio_readv,
+    .bdrv_aio_cancel = curl_aio_cancel,
+};
+
+BlockDriver bdrv_scp = {
+    .format_name     = "scp",
+    .protocol_name   = "scp",
+
+    .instance_size   = sizeof(BDRVCURLState),
+    .bdrv_open       = curl_open,
+    .bdrv_close      = curl_close,
+    .bdrv_getlength  = curl_getlength,
+
+    .aiocb_size      = sizeof(CURLAIOCB),
+    .bdrv_aio_readv  = curl_aio_readv,
+    .bdrv_aio_cancel = curl_aio_cancel,
+};
+
+BlockDriver bdrv_tftp = {
+    .format_name     = "tftp",
+    .protocol_name   = "tftp",
+
+    .instance_size   = sizeof(BDRVCURLState),
+    .bdrv_open       = curl_open,
+    .bdrv_close      = curl_close,
+    .bdrv_getlength  = curl_getlength,
+
+    .aiocb_size      = sizeof(CURLAIOCB),
+    .bdrv_aio_readv  = curl_aio_readv,
+    .bdrv_aio_cancel = curl_aio_cancel,
+};
diff --git a/block.c b/block.c
index 3d1223d..55af1eb 100644
--- a/block.c
+++ b/block.c
@@ -1504,6 +1504,18 @@ void bdrv_init(void)
     bdrv_register(&bdrv_qcow2);
     bdrv_register(&bdrv_parallels);
     bdrv_register(&bdrv_nbd);
+#ifdef CONFIG_CURL
+    bdrv_register(&bdrv_http);
+    bdrv_register(&bdrv_https);
+    bdrv_register(&bdrv_ftp);
+    bdrv_register(&bdrv_ftps);
+    bdrv_register(&bdrv_tftp);
+#if 0
+    /* SSH over curl can't detect file sizes :-( */
+    bdrv_register(&bdrv_sftp);
+    bdrv_register(&bdrv_scp);
+#endif
+#endif
 }
 
 void aio_pool_init(AIOPool *pool, int aiocb_size,
diff --git a/block.h b/block.h
index 5aef076..5e554e8 100644
--- a/block.h
+++ b/block.h
@@ -20,6 +20,13 @@ extern BlockDriver bdrv_vvfat;
 extern BlockDriver bdrv_qcow2;
 extern BlockDriver bdrv_parallels;
 extern BlockDriver bdrv_nbd;
+extern BlockDriver bdrv_http;
+extern BlockDriver bdrv_https;
+extern BlockDriver bdrv_ftp;
+extern BlockDriver bdrv_ftps;
+extern BlockDriver bdrv_sftp;
+extern BlockDriver bdrv_scp;
+extern BlockDriver bdrv_tftp;
 
 typedef struct BlockDriverInfo {
     /* in bytes, 0 if irrelevant */
diff --git a/configure b/configure
index 82fb60a..49b5b84 100755
--- a/configure
+++ b/configure
@@ -181,6 +181,7 @@ bsd_user="no"
 build_docs="no"
 uname_release=""
 curses="yes"
+curl="yes"
 pthread="yes"
 aio="yes"
 io_thread="no"
@@ -477,6 +478,8 @@ for opt do
   ;;
   --disable-curses) curses="no"
   ;;
+  --disable-curl) curl="no"
+  ;;
   --disable-nptl) nptl="no"
   ;;
   --enable-mixemu) mixemu="yes"
@@ -600,6 +603,7 @@ echo "  --disable-brlapi         disable BrlAPI"
 echo "  --disable-vnc-tls        disable TLS encryption for VNC server"
 echo "  --disable-vnc-sasl       disable SASL encryption for VNC server"
 echo "  --disable-curses         disable curses output"
+echo "  --disable-curl           disable curl connectivity"
 echo "  --disable-bluez          disable bluez stack connectivity"
 echo "  --disable-kvm            disable KVM acceleration support"
 echo "  --disable-nptl           disable usermode NPTL support"
@@ -1062,6 +1066,21 @@ EOF
 fi # test "$curses"
 
 ##########################################
+# curl probe
+
+if test "$curl" = "yes" ; then
+  curl=no
+  cat > $TMPC << EOF
+#include <curl/curl.h>
+int main(void) { return curl_easy_init(); }
+EOF
+  curl_libs=`curl-config --libs`
+ if $cc $ARCH_CFLAGS $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+    curl=yes
+  fi
+fi # test "$curl"
+
+##########################################
 # bluez support probe
 if test "$bluez" = "yes" ; then
   `pkg-config bluez 2> /dev/null` || bluez="no"
@@ -1311,6 +1330,7 @@ if test "$sdl" != "no" ; then
     echo "SDL static link   $sdl_static"
 fi
 echo "curses support    $curses"
+echo "curl support      $curl"
 echo "mingw32 support   $mingw32"
 echo "Audio drivers     $audio_drv_list"
 echo "Extra audio cards $audio_card_list"
@@ -1637,6 +1657,11 @@ fi
 if test "$inotify" = "yes" ; then
   echo "#define CONFIG_INOTIFY 1" >> $config_h
 fi
+if test "$curl" = "yes" ; then
+  echo "CONFIG_CURL=yes" >> $config_mak
+  echo "CURL_LIBS=$curl_libs" >> $config_mak
+  echo "#define CONFIG_CURL 1" >> $config_h
+fi
 if test "$brlapi" = "yes" ; then
   echo "CONFIG_BRLAPI=yes" >> $config_mak
   echo "#define CONFIG_BRLAPI 1" >> $config_h
-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v7
  2009-05-22 14:57 [Qemu-devel] [PATCH] Add HTTP protocol using curl v7 Alexander Graf
@ 2009-05-22 15:41 ` Laurent Vivier
  2009-05-27 14:49 ` Richard W.M. Jones
  1 sibling, 0 replies; 10+ messages in thread
From: Laurent Vivier @ 2009-05-22 15:41 UTC (permalink / raw
  To: Alexander Graf; +Cc: qemu-devel

Le vendredi 22 mai 2009 à 16:57 +0200, Alexander Graf a écrit :
> Currently Qemu can read from posix I/O and NBD. This patch adds a
> third 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
> don't know if you want to download it yet.
> 
> Using this patch you can now try it on on the fly. Just use it like:
> 
> qemu -cdrom http://host/path/my.iso
> 
> In order to not reinvent the wheel, this patch uses libcurl.
> 
> Signed-off-by: Alexander Graf <agraf@suse.de>

Just a comment on the form: changelog should appear after the "---" with
diffstat to not be commited with the patch comment.
(they work like that on the linux kernel mailing list...)

> v2 changes:
> 
> - fix the segfault (yay!)
> - implement AIO
> 
> v3 changes:
> 
> - remove synchronous API
> - implement caching
> 
> v4 changes:
> 
> - enable other protocols (HTTPS, FTP, FTPS, TFTP, SFTP, SCP)
>   (I only tested FTP so far, but they _should_ work)
> 
> v5 changes:
> 
> - address Anthony's comments
> - deactivate ssh protocols again
> 
> v6 changes:
> 
> - s/^I/        /g
> - s/http/curl/g
> 
> v7 changes:
> 
> - add Signed-off-by again
> 
> ---
>  Makefile        |    6 +
>  Makefile.target |    2 +-
>  block-curl.c    |  540 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  block.c         |   12 ++
>  block.h         |    7 +
>  configure       |   25 +++
>  6 files changed, 591 insertions(+), 1 deletions(-)
>  create mode 100644 block-curl.c
> 
> diff --git a/Makefile b/Makefile
> index 3c70068..421cd41 100644
> --- a/Makefile
> +++ b/Makefile
[...]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v7
  2009-05-22 14:57 [Qemu-devel] [PATCH] Add HTTP protocol using curl v7 Alexander Graf
  2009-05-22 15:41 ` Laurent Vivier
@ 2009-05-27 14:49 ` Richard W.M. Jones
  2009-05-27 14:55   ` Alexander Graf
  2009-05-27 14:58   ` Anthony Liguori
  1 sibling, 2 replies; 10+ messages in thread
From: Richard W.M. Jones @ 2009-05-27 14:49 UTC (permalink / raw
  To: Alexander Graf; +Cc: qemu-devel

I tried to test out this patch, but unfortunately it doesn't apply to
the latest git repo - have you got an updated patch?

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v7
  2009-05-27 14:49 ` Richard W.M. Jones
@ 2009-05-27 14:55   ` Alexander Graf
  2009-05-27 15:01     ` Richard W.M. Jones
  2009-05-27 14:58   ` Anthony Liguori
  1 sibling, 1 reply; 10+ messages in thread
From: Alexander Graf @ 2009-05-27 14:55 UTC (permalink / raw
  To: Richard W.M. Jones; +Cc: qemu-devel


On 27.05.2009, at 16:49, Richard W.M. Jones wrote:

> I tried to test out this patch, but unfortunately it doesn't apply to
> the latest git repo - have you got an updated patch?

Last time I checked it was in qemu.git.

Alex

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v7
  2009-05-27 14:49 ` Richard W.M. Jones
  2009-05-27 14:55   ` Alexander Graf
@ 2009-05-27 14:58   ` Anthony Liguori
  2009-05-27 17:45     ` [Qemu-devel] " Consul
  1 sibling, 1 reply; 10+ messages in thread
From: Anthony Liguori @ 2009-05-27 14:58 UTC (permalink / raw
  To: Richard W.M. Jones; +Cc: Alexander Graf, qemu-devel

Richard W.M. Jones wrote:
> I tried to test out this patch, but unfortunately it doesn't apply to
> the latest git repo - have you got an updated patch?
>   

It's already in git.

Regards,

Anthony Liguori

> Rich.
>
>   

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] [PATCH] Add HTTP protocol using curl v7
  2009-05-27 14:55   ` Alexander Graf
@ 2009-05-27 15:01     ` Richard W.M. Jones
  0 siblings, 0 replies; 10+ messages in thread
From: Richard W.M. Jones @ 2009-05-27 15:01 UTC (permalink / raw
  To: Alexander Graf; +Cc: qemu-devel

On Wed, May 27, 2009 at 04:55:18PM +0200, Alexander Graf wrote:
>
> On 27.05.2009, at 16:49, Richard W.M. Jones wrote:
>
>> I tried to test out this patch, but unfortunately it doesn't apply to
>> the latest git repo - have you got an updated patch?
>
> Last time I checked it was in qemu.git.

So it is, sorry for the noise.

Great feature BTW ...

Rich.

-- 
Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into Xen guests.
http://et.redhat.com/~rjones/virt-p2v

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: [PATCH] Add HTTP protocol using curl v7
  2009-05-27 14:58   ` Anthony Liguori
@ 2009-05-27 17:45     ` Consul
  2009-05-28  8:45       ` Anthony Liguori
  0 siblings, 1 reply; 10+ messages in thread
From: Consul @ 2009-05-27 17:45 UTC (permalink / raw
  To: qemu-devel

Anthony Liguori wrote:
> It's already in git.

Does it work on Windows for anybody? In my case the git version of configure does not even recognize the presence of libcurl.
The hack below makes it to compile in, but running for example "qemu -cdrom http://aleksoft.net/fdbasecd.iso" hangs the emulator
with the following log. Any hints?

Alex

curl --version
curl 7.19.5 (i686-pc-mingw32) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3 libssh2/0.18
Protocols: tftp ftp telnet dict ldap http file https ftps scp sftp
Features: Largefile NTLM SSL libz

<log>

C:\qemu-dist>qemu -cdrom http://aleksoft.net/fdbasecd.iso
CURL: Opening http://aleksoft.net/fdbasecd.iso
* About to connect() to aleksoft.net port 80 (#0)
*   Trying 74.220.214.207... * connected
* Connected to aleksoft.net (74.220.214.207) port 80 (#0)
 > HEAD /fdbasecd.iso HTTP/1.1
Host: aleksoft.net
Accept: */*

< HTTP/1.1 200 OK
< Date: Wed, 27 May 2009 16:28:38 GMT
< Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_pass
through/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
< Last-Modified: Wed, 27 May 2009 16:27:53 GMT
< ETag: "40719c4-7f2800-46ae75337d440"
< Accept-Ranges: bytes
< Content-Length: 8333312
< Content-Type: application/octet-stream
<
* Connection #0 to host aleksoft.net left intact
CURL: Size = 8333312
* Closing connection #0
CURL (AIO): Reading 2048 at 0 (0-0)
CURL (AIO): Sock action 2 on fd 1828
CURL (AIO): Sock action 4 on fd 1828
* About to connect() to aleksoft.net port 80 (#0)
*   Trying 74.220.214.207... CURL (AIO): Sock action 2 on fd 1784
* Connected to aleksoft.net (74.220.214.207) port 80 (#0)
 > GET /fdbasecd.iso HTTP/1.1
Range: bytes=0-0
Host: aleksoft.net
Accept: */*

CURL (AIO): Sock action 1 on fd 1784
< HTTP/1.1 206 Partial Content
< Date: Wed, 27 May 2009 16:28:38 GMT
< Server: Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8i DAV/2 mod_auth_pass
through/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635
< Last-Modified: Wed, 27 May 2009 16:27:53 GMT
< ETag: "40719c4-7f2800-46ae75337d440"
< Accept-Ranges: bytes
< Content-Length: 1
< Content-Range: bytes 0-0/8333312
< Content-Type: application/octet-stream
<
CURL: Just reading 1 bytes
read 1
CURL (AIO): Sock action 4 on fd 1784
* Connection #0 to host aleksoft.net left intact

</log>

diff --git a/block/curl.c b/block/curl.c
index 5d1487d..14ce646 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -25,8 +25,8 @@
  #include "block_int.h"
  #include <curl/curl.h>

-// #define DEBUG
-// #define DEBUG_VERBOSE
+ #define DEBUG_CURL
+ #define DEBUG_VERBOSE

  #ifdef DEBUG_CURL
  #define dprintf(fmt, ...) do { printf(fmt, ## __VA_ARGS__); } while (0)
@@ -141,6 +141,7 @@ static size_t curl_read_cb(void *ptr, size_t size, size_t nmemb, void *opaque)
      }

  read_end:
+    printf("read %x\n",realsize);
      return realsize;
  }

@@ -255,7 +256,11 @@ static CURLState *curl_init_state(BDRVCURLState *s)
              break;
          }
          if (!state) {
+#ifndef _WIN32
              usleep(100);
+#else
+            Sleep(0);
+#endif
              curl_multi_do(s);
          }
      } while(!state);
diff --git a/configure b/configure
index bcf1207..c85c29e 100755
--- a/configure
+++ b/configure
@@ -640,7 +640,7 @@ if test "$mingw32" = "yes" ; then
      oss="no"
      linux_user="no"
      bsd_user="no"
-    OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501"
+    OS_CFLAGS="$OS_CFLAGS -DWIN32_LEAN_AND_MEAN -DWINVER=0x501 -DCURL_STATICLIB"
  fi

  if test ! -x "$(which cgcc 2>/dev/null)"; then
@@ -1103,7 +1103,7 @@ if test "$curl" = "yes" ; then
  int main(void) { return curl_easy_init(); }
  EOF
    curl_libs=`curl-config --libs 2>/dev/null`
- if $cc $ARCH_CFLAGS $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+ if $cc $ARCH_CFLAGS -DCURL_STATICLIB -o $TMPE $TMPC $curl_libs > /dev/null 2> /dev/null ; then
      curl=yes
    fi
  fi # test "$curl"

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [Qemu-devel] Re: [PATCH] Add HTTP protocol using curl v7
  2009-05-27 17:45     ` [Qemu-devel] " Consul
@ 2009-05-28  8:45       ` Anthony Liguori
  2009-05-28 18:20         ` Consul
  2009-05-28 18:23         ` Consul
  0 siblings, 2 replies; 10+ messages in thread
From: Anthony Liguori @ 2009-05-28  8:45 UTC (permalink / raw
  To: Consul; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

Consul wrote:
> Anthony Liguori wrote:
>> It's already in git.
>
> Does it work on Windows for anybody? In my case the git version of
> configure does not even recognize the presence of libcurl. \

Is curl-config in your path?  Does the following help?

> The hack below makes it to compile in, but running for example "qemu
> -cdrom http://aleksoft.net/fdbasecd.iso" hangs the emulator
> with the following log. Any hints?

It probably doesn't.  AIO on Windows is really busted.  It needs some
serious work.

Regards,

Anthony Liguori



[-- Attachment #2: curl-config.patch --]
[-- Type: text/x-patch, Size: 1802 bytes --]

commit 2712d0cbaa816ab6b0976f3d65b7cc9f222dd63f
Author: Anthony Liguori <aliguori@us.ibm.com>
Date:   Thu May 28 03:44:23 2009 -0500

    Make sure to respect curl-config CFLAGS
    
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

diff --git a/Makefile.target b/Makefile.target
index 445d55f..0078668 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -548,6 +548,11 @@ ifdef CONFIG_BLUEZ
 LIBS += $(CONFIG_BLUEZ_LIBS)
 endif
 
+ifdef CONFIG_CURL
+CPPFLAGS += $(CURL_CFLAGS)
+LIBS += $(CURL_LIBS)
+endif
+
 # xen backend driver support
 XEN_OBJS := xen_machine_pv.o xen_domainbuild.o
 ifeq ($(CONFIG_XEN), yes)
@@ -732,7 +737,7 @@ endif
 
 vl.o: qemu-options.h
 
-$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS) $(CURL_LIBS)
+$(QEMU_PROG): LIBS += $(SDL_LIBS) $(COCOA_LIBS) $(CURSES_LIBS) $(BRLAPI_LIBS) $(VDE_LIBS)
 $(QEMU_PROG): ARLIBS=../libqemu_common.a libqemu.a $(HWLIB)
 $(QEMU_PROG): $(OBJS) ../libqemu_common.a libqemu.a $(HWLIB)
 	$(call LINK,$(OBJS))
diff --git a/configure b/configure
index 21c0633..2e68fe3 100755
--- a/configure
+++ b/configure
@@ -1079,7 +1079,8 @@ if test "$curl" = "yes" ; then
 int main(void) { return curl_easy_init(); }
 EOF
   curl_libs=`curl-config --libs 2>/dev/null`
- if $cc $ARCH_CFLAGS $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+  curl_cflags=`curl-config --cflags 2>/dev/null`
+ if $cc $ARCH_CFLAGS $curl_cflags $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
     curl=yes
   fi
 fi # test "$curl"
@@ -1663,6 +1664,7 @@ fi
 if test "$curl" = "yes" ; then
   echo "CONFIG_CURL=yes" >> $config_mak
   echo "CURL_LIBS=$curl_libs" >> $config_mak
+  echo "CURL_CFLAGS=$curl_cflags" >> $config_mak
   echo "#define CONFIG_CURL 1" >> $config_h
 fi
 if test "$brlapi" = "yes" ; then

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: [PATCH] Add HTTP protocol using curl v7
  2009-05-28  8:45       ` Anthony Liguori
@ 2009-05-28 18:20         ` Consul
  2009-05-28 18:23         ` Consul
  1 sibling, 0 replies; 10+ messages in thread
From: Consul @ 2009-05-28 18:20 UTC (permalink / raw
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1404 bytes --]

Anthony Liguori wrote:
> 
> Is curl-config in your path?  Does the following help?
> 
Yes.
How about this patch on top of yours? Still does not run well on windows, but at least compiles on both linux and windows.
Without re-arranging the args order linker can't resolve the symbols.

diff --git a/Makefile b/Makefile
index d7b9985..4830285 100644
--- a/Makefile
+++ b/Makefile
@@ -202,6 +202,8 @@ endif

  LIBS+=$(CURL_LIBS)

+block/curl.o: CFLAGS += $(CURL_CFLAGS)
+
  cocoa.o: cocoa.m

  keymaps.o: keymaps.c keymaps.h
diff --git a/block/curl.c b/block/curl.c
index e1a553f..5534680 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -255,7 +255,11 @@ static CURLState *curl_init_state(BDRVCURLState *s)
              break;
          }
          if (!state) {
+#ifndef _WIN32
              usleep(100);
+#else
+            Sleep(0);
+#endif
              curl_multi_do(s);
          }
      } while(!state);
diff --git a/configure b/configure
index 2e68fe3..fdbc352 100755
--- a/configure
+++ b/configure
@@ -1080,7 +1080,7 @@ int main(void) { return curl_easy_init(); }
  EOF
    curl_libs=`curl-config --libs 2>/dev/null`
    curl_cflags=`curl-config --cflags 2>/dev/null`
- if $cc $ARCH_CFLAGS $curl_cflags $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+ if $cc $ARCH_CFLAGS $curl_cflags -o $TMPE $TMPC $curl_libs > /dev/null 2> /dev/null ; then
      curl=yes
    fi
  fi # test "$curl"

[-- Attachment #2: curl-win.patch --]
[-- Type: text/plain, Size: 1106 bytes --]

diff --git a/Makefile b/Makefile
index d7b9985..4830285 100644
--- a/Makefile
+++ b/Makefile
@@ -202,6 +202,8 @@ endif
 
 LIBS+=$(CURL_LIBS)
 
+block/curl.o: CFLAGS += $(CURL_CFLAGS)
+
 cocoa.o: cocoa.m
 
 keymaps.o: keymaps.c keymaps.h
diff --git a/block/curl.c b/block/curl.c
index e1a553f..5534680 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -255,7 +255,11 @@ static CURLState *curl_init_state(BDRVCURLState *s)
             break;
         }
         if (!state) {
+#ifndef _WIN32
             usleep(100);
+#else
+            Sleep(0);
+#endif
             curl_multi_do(s);
         }
     } while(!state);
diff --git a/configure b/configure
index 2e68fe3..fdbc352 100755
--- a/configure
+++ b/configure
@@ -1080,7 +1080,7 @@ int main(void) { return curl_easy_init(); }
 EOF
   curl_libs=`curl-config --libs 2>/dev/null`
   curl_cflags=`curl-config --cflags 2>/dev/null`
- if $cc $ARCH_CFLAGS $curl_cflags $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+ if $cc $ARCH_CFLAGS $curl_cflags -o $TMPE $TMPC $curl_libs > /dev/null 2> /dev/null ; then
     curl=yes
   fi
 fi # test "$curl"

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Qemu-devel] Re: [PATCH] Add HTTP protocol using curl v7
  2009-05-28  8:45       ` Anthony Liguori
  2009-05-28 18:20         ` Consul
@ 2009-05-28 18:23         ` Consul
  1 sibling, 0 replies; 10+ messages in thread
From: Consul @ 2009-05-28 18:23 UTC (permalink / raw
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1405 bytes --]

Anthony Liguori wrote:
 >
 > Is curl-config in your path?  Does the following help?
 >
Yes.
How about this patch on top of yours? Still does not run well on windows, but at least compiles on both linux and windows.
Without re-arranging the args order linker can't resolve the symbols.

diff --git a/Makefile b/Makefile
index d7b9985..4830285 100644
--- a/Makefile
+++ b/Makefile
@@ -202,6 +202,8 @@ endif

  LIBS+=$(CURL_LIBS)

+block/curl.o: CFLAGS += $(CURL_CFLAGS)
+
  cocoa.o: cocoa.m

  keymaps.o: keymaps.c keymaps.h
diff --git a/block/curl.c b/block/curl.c
index e1a553f..5534680 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -255,7 +255,11 @@ static CURLState *curl_init_state(BDRVCURLState *s)
              break;
          }
          if (!state) {
+#ifndef _WIN32
              usleep(100);
+#else
+            Sleep(0);
+#endif
              curl_multi_do(s);
          }
      } while(!state);
diff --git a/configure b/configure
index 2e68fe3..fdbc352 100755
--- a/configure
+++ b/configure
@@ -1080,7 +1080,7 @@ int main(void) { return curl_easy_init(); }
  EOF
    curl_libs=`curl-config --libs 2>/dev/null`
    curl_cflags=`curl-config --cflags 2>/dev/null`
- if $cc $ARCH_CFLAGS $curl_cflags $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+ if $cc $ARCH_CFLAGS $curl_cflags -o $TMPE $TMPC $curl_libs > /dev/null 2> /dev/null ; then
      curl=yes
    fi
  fi # test "$curl"

[-- Attachment #2: curl-win.patch --]
[-- Type: text/plain, Size: 1106 bytes --]

diff --git a/Makefile b/Makefile
index d7b9985..4830285 100644
--- a/Makefile
+++ b/Makefile
@@ -202,6 +202,8 @@ endif
 
 LIBS+=$(CURL_LIBS)
 
+block/curl.o: CFLAGS += $(CURL_CFLAGS)
+
 cocoa.o: cocoa.m
 
 keymaps.o: keymaps.c keymaps.h
diff --git a/block/curl.c b/block/curl.c
index e1a553f..5534680 100644
--- a/block/curl.c
+++ b/block/curl.c
@@ -255,7 +255,11 @@ static CURLState *curl_init_state(BDRVCURLState *s)
             break;
         }
         if (!state) {
+#ifndef _WIN32
             usleep(100);
+#else
+            Sleep(0);
+#endif
             curl_multi_do(s);
         }
     } while(!state);
diff --git a/configure b/configure
index 2e68fe3..fdbc352 100755
--- a/configure
+++ b/configure
@@ -1080,7 +1080,7 @@ int main(void) { return curl_easy_init(); }
 EOF
   curl_libs=`curl-config --libs 2>/dev/null`
   curl_cflags=`curl-config --cflags 2>/dev/null`
- if $cc $ARCH_CFLAGS $curl_cflags $curl_libs -o $TMPE $TMPC > /dev/null 2> /dev/null ; then
+ if $cc $ARCH_CFLAGS $curl_cflags -o $TMPE $TMPC $curl_libs > /dev/null 2> /dev/null ; then
     curl=yes
   fi
 fi # test "$curl"

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-05-28 18:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-22 14:57 [Qemu-devel] [PATCH] Add HTTP protocol using curl v7 Alexander Graf
2009-05-22 15:41 ` Laurent Vivier
2009-05-27 14:49 ` Richard W.M. Jones
2009-05-27 14:55   ` Alexander Graf
2009-05-27 15:01     ` Richard W.M. Jones
2009-05-27 14:58   ` Anthony Liguori
2009-05-27 17:45     ` [Qemu-devel] " Consul
2009-05-28  8:45       ` Anthony Liguori
2009-05-28 18:20         ` Consul
2009-05-28 18:23         ` Consul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.