mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #1247: Enable VMware console access
This commit is contained in:
parent
97cf299f70
commit
0c60e38f28
@ -1,3 +1,5 @@
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2012, OpenNebula Project Leads (OpenNebula.org) */
|
||||
/* */
|
||||
@ -64,6 +66,13 @@ int LibVirtDriver::deployment_description_vmware(
|
||||
string script = "";
|
||||
string model = "";
|
||||
|
||||
const VectorAttribute * graphics;
|
||||
|
||||
string listen = "";
|
||||
string port = "";
|
||||
string passwd = "";
|
||||
string keymap = "";
|
||||
|
||||
const VectorAttribute * raw;
|
||||
string data;
|
||||
|
||||
@ -358,6 +367,58 @@ int LibVirtDriver::deployment_description_vmware(
|
||||
|
||||
attrs.clear();
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Graphics
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if ( vm->get_template_attribute("GRAPHICS",attrs) > 0 )
|
||||
{
|
||||
graphics = dynamic_cast<const VectorAttribute *>(attrs[0]);
|
||||
|
||||
if ( graphics != 0 )
|
||||
{
|
||||
type = graphics->vector_value("TYPE");
|
||||
listen = graphics->vector_value("LISTEN");
|
||||
port = graphics->vector_value("PORT");
|
||||
passwd = graphics->vector_value("PASSWD");
|
||||
keymap = graphics->vector_value("KEYMAP");
|
||||
|
||||
if ( type == "vnc" || type == "VNC" )
|
||||
{
|
||||
file << "\t\t<graphics type='vnc'";
|
||||
|
||||
if ( !listen.empty() )
|
||||
{
|
||||
file << " listen='" << listen << "'";
|
||||
}
|
||||
|
||||
if ( !port.empty() )
|
||||
{
|
||||
file << " port='" << port << "'";
|
||||
}
|
||||
|
||||
if ( !passwd.empty() )
|
||||
{
|
||||
file << " passwd='" << passwd << "'";
|
||||
}
|
||||
|
||||
if ( !keymap.empty() )
|
||||
{
|
||||
file << " keymap='" << keymap << "'";
|
||||
}
|
||||
|
||||
file << "/>" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
vm->log("VMM", Log::WARNING,
|
||||
"Not supported graphics type, ignored.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
attrs.clear();
|
||||
|
||||
file << "\t</devices>" << endl;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
Loading…
x
Reference in New Issue
Block a user