9ae3a8
From 6313c97af86d08de7928433ab29ed4450f49c425 Mon Sep 17 00:00:00 2001
9ae3a8
From: Richard Jones <rjones@redhat.com>
9ae3a8
Date: Thu, 11 Jun 2015 11:40:12 +0200
9ae3a8
Subject: [PATCH 12/30] curl: Remove erroneous sleep waiting for curl
9ae3a8
 completion
9ae3a8
9ae3a8
Message-id: <1434022828-13037-6-git-send-email-rjones@redhat.com>
9ae3a8
Patchwork-id: 65841
9ae3a8
O-Subject: [RHEL-7.2 qemu-kvm v3 PATCH 05/21] curl: Remove erroneous sleep waiting for curl completion
9ae3a8
Bugzilla: 1226684
9ae3a8
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
9ae3a8
From: Matthew Booth <mbooth@redhat.com>
9ae3a8
9ae3a8
The driver will not start more than a fixed number of curl sessions.
9ae3a8
If it needs more, it must wait for the completion of an existing one.
9ae3a8
The driver was sleeping, which will prevent the main loop from
9ae3a8
running, and therefore the event it's waiting on. It was also directly
9ae3a8
calling its internal handler rather than waiting on existing
9ae3a8
registered handlers to be called from the main loop.
9ae3a8
9ae3a8
This change causes it simply to wait for a period of time whilst
9ae3a8
allowing the main loop to execute.
9ae3a8
9ae3a8
Signed-off-by: Matthew Booth <mbooth@redhat.com>
9ae3a8
Tested-by: Richard W.M. Jones <rjones@redhat.com>
9ae3a8
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
9ae3a8
9ae3a8
Upstream-status: e466183718bfaaf347a3c02499473068a0072114
9ae3a8
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9ae3a8
---
9ae3a8
 block/curl.c | 3 +--
9ae3a8
 1 file changed, 1 insertion(+), 2 deletions(-)
9ae3a8
9ae3a8
diff --git a/block/curl.c b/block/curl.c
9ae3a8
index 8c707e1..e06c222 100644
9ae3a8
--- a/block/curl.c
9ae3a8
+++ b/block/curl.c
9ae3a8
@@ -289,8 +289,7 @@ static CURLState *curl_init_state(BDRVCURLState *s)
9ae3a8
             break;
9ae3a8
         }
9ae3a8
         if (!state) {
9ae3a8
-            g_usleep(100);
9ae3a8
-            curl_multi_do(s);
9ae3a8
+            qemu_aio_wait();
9ae3a8
         }
9ae3a8
     } while(!state);
9ae3a8
 
9ae3a8
-- 
9ae3a8
1.8.3.1
9ae3a8