changes to establish connection to ovirt server on vm's forward_vnc_port
[ovirt-viewer.git] / wui_thread.c
index 0585c89..9dab95c 100644 (file)
@@ -977,6 +977,7 @@ parse_vm_from_xml (xmlNodePtr node)
   vm.hostid = -1;
   vm.id = -1;
   vm.vnc_port = -1;
+  vm.forward_vnc_port = -1;
   vm.mem_allocated = -1;
   vm.mem_used = -1;
   vm.vcpus_allocated = -1;
@@ -1053,6 +1054,13 @@ parse_vm_from_xml (xmlNodePtr node)
        xmlFree (str);
       }
     }
+    else if (xmlStrcmp (p->name, (const xmlChar *) "forward-vnc-port") == 0) {
+      str = xmlNodeGetContent (p);
+      if (str != NULL) {
+       vm.forward_vnc_port = strtol ((char *) str, NULL, 10);
+       xmlFree (str);
+      }
+    }
     else if (xmlStrcmp (p->name, (const xmlChar *) "vnic-mac-addr") == 0) {
       str = xmlNodeGetContent (p);
       if (str != NULL) {
@@ -1072,6 +1080,8 @@ parse_vm_from_xml (xmlNodePtr node)
     DEBUG ("required field \"description\" missing from <vm> structure");
   else if (vm.vnc_port == -1)
     DEBUG ("required field \"vnc-port\" missing from <vm> structure");
+  else if (vm.forward_vnc_port == -1)
+    DEBUG ("required field \"forward-vnc-port\" missing from <vm> structure");
   else if (vm.uuid == NULL)
     DEBUG ("required field \"uuid\" missing from <vm> structure");
   else