mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 09:55:18 +00:00
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: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
This commit is contained in:
parent
df33ecdd9e
commit
7a95eccc81
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user