Exemple #1
0
        /// <summary>
        /// Destroys any PBDs on the SR and sets the SR to be unshared.
        ///
        /// No throw.
        /// </summary>
        private void rollback()
        {
            try
            {
                Description = string.Format(Messages.SR_SHARE_REVERTING2, SR.Name);

                foreach (PBD broke in Connection.ResolveAll(SR.PBDs))
                {
                    if (!broke.currently_attached && !broke.Locked)
                    {
                        PBD.destroy(Session, broke.opaque_ref);
                    }
                }

                XenAPI.SR.set_shared(Session, SR.opaque_ref, false);

                Description = string.Format(Messages.SR_SHARE_REVERTED, SR.Name);
            }
            catch (Exception e)
            {
                log.Error("Exception rolling back SR shared action");
                log.Error(e, e);
            }
        }