提交 7a95eccc 编写于 作者: V Viktor Mihajlovski 提交者: Daniel P. Berrange

qemu: Wait for monitor socket even without pid

If qemuMonitorOpenUnix is called without a related pid, i.e. for
QMP probing, a connect failure can happen as the result of a race.
Without a pid there is no retry and thus we give up too early.
This changes the code to retry if no pid is supplied.
Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
上级 df33ecdd
...@@ -283,7 +283,7 @@ qemuMonitorOpenUnix(const char *monitor, pid_t cpid) ...@@ -283,7 +283,7 @@ qemuMonitorOpenUnix(const char *monitor, pid_t cpid)
break; break;
if ((errno == ENOENT || errno == ECONNREFUSED) && if ((errno == ENOENT || errno == ECONNREFUSED) &&
cpid && virProcessKill(cpid, 0) == 0) { (!cpid || virProcessKill(cpid, 0) == 0)) {
/* ENOENT : Socket may not have shown up yet /* ENOENT : Socket may not have shown up yet
* ECONNREFUSED : Leftover socket hasn't been removed yet */ * ECONNREFUSED : Leftover socket hasn't been removed yet */
continue; continue;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册