mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/virt-viewer
synced 2025-12-27 06:23:42 +00:00
ovirt: Fail gracefully when hostname is missing
When parsing info returned by oVirt REST API, the hostname should be present. However, I recently run remote-viewer against a buggy oVirt instance where the hostname was missing. This commit handles better this situation by displaying an error message and exiting.
This commit is contained in:
parent
f9577b9197
commit
ccafa32fe0
@ -914,6 +914,13 @@ create_ovirt_session(VirtViewerApp *app, const char *uri, GError **err)
|
||||
gport = g_strdup_printf("%d", port);
|
||||
gtlsport = g_strdup_printf("%d", secure_port);
|
||||
|
||||
if (ghost == NULL) {
|
||||
g_set_error(&error, VIRT_VIEWER_ERROR, VIRT_VIEWER_ERROR_FAILED,
|
||||
_("oVirt VM %s has no host information"), vm_name);
|
||||
g_debug("%s", error->message);
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (type == OVIRT_VM_DISPLAY_SPICE) {
|
||||
session_type = "spice";
|
||||
} else if (type == OVIRT_VM_DISPLAY_VNC) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user