mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 04:12:37 +09:00
feature #1977: Fix core compiling problems
This commit is contained in:
1 parent
b372fa57f1
commit
f12bb1e506
2 files changed
+23
-16
No files matched your search
@@ -78,9 +78,9 @@ int LibVirtDriver::deployment_description_vmware(
|
||||
const VectorAttribute * raw;
|
||||
string data;
|
||||
string default_raw;
|
||||
string data_vmx = "";
|
||||
string data_vmx = "";
|
||||
|
||||
string metadata = "";
|
||||
ostringstream metadata;
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@@ -461,7 +461,7 @@ int LibVirtDriver::deployment_description_vmware(
|
||||
data_vmx = raw->vector_value("DATA_VMX");
|
||||
if ( !data_vmx.empty() )
|
||||
{
|
||||
metadata << data_vmx
|
||||
metadata << data_vmx << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -473,11 +473,11 @@ int LibVirtDriver::deployment_description_vmware(
|
||||
file << "\t" << default_raw << endl;
|
||||
}
|
||||
|
||||
if ( !metadata.empty? )
|
||||
if ( !metadata.str().empty() )
|
||||
{
|
||||
file << "\t<metadata>" << metadata << "</metadata>" << endl;
|
||||
file << "\t<metadata>" << metadata.str() << "</metadata>" << endl;
|
||||
}
|
||||
|
||||
|
||||
file << "</domain>" << endl;
|
||||
|
||||
file.close();
|
||||
|
||||
@@ -380,6 +380,17 @@ class VMwareDriver
|
||||
deploy_id.strip!
|
||||
|
||||
dfile_hash = Document.new(File.open(dfile).read)
|
||||
handle_metada(dfile_hash)
|
||||
|
||||
return deploy_id
|
||||
end
|
||||
|
||||
def domain_defined?(one_id)
|
||||
rc, info = do_action("virsh -c #{@uri} dominfo one-#{one_id}", false)
|
||||
return rc
|
||||
end
|
||||
|
||||
def handle_metadata(dfile_hash)
|
||||
metadata = XPath.first(dfile_hash, "//metadata")
|
||||
|
||||
# Check for the known types
|
||||
@@ -387,18 +398,21 @@ class VMwareDriver
|
||||
pciBridge = XPath.first(dfile_hash, "//metadata/pciBridge")
|
||||
|
||||
|
||||
vi_drv = VIDriver.new(@host) if (guestOS | pciBridge)
|
||||
if (guestOS | pciBridge)
|
||||
vi_drv = VIDriver.new(@host)
|
||||
end
|
||||
|
||||
dfile_hash = vi_driver.set_guest_os(dfile_hash,
|
||||
vi_driver,
|
||||
deploy_id,
|
||||
guestOS) if guestOS
|
||||
|
||||
return if metadata.nil?
|
||||
return if metadata.text.nil?
|
||||
|
||||
return deploy_id if (metadata.nil? | metadata.text.nil?)
|
||||
metadata = metadata.text
|
||||
|
||||
# Get the ds_id for system_ds from the first disk
|
||||
metadata = metadata.text
|
||||
source = XPath.first(dfile_hash, "//disk/source").attributes['file']
|
||||
ds_id = source.match(/^\[(.*)\](.*)/)[1]
|
||||
|
||||
@@ -413,13 +427,6 @@ class VMwareDriver
|
||||
cmd_str = "sed -ri \"/^(#{sed_str}) *=.*$/d\" #{path_to_vmx}; "
|
||||
cmd_str << "cat >> #{path_to_vmx}"
|
||||
do_ssh_action(,cmd_str metadata)
|
||||
|
||||
return deploy_id
|
||||
end
|
||||
|
||||
def domain_defined?(one_id)
|
||||
rc, info = do_action("virsh -c #{@uri} dominfo one-#{one_id}", false)
|
||||
return rc
|
||||
end
|
||||
|
||||
def set_guest_os(dfile_hash,vi_driver, deploy_id, guestOS)
|
||||
|
||||
Reference in new issue
Block a user