mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 07:19:18 +01:00
Merge pull request #1333 from MihaelaStoica/CA-235381
CA-235381: XenCenter should not allow users to edit the PVS cache sto…
This commit is contained in:
commit
c5c2906cb1
5
XenAdmin/Controls/PvsCacheStorageRow.Designer.cs
generated
5
XenAdmin/Controls/PvsCacheStorageRow.Designer.cs
generated
@ -32,7 +32,7 @@
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.labelUnits = new System.Windows.Forms.Label();
|
||||
this.numericUpDownCacheSize = new System.Windows.Forms.NumericUpDown();
|
||||
this.comboBoxCacheSr = new EnableableComboBox();
|
||||
this.comboBoxCacheSr = new XenAdmin.Controls.EnableableComboBox();
|
||||
this.labelHostName = new System.Windows.Forms.Label();
|
||||
this.labelCacheStorage = new System.Windows.Forms.Label();
|
||||
this.labelCacheSize = new System.Windows.Forms.Label();
|
||||
@ -69,9 +69,10 @@
|
||||
//
|
||||
// comboBoxCacheSr
|
||||
//
|
||||
resources.ApplyResources(this.comboBoxCacheSr, "comboBoxCacheSr");
|
||||
this.comboBoxCacheSr.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
|
||||
this.comboBoxCacheSr.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.comboBoxCacheSr.FormattingEnabled = true;
|
||||
resources.ApplyResources(this.comboBoxCacheSr, "comboBoxCacheSr");
|
||||
this.comboBoxCacheSr.Name = "comboBoxCacheSr";
|
||||
this.comboBoxCacheSr.SelectedIndexChanged += new System.EventHandler(this.comboBoxCacheSr_SelectedIndexChanged);
|
||||
//
|
||||
|
@ -70,6 +70,8 @@ namespace XenAdmin.Controls
|
||||
origCacheSizeGb = numericUpDownCacheSize.Value;
|
||||
|
||||
PopulateCacheSrCombobox();
|
||||
ReadOnly = OrigPvsCacheStorage != null && OrigPvsCacheStorage.IsInUse;
|
||||
comboBoxCacheSr.Enabled = numericUpDownCacheSize.Enabled = !ReadOnly;
|
||||
}
|
||||
|
||||
private void PopulateCacheSrCombobox()
|
||||
@ -180,6 +182,8 @@ namespace XenAdmin.Controls
|
||||
}
|
||||
}
|
||||
|
||||
public bool ReadOnly { get; private set; }
|
||||
|
||||
private void SomethingChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (Changed != null)
|
||||
|
@ -130,7 +130,7 @@
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="labelUnits.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>402, 22</value>
|
||||
<value>421, 22</value>
|
||||
</data>
|
||||
<data name="labelUnits.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>3, 3, 3, 3</value>
|
||||
@ -160,7 +160,7 @@
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="numericUpDownCacheSize.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>324, 22</value>
|
||||
<value>343, 22</value>
|
||||
</data>
|
||||
<data name="numericUpDownCacheSize.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>72, 20</value>
|
||||
@ -180,11 +180,14 @@
|
||||
<data name=">>numericUpDownCacheSize.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="comboBoxCacheSr.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Left, Right</value>
|
||||
</data>
|
||||
<data name="comboBoxCacheSr.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>114, 22</value>
|
||||
</data>
|
||||
<data name="comboBoxCacheSr.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>196, 21</value>
|
||||
<value>215, 21</value>
|
||||
</data>
|
||||
<data name="comboBoxCacheSr.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>3</value>
|
||||
@ -193,7 +196,7 @@
|
||||
<value>comboBoxCacheSr</value>
|
||||
</data>
|
||||
<data name=">>comboBoxCacheSr.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>XenAdmin.Controls.EnableableComboBox, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>comboBoxCacheSr.Parent" xml:space="preserve">
|
||||
<value>tableLayoutPanel1</value>
|
||||
@ -253,7 +256,7 @@
|
||||
<value>3, 3, 3, 3</value>
|
||||
</data>
|
||||
<data name="labelCacheStorage.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>196, 13</value>
|
||||
<value>215, 13</value>
|
||||
</data>
|
||||
<data name="labelCacheStorage.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
@ -289,7 +292,7 @@
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="labelCacheSize.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>324, 3</value>
|
||||
<value>343, 3</value>
|
||||
</data>
|
||||
<data name="labelCacheSize.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>3, 3, 3, 3</value>
|
||||
@ -328,7 +331,7 @@
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>431, 46</value>
|
||||
<value>450, 46</value>
|
||||
</data>
|
||||
<data name="tableLayoutPanel1.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
@ -346,7 +349,7 @@
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
|
||||
<value><?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelUnits" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="numericUpDownCacheSize" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="comboBoxCacheSr" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelHostName" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelCacheStorage" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCacheSize" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Absolute,111,AutoSize,0,Absolute,8,AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,AutoSize,0" /></TableLayoutSettings></value>
|
||||
<value><?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="labelUnits" Row="1" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="numericUpDownCacheSize" Row="1" RowSpan="1" Column="3" ColumnSpan="1" /><Control Name="comboBoxCacheSr" Row="1" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelHostName" Row="1" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="labelCacheStorage" Row="0" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="labelCacheSize" Row="0" RowSpan="1" Column="3" ColumnSpan="1" /></Controls><Columns Styles="Absolute,111,Percent,100,Absolute,8,AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0" /></TableLayoutSettings></value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
@ -357,8 +360,11 @@
|
||||
<data name="$this.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="$this.MinimumSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>360, 21</value>
|
||||
</data>
|
||||
<data name="$this.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>431, 47</value>
|
||||
<value>450, 47</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>PvsCacheStorageRow</value>
|
||||
|
@ -306,6 +306,9 @@
|
||||
<data name=">>splitContainer.Panel1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="splitContainer.Panel1MinSize" type="System.Int32, mscorlib">
|
||||
<value>100</value>
|
||||
</data>
|
||||
<data name=">>splitContainer.Panel2.Name" xml:space="preserve">
|
||||
<value>splitContainer.Panel2</value>
|
||||
</data>
|
||||
@ -318,6 +321,9 @@
|
||||
<data name=">>splitContainer.Panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="splitContainer.Panel2MinSize" type="System.Int32, mscorlib">
|
||||
<value>400</value>
|
||||
</data>
|
||||
<data name="splitContainer.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>763, 474</value>
|
||||
</data>
|
||||
|
@ -30,6 +30,7 @@ namespace XenAdmin.Dialogs
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PvsCacheConfigurationPage));
|
||||
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.cacheStorageInUseInfoLabel = new System.Windows.Forms.Label();
|
||||
this.memoryOnlyInfoLabel = new System.Windows.Forms.Label();
|
||||
this.deleteButton = new System.Windows.Forms.Button();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
@ -40,26 +41,36 @@ namespace XenAdmin.Dialogs
|
||||
this.pvsConfigInfoIcon = new System.Windows.Forms.PictureBox();
|
||||
this.pvsConfigInfoLabel = new System.Windows.Forms.Label();
|
||||
this.memoryOnlyInfoIcon = new System.Windows.Forms.PictureBox();
|
||||
this.cacheStorageInUseInfoIcon = new System.Windows.Forms.PictureBox();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pvsConfigInfoIcon)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.memoryOnlyInfoIcon)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cacheStorageInUseInfoIcon)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
//
|
||||
resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1");
|
||||
this.tableLayoutPanel1.Controls.Add(this.memoryOnlyInfoLabel, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.deleteButton, 4, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.cacheStorageInUseInfoLabel, 1, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.memoryOnlyInfoLabel, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.deleteButton, 4, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label1, 0, 1);
|
||||
this.tableLayoutPanel1.Controls.Add(this.label7, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.textBox1, 2, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.hostsPanel, 0, 2);
|
||||
this.tableLayoutPanel1.Controls.Add(this.viewPvsServersButton, 2, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.pvsConfigInfoIcon, 0, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.pvsConfigInfoLabel, 1, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.memoryOnlyInfoIcon, 0, 3);
|
||||
this.tableLayoutPanel1.Controls.Add(this.viewPvsServersButton, 2, 6);
|
||||
this.tableLayoutPanel1.Controls.Add(this.pvsConfigInfoIcon, 0, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.pvsConfigInfoLabel, 1, 5);
|
||||
this.tableLayoutPanel1.Controls.Add(this.memoryOnlyInfoIcon, 0, 4);
|
||||
this.tableLayoutPanel1.Controls.Add(this.cacheStorageInUseInfoIcon, 0, 3);
|
||||
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
|
||||
//
|
||||
// cacheStorageInUseInfoLabel
|
||||
//
|
||||
resources.ApplyResources(this.cacheStorageInUseInfoLabel, "cacheStorageInUseInfoLabel");
|
||||
this.tableLayoutPanel1.SetColumnSpan(this.cacheStorageInUseInfoLabel, 3);
|
||||
this.cacheStorageInUseInfoLabel.Name = "cacheStorageInUseInfoLabel";
|
||||
//
|
||||
// memoryOnlyInfoLabel
|
||||
//
|
||||
resources.ApplyResources(this.memoryOnlyInfoLabel, "memoryOnlyInfoLabel");
|
||||
@ -128,6 +139,13 @@ namespace XenAdmin.Dialogs
|
||||
this.memoryOnlyInfoIcon.Name = "memoryOnlyInfoIcon";
|
||||
this.memoryOnlyInfoIcon.TabStop = false;
|
||||
//
|
||||
// cacheStorageInUseInfoIcon
|
||||
//
|
||||
resources.ApplyResources(this.cacheStorageInUseInfoIcon, "cacheStorageInUseInfoIcon");
|
||||
this.cacheStorageInUseInfoIcon.Image = global::XenAdmin.Properties.Resources._000_Alert2_h32bit_16;
|
||||
this.cacheStorageInUseInfoIcon.Name = "cacheStorageInUseInfoIcon";
|
||||
this.cacheStorageInUseInfoIcon.TabStop = false;
|
||||
//
|
||||
// PvsCacheConfigurationPage
|
||||
//
|
||||
resources.ApplyResources(this, "$this");
|
||||
@ -139,6 +157,7 @@ namespace XenAdmin.Dialogs
|
||||
this.tableLayoutPanel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.pvsConfigInfoIcon)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.memoryOnlyInfoIcon)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.cacheStorageInUseInfoIcon)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@ -156,5 +175,7 @@ namespace XenAdmin.Dialogs
|
||||
private System.Windows.Forms.PictureBox pvsConfigInfoIcon;
|
||||
private System.Windows.Forms.Label memoryOnlyInfoLabel;
|
||||
private System.Windows.Forms.PictureBox memoryOnlyInfoIcon;
|
||||
private System.Windows.Forms.Label cacheStorageInUseInfoLabel;
|
||||
private System.Windows.Forms.PictureBox cacheStorageInUseInfoIcon;
|
||||
}
|
||||
}
|
||||
|
@ -88,6 +88,8 @@ namespace XenAdmin.Dialogs
|
||||
|
||||
LoadServers();
|
||||
viewPvsServersButton.Enabled = PvsSite != null && PvsSite.servers.Count > 0;
|
||||
cacheStorageInUseInfoIcon.Visible = cacheStorageInUseInfoLabel.Visible = rows.Any(row => row.ReadOnly);
|
||||
memoryOnlyInfoIcon.Visible = memoryOnlyInfoLabel.Visible = rows.Any(row => !row.ReadOnly);
|
||||
}
|
||||
|
||||
public bool ValidToSave
|
||||
|
@ -121,14 +121,50 @@
|
||||
<data name="tableLayoutPanel1.ColumnCount" type="System.Int32, mscorlib">
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="memoryOnlyInfoLabel.AutoSize" type="System.Boolean, mscorlib">
|
||||
<data name="cacheStorageInUseInfoLabel.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="memoryOnlyInfoLabel.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<data name="cacheStorageInUseInfoLabel.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Segoe UI, 9pt</value>
|
||||
</data>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="cacheStorageInUseInfoLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoLabel.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>22, 219</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoLabel.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>3, 3, 3, 3</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoLabel.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>357, 15</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoLabel.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>21</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoLabel.Text" xml:space="preserve">
|
||||
<value>The cache storage cannot be changed on servers where it is in use.</value>
|
||||
</data>
|
||||
<data name=">>cacheStorageInUseInfoLabel.Name" xml:space="preserve">
|
||||
<value>cacheStorageInUseInfoLabel</value>
|
||||
</data>
|
||||
<data name=">>cacheStorageInUseInfoLabel.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cacheStorageInUseInfoLabel.Parent" xml:space="preserve">
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>cacheStorageInUseInfoLabel.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="memoryOnlyInfoLabel.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<data name="memoryOnlyInfoLabel.Font" type="System.Drawing.Font, System.Drawing">
|
||||
<value>Segoe UI, 9pt</value>
|
||||
</data>
|
||||
<data name="memoryOnlyInfoLabel.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
@ -158,7 +194,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>memoryOnlyInfoLabel.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="deleteButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Right</value>
|
||||
@ -206,7 +242,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>deleteButton.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
<value>2</value>
|
||||
</data>
|
||||
<data name="label1.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Left, Right</value>
|
||||
@ -242,7 +278,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>label1.ZOrder" xml:space="preserve">
|
||||
<value>2</value>
|
||||
<value>3</value>
|
||||
</data>
|
||||
<data name="label7.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@ -281,7 +317,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>label7.ZOrder" xml:space="preserve">
|
||||
<value>3</value>
|
||||
<value>4</value>
|
||||
</data>
|
||||
<data name="textBox1.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>69, 13</value>
|
||||
@ -302,7 +338,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>textBox1.ZOrder" xml:space="preserve">
|
||||
<value>4</value>
|
||||
<value>5</value>
|
||||
</data>
|
||||
<data name="hostsPanel.AutoScroll" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@ -314,7 +350,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>3, 72</value>
|
||||
</data>
|
||||
<data name="hostsPanel.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>434, 163</value>
|
||||
<value>434, 141</value>
|
||||
</data>
|
||||
<data name="hostsPanel.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>4</value>
|
||||
@ -329,7 +365,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>hostsPanel.ZOrder" xml:space="preserve">
|
||||
<value>5</value>
|
||||
<value>6</value>
|
||||
</data>
|
||||
<data name="viewPvsServersButton.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Bottom, Right</value>
|
||||
@ -368,7 +404,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>viewPvsServersButton.ZOrder" xml:space="preserve">
|
||||
<value>6</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="pvsConfigInfoIcon.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Bottom, Left</value>
|
||||
@ -401,7 +437,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>pvsConfigInfoIcon.ZOrder" xml:space="preserve">
|
||||
<value>7</value>
|
||||
<value>8</value>
|
||||
</data>
|
||||
<data name="pvsConfigInfoLabel.AutoSize" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
@ -437,7 +473,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>pvsConfigInfoLabel.ZOrder" xml:space="preserve">
|
||||
<value>8</value>
|
||||
<value>9</value>
|
||||
</data>
|
||||
<data name="memoryOnlyInfoIcon.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Bottom, Left</value>
|
||||
@ -470,7 +506,40 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>memoryOnlyInfoIcon.ZOrder" xml:space="preserve">
|
||||
<value>9</value>
|
||||
<value>10</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoIcon.Anchor" type="System.Windows.Forms.AnchorStyles, System.Windows.Forms">
|
||||
<value>Top, Bottom, Left</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoIcon.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
|
||||
<value>NoControl</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoIcon.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>3, 219</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoIcon.Margin" type="System.Windows.Forms.Padding, System.Windows.Forms">
|
||||
<value>3, 3, 0, 3</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoIcon.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>16, 16</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoIcon.SizeMode" type="System.Windows.Forms.PictureBoxSizeMode, System.Windows.Forms">
|
||||
<value>AutoSize</value>
|
||||
</data>
|
||||
<data name="cacheStorageInUseInfoIcon.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>20</value>
|
||||
</data>
|
||||
<data name=">>cacheStorageInUseInfoIcon.Name" xml:space="preserve">
|
||||
<value>cacheStorageInUseInfoIcon</value>
|
||||
</data>
|
||||
<data name=">>cacheStorageInUseInfoIcon.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>cacheStorageInUseInfoIcon.Parent" xml:space="preserve">
|
||||
<value>tableLayoutPanel1</value>
|
||||
</data>
|
||||
<data name=">>cacheStorageInUseInfoIcon.ZOrder" xml:space="preserve">
|
||||
<value>11</value>
|
||||
</data>
|
||||
<data name="tableLayoutPanel1.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
@ -482,7 +551,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>0, 10, 0, 0</value>
|
||||
</data>
|
||||
<data name="tableLayoutPanel1.RowCount" type="System.Int32, mscorlib">
|
||||
<value>6</value>
|
||||
<value>7</value>
|
||||
</data>
|
||||
<data name="tableLayoutPanel1.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>440, 356</value>
|
||||
@ -503,7 +572,7 @@ If Memory only is chosen, the allowed cache size depends on the server's Control
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="tableLayoutPanel1.LayoutSettings" type="System.Windows.Forms.TableLayoutSettings, System.Windows.Forms">
|
||||
<value><?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="memoryOnlyInfoLabel" Row="3" RowSpan="1" Column="1" ColumnSpan="3" /><Control Name="deleteButton" Row="5" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="label1" Row="1" RowSpan="1" Column="0" ColumnSpan="4" /><Control Name="label7" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="textBox1" Row="0" RowSpan="1" Column="2" ColumnSpan="2" /><Control Name="hostsPanel" Row="2" RowSpan="1" Column="0" ColumnSpan="4" /><Control Name="viewPvsServersButton" Row="5" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pvsConfigInfoIcon" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="pvsConfigInfoLabel" Row="4" RowSpan="1" Column="1" ColumnSpan="3" /><Control Name="memoryOnlyInfoIcon" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,21,AutoSize,0,AutoSize,0,Absolute,20" /></TableLayoutSettings></value>
|
||||
<value><?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="cacheStorageInUseInfoLabel" Row="3" RowSpan="1" Column="1" ColumnSpan="3" /><Control Name="memoryOnlyInfoLabel" Row="4" RowSpan="1" Column="1" ColumnSpan="3" /><Control Name="deleteButton" Row="6" RowSpan="1" Column="4" ColumnSpan="1" /><Control Name="label1" Row="1" RowSpan="1" Column="0" ColumnSpan="4" /><Control Name="label7" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="textBox1" Row="0" RowSpan="1" Column="2" ColumnSpan="2" /><Control Name="hostsPanel" Row="2" RowSpan="1" Column="0" ColumnSpan="4" /><Control Name="viewPvsServersButton" Row="6" RowSpan="1" Column="2" ColumnSpan="1" /><Control Name="pvsConfigInfoIcon" Row="5" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="pvsConfigInfoLabel" Row="5" RowSpan="1" Column="1" ColumnSpan="3" /><Control Name="memoryOnlyInfoIcon" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="cacheStorageInUseInfoIcon" Row="3" RowSpan="1" Column="0" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,Percent,100,AutoSize,0,AutoSize,21,AutoSize,0,AutoSize,0" /></TableLayoutSettings></value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
|
9
XenModel/Messages.Designer.cs
generated
9
XenModel/Messages.Designer.cs
generated
@ -28192,6 +28192,15 @@ namespace XenAdmin {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to This PVS cache storage cannot be changed because it is in use..
|
||||
/// </summary>
|
||||
public static string PVS_CACHE_STORAGE_CANNOT_BE_CHANGED {
|
||||
get {
|
||||
return ResourceManager.GetString("PVS_CACHE_STORAGE_CANNOT_BE_CHANGED", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} (Incomplete Cache Storage configuration).
|
||||
/// </summary>
|
||||
|
@ -9799,6 +9799,9 @@ Press OK to continue the wizard and return to the server and follow the instruct
|
||||
<data name="PVS_CACHE_NOT_CONFIGURED" xml:space="preserve">
|
||||
<value>Not configured</value>
|
||||
</data>
|
||||
<data name="PVS_CACHE_STORAGE_CANNOT_BE_CHANGED" xml:space="preserve">
|
||||
<value>This PVS cache storage cannot be changed because it is in use.</value>
|
||||
</data>
|
||||
<data name="PVS_CACHE_STORAGE_NOT_CONFIGURED" xml:space="preserve">
|
||||
<value>{0} (Incomplete Cache Storage configuration)</value>
|
||||
</data>
|
||||
|
54
XenModel/XenAPI-Extensions/PVS_cache_storage.cs
Normal file
54
XenModel/XenAPI-Extensions/PVS_cache_storage.cs
Normal file
@ -0,0 +1,54 @@
|
||||
/* Copyright (c) Citrix Systems Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms,
|
||||
* with or without modification, are permitted provided
|
||||
* that the following conditions are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the
|
||||
* following disclaimer in the documentation and/or other
|
||||
* materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System.Linq;
|
||||
|
||||
namespace XenAPI
|
||||
{
|
||||
public partial class PVS_cache_storage
|
||||
{
|
||||
public bool IsInUse
|
||||
{
|
||||
get
|
||||
{
|
||||
foreach (var pvsProxy in Connection.Cache.PVS_proxies.Where(p => p.currently_attached))
|
||||
{
|
||||
var vm = pvsProxy.VM;
|
||||
if (vm != null && vm.resident_on != null && vm.resident_on.opaque_ref == host.opaque_ref &&
|
||||
pvsProxy.site != null && pvsProxy.site.opaque_ref == site.opaque_ref)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -330,6 +330,7 @@
|
||||
<Compile Include="WLB\WlbServerState.cs" />
|
||||
<Compile Include="XenAPI-Extensions\Blob.cs" />
|
||||
<Compile Include="XenAPI-Extensions\Pool_update.cs" />
|
||||
<Compile Include="XenAPI-Extensions\PVS_cache_storage.cs" />
|
||||
<Compile Include="XenAPI-Extensions\pvs_proxy_status.cs" />
|
||||
<Compile Include="XenAPI-Extensions\PVS_site.cs" />
|
||||
<Compile Include="XenAPI-Extensions\PVS_proxy.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user