提交 15632a31 编写于 作者: P Peter Krempa

qemu: event: Clean up VNC monitor handling

Get rid of spice specific stuff from the handler func and save a few
lines by reflowing the conditions.
上级 8df888a5
......@@ -638,40 +638,37 @@ qemuMonitorJSONHandleGraphicsVNC(qemuMonitorPtr mon,
return;
}
authScheme = virJSONValueObjectGetString(server, "auth");
if (!authScheme) {
if (!(authScheme = virJSONValueObjectGetString(server, "auth"))) {
/* not all events are required to contain auth scheme */
VIR_DEBUG("missing auth scheme in graphics event");
VIR_DEBUG("missing auth scheme in VNC event");
authScheme = "";
}
localFamily = virJSONValueObjectGetString(server, "family");
if (!localFamily) {
VIR_WARN("missing local address family in graphics event");
if (!(localFamily = virJSONValueObjectGetString(server, "family"))) {
VIR_WARN("missing local address family in VNC event");
return;
}
localNode = virJSONValueObjectGetString(server, "host");
if (!localNode) {
VIR_WARN("missing local hostname in graphics event");
if (!(localNode = virJSONValueObjectGetString(server, "host"))) {
VIR_WARN("missing local hostname in VNC event");
return;
}
if (!(localService = virJSONValueObjectGetString(server, "service"))) {
VIR_WARN("missing local service in VNC event");
return;
}
localService = virJSONValueObjectGetString(server, "service");
if (!localService)
localService = ""; /* Spice has multiple ports, so this isn't provided */
remoteFamily = virJSONValueObjectGetString(client, "family");
if (!remoteFamily) {
VIR_WARN("missing remote address family in graphics event");
if (!(remoteFamily = virJSONValueObjectGetString(client, "family"))) {
VIR_WARN("missing remote address family in VNC event");
return;
}
if (!(remoteNode = virJSONValueObjectGetString(client, "host"))) {
VIR_WARN("missing remote hostname in VNC event");
return;
}
remoteNode = virJSONValueObjectGetString(client, "host");
if (!remoteNode) {
VIR_WARN("missing remote hostname in graphics event");
if (!(remoteService = virJSONValueObjectGetString(client, "service"))) {
VIR_WARN("missing remote service in VNC event");
return;
}
remoteService = virJSONValueObjectGetString(client, "service");
if (!remoteService)
remoteService = ""; /* Spice has multiple ports, so this isn't provided */
saslUsername = virJSONValueObjectGetString(client, "sasl_username");
x509dname = virJSONValueObjectGetString(client, "x509_dname");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册