If QEMU quits immediately after we opened the monitor it was
possible we would skip the clearing of the SELinux process
socket context
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit
0b62c0736a2a365b9c682d58fa9f66eaea6ec7e4)
virDomainObjLock(vm);
priv->monStart = 0;
- if (mon == NULL)
+ if (mon == NULL) {
virObjectUnref(vm);
-
- if (!virDomainObjIsActive(vm)) {
+ } else if (!virDomainObjIsActive(vm)) {
qemuMonitorClose(mon);
- goto error;
+ mon = NULL;
}
priv->mon = mon;