From 41739b8e7e845694a1b3a7b6efff509744fe2693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 27 Jan 2016 11:37:24 +0100 Subject: [PATCH] Feature #4215: Fix attach nic rollback in wrong order --- src/dm/DispatchManagerActions.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dm/DispatchManagerActions.cc b/src/dm/DispatchManagerActions.cc index a871d58313..901f8db676 100644 --- a/src/dm/DispatchManagerActions.cc +++ b/src/dm/DispatchManagerActions.cc @@ -1528,8 +1528,6 @@ int DispatchManager::attach_nic( if ( vm == 0 ) { - delete nic; - if ( rc == 0 ) { VirtualMachine::release_network_leases(nic, vid); @@ -1541,6 +1539,8 @@ int DispatchManager::attach_nic( } } + delete nic; + oss << "Could not attach a new NIC to VM " << vid << ", VM does not exist after setting its state to HOTPLUG." ; error_str = oss.str();