提交 fbf3cc3a 编写于 作者: M Marc-André Lureau 提交者: Paolo Bonzini

colo: claim in find_and_check_chardev

This factors out claiming of chardev, and changes the call to
non-fatal to return an error like the rest of the chardev checks.
Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20161022095318.17775-15-marcandre.lureau@redhat.com>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 7fa47e2a
......@@ -589,6 +589,13 @@ static int find_and_check_chardev(CharDriverState **chr,
chr_name);
return 1;
}
if (qemu_chr_fe_claim(*chr) < 0) {
error_setg(errp, "chardev \"%s\" cannot be claimed",
chr_name);
return 1;
}
return 0;
}
......@@ -646,12 +653,6 @@ static void colo_compare_complete(UserCreatable *uc, Error **errp)
return;
}
qemu_chr_fe_claim_no_fail(s->chr_pri_in.chr);
qemu_chr_fe_claim_no_fail(s->chr_sec_in.chr);
qemu_chr_fe_claim_no_fail(s->chr_out.chr);
net_socket_rs_init(&s->pri_rs, compare_pri_rs_finalize);
net_socket_rs_init(&s->sec_rs, compare_sec_rs_finalize);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册