From a78b1541e7474c6aaa4f3aff4e10fef1b3964386 Mon Sep 17 00:00:00 2001 From: Danilo Del Busso Date: Mon, 9 Aug 2021 15:24:15 +0100 Subject: [PATCH] CA-339273: Mention source SR in VDI actions Description Also changed description to reflect the status of the action Signed-off-by: Danilo Del Busso --- XenModel/Actions/VDI/MigrateVirtualDiskAction.cs | 5 ++--- XenModel/Actions/VDI/MoveVirtualDiskAction.cs | 6 +++--- XenModel/Actions/VM/VMMoveAction.cs | 2 +- XenModel/Messages.Designer.cs | 11 +---------- XenModel/Messages.resx | 5 +---- 5 files changed, 8 insertions(+), 21 deletions(-) diff --git a/XenModel/Actions/VDI/MigrateVirtualDiskAction.cs b/XenModel/Actions/VDI/MigrateVirtualDiskAction.cs index 5cbd1654f..7f410afce 100644 --- a/XenModel/Actions/VDI/MigrateVirtualDiskAction.cs +++ b/XenModel/Actions/VDI/MigrateVirtualDiskAction.cs @@ -44,16 +44,15 @@ namespace XenAdmin.Actions private readonly VDI vdi; public MigrateVirtualDiskAction(IXenConnection connection, VDI vdi, SR sr) - : base(connection, string.Format(Messages.ACTION_MOVING_VDI_TO_SR, Helpers.GetName(vdi), Helpers.GetName(sr))) + : base(connection, string.Format(Messages.ACTION_MOVING_VDI_TO_SR, Helpers.GetName(vdi), Helpers.GetName(connection.Resolve(vdi.SR)), Helpers.GetName(sr))) { - Description = Messages.ACTION_PREPARING; this.vdi = vdi; SR = sr; } protected override void Run() { - Description = string.Format(Messages.ACTION_MOVING_VDI, Helpers.GetName(vdi)); + Description = Messages.MOVING; RelatedTask = VDI.async_pool_migrate(Session, vdi.opaque_ref, SR.opaque_ref, new Dictionary()); PollToCompletion(); Description = Messages.MOVED; diff --git a/XenModel/Actions/VDI/MoveVirtualDiskAction.cs b/XenModel/Actions/VDI/MoveVirtualDiskAction.cs index d784e5fa1..2659b43e1 100644 --- a/XenModel/Actions/VDI/MoveVirtualDiskAction.cs +++ b/XenModel/Actions/VDI/MoveVirtualDiskAction.cs @@ -44,8 +44,8 @@ namespace XenAdmin.Actions private VDI vdi; - public MoveVirtualDiskAction(IXenConnection connection, XenAPI.VDI vdi, SR sr) - : base(connection, string.Format(Messages.ACTION_MOVING_VDI_TO_SR, Helpers.GetName(vdi), Helpers.GetName(sr))) + public MoveVirtualDiskAction(IXenConnection connection, VDI vdi, SR sr) + : base(connection, string.Format(Messages.ACTION_MOVING_VDI_TO_SR, Helpers.GetName(vdi), Helpers.GetName(connection.Resolve(vdi.SR)), Helpers.GetName(sr))) { this.vdi = vdi; SR = sr; @@ -61,7 +61,7 @@ namespace XenAdmin.Actions protected override void Run() { - Description = string.Format(Messages.ACTION_MOVING_VDI, Helpers.GetName(vdi)); + Description = Messages.MOVING; PercentComplete = 10; log.DebugFormat("Moving VDI '{0}'", Helpers.GetName(vdi)); RelatedTask = VDI.async_copy(Session, vdi.opaque_ref, SR.opaque_ref); diff --git a/XenModel/Actions/VM/VMMoveAction.cs b/XenModel/Actions/VM/VMMoveAction.cs index 5472eefe7..c63e38ca1 100644 --- a/XenModel/Actions/VM/VMMoveAction.cs +++ b/XenModel/Actions/VM/VMMoveAction.cs @@ -126,7 +126,7 @@ namespace XenAdmin.Actions.VMActions continue; Description = string.Format(Messages.ACTION_MOVING_VDI_TO_SR, - Helpers.GetName(curVdi), Helpers.GetName(sr)); + Helpers.GetName(curVdi), Helpers.GetName(Connection.Resolve(curVdi.SR)), Helpers.GetName(sr)); RelatedTask = VDI.async_copy(Session, oldVBD.VDI.opaque_ref, sr.opaque_ref); PollToCompletion(PercentComplete, PercentComplete + halfstep); diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 61d8bd416..ee2b553e4 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -1555,16 +1555,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to Moving virtual disk '{0}'.... - /// - public static string ACTION_MOVING_VDI { - get { - return ResourceManager.GetString("ACTION_MOVING_VDI", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Moving Virtual Disk '{0}' to SR '{1}'. + /// Looks up a localized string similar to Moving Virtual Disk '{0}' from SR '{1}' to SR '{2}'. /// public static string ACTION_MOVING_VDI_TO_SR { get { diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 91ef2e8c2..92fda7da1 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -615,11 +615,8 @@ Started migrating virtual disks - - Moving virtual disk '{0}'... - - Moving Virtual Disk '{0}' to SR '{1}' + Moving Virtual Disk '{0}' from SR '{1}' to SR '{2}' Moving {0} virtual disks to {1}