1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

F #3296 Add IP6_LINK and IP6_GLOBAL attributes to VM short body

This commit is contained in:
Christian González 2019-05-06 17:45:24 +02:00 committed by Ruben S. Montero
parent 5e4f97e84e
commit 8bed8f562c
2 changed files with 18 additions and 3 deletions

View File

@ -313,7 +313,7 @@ module Migrator
xml.STIME body.root.xpath('STIME').text
xml.ETIME body.root.xpath('ETIME').text
xml.DEPLOY_ID body.root.xpath('DEPLOY_ID').text
xml.LOCK {
xml.LOCKED body.root.xpath('LOCK/LOCKED').text unless body.root.xpath('LOCK/LOCKED').text.empty?
} unless body.root.xpath('LOCK').text.empty?
@ -355,6 +355,8 @@ module Migrator
xml.IP nic.xpath('IP').text unless nic.xpath('IP').text.empty?
xml.IP6 nic.xpath('IP6').text unless nic.xpath('IP6').text.empty?
xml.IP6_ULA nic.xpath('IP6_ULA').text unless nic.xpath('IP6_ULA').text.empty?
xml.IP6_LINK nic.xpath('IP6_LINK').text unless nic.xpath('IP6_LINK').text.empty?
xml.IP6_GLOBAL nic.xpath('IP6_GLOBAL').text unless nic.xpath('IP6_GLOBAL').text.empty?
xml.MAC nic.xpath('MAC').text unless nic.xpath('MAC').text.empty?
xml.NETWORK nic.xpath('NETWORK').text unless nic.xpath('NETWORK').text.empty?
xml.NETWORK_ID nic.xpath('NETWORK_ID').text unless nic.xpath('NETWORK_ID').text.empty?

View File

@ -172,13 +172,16 @@ void VirtualMachineNic::authorize(PoolObjectSQL::ObjectType ot, int uid,
/* -------------------------------------------------------------------------- */
#define XML_NIC_ATTR(Y,X) ( Y << "<" << X << ">" << \
one_util::escape_xml(vector_value(X)) << "</" << X << ">")
one_util::escape_xml(vector_value(X)) << "</" << X << ">")
void VirtualMachineNic::to_xml_short(std::ostringstream& oss) const
{
std::string ip = vector_value("IP");
std::string ip6 = vector_value("IP6");
std::string ip6_ula = vector_value("IP6_ULA");
std::string ip6_link = vector_value("IP6_LINK");
std::string ip6_global = vector_value("IP6_GLOBAL");
std::string reqs = vector_value("SCHED_REQUIREMENTS");
std::string rank = vector_value("SCHED_RANK");
@ -201,6 +204,16 @@ void VirtualMachineNic::to_xml_short(std::ostringstream& oss) const
oss << "<IP6_ULA>" << one_util::escape_xml(ip6_ula) << "</IP6_ULA>";
}
if (!ip6_link.empty())
{
oss << "<IP6_LINK>" << one_util::escape_xml(ip6_link) << "</IP6_LINK>";
}
if (!ip6_global.empty())
{
oss << "<IP6_GLOBAL>" << one_util::escape_xml(ip6_global) << "</IP6_GLOBAL>";
}
if (!mode.empty())
{
oss << "<NETWORK_MODE>" << one_util::escape_xml(mode) << "</NETWORK_MODE>";
@ -208,7 +221,7 @@ void VirtualMachineNic::to_xml_short(std::ostringstream& oss) const
if (!reqs.empty())
{
oss << "<SCHED_REQUIREMENTS>" << one_util::escape_xml(reqs)
oss << "<SCHED_REQUIREMENTS>" << one_util::escape_xml(reqs)
<< "</SCHED_REQUIREMENTS>";
}