mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-04-01 20:05:19 +00:00
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.
This commit is contained in:
parent
8df888a532
commit
15632a312e
@ -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;
|
||||
}
|
||||
remoteNode = virJSONValueObjectGetString(client, "host");
|
||||
if (!remoteNode) {
|
||||
VIR_WARN("missing remote hostname in graphics event");
|
||||
if (!(remoteNode = virJSONValueObjectGetString(client, "host"))) {
|
||||
VIR_WARN("missing remote hostname in VNC event");
|
||||
return;
|
||||
}
|
||||
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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user