chSocketRecv fn can be used by operations such as restore, which cannot
have a specific poll timeout. The runtime of these operations at server
side (vmm) cannot be determined or capped as it depends on the guest
configuration. Hence, pass -1 as timeout to poll to make wait until
there's a response from server.
Signed-off-by: Purna Pavan Chandra <paekkaladevi(a)linux.microsoft.com>
---
src/ch/ch_process.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/src/ch/ch_process.c b/src/ch/ch_process.c
index 668a53a1c2..3f2a3f81e5 100644
--- a/src/ch/ch_process.c
+++ b/src/ch/ch_process.c
@@ -530,9 +530,6 @@ chMonitorSocketConnect(virCHMonitor *mon)
return -1;
}
-
-#define PKT_TIMEOUT_MS 500 /* ms */
-
static char *
chSocketRecv(int sock)
{
@@ -547,7 +544,7 @@ chSocketRecv(int sock)
pfds[0].events = POLLIN;
do {
- ret = poll(pfds, G_N_ELEMENTS(pfds), PKT_TIMEOUT_MS);
+ ret = poll(pfds, G_N_ELEMENTS(pfds), -1);
} while (ret < 0 && errno == EINTR);
if (ret <= 0) {
@@ -571,8 +568,6 @@ chSocketRecv(int sock)
return g_steal_pointer(&buf);
}
-#undef PKT_TIMEOUT_MS
-
static int
chSocketProcessHttpResponse(int sock)
{
--
2.34.1