[PATCH 0/2] Warn users about non-persistent guests when using Power Off

Someone reported that their guests (not created by Kimchi) were being deleted if they used Kimchi to shut them down. This small patchset adds a warning message and also increases the size of the confirmation dialog in the UI to fit the new text. Note: It still needs the Chinese translation. Christy Perez (2): Add Power-Off warning for non-persistent guests Make the confirmation dialog bigger po/en_US.po | 15 ++++++++++++--- po/kimchi.pot | 10 ++++++++-- po/pt_BR.po | 16 +++++++++++++--- po/zh_CN.po | 10 ++++++++-- ui/css/theme-default/message.css | 4 ++-- ui/pages/i18n.json.tmpl | 1 + 6 files changed, 44 insertions(+), 12 deletions(-) -- 1.9.3

If a user is managing guests created outside kimchi, and tries to Power Off a guest that is non-persistent, the guest will be deleted. Kimchi calls destroy for Power Off, which is destructive for non-persistent guests. This warning message makes users aware of that. Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com> --- po/en_US.po | 15 ++++++++++++--- po/kimchi.pot | 10 ++++++++-- po/pt_BR.po | 16 +++++++++++++--- po/zh_CN.po | 10 ++++++++-- ui/pages/i18n.json.tmpl | 1 + 5 files changed, 42 insertions(+), 10 deletions(-) diff --git a/po/en_US.po b/po/en_US.po index a34da3a..d51a638 100644 --- a/po/en_US.po +++ b/po/en_US.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: kimchi 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-08-08 15:27-0300\n" +"POT-Creation-Date: 2014-08-19 13:13-0500\n" "PO-Revision-Date: 2013-07-11 17:32-0400\n" "Last-Translator: Crístian Viana <vianac@linux.vnet.ibm.com>\n" "Language-Team: English\n" @@ -1366,10 +1366,12 @@ msgstr "Power off Confirmation" msgid "" "This action may produce undesirable results, for example unflushed disk " -"cache in the guest. Would you like to continue?" +"cache in the guest. If your guest is non-persistent (e.g. created manually " +"using virsh create), it will be destroyed. Would you like to continue?" msgstr "" "This action may produce undesirable results, for example unflushed disk " -"cache in the guest. Would you like to continue?" +"cache in the guest. If your guest is non-persistent (e.g. created manually " +"using virsh create), it will be destroyed. Would you like to continue?" msgid "Reset Confirmation" msgstr "Reset Confirmation" @@ -1412,6 +1414,13 @@ msgstr "Successfully replaced!" msgid "Successfully detached!" msgstr "Successfully detached!" +msgid "" +"This disk will be detached permanently and you can re-attach it. Continue to " +"detach it?" +msgstr "" +"This CDROM will be detached permanently and you can re-attach it. Continue " +"to detach it?" + msgid "The VLAN id must be between 1 and 4094." msgstr "The VLAN id must be between 1 and 4094." diff --git a/po/kimchi.pot b/po/kimchi.pot index d8354fa..70ab26e 100755 --- a/po/kimchi.pot +++ b/po/kimchi.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-08-08 15:27-0300\n" +"POT-Creation-Date: 2014-08-19 13:13-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -1294,7 +1294,8 @@ msgstr "" msgid "" "This action may produce undesirable results, for example unflushed disk " -"cache in the guest. Would you like to continue?" +"cache in the guest. If your guest is non-persistent (e.g. created manually " +"using virsh create), it will be destroyed. Would you like to continue?" msgstr "" msgid "Reset Confirmation" @@ -1334,6 +1335,11 @@ msgstr "" msgid "Successfully detached!" msgstr "" +msgid "" +"This disk will be detached permanently and you can re-attach it. Continue to " +"detach it?" +msgstr "" + msgid "The VLAN id must be between 1 and 4094." msgstr "" diff --git a/po/pt_BR.po b/po/pt_BR.po index 452e778..c6634bc 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: kimchi 1.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-08-08 15:27-0300\n" +"POT-Creation-Date: 2014-08-19 13:13-0500\n" "PO-Revision-Date: 2013-06-27 10:48+0000\n" "Last-Translator: Crístian Viana <vianac@linux.vnet.ibm.com>\n" "Language-Team: Aline Manera <alinefm@br.ibm.com>\n" @@ -1429,10 +1429,13 @@ msgstr "Confirmação de desligamento forçado" msgid "" "This action may produce undesirable results, for example unflushed disk " -"cache in the guest. Would you like to continue?" +"cache in the guest. If your guest is non-persistent (e.g. created manually " +"using virsh create), it will be destroyed. Would you like to continue?" msgstr "" "Essa ação pode produzir resultados não desejáveis, como por exemplo cache de " -"disco não atualizado no guest. Deseja continuar?" +"disco não atualizado no guest. Se a máquina virtual não é persistente (ex: " +"criada manualmente usando 'virsh create'), ela será destruída.Deseja " +"continuar?" msgid "Reset Confirmation" msgstr "Confirmação de reinicialização" @@ -1475,6 +1478,13 @@ msgstr "Substituido com sucesso!" msgid "Successfully detached!" msgstr "Removido com sucesso!" +msgid "" +"This disk will be detached permanently and you can re-attach it. Continue to " +"detach it?" +msgstr "" +"Esse CDROM será desconectado permanentemente e você pode reconectá-lo. " +"Deseja continuar a remoção? " + msgid "The VLAN id must be between 1 and 4094." msgstr "VLAN id deve ser um número entre 1 e 4094." diff --git a/po/zh_CN.po b/po/zh_CN.po index 83c7018..c5be012 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: kimchi 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-08-08 15:27-0300\n" +"POT-Creation-Date: 2014-08-19 13:13-0500\n" "PO-Revision-Date: 2013-06-27 10:48+0000\n" "Last-Translator: ShaoHe Feng <shaohef@linux.vnet.ibm.com>\n" "Language-Team: ShaoHe Feng <shaohef@linux.vnet.ibm.com>\n" @@ -1315,7 +1315,8 @@ msgstr "关闭电源确认" msgid "" "This action may produce undesirable results, for example unflushed disk " -"cache in the guest. Would you like to continue?" +"cache in the guest. If your guest is non-persistent (e.g. created manually " +"using virsh create), it will be destroyed. Would you like to continue?" msgstr "这样做可能导致不良后果,比如客户机磁盘缓存未刷新,确认要继续吗?" msgid "Reset Confirmation" @@ -1355,6 +1356,11 @@ msgstr "成功替换" msgid "Successfully detached!" msgstr "成功卸载" +msgid "" +"This disk will be detached permanently and you can re-attach it. Continue to " +"detach it?" +msgstr "CDROM将被永久卸载,你可以重新装载它。继续卸载?" + msgid "The VLAN id must be between 1 and 4094." msgstr "VLAN 标识符必须在1至4094之间" diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl index ccfb081..754c6df 100644 --- a/ui/pages/i18n.json.tmpl +++ b/ui/pages/i18n.json.tmpl @@ -119,6 +119,7 @@ "KCHVM6002M": "$_("Power off Confirmation")", "KCHVM6003M": "$_("This action may produce undesirable results, " "for example unflushed disk cache in the guest. " + "If your guest is non-persistent (e.g. created manually using virsh create), it will be destroyed. " "Would you like to continue?")", "KCHVM6004M": "$_("Reset Confirmation")", "KCHVM6005M": "$_("There is a risk of data loss caused by reset without" -- 1.9.3

On 19-08-2014 15:32, Christy Perez wrote:
If a user is managing guests created outside kimchi, and tries to Power Off a guest that is non-persistent, the guest will be deleted. Kimchi calls destroy for Power Off, which is destructive for non-persistent guests. This warning message makes users aware of that.
Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Even though this requires a little more coding, IMO it would be better to display that message only if the guest being stopped is actually non-persistent. Something like: if (dom.isPersistent()) { alert("Stopping this non-persistent guest will destroy it. Do you want to continue?") } else { alert("This action may produce undesirable results. Do you want to continue?") } I didn't find a way to read a guest's persistent state using the current Kimchi REST API, so maybe we'd need to add that field to the "/vms/<vm-name>" result. I mean, that popup dialog is making the user think whether the guest is persistent or not, but the system itself can tell that.

On 2014年08月20日 02:54, Crístian Viana wrote:
On 19-08-2014 15:32, Christy Perez wrote:
If a user is managing guests created outside kimchi, and tries to Power Off a guest that is non-persistent, the guest will be deleted. Kimchi calls destroy for Power Off, which is destructive for non-persistent guests. This warning message makes users aware of that.
Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Even though this requires a little more coding, IMO it would be better to display that message only if the guest being stopped is actually non-persistent.
Something like:
if (dom.isPersistent()) { alert("Stopping this non-persistent guest will destroy it. Do you want to continue?") } else { alert("This action may produce undesirable results. Do you want to continue?") }
I didn't find a way to read a guest's persistent state using the current Kimchi REST API, so maybe we'd need to add that field to the "/vms/<vm-name>" result.
I mean, that popup dialog is making the user think whether the guest is persistent or not, but the system itself can tell that. Good point! I agree with adding a field to track if dom is persistent as we did for network.
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

On 08/19/2014 10:41 PM, Royce Lv wrote:
On 2014年08月20日 02:54, Crístian Viana wrote:
On 19-08-2014 15:32, Christy Perez wrote:
If a user is managing guests created outside kimchi, and tries to Power Off a guest that is non-persistent, the guest will be deleted. Kimchi calls destroy for Power Off, which is destructive for non-persistent guests. This warning message makes users aware of that.
Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
Even though this requires a little more coding, IMO it would be better to display that message only if the guest being stopped is actually non-persistent.
Something like:
if (dom.isPersistent()) { alert("Stopping this non-persistent guest will destroy it. Do you want to continue?") } else { alert("This action may produce undesirable results. Do you want to continue?") }
I didn't find a way to read a guest's persistent state using the current Kimchi REST API, so maybe we'd need to add that field to the "/vms/<vm-name>" result.
I mean, that popup dialog is making the user think whether the guest is persistent or not, but the system itself can tell that. Good point! I agree with adding a field to track if dom is persistent as we did for network.
Easy enough! Please see and review (and provide translations for!) [PATCH 0/2] Warn before Power Off non-persistent VM
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel
Thanks! - Christy

With the new text added for Power Down, the entire message no longer fit into the box. Increasing it slightly to address that. Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com> --- ui/css/theme-default/message.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/css/theme-default/message.css b/ui/css/theme-default/message.css index 53b3495..4f8eaed 100644 --- a/ui/css/theme-default/message.css +++ b/ui/css/theme-default/message.css @@ -78,8 +78,8 @@ box-sizing: border-box; max-width: 100%; max-height: 100%; - width: 350px; - height: 170px; + width: 375px; + height: 200px; z-index: 9999; } -- 1.9.3
participants (3)
-
Christy Perez
-
Crístian Viana
-
Royce Lv