
On 27-04-2015 09:43, Aline Manera wrote:
On 20/04/2015 16:43, Jose Ricardo Ziviani wrote:
- If NetworkManager is running when user is trying to create a bridge, it will warn about problems that could happen, asking the user to turn NM service off while dealing with bridge creation.
Signed-off-by: Jose Ricardo Ziviani <joserz@linux.vnet.ibm.com> --- ui/js/src/kimchi.network.js | 5 +++++ ui/pages/i18n.json.tmpl | 1 + 2 files changed, 6 insertions(+)
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js index 90fb62b..be140e8 100644 --- a/ui/js/src/kimchi.network.js +++ b/ui/js/src/kimchi.network.js @@ -323,6 +323,11 @@ kimchi.setDefaultNetworkType = function(isInterfaceAvail) { kimchi.enableBridgeOptions(false); $("#networkBriDisabledLabel").show(); } else {
+ kimchi.getCapabilities(function(result) { + if (result && result.nm_running) { + kimchi.message.warn(i18n['KCHNET6001W']); + } + });
The kimchi.getCapabilities() result is cached on UI. So we just need to call it once (check on ui/js/src/kimchi.main.js)
And then you can see an use of the cached value in ui/js/src/kimchi.host.js, ui/js/src/kimchi.repository_edit_main.js, ui/js/src/kimchi.template_add_main.js, etc
The problem with using a cached value is that it won't be updated if users turn NM off. Suppose you see the warning, then you turn NM off. If you go back to Kimchi you certainly don't expect to see that warning again. If I use a cached value, the warning will display anyway.
$("#bridgeOptions").slideDown(100); $("#networkVlanID").toggle(false); $("#labelNetworkVlanID").toggle(false); diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl index a7f9daf..a6e3f5b 100644 --- a/ui/pages/i18n.json.tmpl +++ b/ui/pages/i18n.json.tmpl @@ -153,6 +153,7 @@ "KCHNET6002M": "$_("This action will interrupt network connectivity for any virtual machine that depend on this network.")", "KCHNET6003M": "$_("Create a network")", "KCHNET6004M": "$_("This network is not persistent. Instead of stop, this action will permanently delete it. Would you like to continue?")", + "KCHNET6001W": "$_("The bridged VLAN tag may not work well with NetworkManager enabled. You should consider disabling it.")",
"KCHPOOL6001M": "$_("This will permanently delete the storage pool. Would you like to continue?")", "KCHPOOL6002M": "$_("This storage pool is empty.")",
-- Jose Ricardo Ziviani ----------------------------- Software Engineer Linux Technology Center - IBM