提交 8e122c2c 编写于 作者: D Daniel P. Berrange

Remove need to pass in a virDomainObjPtr instance to qemuMonitorOpen

The qemuMonitorOpen method only needs a virDomainObjPtr in order
to access the QEMU pid. This is not critical when detecting the
QEMU capabilties, so can easily be skipped
Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
上级 72574808
......@@ -283,7 +283,7 @@ qemuMonitorOpenUnix(const char *monitor, pid_t cpid)
break;
if ((errno == ENOENT || errno == ECONNREFUSED) &&
virProcessKill(cpid, 0) == 0) {
cpid && virProcessKill(cpid, 0) == 0) {
/* ENOENT : Socket may not have shown up yet
* ECONNREFUSED : Leftover socket hasn't been removed yet */
continue;
......@@ -788,7 +788,7 @@ qemuMonitorOpen(virDomainObjPtr vm,
switch (config->type) {
case VIR_DOMAIN_CHR_TYPE_UNIX:
hasSendFD = true;
if ((fd = qemuMonitorOpenUnix(config->data.nix.path, vm->pid)) < 0)
if ((fd = qemuMonitorOpenUnix(config->data.nix.path, vm ? vm->pid : 0)) < 0)
return NULL;
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册