CA-189674: Move VM shows an irrelevant (VIF mapping) error, but it shouldn't

I assumed the problem was that vm.resident_on is always unknown for stopped vms, but this is there intentionally to match only running vms and be always false for stopped ones. However, we still need similar logic to not to send VIF mapping when not needed in the assert.

Signed-off-by: Gabor Apati-Nagy <gabor.apati-nagy@citrix.com>
This commit is contained in:
Gabor Apati-Nagy 2015-12-02 12:03:54 +00:00
parent 3df22f4735
commit a8ea4d47be
2 changed files with 3 additions and 3 deletions

View File

@ -96,7 +96,7 @@ namespace XenAdmin.Wizards.CrossPoolMigrateWizard.Filters
{
//Skip the resident host as there's a filter for it and
//if not then you could exclude intrapool migration
if (vm.Connection == host.Connection)
if (vm.resident_on == host.opaque_ref)
continue;
PIF managementPif = host.Connection.Cache.PIFs.First(p => p.management);
@ -109,7 +109,7 @@ namespace XenAdmin.Wizards.CrossPoolMigrateWizard.Filters
receiveMapping,
true,
GetVdiMap(vm, targetSR),
GetVifMap(vm, targetNetwork),
vm.Connection == host.Connection ? new Dictionary<XenRef<VIF>, XenRef<XenAPI.Network>>() : GetVifMap(vm, targetNetwork),
new Dictionary<string, string>());
}
catch (Failure failure)

View File

@ -54,7 +54,7 @@ namespace XenAdmin.Wizards.CrossPoolMigrateWizard.Filters
get
{
List<Host> residentHosts = new List<Host>();
preSelectedVMs.ForEach(vm=>residentHosts.Add(vm.Home()));
preSelectedVMs.ForEach(vm=>residentHosts.Add( vm.Connection.Resolve(vm.resident_on)));
if(ItemToFilterOn is Host)
{