diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2016-04-13 15:29:45 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2016-04-13 15:37:49 +0200 |
commit | 91f1b7611e85995eb550833c79f0592f9f9ff9f4 (patch) | |
tree | a13d21a47f50096fd9f115714c70d10c515dcdd4 | |
parent | 4afb3ffdea45ab8d40aed7265ede1df59eb53de2 (diff) |
proxy; Don't try to set CA on VMs with no displays
In some corner cases (unit tests...), we can have VM resources without
an associated display. In such cases, do not try to set the display CA
on the non-existent display.
-rw-r--r-- | govirt/ovirt-proxy.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/govirt/ovirt-proxy.c b/govirt/ovirt-proxy.c index 9906a7c..fc0273f 100644 --- a/govirt/ovirt-proxy.c +++ b/govirt/ovirt-proxy.c @@ -598,10 +598,17 @@ static void ovirt_proxy_update_vm_display_ca(OvirtProxy *proxy) OvirtVmDisplay *display; g_object_get(G_OBJECT(vm), "display", &display, NULL); - g_object_set(G_OBJECT(display), - "ca-cert", proxy->priv->display_ca, - NULL); - g_object_unref(display); + if (display != NULL) { + g_object_set(G_OBJECT(display), + "ca-cert", proxy->priv->display_ca, + NULL); + g_object_unref(display); + } else { + char *name; + g_object_get(vm, "name", &name, NULL); + g_debug("Not setting display CA for '%s' since it has no display", name); + g_free(name); + } } g_list_free(vms); } |