From 34585c74026b2f7adb86093d42b75aedf99953b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 16 Jun 2011 16:16:20 +0200 Subject: [PATCH] Bug: If a VMTemplate was instantiated without name, the resulting VM's template had two XML NAME attributes, one of them empty. --- src/vm/VirtualMachine.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/vm/VirtualMachine.cc b/src/vm/VirtualMachine.cc index 261c15d35f..d6a505fc4c 100644 --- a/src/vm/VirtualMachine.cc +++ b/src/vm/VirtualMachine.cc @@ -201,8 +201,7 @@ int VirtualMachine::insert(SqlDB * db, string& error_str) oss << "one-" << oid; name = oss.str(); - attr = new SingleAttribute("NAME",name); - obj_template->set(attr); + replace_template_attribute("NAME", name); } this->name = name;