From dea2749afa5a08429375dda01362a73f51c642b0 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Tue, 9 Aug 2016 11:12:34 +0100 Subject: [PATCH 1/4] CP-18407: Rename PVS farm to PVS site - New API bindings - Fixed usages of PVS_farm class Signed-off-by: Mihaela Stoica --- .../CollapsingPvsFarmServerDataGridViewRow.cs | 8 +- XenAdmin/Dialogs/PvsFarmDialog.cs | 6 +- XenAdmin/MainWindow.cs | 2 +- XenAdmin/TabPages/PvsPage.cs | 8 +- XenModel/Network/Cache.cs | 9 +- XenModel/Network/ICache.cs | 2 +- .../{PVS_farm.cs => PVS_site.cs} | 74 +- XenModel/XenAPI/FriendlyErrorNames.resx | 26 +- XenModel/XenAPI/PVS_cache_storage.cs | 319 ++++++ XenModel/XenAPI/PVS_proxy.cs | 890 ++++++++--------- XenModel/XenAPI/PVS_server.cs | 762 +++++++-------- XenModel/XenAPI/{PVS_farm.cs => PVS_site.cs} | 904 +++++++++--------- XenModel/XenAPI/Proxy.cs | 166 +++- XenModel/XenAPI/Relation.cs | 10 +- XenModel/XenAPI/VM.cs | 65 +- XenModel/XenModel.csproj | 5 +- 16 files changed, 1855 insertions(+), 1401 deletions(-) rename XenModel/XenAPI-Extensions/{PVS_farm.cs => PVS_site.cs} (94%) create mode 100644 XenModel/XenAPI/PVS_cache_storage.cs rename XenModel/XenAPI/{PVS_farm.cs => PVS_site.cs} (64%) diff --git a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridViewRow.cs b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridViewRow.cs index c71f56c3b..c2514cc2c 100644 --- a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridViewRow.cs +++ b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridViewRow.cs @@ -44,7 +44,7 @@ namespace XenAdmin.Controls.DataGridViewEx protected DataGridViewTextBoxCell lastPortCell; protected bool isPvsFarmRow; - public CollapsingPvsFarmServerDataGridViewRow(PVS_farm farm) + public CollapsingPvsFarmServerDataGridViewRow(PVS_site farm) { Tag = farm; isPvsFarmRow = true; @@ -81,7 +81,7 @@ namespace XenAdmin.Controls.DataGridViewEx { if (isPvsFarmRow) { - PVS_farm farm = (PVS_farm)Tag; + PVS_site farm = (PVS_site)Tag; if (farm.servers.Count == 0) SetNoIcon(); @@ -112,9 +112,9 @@ namespace XenAdmin.Controls.DataGridViewEx get { return !isPvsFarmRow; } } - public PVS_farm UnderlyingFarm + public PVS_site UnderlyingFarm { - get { return Tag as PVS_farm; } + get { return Tag as PVS_site; } } public PVS_server UnderlyingServer diff --git a/XenAdmin/Dialogs/PvsFarmDialog.cs b/XenAdmin/Dialogs/PvsFarmDialog.cs index ba01ea45c..a53c2c0ff 100644 --- a/XenAdmin/Dialogs/PvsFarmDialog.cs +++ b/XenAdmin/Dialogs/PvsFarmDialog.cs @@ -62,13 +62,13 @@ namespace XenAdmin.Dialogs private void RegisterEventHandlers() { UnregisterEventHandlers(); - connection.Cache.RegisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); + connection.Cache.RegisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); connection.Cache.RegisterBatchCollectionChanged(PvsServerBatchCollectionChanged); } private void UnregisterEventHandlers() { - connection.Cache.DeregisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); + connection.Cache.DeregisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); connection.Cache.DeregisterBatchCollectionChanged(PvsServerBatchCollectionChanged); } @@ -98,7 +98,7 @@ namespace XenAdmin.Dialogs gridView.SuspendLayout(); gridView.Rows.Clear(); - var pvsFarms = connection.Cache.PVS_farms.ToList(); + var pvsFarms = connection.Cache.PVS_sites.ToList(); pvsFarms.Sort(); foreach (var pvsFarm in pvsFarms) diff --git a/XenAdmin/MainWindow.cs b/XenAdmin/MainWindow.cs index dc45c994e..8abf839b2 100644 --- a/XenAdmin/MainWindow.cs +++ b/XenAdmin/MainWindow.cs @@ -1427,7 +1427,7 @@ namespace XenAdmin ShowTab(ad_upsell ? TabPageADUpsell : TabPageAD, !multi && !SearchMode && (isPoolSelected || isHostSelected && isHostLive)); - bool hasPvsFarms = selectionConnection != null && selectionConnection.Cache.PVS_farms.Length > 0; + bool hasPvsFarms = selectionConnection != null && selectionConnection.Cache.PVS_sites.Length > 0; ShowTab(TabPagePvs, !multi && !SearchMode && isPoolOrLiveStandaloneHost && hasPvsFarms && !Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictPvsCache)); foreach (TabPageFeature f in pluginManager.GetAllFeatures(f => !f.IsConsoleReplacement && !multi && f.ShowTab)) diff --git a/XenAdmin/TabPages/PvsPage.cs b/XenAdmin/TabPages/PvsPage.cs index 1069eb34f..2410022ea 100644 --- a/XenAdmin/TabPages/PvsPage.cs +++ b/XenAdmin/TabPages/PvsPage.cs @@ -61,7 +61,7 @@ namespace XenAdmin.TabPages { if (connection != null) { - connection.Cache.DeregisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); + connection.Cache.DeregisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); connection.Cache.DeregisterBatchCollectionChanged(PvsProxyBatchCollectionChanged); } @@ -69,7 +69,7 @@ namespace XenAdmin.TabPages if (connection != null) { - connection.Cache.RegisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); + connection.Cache.RegisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); connection.Cache.RegisterBatchCollectionChanged(PvsProxyBatchCollectionChanged); } @@ -92,7 +92,7 @@ namespace XenAdmin.TabPages var rowList = new List(); - foreach (var pvsFarm in Connection.Cache.PVS_farms) + foreach (var pvsFarm in Connection.Cache.PVS_sites) rowList.Add(NewPvsFarmRow(pvsFarm)); dataGridViewFarms.Rows.AddRange(rowList.ToArray()); @@ -132,7 +132,7 @@ namespace XenAdmin.TabPages } } - private DataGridViewRow NewPvsFarmRow(PVS_farm pvsFarm) + private DataGridViewRow NewPvsFarmRow(PVS_site pvsFarm) { var farmCell = new DataGridViewTextBoxCell {Value = pvsFarm.name}; var configurationCell = new DataGridViewTextBoxCell diff --git a/XenModel/Network/Cache.cs b/XenModel/Network/Cache.cs index f578b7fa3..22430c0f9 100644 --- a/XenModel/Network/Cache.cs +++ b/XenModel/Network/Cache.cs @@ -67,9 +67,10 @@ namespace XenAdmin.Network private readonly ChangeableDictionary, PIF_metrics> _pif_metrics = new ChangeableDictionary, PIF_metrics>(); private readonly ChangeableDictionary, Pool> _pool = new ChangeableDictionary, Pool>(); private readonly ChangeableDictionary, Pool_patch> _pool_patch = new ChangeableDictionary, Pool_patch>(); - private readonly ChangeableDictionary, PVS_farm> _pvs_farm = new ChangeableDictionary, PVS_farm>(); - private readonly ChangeableDictionary, PVS_server> _pvs_server = new ChangeableDictionary, PVS_server>(); + private readonly ChangeableDictionary, PVS_cache_storage> _pvs_cache_storage = new ChangeableDictionary, PVS_cache_storage>(); private readonly ChangeableDictionary, PVS_proxy> _pvs_proxy = new ChangeableDictionary, PVS_proxy>(); + private readonly ChangeableDictionary, PVS_server> _pvs_server = new ChangeableDictionary, PVS_server>(); + private readonly ChangeableDictionary, PVS_site> _pvs_site = new ChangeableDictionary, PVS_site>(); private readonly ChangeableDictionary, Role> _role = new ChangeableDictionary, Role>(); private readonly ChangeableDictionary, SM> _sm = new ChangeableDictionary, SM>(); private readonly ChangeableDictionary, SR> _sr = new ChangeableDictionary, SR>(); @@ -193,9 +194,9 @@ namespace XenAdmin.Network get { return contents(_pool_patch); } } - public PVS_farm[] PVS_farms + public PVS_site[] PVS_sites { - get { return contents(_pvs_farm); } + get { return contents(_pvs_site); } } public PVS_server[] PVS_servers diff --git a/XenModel/Network/ICache.cs b/XenModel/Network/ICache.cs index 5d1d48f20..43b53707f 100644 --- a/XenModel/Network/ICache.cs +++ b/XenModel/Network/ICache.cs @@ -82,7 +82,7 @@ namespace XenAdmin.Network VM[] VMs { get; } IEnumerable XenSearchableObjects { get; } DockerContainer[] DockerContainers { get; } - PVS_farm[] PVS_farms { get; } + PVS_site[] PVS_sites { get; } PVS_server[] PVS_servers { get; } PVS_proxy[] PVS_proxies { get; } void UpdateDockerContainersForVM(IList d, VM v); diff --git a/XenModel/XenAPI-Extensions/PVS_farm.cs b/XenModel/XenAPI-Extensions/PVS_site.cs similarity index 94% rename from XenModel/XenAPI-Extensions/PVS_farm.cs rename to XenModel/XenAPI-Extensions/PVS_site.cs index f8aa75ce9..736a4d1b0 100644 --- a/XenModel/XenAPI-Extensions/PVS_farm.cs +++ b/XenModel/XenAPI-Extensions/PVS_site.cs @@ -1,40 +1,40 @@ -/* - * 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: - * - * 1) Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2) 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. - */ - -namespace XenAPI -{ - public partial class PVS_farm : XenObject - { +/* + * 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: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) 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. + */ + +namespace XenAPI +{ + public partial class PVS_site : XenObject + { public override string Name { get { return name; } - } - } -} + } + } +} diff --git a/XenModel/XenAPI/FriendlyErrorNames.resx b/XenModel/XenAPI/FriendlyErrorNames.resx index 4a0be547a..34072c6ab 100644 --- a/XenModel/XenAPI/FriendlyErrorNames.resx +++ b/XenModel/XenAPI/FriendlyErrorNames.resx @@ -861,17 +861,17 @@ The provision call can only be invoked on templates, not regular VMs. - - The PVS farm contains running proxies. + + The PVS site contains running proxies. - - The PVS farm contains servers and cannot be forgotten. + + The PVS site contains servers and cannot be forgotten. - - Trying to add a cache SR that is already associated with the farm + + Trying to add a cache SR that is already associated with the site - - The SR is in use by the farm and cannot be removed. + + The SR is in use by the site and cannot be removed. Your current role is not authorized to perform this action. @@ -1526,8 +1526,8 @@ Authorized Roles: {1} The SR operation cannot be performed because the SR is not empty. - - The SR is not associated with the farm. + + The SR is not associated with the site. SR is not sharable @@ -1697,6 +1697,9 @@ Authorized Roles: {1} This VIF was not mapped to a destination network + + Operation cannot be performed because this VLAN is already in use. Please check your network configuration. + You tried to create a VLAN, but the tag you gave ({0}) was invalid -- it must be between 0 and 4094. @@ -1772,6 +1775,9 @@ Authorized Roles: {1} The host does not have some of the CPU features that the VM is currently using + + The VM is configured in a way that prevents it from being mobile. + The VM cannot be recovered on its own as it is part of a VM appliance. diff --git a/XenModel/XenAPI/PVS_cache_storage.cs b/XenModel/XenAPI/PVS_cache_storage.cs new file mode 100644 index 000000000..ea924e3fd --- /dev/null +++ b/XenModel/XenAPI/PVS_cache_storage.cs @@ -0,0 +1,319 @@ +/* + * 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: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) 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; +using System.Collections; +using System.Collections.Generic; + +using CookComputing.XmlRpc; + + +namespace XenAPI +{ + /// + /// Describes the storage that is available to a PVS site for caching purposes + /// + public partial class PVS_cache_storage : XenObject + { + public PVS_cache_storage() + { + } + + public PVS_cache_storage(string uuid, + XenRef site, + XenRef SR, + long size) + { + this.uuid = uuid; + this.site = site; + this.SR = SR; + this.size = size; + } + + /// + /// Creates a new PVS_cache_storage from a Proxy_PVS_cache_storage. + /// + /// + public PVS_cache_storage(Proxy_PVS_cache_storage proxy) + { + this.UpdateFromProxy(proxy); + } + + public override void UpdateFrom(PVS_cache_storage update) + { + uuid = update.uuid; + site = update.site; + SR = update.SR; + size = update.size; + } + + internal void UpdateFromProxy(Proxy_PVS_cache_storage proxy) + { + uuid = proxy.uuid == null ? null : (string)proxy.uuid; + site = proxy.site == null ? null : XenRef.Create(proxy.site); + SR = proxy.SR == null ? null : XenRef.Create(proxy.SR); + size = proxy.size == null ? 0 : long.Parse((string)proxy.size); + } + + public Proxy_PVS_cache_storage ToProxy() + { + Proxy_PVS_cache_storage result_ = new Proxy_PVS_cache_storage(); + result_.uuid = (uuid != null) ? uuid : ""; + result_.site = (site != null) ? site : ""; + result_.SR = (SR != null) ? SR : ""; + result_.size = size.ToString(); + return result_; + } + + /// + /// Creates a new PVS_cache_storage from a Hashtable. + /// + /// + public PVS_cache_storage(Hashtable table) + { + uuid = Marshalling.ParseString(table, "uuid"); + site = Marshalling.ParseRef(table, "site"); + SR = Marshalling.ParseRef(table, "SR"); + size = Marshalling.ParseLong(table, "size"); + } + + public bool DeepEquals(PVS_cache_storage other) + { + if (ReferenceEquals(null, other)) + return false; + if (ReferenceEquals(this, other)) + return true; + + return Helper.AreEqual2(this._uuid, other._uuid) && + Helper.AreEqual2(this._site, other._site) && + Helper.AreEqual2(this._SR, other._SR) && + Helper.AreEqual2(this._size, other._size); + } + + public override string SaveChanges(Session session, string opaqueRef, PVS_cache_storage server) + { + if (opaqueRef == null) + { + Proxy_PVS_cache_storage p = this.ToProxy(); + return session.proxy.pvs_cache_storage_create(session.uuid, p).parse(); + } + else + { + throw new InvalidOperationException("This type has no read/write properties"); + } + } + /// + /// Get a record containing the current state of the given PVS_cache_storage. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_cache_storage + public static PVS_cache_storage get_record(Session session, string _pvs_cache_storage) + { + return new PVS_cache_storage((Proxy_PVS_cache_storage)session.proxy.pvs_cache_storage_get_record(session.uuid, (_pvs_cache_storage != null) ? _pvs_cache_storage : "").parse()); + } + + /// + /// Get a reference to the PVS_cache_storage instance with the specified UUID. + /// Experimental. First published in . + /// + /// The session + /// UUID of object to return + public static XenRef get_by_uuid(Session session, string _uuid) + { + return XenRef.Create(session.proxy.pvs_cache_storage_get_by_uuid(session.uuid, (_uuid != null) ? _uuid : "").parse()); + } + + /// + /// Create a new PVS_cache_storage instance, and return its handle. + /// Experimental. First published in . + /// + /// The session + /// All constructor arguments + public static XenRef create(Session session, PVS_cache_storage _record) + { + return XenRef.Create(session.proxy.pvs_cache_storage_create(session.uuid, _record.ToProxy()).parse()); + } + + /// + /// Create a new PVS_cache_storage instance, and return its handle. + /// Experimental. First published in . + /// + /// The session + /// All constructor arguments + public static XenRef async_create(Session session, PVS_cache_storage _record) + { + return XenRef.Create(session.proxy.async_pvs_cache_storage_create(session.uuid, _record.ToProxy()).parse()); + } + + /// + /// Destroy the specified PVS_cache_storage instance. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_cache_storage + public static void destroy(Session session, string _pvs_cache_storage) + { + session.proxy.pvs_cache_storage_destroy(session.uuid, (_pvs_cache_storage != null) ? _pvs_cache_storage : "").parse(); + } + + /// + /// Destroy the specified PVS_cache_storage instance. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_cache_storage + public static XenRef async_destroy(Session session, string _pvs_cache_storage) + { + return XenRef.Create(session.proxy.async_pvs_cache_storage_destroy(session.uuid, (_pvs_cache_storage != null) ? _pvs_cache_storage : "").parse()); + } + + /// + /// Get the uuid field of the given PVS_cache_storage. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_cache_storage + public static string get_uuid(Session session, string _pvs_cache_storage) + { + return (string)session.proxy.pvs_cache_storage_get_uuid(session.uuid, (_pvs_cache_storage != null) ? _pvs_cache_storage : "").parse(); + } + + /// + /// Get the site field of the given PVS_cache_storage. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_cache_storage + public static XenRef get_site(Session session, string _pvs_cache_storage) + { + return XenRef.Create(session.proxy.pvs_cache_storage_get_site(session.uuid, (_pvs_cache_storage != null) ? _pvs_cache_storage : "").parse()); + } + + /// + /// Get the SR field of the given PVS_cache_storage. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_cache_storage + public static XenRef get_SR(Session session, string _pvs_cache_storage) + { + return XenRef.Create(session.proxy.pvs_cache_storage_get_sr(session.uuid, (_pvs_cache_storage != null) ? _pvs_cache_storage : "").parse()); + } + + /// + /// Get the size field of the given PVS_cache_storage. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_cache_storage + public static long get_size(Session session, string _pvs_cache_storage) + { + return long.Parse((string)session.proxy.pvs_cache_storage_get_size(session.uuid, (_pvs_cache_storage != null) ? _pvs_cache_storage : "").parse()); + } + + /// + /// Unique identifier/object reference + /// Experimental. First published in . + /// + public virtual string uuid + { + get { return _uuid; } + set + { + if (!Helper.AreEqual(value, _uuid)) + { + _uuid = value; + Changed = true; + NotifyPropertyChanged("uuid"); + } + } + } + private string _uuid; + + /// + /// PVS site this proxy is part of + /// Experimental. First published in . + /// + public virtual XenRef site + { + get { return _site; } + set + { + if (!Helper.AreEqual(value, _site)) + { + _site = value; + Changed = true; + NotifyPropertyChanged("site"); + } + } + } + private XenRef _site; + + /// + /// SR providing storage for the PVS cache + /// Experimental. First published in . + /// + public virtual XenRef SR + { + get { return _SR; } + set + { + if (!Helper.AreEqual(value, _SR)) + { + _SR = value; + Changed = true; + NotifyPropertyChanged("SR"); + } + } + } + private XenRef _SR; + + /// + /// The size of the cache VDI (in bytes) + /// Experimental. First published in . + /// + public virtual long size + { + get { return _size; } + set + { + if (!Helper.AreEqual(value, _size)) + { + _size = value; + Changed = true; + NotifyPropertyChanged("size"); + } + } + } + private long _size; + } +} diff --git a/XenModel/XenAPI/PVS_proxy.cs b/XenModel/XenAPI/PVS_proxy.cs index c8361fab1..e4091eec5 100644 --- a/XenModel/XenAPI/PVS_proxy.cs +++ b/XenModel/XenAPI/PVS_proxy.cs @@ -1,445 +1,445 @@ -/* - * 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: - * - * 1) Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2) 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; -using System.Collections; -using System.Collections.Generic; - -using CookComputing.XmlRpc; - - -namespace XenAPI -{ - /// - /// a proxy connects a VM/VIF with a PVS farm - /// - public partial class PVS_proxy : XenObject - { - public PVS_proxy() - { - } - - public PVS_proxy(string uuid, - XenRef farm, - XenRef VIF, - bool prepopulate, - bool currently_attached, - XenRef cache_SR) - { - this.uuid = uuid; - this.farm = farm; - this.VIF = VIF; - this.prepopulate = prepopulate; - this.currently_attached = currently_attached; - this.cache_SR = cache_SR; - } - - /// - /// Creates a new PVS_proxy from a Proxy_PVS_proxy. - /// - /// - public PVS_proxy(Proxy_PVS_proxy proxy) - { - this.UpdateFromProxy(proxy); - } - - public override void UpdateFrom(PVS_proxy update) - { - uuid = update.uuid; - farm = update.farm; - VIF = update.VIF; - prepopulate = update.prepopulate; - currently_attached = update.currently_attached; - cache_SR = update.cache_SR; - } - - internal void UpdateFromProxy(Proxy_PVS_proxy proxy) - { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - farm = proxy.farm == null ? null : XenRef.Create(proxy.farm); - VIF = proxy.VIF == null ? null : XenRef.Create(proxy.VIF); - prepopulate = (bool)proxy.prepopulate; - currently_attached = (bool)proxy.currently_attached; - cache_SR = proxy.cache_SR == null ? null : XenRef.Create(proxy.cache_SR); - } - - public Proxy_PVS_proxy ToProxy() - { - Proxy_PVS_proxy result_ = new Proxy_PVS_proxy(); - result_.uuid = (uuid != null) ? uuid : ""; - result_.farm = (farm != null) ? farm : ""; - result_.VIF = (VIF != null) ? VIF : ""; - result_.prepopulate = prepopulate; - result_.currently_attached = currently_attached; - result_.cache_SR = (cache_SR != null) ? cache_SR : ""; - return result_; - } - - /// - /// Creates a new PVS_proxy from a Hashtable. - /// - /// - public PVS_proxy(Hashtable table) - { - uuid = Marshalling.ParseString(table, "uuid"); - farm = Marshalling.ParseRef(table, "farm"); - VIF = Marshalling.ParseRef(table, "VIF"); - prepopulate = Marshalling.ParseBool(table, "prepopulate"); - currently_attached = Marshalling.ParseBool(table, "currently_attached"); - cache_SR = Marshalling.ParseRef(table, "cache_SR"); - } - - public bool DeepEquals(PVS_proxy other) - { - if (ReferenceEquals(null, other)) - return false; - if (ReferenceEquals(this, other)) - return true; - - return Helper.AreEqual2(this._uuid, other._uuid) && - Helper.AreEqual2(this._farm, other._farm) && - Helper.AreEqual2(this._VIF, other._VIF) && - Helper.AreEqual2(this._prepopulate, other._prepopulate) && - Helper.AreEqual2(this._currently_attached, other._currently_attached) && - Helper.AreEqual2(this._cache_SR, other._cache_SR); - } - - public override string SaveChanges(Session session, string opaqueRef, PVS_proxy server) - { - if (opaqueRef == null) - { - System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server"); - return ""; - } - else - { - if (!Helper.AreEqual2(_prepopulate, server._prepopulate)) - { - PVS_proxy.set_prepopulate(session, opaqueRef, _prepopulate); - } - - return null; - } - } - /// - /// Get a record containing the current state of the given PVS_proxy. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - public static PVS_proxy get_record(Session session, string _pvs_proxy) - { - return new PVS_proxy((Proxy_PVS_proxy)session.proxy.pvs_proxy_get_record(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); - } - - /// - /// Get a reference to the PVS_proxy instance with the specified UUID. - /// Experimental. First published in . - /// - /// The session - /// UUID of object to return - public static XenRef get_by_uuid(Session session, string _uuid) - { - return XenRef.Create(session.proxy.pvs_proxy_get_by_uuid(session.uuid, (_uuid != null) ? _uuid : "").parse()); - } - - /// - /// Get the uuid field of the given PVS_proxy. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - public static string get_uuid(Session session, string _pvs_proxy) - { - return (string)session.proxy.pvs_proxy_get_uuid(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse(); - } - - /// - /// Get the farm field of the given PVS_proxy. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - public static XenRef get_farm(Session session, string _pvs_proxy) - { - return XenRef.Create(session.proxy.pvs_proxy_get_farm(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); - } - - /// - /// Get the VIF field of the given PVS_proxy. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - public static XenRef get_VIF(Session session, string _pvs_proxy) - { - return XenRef.Create(session.proxy.pvs_proxy_get_vif(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); - } - - /// - /// Get the prepopulate field of the given PVS_proxy. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - public static bool get_prepopulate(Session session, string _pvs_proxy) - { - return (bool)session.proxy.pvs_proxy_get_prepopulate(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse(); - } - - /// - /// Get the currently_attached field of the given PVS_proxy. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - public static bool get_currently_attached(Session session, string _pvs_proxy) - { - return (bool)session.proxy.pvs_proxy_get_currently_attached(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse(); - } - - /// - /// Get the cache_SR field of the given PVS_proxy. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - public static XenRef get_cache_SR(Session session, string _pvs_proxy) - { - return XenRef.Create(session.proxy.pvs_proxy_get_cache_sr(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); - } - - /// - /// Configure a VM/VIF to use a PVS proxy - /// Experimental. First published in . - /// - /// The session - /// PVS farm that we proxy for - /// VIF for the VM that needs to be proxied - /// if true, prefetch whole disk for VM - public static XenRef create(Session session, string _farm, string _vif, bool _prepopulate) - { - return XenRef.Create(session.proxy.pvs_proxy_create(session.uuid, (_farm != null) ? _farm : "", (_vif != null) ? _vif : "", _prepopulate).parse()); - } - - /// - /// Configure a VM/VIF to use a PVS proxy - /// Experimental. First published in . - /// - /// The session - /// PVS farm that we proxy for - /// VIF for the VM that needs to be proxied - /// if true, prefetch whole disk for VM - public static XenRef async_create(Session session, string _farm, string _vif, bool _prepopulate) - { - return XenRef.Create(session.proxy.async_pvs_proxy_create(session.uuid, (_farm != null) ? _farm : "", (_vif != null) ? _vif : "", _prepopulate).parse()); - } - - /// - /// remove (or switch off) a PVS proxy for this VM - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - public static void destroy(Session session, string _pvs_proxy) - { - session.proxy.pvs_proxy_destroy(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse(); - } - - /// - /// remove (or switch off) a PVS proxy for this VM - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - public static XenRef async_destroy(Session session, string _pvs_proxy) - { - return XenRef.Create(session.proxy.async_pvs_proxy_destroy(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); - } - - /// - /// change the value of the prepopulate field - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - /// set to this value - public static void set_prepopulate(Session session, string _pvs_proxy, bool _value) - { - session.proxy.pvs_proxy_set_prepopulate(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "", _value).parse(); - } - - /// - /// change the value of the prepopulate field - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_proxy - /// set to this value - public static XenRef async_set_prepopulate(Session session, string _pvs_proxy, bool _value) - { - return XenRef.Create(session.proxy.async_pvs_proxy_set_prepopulate(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "", _value).parse()); - } - - /// - /// Return a list of all the PVS_proxys known to the system. - /// Experimental. First published in . - /// - /// The session - public static List> get_all(Session session) - { - return XenRef.Create(session.proxy.pvs_proxy_get_all(session.uuid).parse()); - } - - /// - /// Get all the PVS_proxy Records at once, in a single XML RPC call - /// - /// The session - public static Dictionary, PVS_proxy> get_all_records(Session session) - { - return XenRef.Create(session.proxy.pvs_proxy_get_all_records(session.uuid).parse()); - } - - /// - /// Unique identifier/object reference - /// Experimental. First published in . - /// - public virtual string uuid - { - get { return _uuid; } - set - { - if (!Helper.AreEqual(value, _uuid)) - { - _uuid = value; - Changed = true; - NotifyPropertyChanged("uuid"); - } - } - } - private string _uuid; - - /// - /// PVS farm this proxy is part of - /// Experimental. First published in . - /// - public virtual XenRef farm - { - get { return _farm; } - set - { - if (!Helper.AreEqual(value, _farm)) - { - _farm = value; - Changed = true; - NotifyPropertyChanged("farm"); - } - } - } - private XenRef _farm; - - /// - /// VIF of the VM using the proxy - /// Experimental. First published in . - /// - public virtual XenRef VIF - { - get { return _VIF; } - set - { - if (!Helper.AreEqual(value, _VIF)) - { - _VIF = value; - Changed = true; - NotifyPropertyChanged("VIF"); - } - } - } - private XenRef _VIF; - - /// - /// true = proxy prefetches whole disk for the VM - /// Experimental. First published in . - /// - public virtual bool prepopulate - { - get { return _prepopulate; } - set - { - if (!Helper.AreEqual(value, _prepopulate)) - { - _prepopulate = value; - Changed = true; - NotifyPropertyChanged("prepopulate"); - } - } - } - private bool _prepopulate; - - /// - /// true = VM is currently proxied - /// Experimental. First published in . - /// - public virtual bool currently_attached - { - get { return _currently_attached; } - set - { - if (!Helper.AreEqual(value, _currently_attached)) - { - _currently_attached = value; - Changed = true; - NotifyPropertyChanged("currently_attached"); - } - } - } - private bool _currently_attached; - - /// - /// SR used by this proxy - /// Experimental. First published in . - /// - public virtual XenRef cache_SR - { - get { return _cache_SR; } - set - { - if (!Helper.AreEqual(value, _cache_SR)) - { - _cache_SR = value; - Changed = true; - NotifyPropertyChanged("cache_SR"); - } - } - } - private XenRef _cache_SR; - } -} +/* + * 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: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) 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; +using System.Collections; +using System.Collections.Generic; + +using CookComputing.XmlRpc; + + +namespace XenAPI +{ + /// + /// a proxy connects a VM/VIF with a PVS site + /// + public partial class PVS_proxy : XenObject + { + public PVS_proxy() + { + } + + public PVS_proxy(string uuid, + XenRef site, + XenRef VIF, + bool prepopulate, + bool currently_attached, + XenRef cache_SR) + { + this.uuid = uuid; + this.site = site; + this.VIF = VIF; + this.prepopulate = prepopulate; + this.currently_attached = currently_attached; + this.cache_SR = cache_SR; + } + + /// + /// Creates a new PVS_proxy from a Proxy_PVS_proxy. + /// + /// + public PVS_proxy(Proxy_PVS_proxy proxy) + { + this.UpdateFromProxy(proxy); + } + + public override void UpdateFrom(PVS_proxy update) + { + uuid = update.uuid; + site = update.site; + VIF = update.VIF; + prepopulate = update.prepopulate; + currently_attached = update.currently_attached; + cache_SR = update.cache_SR; + } + + internal void UpdateFromProxy(Proxy_PVS_proxy proxy) + { + uuid = proxy.uuid == null ? null : (string)proxy.uuid; + site = proxy.site == null ? null : XenRef.Create(proxy.site); + VIF = proxy.VIF == null ? null : XenRef.Create(proxy.VIF); + prepopulate = (bool)proxy.prepopulate; + currently_attached = (bool)proxy.currently_attached; + cache_SR = proxy.cache_SR == null ? null : XenRef.Create(proxy.cache_SR); + } + + public Proxy_PVS_proxy ToProxy() + { + Proxy_PVS_proxy result_ = new Proxy_PVS_proxy(); + result_.uuid = (uuid != null) ? uuid : ""; + result_.site = (site != null) ? site : ""; + result_.VIF = (VIF != null) ? VIF : ""; + result_.prepopulate = prepopulate; + result_.currently_attached = currently_attached; + result_.cache_SR = (cache_SR != null) ? cache_SR : ""; + return result_; + } + + /// + /// Creates a new PVS_proxy from a Hashtable. + /// + /// + public PVS_proxy(Hashtable table) + { + uuid = Marshalling.ParseString(table, "uuid"); + site = Marshalling.ParseRef(table, "site"); + VIF = Marshalling.ParseRef(table, "VIF"); + prepopulate = Marshalling.ParseBool(table, "prepopulate"); + currently_attached = Marshalling.ParseBool(table, "currently_attached"); + cache_SR = Marshalling.ParseRef(table, "cache_SR"); + } + + public bool DeepEquals(PVS_proxy other) + { + if (ReferenceEquals(null, other)) + return false; + if (ReferenceEquals(this, other)) + return true; + + return Helper.AreEqual2(this._uuid, other._uuid) && + Helper.AreEqual2(this._site, other._site) && + Helper.AreEqual2(this._VIF, other._VIF) && + Helper.AreEqual2(this._prepopulate, other._prepopulate) && + Helper.AreEqual2(this._currently_attached, other._currently_attached) && + Helper.AreEqual2(this._cache_SR, other._cache_SR); + } + + public override string SaveChanges(Session session, string opaqueRef, PVS_proxy server) + { + if (opaqueRef == null) + { + System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server"); + return ""; + } + else + { + if (!Helper.AreEqual2(_prepopulate, server._prepopulate)) + { + PVS_proxy.set_prepopulate(session, opaqueRef, _prepopulate); + } + + return null; + } + } + /// + /// Get a record containing the current state of the given PVS_proxy. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + public static PVS_proxy get_record(Session session, string _pvs_proxy) + { + return new PVS_proxy((Proxy_PVS_proxy)session.proxy.pvs_proxy_get_record(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); + } + + /// + /// Get a reference to the PVS_proxy instance with the specified UUID. + /// Experimental. First published in . + /// + /// The session + /// UUID of object to return + public static XenRef get_by_uuid(Session session, string _uuid) + { + return XenRef.Create(session.proxy.pvs_proxy_get_by_uuid(session.uuid, (_uuid != null) ? _uuid : "").parse()); + } + + /// + /// Get the uuid field of the given PVS_proxy. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + public static string get_uuid(Session session, string _pvs_proxy) + { + return (string)session.proxy.pvs_proxy_get_uuid(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse(); + } + + /// + /// Get the site field of the given PVS_proxy. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + public static XenRef get_site(Session session, string _pvs_proxy) + { + return XenRef.Create(session.proxy.pvs_proxy_get_site(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); + } + + /// + /// Get the VIF field of the given PVS_proxy. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + public static XenRef get_VIF(Session session, string _pvs_proxy) + { + return XenRef.Create(session.proxy.pvs_proxy_get_vif(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); + } + + /// + /// Get the prepopulate field of the given PVS_proxy. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + public static bool get_prepopulate(Session session, string _pvs_proxy) + { + return (bool)session.proxy.pvs_proxy_get_prepopulate(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse(); + } + + /// + /// Get the currently_attached field of the given PVS_proxy. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + public static bool get_currently_attached(Session session, string _pvs_proxy) + { + return (bool)session.proxy.pvs_proxy_get_currently_attached(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse(); + } + + /// + /// Get the cache_SR field of the given PVS_proxy. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + public static XenRef get_cache_SR(Session session, string _pvs_proxy) + { + return XenRef.Create(session.proxy.pvs_proxy_get_cache_sr(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); + } + + /// + /// Configure a VM/VIF to use a PVS proxy + /// Experimental. First published in . + /// + /// The session + /// PVS site that we proxy for + /// VIF for the VM that needs to be proxied + /// if true, prefetch whole disk for VM + public static XenRef create(Session session, string _site, string _vif, bool _prepopulate) + { + return XenRef.Create(session.proxy.pvs_proxy_create(session.uuid, (_site != null) ? _site : "", (_vif != null) ? _vif : "", _prepopulate).parse()); + } + + /// + /// Configure a VM/VIF to use a PVS proxy + /// Experimental. First published in . + /// + /// The session + /// PVS site that we proxy for + /// VIF for the VM that needs to be proxied + /// if true, prefetch whole disk for VM + public static XenRef async_create(Session session, string _site, string _vif, bool _prepopulate) + { + return XenRef.Create(session.proxy.async_pvs_proxy_create(session.uuid, (_site != null) ? _site : "", (_vif != null) ? _vif : "", _prepopulate).parse()); + } + + /// + /// remove (or switch off) a PVS proxy for this VM + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + public static void destroy(Session session, string _pvs_proxy) + { + session.proxy.pvs_proxy_destroy(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse(); + } + + /// + /// remove (or switch off) a PVS proxy for this VM + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + public static XenRef async_destroy(Session session, string _pvs_proxy) + { + return XenRef.Create(session.proxy.async_pvs_proxy_destroy(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "").parse()); + } + + /// + /// change the value of the prepopulate field + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + /// set to this value + public static void set_prepopulate(Session session, string _pvs_proxy, bool _value) + { + session.proxy.pvs_proxy_set_prepopulate(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "", _value).parse(); + } + + /// + /// change the value of the prepopulate field + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_proxy + /// set to this value + public static XenRef async_set_prepopulate(Session session, string _pvs_proxy, bool _value) + { + return XenRef.Create(session.proxy.async_pvs_proxy_set_prepopulate(session.uuid, (_pvs_proxy != null) ? _pvs_proxy : "", _value).parse()); + } + + /// + /// Return a list of all the PVS_proxys known to the system. + /// Experimental. First published in . + /// + /// The session + public static List> get_all(Session session) + { + return XenRef.Create(session.proxy.pvs_proxy_get_all(session.uuid).parse()); + } + + /// + /// Get all the PVS_proxy Records at once, in a single XML RPC call + /// + /// The session + public static Dictionary, PVS_proxy> get_all_records(Session session) + { + return XenRef.Create(session.proxy.pvs_proxy_get_all_records(session.uuid).parse()); + } + + /// + /// Unique identifier/object reference + /// Experimental. First published in . + /// + public virtual string uuid + { + get { return _uuid; } + set + { + if (!Helper.AreEqual(value, _uuid)) + { + _uuid = value; + Changed = true; + NotifyPropertyChanged("uuid"); + } + } + } + private string _uuid; + + /// + /// PVS site this proxy is part of + /// Experimental. First published in . + /// + public virtual XenRef site + { + get { return _site; } + set + { + if (!Helper.AreEqual(value, _site)) + { + _site = value; + Changed = true; + NotifyPropertyChanged("site"); + } + } + } + private XenRef _site; + + /// + /// VIF of the VM using the proxy + /// Experimental. First published in . + /// + public virtual XenRef VIF + { + get { return _VIF; } + set + { + if (!Helper.AreEqual(value, _VIF)) + { + _VIF = value; + Changed = true; + NotifyPropertyChanged("VIF"); + } + } + } + private XenRef _VIF; + + /// + /// true = proxy prefetches whole disk for the VM + /// Experimental. First published in . + /// + public virtual bool prepopulate + { + get { return _prepopulate; } + set + { + if (!Helper.AreEqual(value, _prepopulate)) + { + _prepopulate = value; + Changed = true; + NotifyPropertyChanged("prepopulate"); + } + } + } + private bool _prepopulate; + + /// + /// true = VM is currently proxied + /// Experimental. First published in . + /// + public virtual bool currently_attached + { + get { return _currently_attached; } + set + { + if (!Helper.AreEqual(value, _currently_attached)) + { + _currently_attached = value; + Changed = true; + NotifyPropertyChanged("currently_attached"); + } + } + } + private bool _currently_attached; + + /// + /// SR used by this proxy + /// Experimental. First published in . + /// + public virtual XenRef cache_SR + { + get { return _cache_SR; } + set + { + if (!Helper.AreEqual(value, _cache_SR)) + { + _cache_SR = value; + Changed = true; + NotifyPropertyChanged("cache_SR"); + } + } + } + private XenRef _cache_SR; + } +} diff --git a/XenModel/XenAPI/PVS_server.cs b/XenModel/XenAPI/PVS_server.cs index 6dfbf3bee..9d41fdc36 100644 --- a/XenModel/XenAPI/PVS_server.cs +++ b/XenModel/XenAPI/PVS_server.cs @@ -1,381 +1,381 @@ -/* - * 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: - * - * 1) Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2) 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; -using System.Collections; -using System.Collections.Generic; - -using CookComputing.XmlRpc; - - -namespace XenAPI -{ - /// - /// individual machine serving provisioning (block) data - /// - public partial class PVS_server : XenObject - { - public PVS_server() - { - } - - public PVS_server(string uuid, - string[] addresses, - long first_port, - long last_port, - XenRef farm) - { - this.uuid = uuid; - this.addresses = addresses; - this.first_port = first_port; - this.last_port = last_port; - this.farm = farm; - } - - /// - /// Creates a new PVS_server from a Proxy_PVS_server. - /// - /// - public PVS_server(Proxy_PVS_server proxy) - { - this.UpdateFromProxy(proxy); - } - - public override void UpdateFrom(PVS_server update) - { - uuid = update.uuid; - addresses = update.addresses; - first_port = update.first_port; - last_port = update.last_port; - farm = update.farm; - } - - internal void UpdateFromProxy(Proxy_PVS_server proxy) - { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - addresses = proxy.addresses == null ? new string[] {} : (string [])proxy.addresses; - first_port = proxy.first_port == null ? 0 : long.Parse((string)proxy.first_port); - last_port = proxy.last_port == null ? 0 : long.Parse((string)proxy.last_port); - farm = proxy.farm == null ? null : XenRef.Create(proxy.farm); - } - - public Proxy_PVS_server ToProxy() - { - Proxy_PVS_server result_ = new Proxy_PVS_server(); - result_.uuid = (uuid != null) ? uuid : ""; - result_.addresses = addresses; - result_.first_port = first_port.ToString(); - result_.last_port = last_port.ToString(); - result_.farm = (farm != null) ? farm : ""; - return result_; - } - - /// - /// Creates a new PVS_server from a Hashtable. - /// - /// - public PVS_server(Hashtable table) - { - uuid = Marshalling.ParseString(table, "uuid"); - addresses = Marshalling.ParseStringArray(table, "addresses"); - first_port = Marshalling.ParseLong(table, "first_port"); - last_port = Marshalling.ParseLong(table, "last_port"); - farm = Marshalling.ParseRef(table, "farm"); - } - - public bool DeepEquals(PVS_server other) - { - if (ReferenceEquals(null, other)) - return false; - if (ReferenceEquals(this, other)) - return true; - - return Helper.AreEqual2(this._uuid, other._uuid) && - Helper.AreEqual2(this._addresses, other._addresses) && - Helper.AreEqual2(this._first_port, other._first_port) && - Helper.AreEqual2(this._last_port, other._last_port) && - Helper.AreEqual2(this._farm, other._farm); - } - - public override string SaveChanges(Session session, string opaqueRef, PVS_server server) - { - if (opaqueRef == null) - { - System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server"); - return ""; - } - else - { - throw new InvalidOperationException("This type has no read/write properties"); - } - } - /// - /// Get a record containing the current state of the given PVS_server. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_server - public static PVS_server get_record(Session session, string _pvs_server) - { - return new PVS_server((Proxy_PVS_server)session.proxy.pvs_server_get_record(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); - } - - /// - /// Get a reference to the PVS_server instance with the specified UUID. - /// Experimental. First published in . - /// - /// The session - /// UUID of object to return - public static XenRef get_by_uuid(Session session, string _uuid) - { - return XenRef.Create(session.proxy.pvs_server_get_by_uuid(session.uuid, (_uuid != null) ? _uuid : "").parse()); - } - - /// - /// Get the uuid field of the given PVS_server. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_server - public static string get_uuid(Session session, string _pvs_server) - { - return (string)session.proxy.pvs_server_get_uuid(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse(); - } - - /// - /// Get the addresses field of the given PVS_server. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_server - public static string[] get_addresses(Session session, string _pvs_server) - { - return (string [])session.proxy.pvs_server_get_addresses(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse(); - } - - /// - /// Get the first_port field of the given PVS_server. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_server - public static long get_first_port(Session session, string _pvs_server) - { - return long.Parse((string)session.proxy.pvs_server_get_first_port(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); - } - - /// - /// Get the last_port field of the given PVS_server. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_server - public static long get_last_port(Session session, string _pvs_server) - { - return long.Parse((string)session.proxy.pvs_server_get_last_port(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); - } - - /// - /// Get the farm field of the given PVS_server. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_server - public static XenRef get_farm(Session session, string _pvs_server) - { - return XenRef.Create(session.proxy.pvs_server_get_farm(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); - } - - /// - /// introduce new PVS server - /// Experimental. First published in . - /// - /// The session - /// IPv4 addresses of the server - /// first UDP port accepted by this server - /// last UDP port accepted by this server - /// PVS farm this server is a part of - public static XenRef introduce(Session session, string[] _addresses, long _first_port, long _last_port, string _farm) - { - return XenRef.Create(session.proxy.pvs_server_introduce(session.uuid, _addresses, _first_port.ToString(), _last_port.ToString(), (_farm != null) ? _farm : "").parse()); - } - - /// - /// introduce new PVS server - /// Experimental. First published in . - /// - /// The session - /// IPv4 addresses of the server - /// first UDP port accepted by this server - /// last UDP port accepted by this server - /// PVS farm this server is a part of - public static XenRef async_introduce(Session session, string[] _addresses, long _first_port, long _last_port, string _farm) - { - return XenRef.Create(session.proxy.async_pvs_server_introduce(session.uuid, _addresses, _first_port.ToString(), _last_port.ToString(), (_farm != null) ? _farm : "").parse()); - } - - /// - /// forget a PVS server - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_server - public static void forget(Session session, string _pvs_server) - { - session.proxy.pvs_server_forget(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse(); - } - - /// - /// forget a PVS server - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_server - public static XenRef async_forget(Session session, string _pvs_server) - { - return XenRef.Create(session.proxy.async_pvs_server_forget(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); - } - - /// - /// Return a list of all the PVS_servers known to the system. - /// Experimental. First published in . - /// - /// The session - public static List> get_all(Session session) - { - return XenRef.Create(session.proxy.pvs_server_get_all(session.uuid).parse()); - } - - /// - /// Get all the PVS_server Records at once, in a single XML RPC call - /// - /// The session - public static Dictionary, PVS_server> get_all_records(Session session) - { - return XenRef.Create(session.proxy.pvs_server_get_all_records(session.uuid).parse()); - } - - /// - /// Unique identifier/object reference - /// Experimental. First published in . - /// - public virtual string uuid - { - get { return _uuid; } - set - { - if (!Helper.AreEqual(value, _uuid)) - { - _uuid = value; - Changed = true; - NotifyPropertyChanged("uuid"); - } - } - } - private string _uuid; - - /// - /// IPv4 addresses of this server - /// Experimental. First published in . - /// - public virtual string[] addresses - { - get { return _addresses; } - set - { - if (!Helper.AreEqual(value, _addresses)) - { - _addresses = value; - Changed = true; - NotifyPropertyChanged("addresses"); - } - } - } - private string[] _addresses; - - /// - /// First UDP port accepted by this server - /// Experimental. First published in . - /// - public virtual long first_port - { - get { return _first_port; } - set - { - if (!Helper.AreEqual(value, _first_port)) - { - _first_port = value; - Changed = true; - NotifyPropertyChanged("first_port"); - } - } - } - private long _first_port; - - /// - /// Last UDP port accepted by this server - /// Experimental. First published in . - /// - public virtual long last_port - { - get { return _last_port; } - set - { - if (!Helper.AreEqual(value, _last_port)) - { - _last_port = value; - Changed = true; - NotifyPropertyChanged("last_port"); - } - } - } - private long _last_port; - - /// - /// PVS farm this server is part of - /// Experimental. First published in . - /// - public virtual XenRef farm - { - get { return _farm; } - set - { - if (!Helper.AreEqual(value, _farm)) - { - _farm = value; - Changed = true; - NotifyPropertyChanged("farm"); - } - } - } - private XenRef _farm; - } -} +/* + * 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: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) 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; +using System.Collections; +using System.Collections.Generic; + +using CookComputing.XmlRpc; + + +namespace XenAPI +{ + /// + /// individual machine serving provisioning (block) data + /// + public partial class PVS_server : XenObject + { + public PVS_server() + { + } + + public PVS_server(string uuid, + string[] addresses, + long first_port, + long last_port, + XenRef site) + { + this.uuid = uuid; + this.addresses = addresses; + this.first_port = first_port; + this.last_port = last_port; + this.site = site; + } + + /// + /// Creates a new PVS_server from a Proxy_PVS_server. + /// + /// + public PVS_server(Proxy_PVS_server proxy) + { + this.UpdateFromProxy(proxy); + } + + public override void UpdateFrom(PVS_server update) + { + uuid = update.uuid; + addresses = update.addresses; + first_port = update.first_port; + last_port = update.last_port; + site = update.site; + } + + internal void UpdateFromProxy(Proxy_PVS_server proxy) + { + uuid = proxy.uuid == null ? null : (string)proxy.uuid; + addresses = proxy.addresses == null ? new string[] {} : (string [])proxy.addresses; + first_port = proxy.first_port == null ? 0 : long.Parse((string)proxy.first_port); + last_port = proxy.last_port == null ? 0 : long.Parse((string)proxy.last_port); + site = proxy.site == null ? null : XenRef.Create(proxy.site); + } + + public Proxy_PVS_server ToProxy() + { + Proxy_PVS_server result_ = new Proxy_PVS_server(); + result_.uuid = (uuid != null) ? uuid : ""; + result_.addresses = addresses; + result_.first_port = first_port.ToString(); + result_.last_port = last_port.ToString(); + result_.site = (site != null) ? site : ""; + return result_; + } + + /// + /// Creates a new PVS_server from a Hashtable. + /// + /// + public PVS_server(Hashtable table) + { + uuid = Marshalling.ParseString(table, "uuid"); + addresses = Marshalling.ParseStringArray(table, "addresses"); + first_port = Marshalling.ParseLong(table, "first_port"); + last_port = Marshalling.ParseLong(table, "last_port"); + site = Marshalling.ParseRef(table, "site"); + } + + public bool DeepEquals(PVS_server other) + { + if (ReferenceEquals(null, other)) + return false; + if (ReferenceEquals(this, other)) + return true; + + return Helper.AreEqual2(this._uuid, other._uuid) && + Helper.AreEqual2(this._addresses, other._addresses) && + Helper.AreEqual2(this._first_port, other._first_port) && + Helper.AreEqual2(this._last_port, other._last_port) && + Helper.AreEqual2(this._site, other._site); + } + + public override string SaveChanges(Session session, string opaqueRef, PVS_server server) + { + if (opaqueRef == null) + { + System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server"); + return ""; + } + else + { + throw new InvalidOperationException("This type has no read/write properties"); + } + } + /// + /// Get a record containing the current state of the given PVS_server. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_server + public static PVS_server get_record(Session session, string _pvs_server) + { + return new PVS_server((Proxy_PVS_server)session.proxy.pvs_server_get_record(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); + } + + /// + /// Get a reference to the PVS_server instance with the specified UUID. + /// Experimental. First published in . + /// + /// The session + /// UUID of object to return + public static XenRef get_by_uuid(Session session, string _uuid) + { + return XenRef.Create(session.proxy.pvs_server_get_by_uuid(session.uuid, (_uuid != null) ? _uuid : "").parse()); + } + + /// + /// Get the uuid field of the given PVS_server. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_server + public static string get_uuid(Session session, string _pvs_server) + { + return (string)session.proxy.pvs_server_get_uuid(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse(); + } + + /// + /// Get the addresses field of the given PVS_server. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_server + public static string[] get_addresses(Session session, string _pvs_server) + { + return (string [])session.proxy.pvs_server_get_addresses(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse(); + } + + /// + /// Get the first_port field of the given PVS_server. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_server + public static long get_first_port(Session session, string _pvs_server) + { + return long.Parse((string)session.proxy.pvs_server_get_first_port(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); + } + + /// + /// Get the last_port field of the given PVS_server. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_server + public static long get_last_port(Session session, string _pvs_server) + { + return long.Parse((string)session.proxy.pvs_server_get_last_port(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); + } + + /// + /// Get the site field of the given PVS_server. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_server + public static XenRef get_site(Session session, string _pvs_server) + { + return XenRef.Create(session.proxy.pvs_server_get_site(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); + } + + /// + /// introduce new PVS server + /// Experimental. First published in . + /// + /// The session + /// IPv4 addresses of the server + /// first UDP port accepted by this server + /// last UDP port accepted by this server + /// PVS site this server is a part of + public static XenRef introduce(Session session, string[] _addresses, long _first_port, long _last_port, string _site) + { + return XenRef.Create(session.proxy.pvs_server_introduce(session.uuid, _addresses, _first_port.ToString(), _last_port.ToString(), (_site != null) ? _site : "").parse()); + } + + /// + /// introduce new PVS server + /// Experimental. First published in . + /// + /// The session + /// IPv4 addresses of the server + /// first UDP port accepted by this server + /// last UDP port accepted by this server + /// PVS site this server is a part of + public static XenRef async_introduce(Session session, string[] _addresses, long _first_port, long _last_port, string _site) + { + return XenRef.Create(session.proxy.async_pvs_server_introduce(session.uuid, _addresses, _first_port.ToString(), _last_port.ToString(), (_site != null) ? _site : "").parse()); + } + + /// + /// forget a PVS server + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_server + public static void forget(Session session, string _pvs_server) + { + session.proxy.pvs_server_forget(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse(); + } + + /// + /// forget a PVS server + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_server + public static XenRef async_forget(Session session, string _pvs_server) + { + return XenRef.Create(session.proxy.async_pvs_server_forget(session.uuid, (_pvs_server != null) ? _pvs_server : "").parse()); + } + + /// + /// Return a list of all the PVS_servers known to the system. + /// Experimental. First published in . + /// + /// The session + public static List> get_all(Session session) + { + return XenRef.Create(session.proxy.pvs_server_get_all(session.uuid).parse()); + } + + /// + /// Get all the PVS_server Records at once, in a single XML RPC call + /// + /// The session + public static Dictionary, PVS_server> get_all_records(Session session) + { + return XenRef.Create(session.proxy.pvs_server_get_all_records(session.uuid).parse()); + } + + /// + /// Unique identifier/object reference + /// Experimental. First published in . + /// + public virtual string uuid + { + get { return _uuid; } + set + { + if (!Helper.AreEqual(value, _uuid)) + { + _uuid = value; + Changed = true; + NotifyPropertyChanged("uuid"); + } + } + } + private string _uuid; + + /// + /// IPv4 addresses of this server + /// Experimental. First published in . + /// + public virtual string[] addresses + { + get { return _addresses; } + set + { + if (!Helper.AreEqual(value, _addresses)) + { + _addresses = value; + Changed = true; + NotifyPropertyChanged("addresses"); + } + } + } + private string[] _addresses; + + /// + /// First UDP port accepted by this server + /// Experimental. First published in . + /// + public virtual long first_port + { + get { return _first_port; } + set + { + if (!Helper.AreEqual(value, _first_port)) + { + _first_port = value; + Changed = true; + NotifyPropertyChanged("first_port"); + } + } + } + private long _first_port; + + /// + /// Last UDP port accepted by this server + /// Experimental. First published in . + /// + public virtual long last_port + { + get { return _last_port; } + set + { + if (!Helper.AreEqual(value, _last_port)) + { + _last_port = value; + Changed = true; + NotifyPropertyChanged("last_port"); + } + } + } + private long _last_port; + + /// + /// PVS site this server is part of + /// Experimental. First published in . + /// + public virtual XenRef site + { + get { return _site; } + set + { + if (!Helper.AreEqual(value, _site)) + { + _site = value; + Changed = true; + NotifyPropertyChanged("site"); + } + } + } + private XenRef _site; + } +} diff --git a/XenModel/XenAPI/PVS_farm.cs b/XenModel/XenAPI/PVS_site.cs similarity index 64% rename from XenModel/XenAPI/PVS_farm.cs rename to XenModel/XenAPI/PVS_site.cs index 70e93ba2c..58eeeba29 100644 --- a/XenModel/XenAPI/PVS_farm.cs +++ b/XenModel/XenAPI/PVS_site.cs @@ -1,452 +1,452 @@ -/* - * 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: - * - * 1) Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2) 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; -using System.Collections; -using System.Collections.Generic; - -using CookComputing.XmlRpc; - - -namespace XenAPI -{ - /// - /// machines serving blocks of data for provisioning VMs - /// - public partial class PVS_farm : XenObject - { - public PVS_farm() - { - } - - public PVS_farm(string uuid, - string name, - List> cache_storage, - List> servers, - List> proxies) - { - this.uuid = uuid; - this.name = name; - this.cache_storage = cache_storage; - this.servers = servers; - this.proxies = proxies; - } - - /// - /// Creates a new PVS_farm from a Proxy_PVS_farm. - /// - /// - public PVS_farm(Proxy_PVS_farm proxy) - { - this.UpdateFromProxy(proxy); - } - - public override void UpdateFrom(PVS_farm update) - { - uuid = update.uuid; - name = update.name; - cache_storage = update.cache_storage; - servers = update.servers; - proxies = update.proxies; - } - - internal void UpdateFromProxy(Proxy_PVS_farm proxy) - { - uuid = proxy.uuid == null ? null : (string)proxy.uuid; - name = proxy.name == null ? null : (string)proxy.name; - cache_storage = proxy.cache_storage == null ? null : XenRef.Create(proxy.cache_storage); - servers = proxy.servers == null ? null : XenRef.Create(proxy.servers); - proxies = proxy.proxies == null ? null : XenRef.Create(proxy.proxies); - } - - public Proxy_PVS_farm ToProxy() - { - Proxy_PVS_farm result_ = new Proxy_PVS_farm(); - result_.uuid = (uuid != null) ? uuid : ""; - result_.name = (name != null) ? name : ""; - result_.cache_storage = (cache_storage != null) ? Helper.RefListToStringArray(cache_storage) : new string[] {}; - result_.servers = (servers != null) ? Helper.RefListToStringArray(servers) : new string[] {}; - result_.proxies = (proxies != null) ? Helper.RefListToStringArray(proxies) : new string[] {}; - return result_; - } - - /// - /// Creates a new PVS_farm from a Hashtable. - /// - /// - public PVS_farm(Hashtable table) - { - uuid = Marshalling.ParseString(table, "uuid"); - name = Marshalling.ParseString(table, "name"); - cache_storage = Marshalling.ParseSetRef(table, "cache_storage"); - servers = Marshalling.ParseSetRef(table, "servers"); - proxies = Marshalling.ParseSetRef(table, "proxies"); - } - - public bool DeepEquals(PVS_farm other) - { - if (ReferenceEquals(null, other)) - return false; - if (ReferenceEquals(this, other)) - return true; - - return Helper.AreEqual2(this._uuid, other._uuid) && - Helper.AreEqual2(this._name, other._name) && - Helper.AreEqual2(this._cache_storage, other._cache_storage) && - Helper.AreEqual2(this._servers, other._servers) && - Helper.AreEqual2(this._proxies, other._proxies); - } - - public override string SaveChanges(Session session, string opaqueRef, PVS_farm server) - { - if (opaqueRef == null) - { - System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server"); - return ""; - } - else - { - if (!Helper.AreEqual2(_name, server._name)) - { - PVS_farm.set_name(session, opaqueRef, _name); - } - - return null; - } - } - /// - /// Get a record containing the current state of the given PVS_farm. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - public static PVS_farm get_record(Session session, string _pvs_farm) - { - return new PVS_farm((Proxy_PVS_farm)session.proxy.pvs_farm_get_record(session.uuid, (_pvs_farm != null) ? _pvs_farm : "").parse()); - } - - /// - /// Get a reference to the PVS_farm instance with the specified UUID. - /// Experimental. First published in . - /// - /// The session - /// UUID of object to return - public static XenRef get_by_uuid(Session session, string _uuid) - { - return XenRef.Create(session.proxy.pvs_farm_get_by_uuid(session.uuid, (_uuid != null) ? _uuid : "").parse()); - } - - /// - /// Get the uuid field of the given PVS_farm. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - public static string get_uuid(Session session, string _pvs_farm) - { - return (string)session.proxy.pvs_farm_get_uuid(session.uuid, (_pvs_farm != null) ? _pvs_farm : "").parse(); - } - - /// - /// Get the name field of the given PVS_farm. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - public static string get_name(Session session, string _pvs_farm) - { - return (string)session.proxy.pvs_farm_get_name(session.uuid, (_pvs_farm != null) ? _pvs_farm : "").parse(); - } - - /// - /// Get the cache_storage field of the given PVS_farm. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - public static List> get_cache_storage(Session session, string _pvs_farm) - { - return XenRef.Create(session.proxy.pvs_farm_get_cache_storage(session.uuid, (_pvs_farm != null) ? _pvs_farm : "").parse()); - } - - /// - /// Get the servers field of the given PVS_farm. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - public static List> get_servers(Session session, string _pvs_farm) - { - return XenRef.Create(session.proxy.pvs_farm_get_servers(session.uuid, (_pvs_farm != null) ? _pvs_farm : "").parse()); - } - - /// - /// Get the proxies field of the given PVS_farm. - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - public static List> get_proxies(Session session, string _pvs_farm) - { - return XenRef.Create(session.proxy.pvs_farm_get_proxies(session.uuid, (_pvs_farm != null) ? _pvs_farm : "").parse()); - } - - /// - /// Introduce new PVS farm - /// Experimental. First published in . - /// - /// The session - /// name of the PVS farm - public static XenRef introduce(Session session, string _name) - { - return XenRef.Create(session.proxy.pvs_farm_introduce(session.uuid, (_name != null) ? _name : "").parse()); - } - - /// - /// Introduce new PVS farm - /// Experimental. First published in . - /// - /// The session - /// name of the PVS farm - public static XenRef async_introduce(Session session, string _name) - { - return XenRef.Create(session.proxy.async_pvs_farm_introduce(session.uuid, (_name != null) ? _name : "").parse()); - } - - /// - /// Remove a farm's meta data - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - public static void forget(Session session, string _pvs_farm) - { - session.proxy.pvs_farm_forget(session.uuid, (_pvs_farm != null) ? _pvs_farm : "").parse(); - } - - /// - /// Remove a farm's meta data - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - public static XenRef async_forget(Session session, string _pvs_farm) - { - return XenRef.Create(session.proxy.async_pvs_farm_forget(session.uuid, (_pvs_farm != null) ? _pvs_farm : "").parse()); - } - - /// - /// Update the name of the PVS farm - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - /// name to be used - public static void set_name(Session session, string _pvs_farm, string _value) - { - session.proxy.pvs_farm_set_name(session.uuid, (_pvs_farm != null) ? _pvs_farm : "", (_value != null) ? _value : "").parse(); - } - - /// - /// Update the name of the PVS farm - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - /// name to be used - public static XenRef async_set_name(Session session, string _pvs_farm, string _value) - { - return XenRef.Create(session.proxy.async_pvs_farm_set_name(session.uuid, (_pvs_farm != null) ? _pvs_farm : "", (_value != null) ? _value : "").parse()); - } - - /// - /// Add a cache SR for the proxies on the farm - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - /// SR to be used - public static void add_cache_storage(Session session, string _pvs_farm, string _value) - { - session.proxy.pvs_farm_add_cache_storage(session.uuid, (_pvs_farm != null) ? _pvs_farm : "", (_value != null) ? _value : "").parse(); - } - - /// - /// Add a cache SR for the proxies on the farm - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - /// SR to be used - public static XenRef async_add_cache_storage(Session session, string _pvs_farm, string _value) - { - return XenRef.Create(session.proxy.async_pvs_farm_add_cache_storage(session.uuid, (_pvs_farm != null) ? _pvs_farm : "", (_value != null) ? _value : "").parse()); - } - - /// - /// Remove a cache SR for the proxies on the farm - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - /// SR to be removed - public static void remove_cache_storage(Session session, string _pvs_farm, string _value) - { - session.proxy.pvs_farm_remove_cache_storage(session.uuid, (_pvs_farm != null) ? _pvs_farm : "", (_value != null) ? _value : "").parse(); - } - - /// - /// Remove a cache SR for the proxies on the farm - /// Experimental. First published in . - /// - /// The session - /// The opaque_ref of the given pvs_farm - /// SR to be removed - public static XenRef async_remove_cache_storage(Session session, string _pvs_farm, string _value) - { - return XenRef.Create(session.proxy.async_pvs_farm_remove_cache_storage(session.uuid, (_pvs_farm != null) ? _pvs_farm : "", (_value != null) ? _value : "").parse()); - } - - /// - /// Return a list of all the PVS_farms known to the system. - /// Experimental. First published in . - /// - /// The session - public static List> get_all(Session session) - { - return XenRef.Create(session.proxy.pvs_farm_get_all(session.uuid).parse()); - } - - /// - /// Get all the PVS_farm Records at once, in a single XML RPC call - /// - /// The session - public static Dictionary, PVS_farm> get_all_records(Session session) - { - return XenRef.Create(session.proxy.pvs_farm_get_all_records(session.uuid).parse()); - } - - /// - /// Unique identifier/object reference - /// Experimental. First published in . - /// - public virtual string uuid - { - get { return _uuid; } - set - { - if (!Helper.AreEqual(value, _uuid)) - { - _uuid = value; - Changed = true; - NotifyPropertyChanged("uuid"); - } - } - } - private string _uuid; - - /// - /// Name of the PVS farm. Must match name configured in PVS - /// Experimental. First published in . - /// - public virtual string name - { - get { return _name; } - set - { - if (!Helper.AreEqual(value, _name)) - { - _name = value; - Changed = true; - NotifyPropertyChanged("name"); - } - } - } - private string _name; - - /// - /// The SR used by PVS proxy for the cache - /// Experimental. First published in . - /// - public virtual List> cache_storage - { - get { return _cache_storage; } - set - { - if (!Helper.AreEqual(value, _cache_storage)) - { - _cache_storage = value; - Changed = true; - NotifyPropertyChanged("cache_storage"); - } - } - } - private List> _cache_storage; - - /// - /// The set of PVS servers in the farm - /// Experimental. First published in . - /// - public virtual List> servers - { - get { return _servers; } - set - { - if (!Helper.AreEqual(value, _servers)) - { - _servers = value; - Changed = true; - NotifyPropertyChanged("servers"); - } - } - } - private List> _servers; - - /// - /// The set of proxies associated with the farm - /// Experimental. First published in . - /// - public virtual List> proxies - { - get { return _proxies; } - set - { - if (!Helper.AreEqual(value, _proxies)) - { - _proxies = value; - Changed = true; - NotifyPropertyChanged("proxies"); - } - } - } - private List> _proxies; - } -} +/* + * 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: + * + * 1) Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2) 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; +using System.Collections; +using System.Collections.Generic; + +using CookComputing.XmlRpc; + + +namespace XenAPI +{ + /// + /// machines serving blocks of data for provisioning VMs + /// + public partial class PVS_site : XenObject + { + public PVS_site() + { + } + + public PVS_site(string uuid, + string name, + List> cache_storage, + List> servers, + List> proxies) + { + this.uuid = uuid; + this.name = name; + this.cache_storage = cache_storage; + this.servers = servers; + this.proxies = proxies; + } + + /// + /// Creates a new PVS_site from a Proxy_PVS_site. + /// + /// + public PVS_site(Proxy_PVS_site proxy) + { + this.UpdateFromProxy(proxy); + } + + public override void UpdateFrom(PVS_site update) + { + uuid = update.uuid; + name = update.name; + cache_storage = update.cache_storage; + servers = update.servers; + proxies = update.proxies; + } + + internal void UpdateFromProxy(Proxy_PVS_site proxy) + { + uuid = proxy.uuid == null ? null : (string)proxy.uuid; + name = proxy.name == null ? null : (string)proxy.name; + cache_storage = proxy.cache_storage == null ? null : XenRef.Create(proxy.cache_storage); + servers = proxy.servers == null ? null : XenRef.Create(proxy.servers); + proxies = proxy.proxies == null ? null : XenRef.Create(proxy.proxies); + } + + public Proxy_PVS_site ToProxy() + { + Proxy_PVS_site result_ = new Proxy_PVS_site(); + result_.uuid = (uuid != null) ? uuid : ""; + result_.name = (name != null) ? name : ""; + result_.cache_storage = (cache_storage != null) ? Helper.RefListToStringArray(cache_storage) : new string[] {}; + result_.servers = (servers != null) ? Helper.RefListToStringArray(servers) : new string[] {}; + result_.proxies = (proxies != null) ? Helper.RefListToStringArray(proxies) : new string[] {}; + return result_; + } + + /// + /// Creates a new PVS_site from a Hashtable. + /// + /// + public PVS_site(Hashtable table) + { + uuid = Marshalling.ParseString(table, "uuid"); + name = Marshalling.ParseString(table, "name"); + cache_storage = Marshalling.ParseSetRef(table, "cache_storage"); + servers = Marshalling.ParseSetRef(table, "servers"); + proxies = Marshalling.ParseSetRef(table, "proxies"); + } + + public bool DeepEquals(PVS_site other) + { + if (ReferenceEquals(null, other)) + return false; + if (ReferenceEquals(this, other)) + return true; + + return Helper.AreEqual2(this._uuid, other._uuid) && + Helper.AreEqual2(this._name, other._name) && + Helper.AreEqual2(this._cache_storage, other._cache_storage) && + Helper.AreEqual2(this._servers, other._servers) && + Helper.AreEqual2(this._proxies, other._proxies); + } + + public override string SaveChanges(Session session, string opaqueRef, PVS_site server) + { + if (opaqueRef == null) + { + System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server"); + return ""; + } + else + { + if (!Helper.AreEqual2(_name, server._name)) + { + PVS_site.set_name(session, opaqueRef, _name); + } + + return null; + } + } + /// + /// Get a record containing the current state of the given PVS_site. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + public static PVS_site get_record(Session session, string _pvs_site) + { + return new PVS_site((Proxy_PVS_site)session.proxy.pvs_site_get_record(session.uuid, (_pvs_site != null) ? _pvs_site : "").parse()); + } + + /// + /// Get a reference to the PVS_site instance with the specified UUID. + /// Experimental. First published in . + /// + /// The session + /// UUID of object to return + public static XenRef get_by_uuid(Session session, string _uuid) + { + return XenRef.Create(session.proxy.pvs_site_get_by_uuid(session.uuid, (_uuid != null) ? _uuid : "").parse()); + } + + /// + /// Get the uuid field of the given PVS_site. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + public static string get_uuid(Session session, string _pvs_site) + { + return (string)session.proxy.pvs_site_get_uuid(session.uuid, (_pvs_site != null) ? _pvs_site : "").parse(); + } + + /// + /// Get the name field of the given PVS_site. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + public static string get_name(Session session, string _pvs_site) + { + return (string)session.proxy.pvs_site_get_name(session.uuid, (_pvs_site != null) ? _pvs_site : "").parse(); + } + + /// + /// Get the cache_storage field of the given PVS_site. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + public static List> get_cache_storage(Session session, string _pvs_site) + { + return XenRef.Create(session.proxy.pvs_site_get_cache_storage(session.uuid, (_pvs_site != null) ? _pvs_site : "").parse()); + } + + /// + /// Get the servers field of the given PVS_site. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + public static List> get_servers(Session session, string _pvs_site) + { + return XenRef.Create(session.proxy.pvs_site_get_servers(session.uuid, (_pvs_site != null) ? _pvs_site : "").parse()); + } + + /// + /// Get the proxies field of the given PVS_site. + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + public static List> get_proxies(Session session, string _pvs_site) + { + return XenRef.Create(session.proxy.pvs_site_get_proxies(session.uuid, (_pvs_site != null) ? _pvs_site : "").parse()); + } + + /// + /// Introduce new PVS site + /// Experimental. First published in . + /// + /// The session + /// name of the PVS site + public static XenRef introduce(Session session, string _name) + { + return XenRef.Create(session.proxy.pvs_site_introduce(session.uuid, (_name != null) ? _name : "").parse()); + } + + /// + /// Introduce new PVS site + /// Experimental. First published in . + /// + /// The session + /// name of the PVS site + public static XenRef async_introduce(Session session, string _name) + { + return XenRef.Create(session.proxy.async_pvs_site_introduce(session.uuid, (_name != null) ? _name : "").parse()); + } + + /// + /// Remove a site's meta data + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + public static void forget(Session session, string _pvs_site) + { + session.proxy.pvs_site_forget(session.uuid, (_pvs_site != null) ? _pvs_site : "").parse(); + } + + /// + /// Remove a site's meta data + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + public static XenRef async_forget(Session session, string _pvs_site) + { + return XenRef.Create(session.proxy.async_pvs_site_forget(session.uuid, (_pvs_site != null) ? _pvs_site : "").parse()); + } + + /// + /// Update the name of the PVS site + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + /// name to be used + public static void set_name(Session session, string _pvs_site, string _value) + { + session.proxy.pvs_site_set_name(session.uuid, (_pvs_site != null) ? _pvs_site : "", (_value != null) ? _value : "").parse(); + } + + /// + /// Update the name of the PVS site + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + /// name to be used + public static XenRef async_set_name(Session session, string _pvs_site, string _value) + { + return XenRef.Create(session.proxy.async_pvs_site_set_name(session.uuid, (_pvs_site != null) ? _pvs_site : "", (_value != null) ? _value : "").parse()); + } + + /// + /// Add a cache SR for the proxies on the site + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + /// SR to be used + public static void add_cache_storage(Session session, string _pvs_site, string _value) + { + session.proxy.pvs_site_add_cache_storage(session.uuid, (_pvs_site != null) ? _pvs_site : "", (_value != null) ? _value : "").parse(); + } + + /// + /// Add a cache SR for the proxies on the site + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + /// SR to be used + public static XenRef async_add_cache_storage(Session session, string _pvs_site, string _value) + { + return XenRef.Create(session.proxy.async_pvs_site_add_cache_storage(session.uuid, (_pvs_site != null) ? _pvs_site : "", (_value != null) ? _value : "").parse()); + } + + /// + /// Remove a cache SR for the proxies on the site + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + /// SR to be removed + public static void remove_cache_storage(Session session, string _pvs_site, string _value) + { + session.proxy.pvs_site_remove_cache_storage(session.uuid, (_pvs_site != null) ? _pvs_site : "", (_value != null) ? _value : "").parse(); + } + + /// + /// Remove a cache SR for the proxies on the site + /// Experimental. First published in . + /// + /// The session + /// The opaque_ref of the given pvs_site + /// SR to be removed + public static XenRef async_remove_cache_storage(Session session, string _pvs_site, string _value) + { + return XenRef.Create(session.proxy.async_pvs_site_remove_cache_storage(session.uuid, (_pvs_site != null) ? _pvs_site : "", (_value != null) ? _value : "").parse()); + } + + /// + /// Return a list of all the PVS_sites known to the system. + /// Experimental. First published in . + /// + /// The session + public static List> get_all(Session session) + { + return XenRef.Create(session.proxy.pvs_site_get_all(session.uuid).parse()); + } + + /// + /// Get all the PVS_site Records at once, in a single XML RPC call + /// + /// The session + public static Dictionary, PVS_site> get_all_records(Session session) + { + return XenRef.Create(session.proxy.pvs_site_get_all_records(session.uuid).parse()); + } + + /// + /// Unique identifier/object reference + /// Experimental. First published in . + /// + public virtual string uuid + { + get { return _uuid; } + set + { + if (!Helper.AreEqual(value, _uuid)) + { + _uuid = value; + Changed = true; + NotifyPropertyChanged("uuid"); + } + } + } + private string _uuid; + + /// + /// Name of the PVS site. Must match name configured in PVS + /// Experimental. First published in . + /// + public virtual string name + { + get { return _name; } + set + { + if (!Helper.AreEqual(value, _name)) + { + _name = value; + Changed = true; + NotifyPropertyChanged("name"); + } + } + } + private string _name; + + /// + /// The SR used by PVS proxy for the cache + /// Experimental. First published in . + /// + public virtual List> cache_storage + { + get { return _cache_storage; } + set + { + if (!Helper.AreEqual(value, _cache_storage)) + { + _cache_storage = value; + Changed = true; + NotifyPropertyChanged("cache_storage"); + } + } + } + private List> _cache_storage; + + /// + /// The set of PVS servers in the site + /// Experimental. First published in . + /// + public virtual List> servers + { + get { return _servers; } + set + { + if (!Helper.AreEqual(value, _servers)) + { + _servers = value; + Changed = true; + NotifyPropertyChanged("servers"); + } + } + } + private List> _servers; + + /// + /// The set of proxies associated with the site + /// Experimental. First published in . + /// + public virtual List> proxies + { + get { return _proxies; } + set + { + if (!Helper.AreEqual(value, _proxies)) + { + _proxies = value; + Changed = true; + NotifyPropertyChanged("proxies"); + } + } + } + private List> _proxies; + } +} diff --git a/XenModel/XenAPI/Proxy.cs b/XenModel/XenAPI/Proxy.cs index 7a2affa00..38da7e4ab 100644 --- a/XenModel/XenAPI/Proxy.cs +++ b/XenModel/XenAPI/Proxy.cs @@ -1496,6 +1496,10 @@ namespace XenAPI Response vm_get_has_vendor_device(string session, string _vm); + [XmlRpcMethod("VM.get_requires_reboot")] + Response + vm_get_requires_reboot(string session, string _vm); + [XmlRpcMethod("VM.set_name_label")] Response vm_set_name_label(string session, string _vm, string _label); @@ -1896,6 +1900,14 @@ namespace XenAPI Response async_vm_set_memory_limits(string session, string _vm, string _static_min, string _static_max, string _dynamic_min, string _dynamic_max); + [XmlRpcMethod("VM.set_memory")] + Response + vm_set_memory(string session, string _vm, string _value); + + [XmlRpcMethod("Async.VM.set_memory")] + Response + async_vm_set_memory(string session, string _vm, string _value); + [XmlRpcMethod("VM.set_memory_target_live")] Response vm_set_memory_target_live(string session, string _vm, string _target); @@ -6864,81 +6876,81 @@ namespace XenAPI Response vgpu_type_get_all_records(string session); - [XmlRpcMethod("PVS_farm.get_record")] - Response - pvs_farm_get_record(string session, string _pvs_farm); + [XmlRpcMethod("PVS_site.get_record")] + Response + pvs_site_get_record(string session, string _pvs_site); - [XmlRpcMethod("PVS_farm.get_by_uuid")] + [XmlRpcMethod("PVS_site.get_by_uuid")] Response - pvs_farm_get_by_uuid(string session, string _uuid); + pvs_site_get_by_uuid(string session, string _uuid); - [XmlRpcMethod("PVS_farm.get_uuid")] + [XmlRpcMethod("PVS_site.get_uuid")] Response - pvs_farm_get_uuid(string session, string _pvs_farm); + pvs_site_get_uuid(string session, string _pvs_site); - [XmlRpcMethod("PVS_farm.get_name")] + [XmlRpcMethod("PVS_site.get_name")] Response - pvs_farm_get_name(string session, string _pvs_farm); + pvs_site_get_name(string session, string _pvs_site); - [XmlRpcMethod("PVS_farm.get_cache_storage")] + [XmlRpcMethod("PVS_site.get_cache_storage")] Response - pvs_farm_get_cache_storage(string session, string _pvs_farm); + pvs_site_get_cache_storage(string session, string _pvs_site); - [XmlRpcMethod("PVS_farm.get_servers")] + [XmlRpcMethod("PVS_site.get_servers")] Response - pvs_farm_get_servers(string session, string _pvs_farm); + pvs_site_get_servers(string session, string _pvs_site); - [XmlRpcMethod("PVS_farm.get_proxies")] + [XmlRpcMethod("PVS_site.get_proxies")] Response - pvs_farm_get_proxies(string session, string _pvs_farm); + pvs_site_get_proxies(string session, string _pvs_site); - [XmlRpcMethod("PVS_farm.introduce")] + [XmlRpcMethod("PVS_site.introduce")] Response - pvs_farm_introduce(string session, string _name); + pvs_site_introduce(string session, string _name); - [XmlRpcMethod("Async.PVS_farm.introduce")] + [XmlRpcMethod("Async.PVS_site.introduce")] Response - async_pvs_farm_introduce(string session, string _name); + async_pvs_site_introduce(string session, string _name); - [XmlRpcMethod("PVS_farm.forget")] + [XmlRpcMethod("PVS_site.forget")] Response - pvs_farm_forget(string session, string _pvs_farm); + pvs_site_forget(string session, string _pvs_site); - [XmlRpcMethod("Async.PVS_farm.forget")] + [XmlRpcMethod("Async.PVS_site.forget")] Response - async_pvs_farm_forget(string session, string _pvs_farm); + async_pvs_site_forget(string session, string _pvs_site); - [XmlRpcMethod("PVS_farm.set_name")] + [XmlRpcMethod("PVS_site.set_name")] Response - pvs_farm_set_name(string session, string _pvs_farm, string _value); + pvs_site_set_name(string session, string _pvs_site, string _value); - [XmlRpcMethod("Async.PVS_farm.set_name")] + [XmlRpcMethod("Async.PVS_site.set_name")] Response - async_pvs_farm_set_name(string session, string _pvs_farm, string _value); + async_pvs_site_set_name(string session, string _pvs_site, string _value); - [XmlRpcMethod("PVS_farm.add_cache_storage")] + [XmlRpcMethod("PVS_site.add_cache_storage")] Response - pvs_farm_add_cache_storage(string session, string _pvs_farm, string _value); + pvs_site_add_cache_storage(string session, string _pvs_site, string _value); - [XmlRpcMethod("Async.PVS_farm.add_cache_storage")] + [XmlRpcMethod("Async.PVS_site.add_cache_storage")] Response - async_pvs_farm_add_cache_storage(string session, string _pvs_farm, string _value); + async_pvs_site_add_cache_storage(string session, string _pvs_site, string _value); - [XmlRpcMethod("PVS_farm.remove_cache_storage")] + [XmlRpcMethod("PVS_site.remove_cache_storage")] Response - pvs_farm_remove_cache_storage(string session, string _pvs_farm, string _value); + pvs_site_remove_cache_storage(string session, string _pvs_site, string _value); - [XmlRpcMethod("Async.PVS_farm.remove_cache_storage")] + [XmlRpcMethod("Async.PVS_site.remove_cache_storage")] Response - async_pvs_farm_remove_cache_storage(string session, string _pvs_farm, string _value); + async_pvs_site_remove_cache_storage(string session, string _pvs_site, string _value); - [XmlRpcMethod("PVS_farm.get_all")] + [XmlRpcMethod("PVS_site.get_all")] Response - pvs_farm_get_all(string session); + pvs_site_get_all(string session); - [XmlRpcMethod("PVS_farm.get_all_records")] + [XmlRpcMethod("PVS_site.get_all_records")] Response - pvs_farm_get_all_records(string session); + pvs_site_get_all_records(string session); [XmlRpcMethod("PVS_server.get_record")] Response @@ -6964,17 +6976,17 @@ namespace XenAPI Response pvs_server_get_last_port(string session, string _pvs_server); - [XmlRpcMethod("PVS_server.get_farm")] + [XmlRpcMethod("PVS_server.get_site")] Response - pvs_server_get_farm(string session, string _pvs_server); + pvs_server_get_site(string session, string _pvs_server); [XmlRpcMethod("PVS_server.introduce")] Response - pvs_server_introduce(string session, string [] _addresses, string _first_port, string _last_port, string _farm); + pvs_server_introduce(string session, string [] _addresses, string _first_port, string _last_port, string _site); [XmlRpcMethod("Async.PVS_server.introduce")] Response - async_pvs_server_introduce(string session, string [] _addresses, string _first_port, string _last_port, string _farm); + async_pvs_server_introduce(string session, string [] _addresses, string _first_port, string _last_port, string _site); [XmlRpcMethod("PVS_server.forget")] Response @@ -7004,9 +7016,9 @@ namespace XenAPI Response pvs_proxy_get_uuid(string session, string _pvs_proxy); - [XmlRpcMethod("PVS_proxy.get_farm")] + [XmlRpcMethod("PVS_proxy.get_site")] Response - pvs_proxy_get_farm(string session, string _pvs_proxy); + pvs_proxy_get_site(string session, string _pvs_proxy); [XmlRpcMethod("PVS_proxy.get_VIF")] Response @@ -7026,11 +7038,11 @@ namespace XenAPI [XmlRpcMethod("PVS_proxy.create")] Response - pvs_proxy_create(string session, string _farm, string _vif, bool _prepopulate); + pvs_proxy_create(string session, string _site, string _vif, bool _prepopulate); [XmlRpcMethod("Async.PVS_proxy.create")] Response - async_pvs_proxy_create(string session, string _farm, string _vif, bool _prepopulate); + async_pvs_proxy_create(string session, string _site, string _vif, bool _prepopulate); [XmlRpcMethod("PVS_proxy.destroy")] Response @@ -7055,6 +7067,50 @@ namespace XenAPI [XmlRpcMethod("PVS_proxy.get_all_records")] Response pvs_proxy_get_all_records(string session); + + [XmlRpcMethod("PVS_cache_storage.get_record")] + Response + pvs_cache_storage_get_record(string session, string _pvs_cache_storage); + + [XmlRpcMethod("PVS_cache_storage.get_by_uuid")] + Response + pvs_cache_storage_get_by_uuid(string session, string _uuid); + + [XmlRpcMethod("PVS_cache_storage.create")] + Response + pvs_cache_storage_create(string session, Proxy_PVS_cache_storage _record); + + [XmlRpcMethod("Async.PVS_cache_storage.create")] + Response + async_pvs_cache_storage_create(string session, Proxy_PVS_cache_storage _record); + + [XmlRpcMethod("PVS_cache_storage.destroy")] + Response + pvs_cache_storage_destroy(string session, string _pvs_cache_storage); + + [XmlRpcMethod("Async.PVS_cache_storage.destroy")] + Response + async_pvs_cache_storage_destroy(string session, string _pvs_cache_storage); + + [XmlRpcMethod("PVS_cache_storage.get_uuid")] + Response + pvs_cache_storage_get_uuid(string session, string _pvs_cache_storage); + + [XmlRpcMethod("PVS_cache_storage.get_site")] + Response + pvs_cache_storage_get_site(string session, string _pvs_cache_storage); + + [XmlRpcMethod("PVS_cache_storage.get_SR")] + Response + pvs_cache_storage_get_sr(string session, string _pvs_cache_storage); + + [XmlRpcMethod("PVS_cache_storage.get_size")] + Response + pvs_cache_storage_get_size(string session, string _pvs_cache_storage); + + [XmlRpcMethod("PVS_cache_storage.get_all_records")] + Response + pvs_cache_storage_get_all_records(string session); } [XmlRpcMissingMapping(MappingAction.Ignore)] @@ -7255,6 +7311,7 @@ namespace XenAPI public string generation_id; public string hardware_platform_version; public bool has_vendor_device; + public bool requires_reboot; } [XmlRpcMissingMapping(MappingAction.Ignore)] @@ -7891,7 +7948,7 @@ namespace XenAPI } [XmlRpcMissingMapping(MappingAction.Ignore)] - public class Proxy_PVS_farm + public class Proxy_PVS_site { public string uuid; public string name; @@ -7907,18 +7964,27 @@ namespace XenAPI public string [] addresses; public string first_port; public string last_port; - public string farm; + public string site; } [XmlRpcMissingMapping(MappingAction.Ignore)] public class Proxy_PVS_proxy { public string uuid; - public string farm; + public string site; public string VIF; public bool prepopulate; public bool currently_attached; public string cache_SR; } + [XmlRpcMissingMapping(MappingAction.Ignore)] + public class Proxy_PVS_cache_storage + { + public string uuid; + public string site; + public string SR; + public string size; + } + } diff --git a/XenModel/XenAPI/Relation.cs b/XenModel/XenAPI/Relation.cs index 1ad624806..4a80736b4 100644 --- a/XenModel/XenAPI/Relation.cs +++ b/XenModel/XenAPI/Relation.cs @@ -96,6 +96,11 @@ namespace XenAPI new Relation("bond_master_of", "Bond", "master"), }); + relations.Add(typeof(Proxy_PVS_site), new Relation[] { + new Relation("proxies", "PVS_proxy", "site"), + new Relation("servers", "PVS_server", "site"), + }); + relations.Add(typeof(Proxy_DR_task), new Relation[] { new Relation("introduced_SRs", "SR", "introduced_by"), }); @@ -109,11 +114,6 @@ namespace XenAPI new Relation("subtasks", "task", "subtask_of"), }); - relations.Add(typeof(Proxy_PVS_farm), new Relation[] { - new Relation("proxies", "PVS_proxy", "farm"), - new Relation("servers", "PVS_server", "farm"), - }); - relations.Add(typeof(Proxy_PGPU), new Relation[] { new Relation("resident_VGPUs", "VGPU", "resident_on"), }); diff --git a/XenModel/XenAPI/VM.cs b/XenModel/XenAPI/VM.cs index c1efe6037..b59f71207 100644 --- a/XenModel/XenAPI/VM.cs +++ b/XenModel/XenAPI/VM.cs @@ -124,7 +124,8 @@ namespace XenAPI long version, string generation_id, long hardware_platform_version, - bool has_vendor_device) + bool has_vendor_device, + bool requires_reboot) { this.uuid = uuid; this.allowed_operations = allowed_operations; @@ -203,6 +204,7 @@ namespace XenAPI this.generation_id = generation_id; this.hardware_platform_version = hardware_platform_version; this.has_vendor_device = has_vendor_device; + this.requires_reboot = requires_reboot; } /// @@ -293,6 +295,7 @@ namespace XenAPI generation_id = update.generation_id; hardware_platform_version = update.hardware_platform_version; has_vendor_device = update.has_vendor_device; + requires_reboot = update.requires_reboot; } internal void UpdateFromProxy(Proxy_VM proxy) @@ -374,6 +377,7 @@ namespace XenAPI generation_id = proxy.generation_id == null ? null : (string)proxy.generation_id; hardware_platform_version = proxy.hardware_platform_version == null ? 0 : long.Parse((string)proxy.hardware_platform_version); has_vendor_device = (bool)proxy.has_vendor_device; + requires_reboot = (bool)proxy.requires_reboot; } public Proxy_VM ToProxy() @@ -456,6 +460,7 @@ namespace XenAPI result_.generation_id = (generation_id != null) ? generation_id : ""; result_.hardware_platform_version = hardware_platform_version.ToString(); result_.has_vendor_device = has_vendor_device; + result_.requires_reboot = requires_reboot; return result_; } @@ -542,6 +547,7 @@ namespace XenAPI generation_id = Marshalling.ParseString(table, "generation_id"); hardware_platform_version = Marshalling.ParseLong(table, "hardware_platform_version"); has_vendor_device = Marshalling.ParseBool(table, "has_vendor_device"); + requires_reboot = Marshalling.ParseBool(table, "requires_reboot"); } public bool DeepEquals(VM other, bool ignoreCurrentOperations) @@ -629,7 +635,8 @@ namespace XenAPI Helper.AreEqual2(this._version, other._version) && Helper.AreEqual2(this._generation_id, other._generation_id) && Helper.AreEqual2(this._hardware_platform_version, other._hardware_platform_version) && - Helper.AreEqual2(this._has_vendor_device, other._has_vendor_device); + Helper.AreEqual2(this._has_vendor_device, other._has_vendor_device) && + Helper.AreEqual2(this._requires_reboot, other._requires_reboot); } public override string SaveChanges(Session session, string opaqueRef, VM server) @@ -1743,6 +1750,17 @@ namespace XenAPI return (bool)session.proxy.vm_get_has_vendor_device(session.uuid, (_vm != null) ? _vm : "").parse(); } + /// + /// Get the requires_reboot field of the given VM. + /// First published in . + /// + /// The session + /// The opaque_ref of the given vm + public static bool get_requires_reboot(Session session, string _vm) + { + return (bool)session.proxy.vm_get_requires_reboot(session.uuid, (_vm != null) ? _vm : "").parse(); + } + /// /// Set the name/label field of the given VM. /// First published in XenServer 4.0. @@ -2957,6 +2975,30 @@ namespace XenAPI return XenRef.Create(session.proxy.async_vm_set_memory_limits(session.uuid, (_vm != null) ? _vm : "", _static_min.ToString(), _static_max.ToString(), _dynamic_min.ToString(), _dynamic_max.ToString()).parse()); } + /// + /// Set the memory allocation of this VM. Sets all of memory_static_max, memory_dynamic_min, and memory_dynamic_max to the given value, and leaves memory_static_min untouched. + /// First published in . + /// + /// The session + /// The opaque_ref of the given vm + /// The new memory allocation (bytes). + public static void set_memory(Session session, string _vm, long _value) + { + session.proxy.vm_set_memory(session.uuid, (_vm != null) ? _vm : "", _value.ToString()).parse(); + } + + /// + /// Set the memory allocation of this VM. Sets all of memory_static_max, memory_dynamic_min, and memory_dynamic_max to the given value, and leaves memory_static_min untouched. + /// First published in . + /// + /// The session + /// The opaque_ref of the given vm + /// The new memory allocation (bytes). + public static XenRef async_set_memory(Session session, string _vm, long _value) + { + return XenRef.Create(session.proxy.async_vm_set_memory(session.uuid, (_vm != null) ? _vm : "", _value.ToString()).parse()); + } + /// /// Set the memory target for a running VM /// First published in XenServer 4.0. @@ -5302,5 +5344,24 @@ namespace XenAPI } } private bool _has_vendor_device; + + /// + /// Indicates whether a VM requires a reboot in order to update its configuration, e.g. its memory allocation. + /// First published in . + /// + public virtual bool requires_reboot + { + get { return _requires_reboot; } + set + { + if (!Helper.AreEqual(value, _requires_reboot)) + { + _requires_reboot = value; + Changed = true; + NotifyPropertyChanged("requires_reboot"); + } + } + } + private bool _requires_reboot; } } diff --git a/XenModel/XenModel.csproj b/XenModel/XenModel.csproj index 8f63ef9ac..fbfd3db26 100644 --- a/XenModel/XenModel.csproj +++ b/XenModel/XenModel.csproj @@ -324,7 +324,7 @@ - + @@ -355,9 +355,10 @@ - + + From 9df8b0494c4e5581702ec9e1c56d4147ebb4ca8a Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Tue, 9 Aug 2016 12:01:59 +0100 Subject: [PATCH 2/4] CP-18407: Rename PVS farm to PVS site - Rename everything to PVS site Signed-off-by: Mihaela Stoica --- ...singPvsSiteServerDataGridView.Designer.cs} | 2 +- ...=> CollapsingPvsSiteServerDataGridView.cs} | 18 ++--- ...CollapsingPvsSiteServerDataGridViewRow.cs} | 36 +++++----- ....Designer.cs => PvsSiteDialog.Designer.cs} | 32 ++++----- .../{PvsFarmDialog.cs => PvsSiteDialog.cs} | 28 ++++---- ...rmDialog.ja.resx => PvsSiteDialog.ja.resx} | 2 +- ...{PvsFarmDialog.resx => PvsSiteDialog.resx} | 28 ++++---- ...og.zh-CN.resx => PvsSiteDialog.zh-CN.resx} | 2 +- XenAdmin/MainWindow.cs | 4 +- XenAdmin/TabPages/PvsPage.Designer.cs | 68 +++++++++---------- XenAdmin/TabPages/PvsPage.cs | 44 ++++++------ XenAdmin/TabPages/PvsPage.ja.resx | 44 ++++++------ XenAdmin/TabPages/PvsPage.resx | 66 +++++++++--------- XenAdmin/TabPages/PvsPage.zh-CN.resx | 44 ++++++------ XenAdmin/XenAdmin.csproj | 28 ++++---- XenModel/Messages.Designer.cs | 8 +-- XenModel/Messages.ja.resx | 4 +- XenModel/Messages.resx | 4 +- XenModel/Messages.zh-CN.resx | 4 +- 19 files changed, 234 insertions(+), 232 deletions(-) rename XenAdmin/Controls/DataGridViewEx/{CollapsingPvsFarmServerDataGridView.Designer.cs => CollapsingPvsSiteServerDataGridView.Designer.cs} (91%) rename XenAdmin/Controls/DataGridViewEx/{CollapsingPvsFarmServerDataGridView.cs => CollapsingPvsSiteServerDataGridView.cs} (82%) rename XenAdmin/Controls/DataGridViewEx/{CollapsingPvsFarmServerDataGridViewRow.cs => CollapsingPvsSiteServerDataGridViewRow.cs} (79%) rename XenAdmin/Dialogs/{PvsFarmDialog.Designer.cs => PvsSiteDialog.Designer.cs} (89%) rename XenAdmin/Dialogs/{PvsFarmDialog.cs => PvsSiteDialog.cs} (80%) rename XenAdmin/Dialogs/{PvsFarmDialog.ja.resx => PvsSiteDialog.ja.resx} (97%) rename XenAdmin/Dialogs/{PvsFarmDialog.resx => PvsSiteDialog.resx} (94%) rename XenAdmin/Dialogs/{PvsFarmDialog.zh-CN.resx => PvsSiteDialog.zh-CN.resx} (97%) diff --git a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridView.Designer.cs b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.Designer.cs similarity index 91% rename from XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridView.Designer.cs rename to XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.Designer.cs index d2ea8e1a1..053812638 100644 --- a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridView.Designer.cs +++ b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.Designer.cs @@ -1,6 +1,6 @@ namespace XenAdmin.Controls.DataGridViewEx { - partial class CollapsingPvsFarmServerDataGridView + partial class CollapsingPvsSiteServerDataGridView { /// /// Required designer variable. diff --git a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridView.cs b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.cs similarity index 82% rename from XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridView.cs rename to XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.cs index 318c48dd4..115d35190 100644 --- a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridView.cs +++ b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridView.cs @@ -34,14 +34,14 @@ using System.Windows.Forms; namespace XenAdmin.Controls.DataGridViewEx { - public partial class CollapsingPvsFarmServerDataGridView : DataGridViewEx + public partial class CollapsingPvsSiteServerDataGridView : DataGridViewEx { - public CollapsingPvsFarmServerDataGridView() + public CollapsingPvsSiteServerDataGridView() { InitializeComponent(); } - public CollapsingPvsFarmServerDataGridView(IContainer container) + public CollapsingPvsSiteServerDataGridView(IContainer container) { container.Add(this); @@ -62,23 +62,23 @@ namespace XenAdmin.Controls.DataGridViewEx public void ExpandCollapseClicked(int rowIndex) { - var farmRow = (CollapsingPvsFarmServerDataGridViewRow)Rows[rowIndex]; + var siteRow = (CollapsingPvsSiteServerDataGridViewRow)Rows[rowIndex]; - if (farmRow.UnderlyingFarm != null) + if (siteRow.UnderlyingSite != null) { for (int i = rowIndex + 1; i < Rows.Count; i++) { - var row = (CollapsingPvsFarmServerDataGridViewRow)Rows[i]; + var row = (CollapsingPvsSiteServerDataGridViewRow)Rows[i]; - if (row.IsFarmRow) + if (row.IsSiteRow) break; row.Visible = !row.Visible; if (row.Visible) - farmRow.SetCollapseIcon(); + siteRow.SetCollapseIcon(); else - farmRow.SetExpandIcon(); + siteRow.SetExpandIcon(); } } } diff --git a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridViewRow.cs b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridViewRow.cs similarity index 79% rename from XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridViewRow.cs rename to XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridViewRow.cs index c2514cc2c..2c63c4583 100644 --- a/XenAdmin/Controls/DataGridViewEx/CollapsingPvsFarmServerDataGridViewRow.cs +++ b/XenAdmin/Controls/DataGridViewEx/CollapsingPvsSiteServerDataGridViewRow.cs @@ -35,27 +35,27 @@ using XenAPI; namespace XenAdmin.Controls.DataGridViewEx { - public class CollapsingPvsFarmServerDataGridViewRow : DataGridViewExRow + public class CollapsingPvsSiteServerDataGridViewRow : DataGridViewExRow { protected DataGridViewImageCell expansionCell; - protected DataGridViewTextBoxCell farmCell; + protected DataGridViewTextBoxCell siteCell; protected DataGridViewTextBoxCell ipAddressesCell; protected DataGridViewTextBoxCell firstPortCell; protected DataGridViewTextBoxCell lastPortCell; - protected bool isPvsFarmRow; + protected bool isPvsSiteRow; - public CollapsingPvsFarmServerDataGridViewRow(PVS_site farm) + public CollapsingPvsSiteServerDataGridViewRow(PVS_site site) { - Tag = farm; - isPvsFarmRow = true; + Tag = site; + isPvsSiteRow = true; SetupCells(); } - public CollapsingPvsFarmServerDataGridViewRow(PVS_server server) + public CollapsingPvsSiteServerDataGridViewRow(PVS_server server) { Tag = server; - isPvsFarmRow = false; + isPvsSiteRow = false; SetupCells(); } @@ -63,13 +63,13 @@ namespace XenAdmin.Controls.DataGridViewEx private void SetupCells() { expansionCell = new DataGridViewImageCell(); - farmCell = new DataGridViewTextBoxCell(); + siteCell = new DataGridViewTextBoxCell(); ipAddressesCell = new DataGridViewTextBoxCell(); firstPortCell = new DataGridViewTextBoxCell(); lastPortCell = new DataGridViewTextBoxCell(); Cells.Add(expansionCell); - Cells.Add(farmCell); + Cells.Add(siteCell); Cells.Add(ipAddressesCell); Cells.Add(firstPortCell); Cells.Add(lastPortCell); @@ -79,16 +79,16 @@ namespace XenAdmin.Controls.DataGridViewEx protected void UpdateDetails() { - if (isPvsFarmRow) + if (isPvsSiteRow) { - PVS_site farm = (PVS_site)Tag; + PVS_site site = (PVS_site)Tag; - if (farm.servers.Count == 0) + if (site.servers.Count == 0) SetNoIcon(); else SetCollapseIcon(); - farmCell.Value = farm.name; + siteCell.Value = site.name; } else { @@ -102,17 +102,17 @@ namespace XenAdmin.Controls.DataGridViewEx } } - public bool IsFarmRow + public bool IsSiteRow { - get { return isPvsFarmRow; } + get { return isPvsSiteRow; } } public bool IsServerRow { - get { return !isPvsFarmRow; } + get { return !isPvsSiteRow; } } - public PVS_site UnderlyingFarm + public PVS_site UnderlyingSite { get { return Tag as PVS_site; } } diff --git a/XenAdmin/Dialogs/PvsFarmDialog.Designer.cs b/XenAdmin/Dialogs/PvsSiteDialog.Designer.cs similarity index 89% rename from XenAdmin/Dialogs/PvsFarmDialog.Designer.cs rename to XenAdmin/Dialogs/PvsSiteDialog.Designer.cs index ebde0a49c..4fdb278c1 100644 --- a/XenAdmin/Dialogs/PvsFarmDialog.Designer.cs +++ b/XenAdmin/Dialogs/PvsSiteDialog.Designer.cs @@ -1,6 +1,6 @@ namespace XenAdmin.Dialogs { - partial class PvsFarmDialog + partial class PvsSiteDialog { /// /// Required designer variable. @@ -29,14 +29,14 @@ namespace XenAdmin.Dialogs private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PvsFarmDialog)); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PvsSiteDialog)); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); this.closeButton = new System.Windows.Forms.Button(); this.bottomPanel = new System.Windows.Forms.Panel(); this.mainPanel = new System.Windows.Forms.Panel(); - this.gridView = new XenAdmin.Controls.DataGridViewEx.CollapsingPvsFarmServerDataGridView(this.components); + this.gridView = new XenAdmin.Controls.DataGridViewEx.CollapsingPvsSiteServerDataGridView(this.components); this.expansionColumn = new System.Windows.Forms.DataGridViewImageColumn(); - this.farmColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.siteColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ipAddressesColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.firstPortColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.lastPortColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -72,7 +72,7 @@ namespace XenAdmin.Dialogs this.gridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; this.gridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.expansionColumn, - this.farmColumn, + this.siteColumn, this.ipAddressesColumn, this.firstPortColumn, this.lastPortColumn}); @@ -98,13 +98,13 @@ namespace XenAdmin.Dialogs this.expansionColumn.ReadOnly = true; this.expansionColumn.Resizable = System.Windows.Forms.DataGridViewTriState.False; // - // farmColumn + // siteColumn // - this.farmColumn.FillWeight = 108.4123F; - resources.ApplyResources(this.farmColumn, "farmColumn"); - this.farmColumn.Name = "farmColumn"; - this.farmColumn.ReadOnly = true; - this.farmColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.siteColumn.FillWeight = 108.4123F; + resources.ApplyResources(this.siteColumn, "siteColumn"); + this.siteColumn.Name = "siteColumn"; + this.siteColumn.ReadOnly = true; + this.siteColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // ipAddressesColumn // @@ -130,7 +130,7 @@ namespace XenAdmin.Dialogs this.lastPortColumn.ReadOnly = true; this.lastPortColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // - // PvsFarmDialog + // PvsSiteDialog // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; @@ -141,7 +141,7 @@ namespace XenAdmin.Dialogs this.HelpButton = false; this.MaximizeBox = true; this.MinimizeBox = true; - this.Name = "PvsFarmDialog"; + this.Name = "PvsSiteDialog"; this.ShowInTaskbar = true; this.bottomPanel.ResumeLayout(false); this.mainPanel.ResumeLayout(false); @@ -154,11 +154,11 @@ namespace XenAdmin.Dialogs private System.Windows.Forms.Button closeButton; private System.Windows.Forms.Panel bottomPanel; private System.Windows.Forms.Panel mainPanel; - private Controls.DataGridViewEx.CollapsingPvsFarmServerDataGridView gridView; - private System.Windows.Forms.DataGridViewTextBoxColumn farmColumn; + private Controls.DataGridViewEx.CollapsingPvsSiteServerDataGridView gridView; + private System.Windows.Forms.DataGridViewImageColumn expansionColumn; + private System.Windows.Forms.DataGridViewTextBoxColumn siteColumn; private System.Windows.Forms.DataGridViewTextBoxColumn ipAddressesColumn; private System.Windows.Forms.DataGridViewTextBoxColumn firstPortColumn; private System.Windows.Forms.DataGridViewTextBoxColumn lastPortColumn; - private System.Windows.Forms.DataGridViewImageColumn expansionColumn; } } \ No newline at end of file diff --git a/XenAdmin/Dialogs/PvsFarmDialog.cs b/XenAdmin/Dialogs/PvsSiteDialog.cs similarity index 80% rename from XenAdmin/Dialogs/PvsFarmDialog.cs rename to XenAdmin/Dialogs/PvsSiteDialog.cs index a53c2c0ff..53e4de37a 100644 --- a/XenAdmin/Dialogs/PvsFarmDialog.cs +++ b/XenAdmin/Dialogs/PvsSiteDialog.cs @@ -38,19 +38,19 @@ using XenAPI; namespace XenAdmin.Dialogs { - public partial class PvsFarmDialog : XenDialogBase + public partial class PvsSiteDialog : XenDialogBase { /// - /// Creates a dialog for viewing the PVS farms and PVS servers on a particular connection. + /// Creates a dialog for viewing the PVS sites and PVS servers on a particular connection. /// /// May not be null. - public PvsFarmDialog(IXenConnection _connection) + public PvsSiteDialog(IXenConnection _connection) { System.Diagnostics.Trace.Assert(_connection != null); connection = _connection; InitializeComponent(); - Text = string.Format(Messages.PVS_FARM_DIALOG_TITLE, this.connection.Name); + Text = string.Format(Messages.PVS_SITE_DIALOG_TITLE, this.connection.Name); System.Diagnostics.Trace.Assert(gridView.Columns.Count > 0); gridView.Columns[0].DefaultCellStyle.NullValue = null; @@ -62,17 +62,17 @@ namespace XenAdmin.Dialogs private void RegisterEventHandlers() { UnregisterEventHandlers(); - connection.Cache.RegisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); + connection.Cache.RegisterBatchCollectionChanged(PvsSiteBatchCollectionChanged); connection.Cache.RegisterBatchCollectionChanged(PvsServerBatchCollectionChanged); } private void UnregisterEventHandlers() { - connection.Cache.DeregisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); + connection.Cache.DeregisterBatchCollectionChanged(PvsSiteBatchCollectionChanged); connection.Cache.DeregisterBatchCollectionChanged(PvsServerBatchCollectionChanged); } - private void PvsFarmBatchCollectionChanged(object sender, EventArgs e) + private void PvsSiteBatchCollectionChanged(object sender, EventArgs e) { Program.Invoke(this, Rebuild); } @@ -98,17 +98,17 @@ namespace XenAdmin.Dialogs gridView.SuspendLayout(); gridView.Rows.Clear(); - var pvsFarms = connection.Cache.PVS_sites.ToList(); - pvsFarms.Sort(); + var pvsSites = connection.Cache.PVS_sites.ToList(); + pvsSites.Sort(); - foreach (var pvsFarm in pvsFarms) + foreach (var pvsSite in pvsSites) { - var farmRow = new CollapsingPvsFarmServerDataGridViewRow(pvsFarm); - gridView.Rows.Add(farmRow); + var siteRow = new CollapsingPvsSiteServerDataGridViewRow(pvsSite); + gridView.Rows.Add(siteRow); - foreach (var pvsServer in connection.ResolveAll(pvsFarm.servers)) + foreach (var pvsServer in connection.ResolveAll(pvsSite.servers)) { - var serverRow = new CollapsingPvsFarmServerDataGridViewRow(pvsServer); + var serverRow = new CollapsingPvsSiteServerDataGridViewRow(pvsServer); gridView.Rows.Add(serverRow); } } diff --git a/XenAdmin/Dialogs/PvsFarmDialog.ja.resx b/XenAdmin/Dialogs/PvsSiteDialog.ja.resx similarity index 97% rename from XenAdmin/Dialogs/PvsFarmDialog.ja.resx rename to XenAdmin/Dialogs/PvsSiteDialog.ja.resx index 477993039..5d4c2769f 100644 --- a/XenAdmin/Dialogs/PvsFarmDialog.ja.resx +++ b/XenAdmin/Dialogs/PvsSiteDialog.ja.resx @@ -421,7 +421,7 @@ 高可用性の構成 - PvsFarmDialog + PvsSiteDialog XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null diff --git a/XenAdmin/Dialogs/PvsFarmDialog.resx b/XenAdmin/Dialogs/PvsSiteDialog.resx similarity index 94% rename from XenAdmin/Dialogs/PvsFarmDialog.resx rename to XenAdmin/Dialogs/PvsSiteDialog.resx index db7e7b38d..d4ac7a588 100644 --- a/XenAdmin/Dialogs/PvsFarmDialog.resx +++ b/XenAdmin/Dialogs/PvsSiteDialog.resx @@ -160,7 +160,7 @@ Segoe UI, 9pt - 8, 324 + 8, 325 602, 29 @@ -192,13 +192,13 @@ 20 - + True - - PVS Farm + + PVS Site - + 65 @@ -238,7 +238,7 @@ 0, 0 - 602, 311 + 602, 312 0 @@ -247,7 +247,7 @@ gridView - XenAdmin.Controls.DataGridViewEx.CollapsingPvsFarmServerDataGridView, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + XenAdmin.Controls.DataGridViewEx.CollapsingPvsSiteServerDataGridView, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null mainPanel @@ -268,7 +268,7 @@ 0, 0, 0, 5 - 602, 316 + 602, 317 7 @@ -292,7 +292,7 @@ 96, 96 - 618, 361 + 618, 362 Tahoma, 8pt @@ -307,7 +307,7 @@ 8, 8, 8, 8 - PVS Farms + PVS Sites expansionColumn @@ -315,10 +315,10 @@ System.Windows.Forms.DataGridViewImageColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - farmColumn + + siteColumn - + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 @@ -340,7 +340,7 @@ System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - PvsFarmDialog + PvsSiteDialog XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null diff --git a/XenAdmin/Dialogs/PvsFarmDialog.zh-CN.resx b/XenAdmin/Dialogs/PvsSiteDialog.zh-CN.resx similarity index 97% rename from XenAdmin/Dialogs/PvsFarmDialog.zh-CN.resx rename to XenAdmin/Dialogs/PvsSiteDialog.zh-CN.resx index c2d31d7f1..3f7794c61 100644 --- a/XenAdmin/Dialogs/PvsFarmDialog.zh-CN.resx +++ b/XenAdmin/Dialogs/PvsSiteDialog.zh-CN.resx @@ -421,7 +421,7 @@ 配置高可用性 - PvsFarmDialog + PvsSiteDialog XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null diff --git a/XenAdmin/MainWindow.cs b/XenAdmin/MainWindow.cs index 8abf839b2..dab6b6e39 100644 --- a/XenAdmin/MainWindow.cs +++ b/XenAdmin/MainWindow.cs @@ -1427,8 +1427,8 @@ namespace XenAdmin ShowTab(ad_upsell ? TabPageADUpsell : TabPageAD, !multi && !SearchMode && (isPoolSelected || isHostSelected && isHostLive)); - bool hasPvsFarms = selectionConnection != null && selectionConnection.Cache.PVS_sites.Length > 0; - ShowTab(TabPagePvs, !multi && !SearchMode && isPoolOrLiveStandaloneHost && hasPvsFarms && !Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictPvsCache)); + bool hasPvsSites = selectionConnection != null && selectionConnection.Cache.PVS_sites.Length > 0; + ShowTab(TabPagePvs, !multi && !SearchMode && isPoolOrLiveStandaloneHost && hasPvsSites && !Helpers.FeatureForbidden(SelectionManager.Selection.FirstAsXenObject, Host.RestrictPvsCache)); foreach (TabPageFeature f in pluginManager.GetAllFeatures(f => !f.IsConsoleReplacement && !multi && f.ShowTab)) ShowTab(f.TabPage, true); diff --git a/XenAdmin/TabPages/PvsPage.Designer.cs b/XenAdmin/TabPages/PvsPage.Designer.cs index 18a29a2d2..0d9167ac7 100644 --- a/XenAdmin/TabPages/PvsPage.Designer.cs +++ b/XenAdmin/TabPages/PvsPage.Designer.cs @@ -44,17 +44,17 @@ this.ColumnSR = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnPrepopulation = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.label2 = new System.Windows.Forms.Label(); - this.dataGridViewFarms = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); - this.ColumnFarm = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.dataGridViewSites = new XenAdmin.Controls.DataGridViewEx.DataGridViewEx(); + this.ColumnSite = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnConfiguration = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ColumnSRs = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.ConfigureButton = new System.Windows.Forms.Button(); - this.ViewPvsFarmsButton = new System.Windows.Forms.Button(); + this.ViewPvsSitesButton = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.pageContainerPanel.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewVms)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridViewFarms)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSites)).BeginInit(); this.SuspendLayout(); // // pageContainerPanel @@ -68,9 +68,9 @@ this.tableLayoutPanel1.Controls.Add(this.button2, 0, 5); this.tableLayoutPanel1.Controls.Add(this.dataGridViewVms, 0, 4); this.tableLayoutPanel1.Controls.Add(this.label2, 0, 3); - this.tableLayoutPanel1.Controls.Add(this.dataGridViewFarms, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.dataGridViewSites, 0, 1); this.tableLayoutPanel1.Controls.Add(this.ConfigureButton, 0, 2); - this.tableLayoutPanel1.Controls.Add(this.ViewPvsFarmsButton, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.ViewPvsSitesButton, 1, 2); this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; // @@ -144,32 +144,32 @@ this.tableLayoutPanel1.SetColumnSpan(this.label2, 2); this.label2.Name = "label2"; // - // dataGridViewFarms + // dataGridViewSites // - this.dataGridViewFarms.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; - this.dataGridViewFarms.BackgroundColor = System.Drawing.SystemColors.Window; - this.dataGridViewFarms.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; - this.dataGridViewFarms.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; - this.dataGridViewFarms.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.ColumnFarm, + this.dataGridViewSites.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells; + this.dataGridViewSites.BackgroundColor = System.Drawing.SystemColors.Window; + this.dataGridViewSites.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None; + this.dataGridViewSites.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing; + this.dataGridViewSites.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.ColumnSite, this.ColumnConfiguration, this.ColumnSRs}); - this.tableLayoutPanel1.SetColumnSpan(this.dataGridViewFarms, 2); - resources.ApplyResources(this.dataGridViewFarms, "dataGridViewFarms"); - this.dataGridViewFarms.MultiSelect = true; - this.dataGridViewFarms.Name = "dataGridViewFarms"; - this.dataGridViewFarms.ReadOnly = true; + this.tableLayoutPanel1.SetColumnSpan(this.dataGridViewSites, 2); + resources.ApplyResources(this.dataGridViewSites, "dataGridViewSites"); + this.dataGridViewSites.MultiSelect = true; + this.dataGridViewSites.Name = "dataGridViewSites"; + this.dataGridViewSites.ReadOnly = true; // - // ColumnFarm + // ColumnSite // - this.ColumnFarm.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; + this.ColumnSite.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader; dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.TopLeft; dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.ColumnFarm.DefaultCellStyle = dataGridViewCellStyle5; - this.ColumnFarm.FillWeight = 20F; - resources.ApplyResources(this.ColumnFarm, "ColumnFarm"); - this.ColumnFarm.Name = "ColumnFarm"; - this.ColumnFarm.ReadOnly = true; + this.ColumnSite.DefaultCellStyle = dataGridViewCellStyle5; + this.ColumnSite.FillWeight = 20F; + resources.ApplyResources(this.ColumnSite, "ColumnSite"); + this.ColumnSite.Name = "ColumnSite"; + this.ColumnSite.ReadOnly = true; // // ColumnConfiguration // @@ -197,12 +197,12 @@ this.ConfigureButton.Name = "ConfigureButton"; this.ConfigureButton.UseVisualStyleBackColor = true; // - // ViewPvsFarmsButton + // ViewPvsSitesButton // - resources.ApplyResources(this.ViewPvsFarmsButton, "ViewPvsFarmsButton"); - this.ViewPvsFarmsButton.Name = "ViewPvsFarmsButton"; - this.ViewPvsFarmsButton.UseVisualStyleBackColor = true; - this.ViewPvsFarmsButton.Click += new System.EventHandler(this.ViewPvsFarmsButton_Click); + resources.ApplyResources(this.ViewPvsSitesButton, "ViewPvsSitesButton"); + this.ViewPvsSitesButton.Name = "ViewPvsSitesButton"; + this.ViewPvsSitesButton.UseVisualStyleBackColor = true; + this.ViewPvsSitesButton.Click += new System.EventHandler(this.ViewPvsSitesButton_Click); // // label1 // @@ -219,7 +219,7 @@ this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridViewVms)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridViewFarms)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridViewSites)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -228,9 +228,9 @@ #endregion private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - private Controls.DataGridViewEx.DataGridViewEx dataGridViewFarms; + private Controls.DataGridViewEx.DataGridViewEx dataGridViewSites; public System.Windows.Forms.Button ConfigureButton; - public System.Windows.Forms.Button ViewPvsFarmsButton; + public System.Windows.Forms.Button ViewPvsSitesButton; private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; public System.Windows.Forms.Button button2; @@ -239,7 +239,7 @@ private System.Windows.Forms.DataGridViewTextBoxColumn columnCurrentlyCached; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnSR; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnPrepopulation; - private System.Windows.Forms.DataGridViewTextBoxColumn ColumnFarm; + private System.Windows.Forms.DataGridViewTextBoxColumn ColumnSite; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnConfiguration; private System.Windows.Forms.DataGridViewTextBoxColumn ColumnSRs; } diff --git a/XenAdmin/TabPages/PvsPage.cs b/XenAdmin/TabPages/PvsPage.cs index 2410022ea..118e3284c 100644 --- a/XenAdmin/TabPages/PvsPage.cs +++ b/XenAdmin/TabPages/PvsPage.cs @@ -61,7 +61,7 @@ namespace XenAdmin.TabPages { if (connection != null) { - connection.Cache.DeregisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); + connection.Cache.DeregisterBatchCollectionChanged(PvsSiteBatchCollectionChanged); connection.Cache.DeregisterBatchCollectionChanged(PvsProxyBatchCollectionChanged); } @@ -69,16 +69,16 @@ namespace XenAdmin.TabPages if (connection != null) { - connection.Cache.RegisterBatchCollectionChanged(PvsFarmBatchCollectionChanged); + connection.Cache.RegisterBatchCollectionChanged(PvsSiteBatchCollectionChanged); connection.Cache.RegisterBatchCollectionChanged(PvsProxyBatchCollectionChanged); } - LoadFarms(); + LoadSites(); LoadVMs(); } } - private void LoadFarms() + private void LoadSites() { Program.AssertOnEventThread(); @@ -87,22 +87,22 @@ namespace XenAdmin.TabPages try { - dataGridViewFarms.SuspendLayout(); - dataGridViewFarms.Rows.Clear(); + dataGridViewSites.SuspendLayout(); + dataGridViewSites.Rows.Clear(); var rowList = new List(); - foreach (var pvsFarm in Connection.Cache.PVS_sites) - rowList.Add(NewPvsFarmRow(pvsFarm)); + foreach (var pvsSite in Connection.Cache.PVS_sites) + rowList.Add(NewPvsSiteRow(pvsSite)); - dataGridViewFarms.Rows.AddRange(rowList.ToArray()); + dataGridViewSites.Rows.AddRange(rowList.ToArray()); - if (dataGridViewFarms.SelectedRows.Count == 0 && dataGridViewFarms.Rows.Count > 0) - dataGridViewFarms.Rows[0].Selected = true; + if (dataGridViewSites.SelectedRows.Count == 0 && dataGridViewSites.Rows.Count > 0) + dataGridViewSites.Rows[0].Selected = true; } finally { - dataGridViewFarms.ResumeLayout(); + dataGridViewSites.ResumeLayout(); } } @@ -132,20 +132,20 @@ namespace XenAdmin.TabPages } } - private DataGridViewRow NewPvsFarmRow(PVS_site pvsFarm) + private DataGridViewRow NewPvsSiteRow(PVS_site pvsSite) { - var farmCell = new DataGridViewTextBoxCell {Value = pvsFarm.name}; + var siteCell = new DataGridViewTextBoxCell {Value = pvsSite.name}; var configurationCell = new DataGridViewTextBoxCell { - Value = pvsFarm.cache_storage.Count > 0 ? Messages.PVS_CACHE_MEMORY_AND_DISK: Messages.PVS_CACHE_MEMORY_ONLY + Value = pvsSite.cache_storage.Count > 0 ? Messages.PVS_CACHE_MEMORY_AND_DISK: Messages.PVS_CACHE_MEMORY_ONLY }; var cacheSrsCell = new DataGridViewTextBoxCell { - Value = string.Join(", ", Connection.ResolveAll(pvsFarm.cache_storage)) + Value = string.Join(", ", Connection.ResolveAll(pvsSite.cache_storage)) }; - var newRow = new DataGridViewRow { Tag = pvsFarm }; - newRow.Cells.AddRange(farmCell, configurationCell, cacheSrsCell); + var newRow = new DataGridViewRow { Tag = pvsSite }; + newRow.Cells.AddRange(siteCell, configurationCell, cacheSrsCell); return newRow; } @@ -182,9 +182,9 @@ namespace XenAdmin.TabPages } } - private void PvsFarmBatchCollectionChanged(object sender, EventArgs e) + private void PvsSiteBatchCollectionChanged(object sender, EventArgs e) { - Program.Invoke(this, LoadFarms); + Program.Invoke(this, LoadSites); } private void PvsProxyBatchCollectionChanged(object sender, EventArgs e) @@ -208,9 +208,9 @@ namespace XenAdmin.TabPages } } - private void ViewPvsFarmsButton_Click(object sender, EventArgs e) + private void ViewPvsSitesButton_Click(object sender, EventArgs e) { - Program.MainWindow.ShowPerConnectionWizard(connection, new PvsFarmDialog(connection)); + Program.MainWindow.ShowPerConnectionWizard(connection, new PvsSiteDialog(connection)); } } } diff --git a/XenAdmin/TabPages/PvsPage.ja.resx b/XenAdmin/TabPages/PvsPage.ja.resx index 70ad390e8..b4289fa5b 100644 --- a/XenAdmin/TabPages/PvsPage.ja.resx +++ b/XenAdmin/TabPages/PvsPage.ja.resx @@ -131,7 +131,7 @@ - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewFarms" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewSites" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> @@ -270,7 +270,7 @@ 2 - + True @@ -279,34 +279,34 @@ True - + Top, Left, Right - + Segoe UI, 9pt - + 0, 23 - + 0, 0, 1, 5 - + 718, 165 - + 5 - - dataGridViewFarms + + dataGridViewSites - + XenAdmin.Controls.DataGridViewEx.DataGridViewEx, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - + tableLayoutPanel1 - + 3 @@ -361,7 +361,7 @@ 7 - &View PVS Farms... + &View PVS Sites... button1 @@ -439,7 +439,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewFarms" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewSites" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> True @@ -474,13 +474,13 @@ Marked for prepopulation - + True - - PVS Farm + + PVS Site - + 80 @@ -534,10 +534,10 @@ System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ColumnFarm + + ColumnSite - + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/XenAdmin/TabPages/PvsPage.resx b/XenAdmin/TabPages/PvsPage.resx index 08c69385f..fe0069485 100644 --- a/XenAdmin/TabPages/PvsPage.resx +++ b/XenAdmin/TabPages/PvsPage.resx @@ -267,16 +267,16 @@ 2 - + True - - PVS Farm + + PVS Site - + 80 - + 82 @@ -300,34 +300,34 @@ 80 - + Fill - + Segoe UI, 9pt - + 0, 23 - + 0, 0, 1, 5 - + 561, 155 - + 5 - - dataGridViewFarms + + dataGridViewSites - + XenAdmin.Controls.DataGridViewEx.DataGridViewEx, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - + tableLayoutPanel1 - + 3 @@ -363,37 +363,37 @@ 4 - + True - + NoControl - + 131, 186 - + 0, 3, 3, 3 - + 104, 23 - + 7 - - View PVS &Farms... + + View PVS &Sites... - - ViewPvsFarmsButton + + ViewPvsSitesButton - + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + tableLayoutPanel1 - + 5 @@ -460,7 +460,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewFarms" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="ViewPvsFarmsButton" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,Absolute,160,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewSites" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="ViewPvsSitesButton" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,Percent,100" /><Rows Styles="AutoSize,0,Absolute,160,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> 0, 91 @@ -513,10 +513,10 @@ System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ColumnFarm + + ColumnSite - + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/XenAdmin/TabPages/PvsPage.zh-CN.resx b/XenAdmin/TabPages/PvsPage.zh-CN.resx index 70ad390e8..b4289fa5b 100644 --- a/XenAdmin/TabPages/PvsPage.zh-CN.resx +++ b/XenAdmin/TabPages/PvsPage.zh-CN.resx @@ -131,7 +131,7 @@ - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewFarms" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewSites" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> @@ -270,7 +270,7 @@ 2 - + True @@ -279,34 +279,34 @@ True - + Top, Left, Right - + Segoe UI, 9pt - + 0, 23 - + 0, 0, 1, 5 - + 718, 165 - + 5 - - dataGridViewFarms + + dataGridViewSites - + XenAdmin.Controls.DataGridViewEx.DataGridViewEx, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - + tableLayoutPanel1 - + 3 @@ -361,7 +361,7 @@ 7 - &View PVS Farms... + &View PVS Sites... button1 @@ -439,7 +439,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewFarms" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="button2" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewVms" Row="4" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="label2" Row="3" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="dataGridViewSites" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="ConfigureButton" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="button1" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /></Controls><Columns Styles="AutoSize,0,AutoSize,0" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100,AutoSize,0" /></TableLayoutSettings> True @@ -474,13 +474,13 @@ Marked for prepopulation - + True - - PVS Farm + + PVS Site - + 80 @@ -534,10 +534,10 @@ System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ColumnFarm + + ColumnSite - + System.Windows.Forms.DataGridViewTextBoxColumn, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj index c4ee5f729..4ae3acd29 100644 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -157,12 +157,12 @@ ConsolePanel.cs - - + + Component - - CollapsingPvsFarmServerDataGridView.cs + + CollapsingPvsSiteServerDataGridView.cs Component @@ -226,11 +226,11 @@ - + Form - - PvsFarmDialog.cs + + PvsSiteDialog.cs @@ -1550,16 +1550,16 @@ Designer AdPasswordPrompt.cs - - PvsFarmDialog.cs + + PvsSiteDialog.cs Designer - - PvsFarmDialog.cs + + PvsSiteDialog.cs Designer - - PvsFarmDialog.cs + + PvsSiteDialog.cs Designer @@ -1864,9 +1864,11 @@ PvsPage.cs + Designer PvsPage.cs + Designer PvsPage.cs diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index b22cd6d21..19567a0cf 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Runtime Version:4.0.30319.34209 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -27234,11 +27234,11 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to PVS Farms - '{0}'. + /// Looks up a localized string similar to PVS Sites - '{0}'. /// - public static string PVS_FARM_DIALOG_TITLE { + public static string PVS_SITE_DIALOG_TITLE { get { - return ResourceManager.GetString("PVS_FARM_DIALOG_TITLE", resourceCulture); + return ResourceManager.GetString("PVS_SITE_DIALOG_TITLE", resourceCulture); } } diff --git a/XenModel/Messages.ja.resx b/XenModel/Messages.ja.resx index 626bbdbdb..2279511fb 100644 --- a/XenModel/Messages.ja.resx +++ b/XenModel/Messages.ja.resx @@ -9429,8 +9429,8 @@ VM が再起動したら、[[XenServer product] Tools のインストール] を プロキシ サーバーはサポートされません。 - - PVS Farms - '{0}' + + PVS Sites - '{0}' [XenServer product] Tools 未インストール diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 97a58ae7c..1a84292e3 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -9477,8 +9477,8 @@ Press OK to continue the wizard and return to the server and follow the instruct Memory only - - PVS Farms - '{0}' + + PVS Sites - '{0}' PVS Read Cache diff --git a/XenModel/Messages.zh-CN.resx b/XenModel/Messages.zh-CN.resx index e7e975707..518d73fdb 100644 --- a/XenModel/Messages.zh-CN.resx +++ b/XenModel/Messages.zh-CN.resx @@ -9428,8 +9428,8 @@ VM 克隆使用文件管理器的快照和克隆功能来实现高性能,并 不支持代理服务器。 - - PVS Farms - '{0}' + + PVS Sites - '{0}' 未安装 [XenServer product] Tools From 72be4e1141bb9d28e136158a695ae79824da1ef8 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Mon, 1 Aug 2016 09:25:10 +0100 Subject: [PATCH 3/4] CP-16935: Configure Control domain memory for a host - Added Control Domain memory entry in the host memory control on Memory tab. - Control domain memory is editable for Ely and greater hosts. - Can be changed from a dialog that requires host to be in maintenance mode and triggers a host reboot after the memory is changed. - This dialog is available from Server main menu and from the host memory tab. - Also removed unused unit controls on host and VM memory bars. Signed-off-by: Mihaela Stoica --- .../ChangeControlDomainMemoryCommand.cs | 98 ++++ .../Controls/Ballooning/BallooningColors.cs | 3 +- .../Ballooning/HostMemoryControls.Designer.cs | 26 +- .../Controls/Ballooning/HostMemoryControls.cs | 22 +- .../Ballooning/HostMemoryControls.resx | 194 ++++--- .../Ballooning/HostMemoryRow.Designer.cs | 3 - .../Controls/Ballooning/HostMemoryRow.resx | 31 +- XenAdmin/Controls/Ballooning/HostShinyBar.cs | 9 +- .../Ballooning/MemorySpinner.Designer.cs | 1 - .../VMMemoryControlsNoEdit.Designer.cs | 28 +- .../Ballooning/VMMemoryControlsNoEdit.cs | 6 +- .../Ballooning/VMMemoryControlsNoEdit.resx | 121 +--- .../ControlDomainMemoryDialog.Designer.cs | 160 ++++++ XenAdmin/Dialogs/ControlDomainMemoryDialog.cs | 177 ++++++ .../Dialogs/ControlDomainMemoryDialog.ja.resx | 543 ++++++++++++++++++ .../Dialogs/ControlDomainMemoryDialog.resx | 543 ++++++++++++++++++ .../ControlDomainMemoryDialog.zh-CN.resx | 543 ++++++++++++++++++ XenAdmin/MainWindow.Designer.cs | 9 + XenAdmin/MainWindow.resx | 58 +- XenAdmin/XenAdmin.csproj | 16 + XenAdminTests/TabsAndMenus/MainMenuGeorge.cs | 48 +- .../Host/ChangeControlDomainMemoryAction.cs | 65 +++ XenModel/Messages.Designer.cs | 49 +- XenModel/Messages.resx | 19 +- XenModel/Utils/Helpers.cs | 19 + XenModel/XenAPI-Extensions/Host.cs | 16 + XenModel/XenModel.csproj | 1 + 27 files changed, 2506 insertions(+), 302 deletions(-) create mode 100644 XenAdmin/Commands/ChangeControlDomainMemoryCommand.cs create mode 100644 XenAdmin/Dialogs/ControlDomainMemoryDialog.Designer.cs create mode 100644 XenAdmin/Dialogs/ControlDomainMemoryDialog.cs create mode 100644 XenAdmin/Dialogs/ControlDomainMemoryDialog.ja.resx create mode 100644 XenAdmin/Dialogs/ControlDomainMemoryDialog.resx create mode 100644 XenAdmin/Dialogs/ControlDomainMemoryDialog.zh-CN.resx create mode 100644 XenModel/Actions/Host/ChangeControlDomainMemoryAction.cs diff --git a/XenAdmin/Commands/ChangeControlDomainMemoryCommand.cs b/XenAdmin/Commands/ChangeControlDomainMemoryCommand.cs new file mode 100644 index 000000000..b2a5b520d --- /dev/null +++ b/XenAdmin/Commands/ChangeControlDomainMemoryCommand.cs @@ -0,0 +1,98 @@ +/* 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; +using System.Collections.Generic; +using System.Text; +using XenAPI; +using XenAdmin.Core; +using XenAdmin.Network; +using XenAdmin.Wizards.NewVMWizard; +using XenAdmin.Properties; +using System.Drawing; +using System.Collections.ObjectModel; +using System.Windows.Forms; +using XenAdmin.Dialogs; +using XenAdmin.Actions; + + +namespace XenAdmin.Commands +{ + /// + /// Launches the Control Domain Memory dialog. + /// + internal class ChangeControlDomainMemoryCommand : Command + { + /// + /// Initializes a new instance of this Command. The parameter-less constructor is required if + /// this Command is to be attached to a ToolStrip menu item or button. It should not be used in any other scenario. + /// + public ChangeControlDomainMemoryCommand() + { + } + + public ChangeControlDomainMemoryCommand(IMainWindow mainWindow, IEnumerable selection) + : base(mainWindow, selection) + { + } + + + protected override void ExecuteCore(SelectedItemCollection selection) + { + Host host = selection[0].HostAncestor; + using (var dlg = new ControlDomainMemoryDialog(host)) + dlg.ShowDialog(Program.MainWindow); + } + + protected override bool ConfirmationRequired + { + get { return false; } + } + + private bool CanExecute(Host host) + { + return host != null && host.IsLive && Helpers.ElyOrGreater(host); + } + + protected override bool CanExecuteCore(SelectedItemCollection selection) + { + return selection.ContainsOneItemOfType() && selection.AtLeastOneXenObjectCan(CanExecute); + } + + public override string MenuText + { + get + { + return Messages.HOST_MENU_CONTROL_DOMAIN_MEMORY; + } + } + } +} diff --git a/XenAdmin/Controls/Ballooning/BallooningColors.cs b/XenAdmin/Controls/Ballooning/BallooningColors.cs index 4e9a1d187..0d418f9c7 100644 --- a/XenAdmin/Controls/Ballooning/BallooningColors.cs +++ b/XenAdmin/Controls/Ballooning/BallooningColors.cs @@ -39,7 +39,8 @@ namespace XenAdmin.Controls.Ballooning public static Color VMShinyBar_Unused = Color.Black; public static Color VMShinyBar_Text = Color.White; - public static Color HostShinyBar_Control = Color.DimGray; + public static Color HostShinyBar_Xen = Color.DarkGray; + public static Color HostShinyBar_ControlDomain = Color.DimGray; public static Color[] HostShinyBar_VMs = { Color.MidnightBlue, Color.SteelBlue }; public static Color HostShinyBar_Unused = Color.Black; public static Color HostShinyBar_Text = Color.White; diff --git a/XenAdmin/Controls/Ballooning/HostMemoryControls.Designer.cs b/XenAdmin/Controls/Ballooning/HostMemoryControls.Designer.cs index 2d6773c86..da83dcfb8 100644 --- a/XenAdmin/Controls/Ballooning/HostMemoryControls.Designer.cs +++ b/XenAdmin/Controls/Ballooning/HostMemoryControls.Designer.cs @@ -39,9 +39,10 @@ namespace XenAdmin.Controls.Ballooning this.valueTotDynMax = new System.Windows.Forms.Label(); this.unitsTotal = new System.Windows.Forms.Label(); this.unitsUsed = new System.Windows.Forms.Label(); - this.unitsAvail = new System.Windows.Forms.Label(); this.unitsTotDynMax = new System.Windows.Forms.Label(); this.labelOvercommit = new System.Windows.Forms.Label(); + this.labelControlDomain = new System.Windows.Forms.Label(); + this.valueControlDomain = new System.Windows.Forms.LinkLabel(); this.hostShinyBar = new XenAdmin.Controls.Ballooning.HostShinyBar(); this.SuspendLayout(); // @@ -95,11 +96,6 @@ namespace XenAdmin.Controls.Ballooning resources.ApplyResources(this.unitsUsed, "unitsUsed"); this.unitsUsed.Name = "unitsUsed"; // - // unitsAvail - // - resources.ApplyResources(this.unitsAvail, "unitsAvail"); - this.unitsAvail.Name = "unitsAvail"; - // // unitsTotDynMax // resources.ApplyResources(this.unitsTotDynMax, "unitsTotDynMax"); @@ -110,6 +106,18 @@ namespace XenAdmin.Controls.Ballooning resources.ApplyResources(this.labelOvercommit, "labelOvercommit"); this.labelOvercommit.Name = "labelOvercommit"; // + // labelControlDomain + // + resources.ApplyResources(this.labelControlDomain, "labelControlDomain"); + this.labelControlDomain.Name = "labelControlDomain"; + // + // valueControlDomain + // + resources.ApplyResources(this.valueControlDomain, "valueControlDomain"); + this.valueControlDomain.DisabledLinkColor = System.Drawing.SystemColors.ControlText; + this.valueControlDomain.Name = "valueControlDomain"; + this.valueControlDomain.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.valueControlDomain_LinkClicked); + // // hostShinyBar // resources.ApplyResources(this.hostShinyBar, "hostShinyBar"); @@ -119,9 +127,10 @@ namespace XenAdmin.Controls.Ballooning // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.valueControlDomain); + this.Controls.Add(this.labelControlDomain); this.Controls.Add(this.labelOvercommit); this.Controls.Add(this.unitsTotDynMax); - this.Controls.Add(this.unitsAvail); this.Controls.Add(this.unitsUsed); this.Controls.Add(this.unitsTotal); this.Controls.Add(this.valueTotDynMax); @@ -152,8 +161,9 @@ namespace XenAdmin.Controls.Ballooning private System.Windows.Forms.Label valueTotDynMax; private System.Windows.Forms.Label unitsTotal; private System.Windows.Forms.Label unitsUsed; - private System.Windows.Forms.Label unitsAvail; private System.Windows.Forms.Label unitsTotDynMax; private System.Windows.Forms.Label labelOvercommit; + private System.Windows.Forms.Label labelControlDomain; + private System.Windows.Forms.LinkLabel valueControlDomain; } } diff --git a/XenAdmin/Controls/Ballooning/HostMemoryControls.cs b/XenAdmin/Controls/Ballooning/HostMemoryControls.cs index abe881405..cd22442df 100644 --- a/XenAdmin/Controls/Ballooning/HostMemoryControls.cs +++ b/XenAdmin/Controls/Ballooning/HostMemoryControls.cs @@ -37,6 +37,8 @@ using System.Data; using System.Text; using System.Windows.Forms; using XenAPI; +using XenAdmin.Dialogs; +using XenAdmin.Core; namespace XenAdmin.Controls.Ballooning @@ -67,6 +69,16 @@ namespace XenAdmin.Controls.Ballooning if (metrics != null) metrics.PropertyChanged += vm_metrics_PropertyChanged; } + if (Helpers.ElyOrGreater(_host)) + { + valueControlDomain.LinkBehavior = LinkBehavior.AlwaysUnderline; + valueControlDomain.Links[0].Enabled = true; + } + else + { + valueControlDomain.LinkBehavior = LinkBehavior.NeverUnderline; + valueControlDomain.Links[0].Enabled = false; + } } } @@ -81,13 +93,14 @@ namespace XenAdmin.Controls.Ballooning long xen_memory = host.xen_memory_calc; long avail = host.memory_available_calc; long tot_dyn_max = host.tot_dyn_max + xen_memory; + long dom0 = host.dom0_memory; long overcommit = total > 0 ? (long)Math.Round((double)tot_dyn_max / (double)total * 100.0) : 0; // Initialize the shiny bar - hostShinyBar.Initialize(host, xen_memory); + hostShinyBar.Initialize(host, xen_memory, dom0); // Set the text values valueTotal.Text = Util.MemorySizeStringSuitableUnits(total, true); @@ -95,6 +108,7 @@ namespace XenAdmin.Controls.Ballooning valueAvail.Text = Util.MemorySizeStringSuitableUnits(avail, true); valueTotDynMax.Text = Util.MemorySizeStringSuitableUnits(tot_dyn_max, true); labelOvercommit.Text = string.Format(Messages.OVERCOMMIT, overcommit); + valueControlDomain.Text = Util.MemorySizeStringSuitableUnits(dom0, true); } void vm_PropertyChanged(object sender, PropertyChangedEventArgs e) @@ -114,5 +128,11 @@ namespace XenAdmin.Controls.Ballooning if (e.PropertyName == "memory_actual") this.Refresh(); } + + private void valueControlDomain_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + using (var dlg = new ControlDomainMemoryDialog(host)) + dlg.ShowDialog(Program.MainWindow); + } } } diff --git a/XenAdmin/Controls/Ballooning/HostMemoryControls.resx b/XenAdmin/Controls/Ballooning/HostMemoryControls.resx index ce2753b45..392e8bc7a 100644 --- a/XenAdmin/Controls/Ballooning/HostMemoryControls.resx +++ b/XenAdmin/Controls/Ballooning/HostMemoryControls.resx @@ -132,7 +132,7 @@ 0, 0, 0, 0 - 111, 18 + 123, 18 @@ -154,7 +154,7 @@ $this - 12 + 13 Top, Right @@ -169,7 +169,7 @@ 0, 0, 0, 0 - 111, 18 + 123, 18 2 @@ -190,7 +190,7 @@ $this - 11 + 12 Top, Right @@ -199,13 +199,13 @@ NoControl - 490, 36 + 490, 54 0, 0, 0, 0 - 111, 18 + 123, 18 3 @@ -226,7 +226,7 @@ $this - 10 + 11 Top, Right @@ -235,13 +235,13 @@ NoControl - 490, 54 + 490, 72 0, 0, 0, 0 - 111, 18 + 123, 18 4 @@ -262,7 +262,7 @@ $this - 9 + 10 Top, Right @@ -271,7 +271,7 @@ NoControl - 605, 0 + 646, 0 0, 0, 0, 0 @@ -295,7 +295,7 @@ $this - 8 + 9 Top, Right @@ -304,7 +304,7 @@ NoControl - 605, 18 + 646, 18 0, 0, 0, 0 @@ -328,7 +328,7 @@ $this - 7 + 8 Top, Right @@ -337,7 +337,7 @@ NoControl - 605, 36 + 646, 54 0, 0, 0, 0 @@ -361,7 +361,7 @@ $this - 6 + 7 Top, Right @@ -370,7 +370,7 @@ NoControl - 605, 54 + 646, 72 0, 0, 0, 0 @@ -394,28 +394,19 @@ $this - 5 - - - Top, Right + 6 NoControl - 674, 0 - - - 0, 0, 0, 0 + 0, 0 - 26, 18 + 100, 23 - 11 - - - MiddleCenter + 21 unitsTotal @@ -427,28 +418,19 @@ $this - 4 - - - Top, Right + 5 NoControl - 674, 18 - - - 0, 0, 0, 0 + 0, 0 - 26, 18 + 100, 23 - 12 - - - MiddleCenter + 20 unitsUsed @@ -460,61 +442,19 @@ $this - 3 - - - Top, Right - - - NoControl - - - 674, 36 - - - 0, 0, 0, 0 - - - 26, 18 - - - 13 - - - MiddleCenter - - - unitsAvail - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - Top, Right + 4 NoControl - 674, 54 - - - 0, 0, 0, 0 + 0, 0 - 26, 18 + 100, 23 - 14 - - - MiddleCenter + 19 unitsTotDynMax @@ -526,7 +466,7 @@ $this - 1 + 3 Top, Right @@ -535,7 +475,7 @@ NoControl - 490, 72 + 490, 90 0, 0, 0, 0 @@ -559,6 +499,72 @@ $this + 2 + + + Top, Right + + + NoControl + + + 490, 36 + + + 0, 0, 0, 0 + + + 143, 18 + + + 16 + + + Control domain memory + + + MiddleLeft + + + labelControlDomain + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 1 + + + Top, Right + + + NoControl + + + 646, 36 + + + 54, 18 + + + 18 + + + MiddleRight + + + valueControlDomain + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + 0 @@ -571,7 +577,7 @@ 0, 0, 0, 0 - 420, 90 + 420, 111 0 @@ -586,7 +592,7 @@ $this - 13 + 14 True @@ -601,7 +607,7 @@ 700, 90 - 700, 90 + 700, 111 HostMemoryControls diff --git a/XenAdmin/Controls/Ballooning/HostMemoryRow.Designer.cs b/XenAdmin/Controls/Ballooning/HostMemoryRow.Designer.cs index c71b21077..1154d3cbf 100644 --- a/XenAdmin/Controls/Ballooning/HostMemoryRow.Designer.cs +++ b/XenAdmin/Controls/Ballooning/HostMemoryRow.Designer.cs @@ -47,14 +47,12 @@ namespace XenAdmin.Controls.Ballooning // resources.ApplyResources(this.hostMemoryControls, "hostMemoryControls"); this.hostMemoryControls.BackColor = System.Drawing.Color.Transparent; - this.hostMemoryControls.MinimumSize = new System.Drawing.Size(700, 90); this.hostMemoryControls.Name = "hostMemoryControls"; // // memoryRowLabel // resources.ApplyResources(this.memoryRowLabel, "memoryRowLabel"); this.memoryRowLabel.BackColor = System.Drawing.Color.Transparent; - this.memoryRowLabel.MinimumSize = new System.Drawing.Size(0, 26); this.memoryRowLabel.Name = "memoryRowLabel"; // // HostMemoryRow @@ -64,7 +62,6 @@ namespace XenAdmin.Controls.Ballooning this.BackColor = System.Drawing.Color.Transparent; this.Controls.Add(this.panel); this.DoubleBuffered = true; - this.MinimumSize = new System.Drawing.Size(700, 118); this.Name = "HostMemoryRow"; this.panel.ResumeLayout(false); this.ResumeLayout(false); diff --git a/XenAdmin/Controls/Ballooning/HostMemoryRow.resx b/XenAdmin/Controls/Ballooning/HostMemoryRow.resx index 875bf2995..0edce9b94 100644 --- a/XenAdmin/Controls/Ballooning/HostMemoryRow.resx +++ b/XenAdmin/Controls/Ballooning/HostMemoryRow.resx @@ -112,29 +112,32 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - + Top, Bottom, Left, Right Top, Left, Right - + 1, 27 0, 0, 0, 0 - - 786, 90 + + 700, 90 - + + 786, 111 + + 1 @@ -159,6 +162,9 @@ 0, 0, 0, 0 + + 0, 26 + 10, 5, 10, 5 @@ -187,7 +193,7 @@ 0, 0, 0, 0 - 788, 118 + 788, 139 2 @@ -204,7 +210,7 @@ 0 - + True @@ -213,13 +219,16 @@ 0, 0, 0, 0 + + 700, 139 + - 788, 118 + 788, 139 HostMemoryRow - System.Windows.Forms.UserControl, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Windows.Forms.UserControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 \ No newline at end of file diff --git a/XenAdmin/Controls/Ballooning/HostShinyBar.cs b/XenAdmin/Controls/Ballooning/HostShinyBar.cs index 0f61905e7..21ebcf7ac 100644 --- a/XenAdmin/Controls/Ballooning/HostShinyBar.cs +++ b/XenAdmin/Controls/Ballooning/HostShinyBar.cs @@ -53,12 +53,14 @@ namespace XenAdmin.Controls.Ballooning List vms; Dictionary vm_metrics; long xen_memory; + long dom0_memory; - public void Initialize(Host host, long xen_memory) + public void Initialize(Host host, long xen_memory, long dom0_memory) { this.host = host; this.host_metrics = host.Connection.Resolve(host.metrics); this.xen_memory = xen_memory; + this.dom0_memory = dom0_memory; vms = host.Connection.ResolveAll(host.resident_VMs); vm_metrics = new Dictionary(); foreach (VM vm in vms) @@ -79,7 +81,10 @@ namespace XenAdmin.Controls.Ballooning // A bar for Xen memory double left = (double)barArea.Left; - DrawSegment(g, xen_memory, bytesPerPixel, Messages.MEMORY_XEN, null, BallooningColors.HostShinyBar_Control, ref left); + DrawSegment(g, xen_memory - dom0_memory, bytesPerPixel, Messages.MEMORY_XEN, null, BallooningColors.HostShinyBar_Xen, ref left); + + // A bar for Dom0 memory + DrawSegment(g, dom0_memory, bytesPerPixel, string.Format(Messages.CONTROL_DOM_ON_HOST, host.Name), null, BallooningColors.HostShinyBar_ControlDomain, ref left); // A bar for each VM int i = 0; diff --git a/XenAdmin/Controls/Ballooning/MemorySpinner.Designer.cs b/XenAdmin/Controls/Ballooning/MemorySpinner.Designer.cs index 44fa6fe0b..9aec2010e 100644 --- a/XenAdmin/Controls/Ballooning/MemorySpinner.Designer.cs +++ b/XenAdmin/Controls/Ballooning/MemorySpinner.Designer.cs @@ -64,7 +64,6 @@ namespace XenAdmin.Controls.Ballooning // SpinnerUnits // resources.ApplyResources(this.SpinnerUnits, "SpinnerUnits"); - this.SpinnerUnits.BackColor = System.Drawing.SystemColors.Control; this.SpinnerUnits.Name = "SpinnerUnits"; // // MemorySpinner diff --git a/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.Designer.cs b/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.Designer.cs index 8df14ede7..b72c50399 100644 --- a/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.Designer.cs +++ b/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.Designer.cs @@ -37,9 +37,6 @@ namespace XenAdmin.Controls.Ballooning this.valueDynMin = new System.Windows.Forms.Label(); this.valueDynMax = new System.Windows.Forms.Label(); this.valueStatMax = new System.Windows.Forms.Label(); - this.unitsDynMin = new System.Windows.Forms.Label(); - this.unitsDynMax = new System.Windows.Forms.Label(); - this.unitsStatMax = new System.Windows.Forms.Label(); this.editButton = new System.Windows.Forms.Button(); this.vmShinyBar = new XenAdmin.Controls.Ballooning.VMShinyBar(); ((System.ComponentModel.ISupportInitialize)(this.iconBoxDynMin)).BeginInit(); @@ -98,24 +95,6 @@ namespace XenAdmin.Controls.Ballooning this.valueStatMax.BackColor = System.Drawing.Color.Transparent; this.valueStatMax.Name = "valueStatMax"; // - // unitsDynMin - // - resources.ApplyResources(this.unitsDynMin, "unitsDynMin"); - this.unitsDynMin.BackColor = System.Drawing.Color.Transparent; - this.unitsDynMin.Name = "unitsDynMin"; - // - // unitsDynMax - // - resources.ApplyResources(this.unitsDynMax, "unitsDynMax"); - this.unitsDynMax.BackColor = System.Drawing.Color.Transparent; - this.unitsDynMax.Name = "unitsDynMax"; - // - // unitsStatMax - // - resources.ApplyResources(this.unitsStatMax, "unitsStatMax"); - this.unitsStatMax.BackColor = System.Drawing.Color.Transparent; - this.unitsStatMax.Name = "unitsStatMax"; - // // editButton // resources.ApplyResources(this.editButton, "editButton"); @@ -126,6 +105,7 @@ namespace XenAdmin.Controls.Ballooning // vmShinyBar // resources.ApplyResources(this.vmShinyBar, "vmShinyBar"); + this.vmShinyBar.Increment = 0D; this.vmShinyBar.Name = "vmShinyBar"; // // VMMemoryControlsNoEdit @@ -133,9 +113,6 @@ namespace XenAdmin.Controls.Ballooning resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.Controls.Add(this.editButton); - this.Controls.Add(this.unitsStatMax); - this.Controls.Add(this.unitsDynMax); - this.Controls.Add(this.unitsDynMin); this.Controls.Add(this.valueStatMax); this.Controls.Add(this.valueDynMax); this.Controls.Add(this.valueDynMin); @@ -163,9 +140,6 @@ namespace XenAdmin.Controls.Ballooning private System.Windows.Forms.Label valueDynMin; private System.Windows.Forms.Label valueDynMax; private System.Windows.Forms.Label valueStatMax; - private System.Windows.Forms.Label unitsDynMin; - private System.Windows.Forms.Label unitsDynMax; - private System.Windows.Forms.Label unitsStatMax; private System.Windows.Forms.Button editButton; } } diff --git a/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.cs b/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.cs index afc6b3ef8..8cb2a4ae6 100644 --- a/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.cs +++ b/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.cs @@ -87,7 +87,7 @@ namespace XenAdmin.Controls.Ballooning valueDynMin.Text = Util.MemorySizeStringSuitableUnits(vm0.memory_dynamic_min, true); valueDynMax.Text = Util.MemorySizeStringSuitableUnits(vm0.memory_dynamic_max, true); if (vm0.memory_dynamic_max == vm0.memory_static_max) - labelStatMax.Visible = valueStatMax.Visible = unitsStatMax.Visible = false; + labelStatMax.Visible = valueStatMax.Visible = false; else valueStatMax.Text = Util.MemorySizeStringSuitableUnits(vm0.memory_static_max, true); } @@ -97,8 +97,8 @@ namespace XenAdmin.Controls.Ballooning iconBoxDynMin.Visible = false; labelDynMin.Text = Messages.MEMORY; - iconBoxDynMax.Visible = labelDynMax.Visible = valueDynMax.Visible = unitsDynMax.Visible = false; - labelStatMax.Visible = valueStatMax.Visible = unitsStatMax.Visible = false; + iconBoxDynMax.Visible = labelDynMax.Visible = valueDynMax.Visible = false; + labelStatMax.Visible = valueStatMax.Visible = false; } } diff --git a/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.resx b/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.resx index 86508fac8..4416aa264 100644 --- a/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.resx +++ b/XenAdmin/Controls/Ballooning/VMMemoryControlsNoEdit.resx @@ -151,7 +151,7 @@ $this - 11 + 8 Top, Right @@ -181,7 +181,7 @@ $this - 10 + 7 Top, Right @@ -220,7 +220,7 @@ $this - 9 + 6 Top, Right @@ -256,7 +256,7 @@ $this - 8 + 5 Top, Right @@ -292,7 +292,7 @@ $this - 7 + 4 Top, Right @@ -301,7 +301,7 @@ NoControl - 605, 32 + 646, 32 0, 0, 0, 0 @@ -325,7 +325,7 @@ $this - 6 + 3 Top, Right @@ -334,7 +334,7 @@ NoControl - 605, 51 + 646, 51 0, 0, 0, 0 @@ -358,7 +358,7 @@ $this - 5 + 2 Top, Right @@ -367,7 +367,7 @@ NoControl - 605, 70 + 646, 70 0, 0, 0, 0 @@ -391,105 +391,6 @@ $this - 4 - - - Top, Right - - - NoControl - - - 674, 32 - - - 0, 0, 0, 0 - - - 26, 18 - - - 9 - - - MiddleCenter - - - unitsDynMin - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 3 - - - Top, Right - - - NoControl - - - 674, 51 - - - 0, 0, 0, 0 - - - 26, 18 - - - 10 - - - MiddleCenter - - - unitsDynMax - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - - 2 - - - Top, Right - - - NoControl - - - 674, 70 - - - 0, 0, 0, 0 - - - 26, 18 - - - 11 - - - MiddleCenter - - - unitsStatMax - - - System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - $this - - 1 @@ -550,7 +451,7 @@ $this - 12 + 9 True diff --git a/XenAdmin/Dialogs/ControlDomainMemoryDialog.Designer.cs b/XenAdmin/Dialogs/ControlDomainMemoryDialog.Designer.cs new file mode 100644 index 000000000..d6b9ac02f --- /dev/null +++ b/XenAdmin/Dialogs/ControlDomainMemoryDialog.Designer.cs @@ -0,0 +1,160 @@ +namespace XenAdmin.Dialogs +{ + partial class ControlDomainMemoryDialog + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ControlDomainMemoryDialog)); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.panel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.CloseButton = new System.Windows.Forms.Button(); + this.OkButton = new System.Windows.Forms.Button(); + this.hostRebootWarningLabel = new System.Windows.Forms.Label(); + this.hostRebootWarningImage = new System.Windows.Forms.PictureBox(); + this.label1 = new System.Windows.Forms.Label(); + this.maintenanceWarningImage = new System.Windows.Forms.PictureBox(); + this.maintenanceWarningLabel = new System.Windows.Forms.Label(); + this.memorySpinner = new XenAdmin.Controls.Ballooning.MemorySpinner(); + this.maintenanceModeLinkLabel = new System.Windows.Forms.LinkLabel(); + this.tableLayoutPanel1.SuspendLayout(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.hostRebootWarningImage)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.maintenanceWarningImage)).BeginInit(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + resources.ApplyResources(this.tableLayoutPanel1, "tableLayoutPanel1"); + this.tableLayoutPanel1.Controls.Add(this.panel1, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.hostRebootWarningLabel, 1, 4); + this.tableLayoutPanel1.Controls.Add(this.hostRebootWarningImage, 0, 4); + this.tableLayoutPanel1.Controls.Add(this.label1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.maintenanceWarningImage, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.maintenanceWarningLabel, 1, 2); + this.tableLayoutPanel1.Controls.Add(this.memorySpinner, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.maintenanceModeLinkLabel, 1, 3); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + // + // panel1 + // + resources.ApplyResources(this.panel1, "panel1"); + this.tableLayoutPanel1.SetColumnSpan(this.panel1, 2); + this.panel1.Controls.Add(this.CloseButton); + this.panel1.Controls.Add(this.OkButton); + this.panel1.Name = "panel1"; + // + // CloseButton + // + resources.ApplyResources(this.CloseButton, "CloseButton"); + this.CloseButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.CloseButton.Name = "CloseButton"; + this.CloseButton.UseVisualStyleBackColor = true; + this.CloseButton.Click += new System.EventHandler(this.CloseButton_Click); + // + // OkButton + // + resources.ApplyResources(this.OkButton, "OkButton"); + this.OkButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.OkButton.Name = "OkButton"; + this.OkButton.UseVisualStyleBackColor = true; + this.OkButton.Click += new System.EventHandler(this.OkButton_Click); + // + // hostRebootWarningLabel + // + resources.ApplyResources(this.hostRebootWarningLabel, "hostRebootWarningLabel"); + this.hostRebootWarningLabel.Name = "hostRebootWarningLabel"; + // + // hostRebootWarningImage + // + resources.ApplyResources(this.hostRebootWarningImage, "hostRebootWarningImage"); + this.hostRebootWarningImage.Image = global::XenAdmin.Properties.Resources._000_Alert2_h32bit_16; + this.hostRebootWarningImage.Name = "hostRebootWarningImage"; + this.hostRebootWarningImage.TabStop = false; + // + // label1 + // + resources.ApplyResources(this.label1, "label1"); + this.tableLayoutPanel1.SetColumnSpan(this.label1, 2); + this.label1.Name = "label1"; + // + // maintenanceWarningImage + // + resources.ApplyResources(this.maintenanceWarningImage, "maintenanceWarningImage"); + this.maintenanceWarningImage.Image = global::XenAdmin.Properties.Resources._000_Info3_h32bit_16; + this.maintenanceWarningImage.Name = "maintenanceWarningImage"; + this.maintenanceWarningImage.TabStop = false; + // + // maintenanceWarningLabel + // + resources.ApplyResources(this.maintenanceWarningLabel, "maintenanceWarningLabel"); + this.maintenanceWarningLabel.Name = "maintenanceWarningLabel"; + // + // memorySpinnerDynMin + // + this.tableLayoutPanel1.SetColumnSpan(this.memorySpinner, 2); + resources.ApplyResources(this.memorySpinner, "memorySpinnerDynMin"); + this.memorySpinner.Increment = 0.1D; + this.memorySpinner.Name = "memorySpinnerDynMin"; + // + // maintenanceModeLinkLabel + // + resources.ApplyResources(this.maintenanceModeLinkLabel, "maintenanceModeLinkLabel"); + this.maintenanceModeLinkLabel.Name = "maintenanceModeLinkLabel"; + this.maintenanceModeLinkLabel.TabStop = true; + this.maintenanceModeLinkLabel.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.maintenanceModeLinkLabel_LinkClicked); + // + // ControlDomainMemoryDialog + // + resources.ApplyResources(this, "$this"); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; + this.Controls.Add(this.tableLayoutPanel1); + this.Name = "ControlDomainMemoryDialog"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ControlDomainMemoryDialog_FormClosing); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.hostRebootWarningImage)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.maintenanceWarningImage)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label hostRebootWarningLabel; + private System.Windows.Forms.PictureBox hostRebootWarningImage; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.PictureBox maintenanceWarningImage; + private System.Windows.Forms.Label maintenanceWarningLabel; + private Controls.Ballooning.MemorySpinner memorySpinner; + private System.Windows.Forms.FlowLayoutPanel panel1; + public System.Windows.Forms.Button CloseButton; + public System.Windows.Forms.Button OkButton; + private System.Windows.Forms.LinkLabel maintenanceModeLinkLabel; + } +} \ No newline at end of file diff --git a/XenAdmin/Dialogs/ControlDomainMemoryDialog.cs b/XenAdmin/Dialogs/ControlDomainMemoryDialog.cs new file mode 100644 index 000000000..6aed88f7d --- /dev/null +++ b/XenAdmin/Dialogs/ControlDomainMemoryDialog.cs @@ -0,0 +1,177 @@ +/* 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; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using XenAdmin.Actions; +using XenAdmin.Commands; +using XenAPI; + +namespace XenAdmin.Dialogs +{ + public partial class ControlDomainMemoryDialog : XenDialogBase + { + private Host host; + private Host_metrics hostMetrics; + private double origMemory; + + public const int MAXIMUM_DOM0_MEMORY_GB = 256; + + public ControlDomainMemoryDialog(Host host) + : base(host.Connection) + { + if (host == null) throw new ArgumentNullException("host"); + + InitializeComponent(); + this.host = host; + this.host.PropertyChanged += Server_PropertyChanged; + hostMetrics = connection.Resolve(this.host.metrics); + if (hostMetrics != null) + hostMetrics.PropertyChanged += Server_PropertyChanged; + Text = string.Format(Messages.CONTROL_DOMAIN_MEMORY_DIALOG_TITLE, this.host.Name); + Populate(); + } + + private void UpdateMaintenanceWarning() + { + Host_metrics metrics = host.Connection.Resolve(host.metrics); + bool maintenanceMode = host.MaintenanceMode || (metrics != null && !metrics.live); + + maintenanceWarningImage.Visible = maintenanceWarningLabel.Visible = maintenanceModeLinkLabel.Visible = !maintenanceMode; + hostRebootWarningImage.Visible = hostRebootWarningLabel.Visible = maintenanceMode; + + memorySpinner.Enabled = maintenanceMode; + } + + private void Populate() + { + VM vm = host.ControlDomainZero; + + // Since updates come in dribs and drabs, avoid error if new max and min arrive + // out of sync and maximum < minimum. + if (vm.memory_dynamic_max >= vm.memory_dynamic_min && + vm.memory_static_max >= vm.memory_static_min) + { + double min = vm.memory_static_min; + double max = Math.Min(host.memory_available_calc, MAXIMUM_DOM0_MEMORY_GB * Util.BINARY_GIGA); + double value = vm.memory_dynamic_min; + // Avoid setting the range to exclude the current value: CA-40041 + if (value > max) + max = value; + if (value < min) + min = value; + memorySpinner.Initialize(Messages.CONTROL_DOMAIN_MEMORY_LABEL, null, value, max); + memorySpinner.SetRange(min, max); + } + origMemory = memorySpinner.Value; + UpdateMaintenanceWarning(); + } + + private bool HasChanged() + { + return memorySpinner.Value != origMemory; + } + + private bool SaveChanges() + { + if (!HasChanged()) + return false; + + var mem = memorySpinner.Value; + + DialogResult dialogResult; + using (var dlg = new ThreeButtonDialog( + new ThreeButtonDialog.Details(SystemIcons.Warning, Messages.CONFIRM_CHANGE_CONTROL_DOMAIN_MEMORY, Messages.XENCENTER), + ThreeButtonDialog.ButtonYes, + ThreeButtonDialog.ButtonNo)) + { + dialogResult = dlg.ShowDialog(this); + } + + if (DialogResult.Yes != dialogResult) + return false; + + var actions = new List(); + var action = new ChangeControlDomainMemoryAction(host, (long)mem, false); + actions.Add(action); + + actions.Add(new RebootHostAction(host, AddHostToPoolCommand.NtolDialog)); + + var multipleAction = new MultipleAction(connection, + string.Format(Messages.ACTION_CHANGE_CONTROL_DOMAIN_MEMORY, host.Name), + string.Format(Messages.ACTION_CHANGE_CONTROL_DOMAIN_MEMORY, host.Name), + Messages.COMPLETED, actions, true, false, true); + + multipleAction.RunAsync(); + return true; + } + + private void Cleanup() + { + host.PropertyChanged -= Server_PropertyChanged; + if (hostMetrics != null) + hostMetrics.PropertyChanged -= Server_PropertyChanged; + } + + private void Server_PropertyChanged(object sender, PropertyChangedEventArgs e) + { + Program.Invoke(this, Populate); + } + + private void OkButton_Click(object sender, EventArgs e) + { + if (SaveChanges()) + { + DialogResult = DialogResult.OK; + } + Close(); + } + + private void maintenanceModeLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) + { + new HostMaintenanceModeCommand(Program.MainWindow, host, HostMaintenanceModeCommandParameter.Enter).Execute(); + } + + private void ControlDomainMemoryDialog_FormClosing(object sender, FormClosingEventArgs e) + { + Cleanup(); + } + + private void CloseButton_Click(object sender, EventArgs e) + { + Close(); + } + } +} diff --git a/XenAdmin/Dialogs/ControlDomainMemoryDialog.ja.resx b/XenAdmin/Dialogs/ControlDomainMemoryDialog.ja.resx new file mode 100644 index 000000000..37b479966 --- /dev/null +++ b/XenAdmin/Dialogs/ControlDomainMemoryDialog.ja.resx @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + True + + + CloseButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + OkButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + + Bottom + + + RightToLeft + + + + Segoe UI, 9pt + + + 3, 180 + + + 433, 27 + + + 21 + + + panel1 + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + Segoe UI, 9pt + + + NoControl + + + 22, 160 + + + 0, 20, 0, 0 + + + 271, 15 + + + 14 + + + Changes to this setting will trigger a server reboot. + + + hostRebootWarningLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Segoe UI, 9pt + + + NoControl + + + 3, 158 + + + 3, 18, 3, 3 + + + 16, 16 + + + AutoSize + + + 15 + + + hostRebootWarningImage + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + True + + + Fill + + + Segoe UI, 9pt + + + NoControl + + + 3, 3 + + + 3, 3, 3, 20 + + + 433, 30 + + + 3 + + + Specify the amount of memory to be allocated to the Control Domain on this server. + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Segoe UI, 9pt + + + NoControl + + + 3, 100 + + + 3, 18, 3, 3 + + + 16, 16 + + + 1 + + + maintenanceWarningImage + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + True + + + Segoe UI, 9pt + + + NoControl + + + 22, 102 + + + 0, 20, 0, 0 + + + 332, 15 + + + 2 + + + This server must be in maintenance mode to edit this setting. + + + MiddleLeft + + + maintenanceWarningLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Segoe UI, 9pt + + + 0, 53 + + + 0, 0, 0, 0 + + + 293, 29 + + + 16 + + + memorySpinnerDynMin + + + XenAdmin.Controls.Ballooning.MemorySpinner, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + tableLayoutPanel1 + + + 6 + + + True + + + Segoe UI, 9pt + + + 25, 122 + + + 3, 3, 3, 3 + + + 149, 15 + + + 22 + + + Enter maintenance mode... + + + maintenanceModeLinkLabel + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Fill + + + Segoe UI, 9pt + + + 10, 10 + + + 6 + + + 439, 210 + + + 6 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="panel1" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="hostRebootWarningLabel" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="hostRebootWarningImage" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceWarningImage" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="maintenanceWarningLabel" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="memorySpinnerDynMin" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceModeLinkLabel" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,Absolute,20" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> + + + Bottom, Right + + + Segoe UI, 9pt + + + NoControl + + + 355, 3 + + + 75, 23 + + + 1 + + + Cancel + + + CloseButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + Bottom, Right + + + Segoe UI, 9pt + + + NoControl + + + 274, 3 + + + 75, 23 + + + 0 + + + OK + + + OkButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + True + + + 96, 96 + + + 459, 230 + + + Segoe UI, 9pt + + + 10, 10, 10, 10 + + + + + + ControlDomainMemoryDialog + + + XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + \ No newline at end of file diff --git a/XenAdmin/Dialogs/ControlDomainMemoryDialog.resx b/XenAdmin/Dialogs/ControlDomainMemoryDialog.resx new file mode 100644 index 000000000..37b479966 --- /dev/null +++ b/XenAdmin/Dialogs/ControlDomainMemoryDialog.resx @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + True + + + CloseButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + OkButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + + Bottom + + + RightToLeft + + + + Segoe UI, 9pt + + + 3, 180 + + + 433, 27 + + + 21 + + + panel1 + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + Segoe UI, 9pt + + + NoControl + + + 22, 160 + + + 0, 20, 0, 0 + + + 271, 15 + + + 14 + + + Changes to this setting will trigger a server reboot. + + + hostRebootWarningLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Segoe UI, 9pt + + + NoControl + + + 3, 158 + + + 3, 18, 3, 3 + + + 16, 16 + + + AutoSize + + + 15 + + + hostRebootWarningImage + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + True + + + Fill + + + Segoe UI, 9pt + + + NoControl + + + 3, 3 + + + 3, 3, 3, 20 + + + 433, 30 + + + 3 + + + Specify the amount of memory to be allocated to the Control Domain on this server. + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Segoe UI, 9pt + + + NoControl + + + 3, 100 + + + 3, 18, 3, 3 + + + 16, 16 + + + 1 + + + maintenanceWarningImage + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + True + + + Segoe UI, 9pt + + + NoControl + + + 22, 102 + + + 0, 20, 0, 0 + + + 332, 15 + + + 2 + + + This server must be in maintenance mode to edit this setting. + + + MiddleLeft + + + maintenanceWarningLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Segoe UI, 9pt + + + 0, 53 + + + 0, 0, 0, 0 + + + 293, 29 + + + 16 + + + memorySpinnerDynMin + + + XenAdmin.Controls.Ballooning.MemorySpinner, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + tableLayoutPanel1 + + + 6 + + + True + + + Segoe UI, 9pt + + + 25, 122 + + + 3, 3, 3, 3 + + + 149, 15 + + + 22 + + + Enter maintenance mode... + + + maintenanceModeLinkLabel + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Fill + + + Segoe UI, 9pt + + + 10, 10 + + + 6 + + + 439, 210 + + + 6 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="panel1" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="hostRebootWarningLabel" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="hostRebootWarningImage" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceWarningImage" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="maintenanceWarningLabel" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="memorySpinnerDynMin" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceModeLinkLabel" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,Absolute,20" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> + + + Bottom, Right + + + Segoe UI, 9pt + + + NoControl + + + 355, 3 + + + 75, 23 + + + 1 + + + Cancel + + + CloseButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + Bottom, Right + + + Segoe UI, 9pt + + + NoControl + + + 274, 3 + + + 75, 23 + + + 0 + + + OK + + + OkButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + True + + + 96, 96 + + + 459, 230 + + + Segoe UI, 9pt + + + 10, 10, 10, 10 + + + + + + ControlDomainMemoryDialog + + + XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + \ No newline at end of file diff --git a/XenAdmin/Dialogs/ControlDomainMemoryDialog.zh-CN.resx b/XenAdmin/Dialogs/ControlDomainMemoryDialog.zh-CN.resx new file mode 100644 index 000000000..37b479966 --- /dev/null +++ b/XenAdmin/Dialogs/ControlDomainMemoryDialog.zh-CN.resx @@ -0,0 +1,543 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + 2 + + + True + + + CloseButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + OkButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + + Bottom + + + RightToLeft + + + + Segoe UI, 9pt + + + 3, 180 + + + 433, 27 + + + 21 + + + panel1 + + + System.Windows.Forms.FlowLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 0 + + + True + + + Segoe UI, 9pt + + + NoControl + + + 22, 160 + + + 0, 20, 0, 0 + + + 271, 15 + + + 14 + + + Changes to this setting will trigger a server reboot. + + + hostRebootWarningLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 1 + + + Segoe UI, 9pt + + + NoControl + + + 3, 158 + + + 3, 18, 3, 3 + + + 16, 16 + + + AutoSize + + + 15 + + + hostRebootWarningImage + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 2 + + + True + + + Fill + + + Segoe UI, 9pt + + + NoControl + + + 3, 3 + + + 3, 3, 3, 20 + + + 433, 30 + + + 3 + + + Specify the amount of memory to be allocated to the Control Domain on this server. + + + label1 + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 3 + + + Segoe UI, 9pt + + + NoControl + + + 3, 100 + + + 3, 18, 3, 3 + + + 16, 16 + + + 1 + + + maintenanceWarningImage + + + System.Windows.Forms.PictureBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 4 + + + True + + + Segoe UI, 9pt + + + NoControl + + + 22, 102 + + + 0, 20, 0, 0 + + + 332, 15 + + + 2 + + + This server must be in maintenance mode to edit this setting. + + + MiddleLeft + + + maintenanceWarningLabel + + + System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 5 + + + Segoe UI, 9pt + + + 0, 53 + + + 0, 0, 0, 0 + + + 293, 29 + + + 16 + + + memorySpinnerDynMin + + + XenAdmin.Controls.Ballooning.MemorySpinner, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + + tableLayoutPanel1 + + + 6 + + + True + + + Segoe UI, 9pt + + + 25, 122 + + + 3, 3, 3, 3 + + + 149, 15 + + + 22 + + + Enter maintenance mode... + + + maintenanceModeLinkLabel + + + System.Windows.Forms.LinkLabel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + tableLayoutPanel1 + + + 7 + + + Fill + + + Segoe UI, 9pt + + + 10, 10 + + + 6 + + + 439, 210 + + + 6 + + + tableLayoutPanel1 + + + System.Windows.Forms.TableLayoutPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + $this + + + 0 + + + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="panel1" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="hostRebootWarningLabel" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="hostRebootWarningImage" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceWarningImage" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="maintenanceWarningLabel" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="memorySpinnerDynMin" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceModeLinkLabel" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,Absolute,20" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> + + + Bottom, Right + + + Segoe UI, 9pt + + + NoControl + + + 355, 3 + + + 75, 23 + + + 1 + + + Cancel + + + CloseButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 0 + + + Bottom, Right + + + Segoe UI, 9pt + + + NoControl + + + 274, 3 + + + 75, 23 + + + 0 + + + OK + + + OkButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + panel1 + + + 1 + + + True + + + 96, 96 + + + 459, 230 + + + Segoe UI, 9pt + + + 10, 10, 10, 10 + + + + + + ControlDomainMemoryDialog + + + XenAdmin.Dialogs.XenDialogBase, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + \ No newline at end of file diff --git a/XenAdmin/MainWindow.Designer.cs b/XenAdmin/MainWindow.Designer.cs index ceae6a079..de3135ffc 100644 --- a/XenAdmin/MainWindow.Designer.cs +++ b/XenAdmin/MainWindow.Designer.cs @@ -188,6 +188,7 @@ namespace XenAdmin this.restoreFromBackupToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.toolStripSeparator23 = new System.Windows.Forms.ToolStripSeparator(); this.maintenanceModeToolStripMenuItem1 = new XenAdmin.Commands.CommandToolStripMenuItem(); + this.controlDomainMemoryToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.RemoveCrashdumpsToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.HostPasswordToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); this.ChangeRootPasswordToolStripMenuItem = new XenAdmin.Commands.CommandToolStripMenuItem(); @@ -1086,6 +1087,7 @@ namespace XenAdmin this.restoreFromBackupToolStripMenuItem, this.toolStripSeparator23, this.maintenanceModeToolStripMenuItem1, + this.controlDomainMemoryToolStripMenuItem, this.RemoveCrashdumpsToolStripMenuItem, this.HostPasswordToolStripMenuItem, this.toolStripSeparator25, @@ -1219,6 +1221,12 @@ namespace XenAdmin this.maintenanceModeToolStripMenuItem1.Name = "maintenanceModeToolStripMenuItem1"; resources.ApplyResources(this.maintenanceModeToolStripMenuItem1, "maintenanceModeToolStripMenuItem1"); // + // controlDomainMemoryToolStripMenuItem + // + this.controlDomainMemoryToolStripMenuItem.Command = new XenAdmin.Commands.ChangeControlDomainMemoryCommand(); + this.controlDomainMemoryToolStripMenuItem.Name = "controlDomainMemoryToolStripMenuItem"; + resources.ApplyResources(this.controlDomainMemoryToolStripMenuItem, "controlDomainMemoryToolStripMenuItem"); + // // RemoveCrashdumpsToolStripMenuItem // this.RemoveCrashdumpsToolStripMenuItem.Command = new XenAdmin.Commands.RemoveHostCrashDumpsCommand(); @@ -2125,6 +2133,7 @@ namespace XenAdmin private TabPage TabPageADUpsell; private TabPage TabPageCvmConsole; private TabPage TabPagePvs; + private CommandToolStripMenuItem controlDomainMemoryToolStripMenuItem; } } diff --git a/XenAdmin/MainWindow.resx b/XenAdmin/MainWindow.resx index 2eaa852d0..42b7fb2e9 100644 --- a/XenAdmin/MainWindow.resx +++ b/XenAdmin/MainWindow.resx @@ -2020,16 +2020,16 @@ &Pool - 212, 22 + 216, 22 &Add... - 209, 6 + 213, 6 - 212, 22 + 216, 22 Reb&oot @@ -2055,7 +2055,7 @@ - 212, 22 + 216, 22 Power O&n @@ -2083,19 +2083,19 @@ - 212, 22 + 216, 22 S&hut Down - 212, 22 + 216, 22 Restart Toolstac&k - 209, 6 + 213, 6 155, 22 @@ -2131,37 +2131,37 @@ Di&sconnect All - 212, 22 + 216, 22 &Connect/Disconnect - 212, 22 + 216, 22 Add to &Pool - 209, 6 + 213, 6 - 212, 22 + 216, 22 &Back Up... - 212, 22 + 216, 22 Restore From Back&up... - 209, 6 + 213, 6 - 212, 22 + 216, 22 Enter &Maintenance Mode @@ -2169,11 +2169,17 @@ Testing + + 216, 22 + + + Control &Domain Memory... + - 212, 22 + 216, 22 - Remove Crash &Dump Files + Remove Crash Dump &Files 161, 22 @@ -2188,37 +2194,37 @@ &Forget Password - 212, 22 + 216, 22 Pass&word - 209, 6 + 213, 6 - 212, 22 + 216, 22 D&estroy - 212, 22 + 216, 22 Remo&ve from [XenCenter] - 209, 6 + 213, 6 - 212, 22 + 216, 22 PluginItemsPlaceHolder - 212, 22 + 216, 22 P&roperties @@ -3312,6 +3318,12 @@ XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + + controlDomainMemoryToolStripMenuItem + + + XenAdmin.Commands.CommandToolStripMenuItem, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null + RemoveCrashdumpsToolStripMenuItem diff --git a/XenAdmin/XenAdmin.csproj b/XenAdmin/XenAdmin.csproj index 4ae3acd29..62c0e3de4 100644 --- a/XenAdmin/XenAdmin.csproj +++ b/XenAdmin/XenAdmin.csproj @@ -111,6 +111,7 @@ + @@ -232,6 +233,12 @@ PvsSiteDialog.cs + + Form + + + ControlDomainMemoryDialog.cs + @@ -1542,6 +1549,15 @@ Designer BallooningDialogAdvanced.cs + + ControlDomainMemoryDialog.cs + + + ControlDomainMemoryDialog.cs + + + ControlDomainMemoryDialog.cs + Designer DateFilterDialog.cs diff --git a/XenAdminTests/TabsAndMenus/MainMenuGeorge.cs b/XenAdminTests/TabsAndMenus/MainMenuGeorge.cs index a7f21429f..b950cf899 100644 --- a/XenAdminTests/TabsAndMenus/MainMenuGeorge.cs +++ b/XenAdminTests/TabsAndMenus/MainMenuGeorge.cs @@ -101,7 +101,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", false, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -210,7 +211,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", false, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", true, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -321,7 +323,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", true, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", true, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", true, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -432,7 +435,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", false, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -544,7 +548,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", vm.Home() != null, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -658,7 +663,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", sr.Home != null, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -773,7 +779,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", false, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -891,7 +898,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", false, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -1010,7 +1018,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", false, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -1130,7 +1139,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", false, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -1251,7 +1261,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", false, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -1367,7 +1378,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", true, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", true, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", true, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -1476,7 +1488,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", true, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", true, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", true, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", true, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -1587,7 +1600,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", true, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -1726,7 +1740,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", true, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), @@ -1851,7 +1866,8 @@ namespace XenAdminTests.TabsAndMenus new ExpectedTextMenuItem("Restore From Back&up...", false, false ), new ExpectedSeparator(), new ExpectedTextMenuItem("Enter &Maintenance Mode...", false, false ), - new ExpectedTextMenuItem("Remove Crash &Dump Files", false, false ), + new ExpectedTextMenuItem("Control &Domain Memory...", false, false ), + new ExpectedTextMenuItem("Remove Crash Dump &Files", false, false ), new ExpectedTextMenuItem("Pass&word", false, false, new ExpectedMenuItem[]{ new ExpectedTextMenuItem("&Change...", false, false ), new ExpectedTextMenuItem("&Forget Password", false, false )}), diff --git a/XenModel/Actions/Host/ChangeControlDomainMemoryAction.cs b/XenModel/Actions/Host/ChangeControlDomainMemoryAction.cs new file mode 100644 index 000000000..72c0a9284 --- /dev/null +++ b/XenModel/Actions/Host/ChangeControlDomainMemoryAction.cs @@ -0,0 +1,65 @@ +/* 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; +using XenAPI; +using XenAdmin.Actions.VMActions; + + +namespace XenAdmin.Actions +{ + public class ChangeControlDomainMemoryAction : AsyncAction + { + long memory; + + public ChangeControlDomainMemoryAction(Host host, long memory, bool suppressHistory) + : base(host.Connection, string.Format(Messages.ACTION_CHANGE_CONTROL_DOMAIN_MEMORY, host.Name), suppressHistory) + { + Host = host; + this.memory = memory; + + #region RBAC Dependencies + + ApiMethodsToRoleCheck.Add("vm.set_memory"); + + #endregion + } + + protected override void Run() + { + VM vm = Host.ControlDomainZero; + + XenAPI.VM.set_memory(Session, vm.opaque_ref, memory); + + Description = Messages.COMPLETED; + } + } +} diff --git a/XenModel/Messages.Designer.cs b/XenModel/Messages.Designer.cs index 19567a0cf..998916022 100755 --- a/XenModel/Messages.Designer.cs +++ b/XenModel/Messages.Designer.cs @@ -78,6 +78,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Changing control domain memory settings on '{0}'. + /// + public static string ACTION_CHANGE_CONTROL_DOMAIN_MEMORY { + get { + return ResourceManager.GetString("ACTION_CHANGE_CONTROL_DOMAIN_MEMORY", resourceCulture); + } + } + /// /// Looks up a localized string similar to Change disk size. /// @@ -6912,6 +6921,17 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Changing the Control Domain memory will cause the server to be rebooted. + /// + ///Do you want to continue?. + /// + public static string CONFIRM_CHANGE_CONTROL_DOMAIN_MEMORY { + get { + return ResourceManager.GetString("CONFIRM_CHANGE_CONTROL_DOMAIN_MEMORY", resourceCulture); + } + } + /// /// Looks up a localized string similar to Changing the maximum memory of these VMs will cause them to be rebooted. /// @@ -8281,6 +8301,24 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Control Domain Memory Settings - {0}. + /// + public static string CONTROL_DOMAIN_MEMORY_DIALOG_TITLE { + get { + return ResourceManager.GetString("CONTROL_DOMAIN_MEMORY_DIALOG_TITLE", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &Control Domain Memory:. + /// + public static string CONTROL_DOMAIN_MEMORY_LABEL { + get { + return ResourceManager.GetString("CONTROL_DOMAIN_MEMORY_LABEL", resourceCulture); + } + } + /// /// Looks up a localized string similar to &Convert. /// @@ -17037,6 +17075,15 @@ namespace XenAdmin { } } + /// + /// Looks up a localized string similar to Control &Domain Memory.... + /// + public static string HOST_MENU_CONTROL_DOMAIN_MEMORY { + get { + return ResourceManager.GetString("HOST_MENU_CONTROL_DOMAIN_MEMORY", resourceCulture); + } + } + /// /// Looks up a localized string similar to &Migrate VM wizard.... /// @@ -20459,7 +20506,7 @@ namespace XenAdmin { } /// - /// Looks up a localized string similar to Remove Crash &Dump Files. + /// Looks up a localized string similar to Remove Crash Dump &Files. /// public static string MAINWINDOW_REMOVE_HOST_CRASHDUMPS { get { diff --git a/XenModel/Messages.resx b/XenModel/Messages.resx index 1a84292e3..6f0438d29 100755 --- a/XenModel/Messages.resx +++ b/XenModel/Messages.resx @@ -126,6 +126,9 @@ Disk size changed for '{0}'. + + Changing control domain memory settings on '{0}' + Change disk size @@ -2511,6 +2514,11 @@ Do you want to assign it to the policy '{2}' instead? Configuring Workload Balancing on pool '{0}' + + Changing the Control Domain memory will cause the server to be rebooted. + +Do you want to continue? + Changing the maximum memory of these VMs will cause them to be rebooted. @@ -3009,6 +3017,12 @@ You can only connect to a single [Citrix] [XenServer product] Express Edition se &Continue with export + + Control Domain Memory Settings - {0} + + + &Control Domain Memory: + Control domain on host {0} @@ -6003,6 +6017,9 @@ Click Configure HA to alter the settings displayed below. (Error generating menu) + + Control &Domain Memory... + &Migrate VM wizard... @@ -7134,7 +7151,7 @@ This will permanently delete and reinitialize all local storage on the servers. Remo&ve from [XenCenter] - Remove Crash &Dump Files + Remove Crash Dump &Files Remove Crash Dump &Files diff --git a/XenModel/Utils/Helpers.cs b/XenModel/Utils/Helpers.cs index 4287164c5..5fa039e7f 100755 --- a/XenModel/Utils/Helpers.cs +++ b/XenModel/Utils/Helpers.cs @@ -402,6 +402,25 @@ namespace XenAdmin.Core HostBuildNumber(host) == CUSTOM_BUILD_NUMBER; } + /// May be null, in which case true is returned. + public static bool ElyOrGreater(IXenConnection conn) + { + return conn == null ? true : ElyOrGreater(Helpers.GetMaster(conn)); + } + + /// Ely is ver. 2.1.1 + /// May be null, in which case true is returned. + public static bool ElyOrGreater(Host host) + { + if (host == null) + return true; + + string platform_version = HostPlatformVersion(host); + return + platform_version != null && productVersionCompare(platform_version, "2.1.1") >= 0 || + HostBuildNumber(host) == CUSTOM_BUILD_NUMBER; + } + /// /// Cream (Creedence SP1) has API version 2.4 /// diff --git a/XenModel/XenAPI-Extensions/Host.cs b/XenModel/XenAPI-Extensions/Host.cs index 72553a14c..60f2266b2 100644 --- a/XenModel/XenAPI-Extensions/Host.cs +++ b/XenModel/XenAPI-Extensions/Host.cs @@ -1249,6 +1249,22 @@ namespace XenAPI } } + public long dom0_memory + { + get + { + long dom0_mem = 0; + VM vm = ControlDomainZero; + if (vm != null) + { + VM_metrics vmMetrics = vm.Connection.Resolve(vm.metrics); + dom0_mem = vmMetrics != null ? vmMetrics.memory_actual : vm.memory_dynamic_min; + } + return dom0_mem; + } + } + + /// /// Friendly string showing memory usage on the host /// diff --git a/XenModel/XenModel.csproj b/XenModel/XenModel.csproj index fbfd3db26..e5e1109b8 100644 --- a/XenModel/XenModel.csproj +++ b/XenModel/XenModel.csproj @@ -77,6 +77,7 @@ + From 5f8cb2ce0be81aa76e95f951987ac96126d30c48 Mon Sep 17 00:00:00 2001 From: Mihaela Stoica Date: Wed, 10 Aug 2016 14:04:01 +0100 Subject: [PATCH 4/4] CP-16935: Configure Control domain memory for a host - Removed unnecessary calls to Close() Signed-off-by: Mihaela Stoica --- .../ControlDomainMemoryDialog.Designer.cs | 7 +- XenAdmin/Dialogs/ControlDomainMemoryDialog.cs | 6 - .../Dialogs/ControlDomainMemoryDialog.resx | 134 +++++++----------- 3 files changed, 58 insertions(+), 89 deletions(-) diff --git a/XenAdmin/Dialogs/ControlDomainMemoryDialog.Designer.cs b/XenAdmin/Dialogs/ControlDomainMemoryDialog.Designer.cs index d6b9ac02f..5dab22fcc 100644 --- a/XenAdmin/Dialogs/ControlDomainMemoryDialog.Designer.cs +++ b/XenAdmin/Dialogs/ControlDomainMemoryDialog.Designer.cs @@ -73,7 +73,6 @@ this.CloseButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.CloseButton.Name = "CloseButton"; this.CloseButton.UseVisualStyleBackColor = true; - this.CloseButton.Click += new System.EventHandler(this.CloseButton_Click); // // OkButton // @@ -113,12 +112,12 @@ resources.ApplyResources(this.maintenanceWarningLabel, "maintenanceWarningLabel"); this.maintenanceWarningLabel.Name = "maintenanceWarningLabel"; // - // memorySpinnerDynMin + // memorySpinner // this.tableLayoutPanel1.SetColumnSpan(this.memorySpinner, 2); - resources.ApplyResources(this.memorySpinner, "memorySpinnerDynMin"); + resources.ApplyResources(this.memorySpinner, "memorySpinner"); this.memorySpinner.Increment = 0.1D; - this.memorySpinner.Name = "memorySpinnerDynMin"; + this.memorySpinner.Name = "memorySpinner"; // // maintenanceModeLinkLabel // diff --git a/XenAdmin/Dialogs/ControlDomainMemoryDialog.cs b/XenAdmin/Dialogs/ControlDomainMemoryDialog.cs index 6aed88f7d..348f0790d 100644 --- a/XenAdmin/Dialogs/ControlDomainMemoryDialog.cs +++ b/XenAdmin/Dialogs/ControlDomainMemoryDialog.cs @@ -156,7 +156,6 @@ namespace XenAdmin.Dialogs { DialogResult = DialogResult.OK; } - Close(); } private void maintenanceModeLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) @@ -168,10 +167,5 @@ namespace XenAdmin.Dialogs { Cleanup(); } - - private void CloseButton_Click(object sender, EventArgs e) - { - Close(); - } } } diff --git a/XenAdmin/Dialogs/ControlDomainMemoryDialog.resx b/XenAdmin/Dialogs/ControlDomainMemoryDialog.resx index 37b479966..4b2d20d09 100644 --- a/XenAdmin/Dialogs/ControlDomainMemoryDialog.resx +++ b/XenAdmin/Dialogs/ControlDomainMemoryDialog.resx @@ -124,6 +124,29 @@ True + + + Bottom, Right + + + + Segoe UI, 9pt + + + NoControl + + + 355, 3 + + + 75, 23 + + + 1 + + + Cancel + CloseButton @@ -136,6 +159,27 @@ 0 + + Bottom, Right + + + Segoe UI, 9pt + + + NoControl + + + 274, 3 + + + 75, 23 + + + 0 + + + OK + OkButton @@ -148,14 +192,12 @@ 1 - Bottom RightToLeft - Segoe UI, 9pt @@ -357,31 +399,31 @@ 5 - + Segoe UI, 9pt - + 0, 53 - + 0, 0, 0, 0 - + 293, 29 - + 16 - - memorySpinnerDynMin + + memorySpinner - + XenAdmin.Controls.Ballooning.MemorySpinner, XenCenterMain, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null - + tableLayoutPanel1 - + 6 @@ -448,73 +490,7 @@ 0 - <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="panel1" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="hostRebootWarningLabel" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="hostRebootWarningImage" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceWarningImage" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="maintenanceWarningLabel" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="memorySpinnerDynMin" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceModeLinkLabel" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,Absolute,20" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> - - - Bottom, Right - - - Segoe UI, 9pt - - - NoControl - - - 355, 3 - - - 75, 23 - - - 1 - - - Cancel - - - CloseButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel1 - - - 0 - - - Bottom, Right - - - Segoe UI, 9pt - - - NoControl - - - 274, 3 - - - 75, 23 - - - 0 - - - OK - - - OkButton - - - System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - panel1 - - - 1 + <?xml version="1.0" encoding="utf-16"?><TableLayoutSettings><Controls><Control Name="panel1" Row="5" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="hostRebootWarningLabel" Row="4" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="hostRebootWarningImage" Row="4" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="label1" Row="0" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceWarningImage" Row="2" RowSpan="1" Column="0" ColumnSpan="1" /><Control Name="maintenanceWarningLabel" Row="2" RowSpan="1" Column="1" ColumnSpan="1" /><Control Name="memorySpinner" Row="1" RowSpan="1" Column="0" ColumnSpan="2" /><Control Name="maintenanceModeLinkLabel" Row="3" RowSpan="1" Column="1" ColumnSpan="1" /></Controls><Columns Styles="AutoSize,0,Percent,100,Absolute,20" /><Rows Styles="AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,AutoSize,0,Percent,100" /></TableLayoutSettings> True