File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 4242
4343#define VIR_FROM_THIS VIR_FROM_CH
4444
45+ /*
46+ * Retry count for temporary failures observed
47+ * in Monitor code path.
48+ */
49+ #define MONITOR_TMP_FAIL_RETRIES 5
50+
4551VIR_LOG_INIT ("ch.ch_monitor" );
4652
4753static virClassPtr virCHMonitorClass ;
@@ -1094,14 +1100,14 @@ virCHMonitorNew(virDomainObjPtr vm, virCHDriverPtr driver)
10941100 /* get a curl handle */
10951101 mon -> handle = curl_easy_init ();
10961102
1097- /* try to ping VMM socket 5 times to make sure it is ready */
1098- while (pings < 5 ) {
1099- if (virCHMonitorPingVMM ( mon ) == 0 )
1100- break ;
1101- if ( pings == 5 )
1102- goto cleanup ;
1103-
1104- g_usleep ( 100 * 1000 ) ;
1103+ /* Try pinging the VMM to make sure it is ready */
1104+ while (virCHMonitorPingVMM ( mon ) ) {
1105+ if (++ pings < MONITOR_TMP_FAIL_RETRIES ) {
1106+ g_usleep ( 100 * 1000 ) ;
1107+ continue ;
1108+ }
1109+ VIR_WARN ( "Failed to ping VMM after %d retries" , pings );
1110+ goto cleanup ;
11051111 }
11061112
11071113 if (virDomainObjSave (vm , driver -> xmlopt , cfg -> stateDir ) < 0 )
You can’t perform that action at this time.
0 commit comments