From 35d808313d6800e9bbf12af5cb82bb4755e1f8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 31 Mar 2015 14:50:55 +0200 Subject: [PATCH] Feature #3238: Host drivers can be updated --- src/host/Host.cc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/host/Host.cc b/src/host/Host.cc index 02a4f88c71..679f159e51 100644 --- a/src/host/Host.cc +++ b/src/host/Host.cc @@ -51,6 +51,10 @@ Host::Host( add_template_attribute("RESERVED_CPU", default_cpu); add_template_attribute("RESERVED_MEM", default_cpu); + + replace_template_attribute("IM_MAD", im_mad_name); + replace_template_attribute("VM_MAD", vmm_mad_name); + replace_template_attribute("VN_MAD", vnm_mad_name); } Host::~Host() @@ -693,8 +697,10 @@ int Host::from_xml(const string& xml) int Host::post_update_template(string& error) { - string vcenter_password; + string new_im_mad; + string new_vm_mad; + string new_vn_mad; erase_template_attribute("VCENTER_PASSWORD", vcenter_password); @@ -720,5 +726,25 @@ int Host::post_update_template(string& error) } } + get_template_attribute("IM_MAD", new_im_mad); + get_template_attribute("VM_MAD", new_vm_mad); + get_template_attribute("VN_MAD", new_vn_mad); + + if (new_im_mad != ""){ + im_mad_name = new_im_mad; + } + + if (new_im_mad != ""){ + vmm_mad_name = new_vm_mad; + } + + if (new_im_mad != ""){ + vnm_mad_name = new_vn_mad; + } + + replace_template_attribute("IM_MAD", im_mad_name); + replace_template_attribute("VM_MAD", vmm_mad_name); + replace_template_attribute("VN_MAD", vnm_mad_name); + return 0; };