提交 9fbf5685 编写于 作者: R Roman Bolshakov 提交者: Michal Privoznik

tools: console: Use proper constructor

"virsh console" on macOS cannot attach to a domain and it doesn't matter if
it's local or remote domain:
  $ ~ virsh console vm
  Connected to domain vm
  Escape character is ^]
  error: internal error: unable to wait on console condition

The error comes from pthread_cond_wait that fails with EINVAL. The mutex
in the parent is not initialized with pthread_mutex_init and it results
in silent failure of pthead_mutex_lock and the attach failure.

Fixes: 98361cc3 ("tools: console: make console virLockableObject")
Signed-off-by: NRoman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 9f020642
......@@ -367,7 +367,7 @@ virConsoleNew(void)
if (virConsoleInitialize() < 0)
return NULL;
if (!(con = virObjectNew(virConsoleClass)))
if (!(con = virObjectLockableNew(virConsoleClass)))
return NULL;
if (virCondInit(&con->cond) < 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册