return NumbersUtil.parseInt(vncport, -1);
}
protected String getVncUrl(Connection conn, VM vm) {
VM.Record record;
Console c;
try {
record = vm.getRecord(conn);
Set<Console> consoles = record.consoles;
if (consoles.isEmpty()) {
s_logger.warn("There are no Consoles available to the vm : " + record.nameDescription);
return null;
}
Iterator<Console> i = consoles.iterator();
while(i.hasNext()) {
c = i.next();
if(c.getProtocol(conn) == ConsoleProtocol.RFB)
return c.getLocation(conn);
}
} catch (XenAPIException e) {
String msg = "Unable to get console url due to " + e.toString();
s_logger.warn(msg, e);
return null;