[PATCH] Issue #667: Unable to rename guest when it is paused

Block guest edition when paused. Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_edit_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js index fc1b4c1..fdc46cb 100644 --- a/ui/js/src/kimchi.guest_edit_main.js +++ b/ui/js/src/kimchi.guest_edit_main.js @@ -662,7 +662,7 @@ kimchi.guest_edit_main = function() { event.preventDefault(); kimchi.window.open("guest-storage-add.html"); }); - if(kimchi.thisVMState === "running") { + if ((kimchi.thisVMState === "running") || (kimchi.thisVMState === "paused")) { $("#form-guest-edit-general input").prop("disabled", true); } else { $("#action-button-container").removeClass("hidden"); -- 2.1.0

Reviewed-By: Paulo Vital <pvital@linux.vnet.ibm.com> On Tue, 2015-09-01 at 16:50 -0300, Ramon Medeiros wrote:
Block guest edition when paused.
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_edit_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js index fc1b4c1..fdc46cb 100644 --- a/ui/js/src/kimchi.guest_edit_main.js +++ b/ui/js/src/kimchi.guest_edit_main.js @@ -662,7 +662,7 @@ kimchi.guest_edit_main = function() { event.preventDefault(); kimchi.window.open("guest-storage-add.html"); }); - if(kimchi.thisVMState === "running") { + if ((kimchi.thisVMState === "running") || (kimchi.thisVMState === "paused")) { $("#form-guest-edit-general input").prop("disabled", true); } else { $("#action-button-container").removeClass("hidden");

Hi Ramon, With this patch the whole General tab is disabled for editing when the guest is paused. As we've already has support for memory and CPU hotplug, those 2 fields should be changed when the guest is paused. Have you tested this scenario? From a quick tests I did, I noticed the UI is sending all the data form to the backend even though the user hasn't changed the field. To workaround it, I changed the backed to "if name in params and params[name] != vm_name" so update the guest name, otherwise keep it as is. After doing that, I was able to change CPU but the UI kept displaying the old value. After rebooting the guest I was able to see the new CPU value in the UI. We need to check why the reboot was needed. Was it a bug on backend or only need to update the UI to get the new value? The same applied to memory! As I am using a libvirt version without memory hotplug support I was not able to test it. But it worth a test too. Based on all that, I will wait on your tests result to decide on this patch. Regards, Aline Manera On 01/09/2015 16:50, Ramon Medeiros wrote:
Block guest edition when paused.
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_edit_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js index fc1b4c1..fdc46cb 100644 --- a/ui/js/src/kimchi.guest_edit_main.js +++ b/ui/js/src/kimchi.guest_edit_main.js @@ -662,7 +662,7 @@ kimchi.guest_edit_main = function() { event.preventDefault(); kimchi.window.open("guest-storage-add.html"); }); - if(kimchi.thisVMState === "running") { + if ((kimchi.thisVMState === "running") || (kimchi.thisVMState === "paused")) { $("#form-guest-edit-general input").prop("disabled", true); } else { $("#action-button-container").removeClass("hidden");

Well, enabling memory/CPU hot plug for paused guests would imply to enable to running guests too. As it is a feature enabling, we need to postpone to after 1.5.1 I will apply the patch as it is. Thanks! On 04/09/2015 09:38, Aline Manera wrote:
Hi Ramon,
With this patch the whole General tab is disabled for editing when the guest is paused.
As we've already has support for memory and CPU hotplug, those 2 fields should be changed when the guest is paused. Have you tested this scenario?
From a quick tests I did, I noticed the UI is sending all the data form to the backend even though the user hasn't changed the field. To workaround it, I changed the backed to "if name in params and params[name] != vm_name" so update the guest name, otherwise keep it as is.
After doing that, I was able to change CPU but the UI kept displaying the old value. After rebooting the guest I was able to see the new CPU value in the UI. We need to check why the reboot was needed. Was it a bug on backend or only need to update the UI to get the new value? The same applied to memory! As I am using a libvirt version without memory hotplug support I was not able to test it. But it worth a test too.
Based on all that, I will wait on your tests result to decide on this patch.
Regards, Aline Manera
On 01/09/2015 16:50, Ramon Medeiros wrote:
Block guest edition when paused.
Signed-off-by: Ramon Medeiros <ramonn@linux.vnet.ibm.com> --- ui/js/src/kimchi.guest_edit_main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js index fc1b4c1..fdc46cb 100644 --- a/ui/js/src/kimchi.guest_edit_main.js +++ b/ui/js/src/kimchi.guest_edit_main.js @@ -662,7 +662,7 @@ kimchi.guest_edit_main = function() { event.preventDefault(); kimchi.window.open("guest-storage-add.html"); }); - if(kimchi.thisVMState === "running") { + if ((kimchi.thisVMState === "running") || (kimchi.thisVMState === "paused")) { $("#form-guest-edit-general input").prop("disabled", true); } else { $("#action-button-container").removeClass("hidden");
_______________________________________________ Kimchi-devel mailing list Kimchi-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/kimchi-devel

Applied. Thanks. Regards, Aline Manera
participants (3)
-
Aline Manera
-
Paulo Ricardo Paz Vital
-
Ramon Medeiros