[virt-tools-list] [PATCH virt-manager] virt-manager: split EDIT_VCPUS and EDIT_MAXVCPUS
Cole Robinson
crobinso at redhat.com
Tue Jun 17 15:25:20 UTC 2014
On 06/17/2014 09:24 AM, Giuseppe Scrivano wrote:
> Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1098040
>
> Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
> ---
> virtManager/details.py | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/virtManager/details.py b/virtManager/details.py
> index 9b2bd8c..dd43259 100644
> --- a/virtManager/details.py
> +++ b/virtManager/details.py
> @@ -52,6 +52,7 @@ EDIT_DESC,
> EDIT_IDMAP,
>
> EDIT_VCPUS,
> +EDIT_MAXVCPUS,
> EDIT_CPUSET,
> EDIT_CPU,
> EDIT_TOPOLOGY,
> @@ -102,7 +103,7 @@ EDIT_FS,
>
> EDIT_HOSTDEV_ROMBAR,
>
> -) = range(1, 43)
> +) = range(1, 44)
>
>
> # Columns in hw list model
> @@ -1750,7 +1751,11 @@ class vmmDetails(vmmGObjectUI):
> def config_maxvcpus_changed(self, ignore):
> if self.widget("config-maxvcpus").get_sensitive():
> self.config_cpu_topology_changed()
> - self.enable_apply(EDIT_VCPUS)
> +
> + # As this callback can be triggered by other events, set EDIT_MAXVCPUS
> + # only when the value is changed.
> + if self.config_get_maxvcpus() != self.vm.vcpu_max_count():
> + self.enable_apply(EDIT_MAXVCPUS)
>
> def on_cpu_copy_host_clicked(self, src):
> uiutil.set_grid_row_visible(
> @@ -2051,9 +2056,11 @@ class vmmDetails(vmmGObjectUI):
>
> if self.edited(EDIT_VCPUS):
> kwargs["vcpus"] = self.config_get_vcpus()
> - kwargs["maxvcpus"] = self.config_get_maxvcpus()
> hotplug_args["vcpus"] = kwargs["vcpus"]
>
> + if self.edited(EDIT_MAXVCPUS):
> + kwargs["maxvcpus"] = self.config_get_maxvcpus()
> +
> if self.edited(EDIT_CPUSET):
> kwargs["cpuset"] = self.get_text("config-vcpupin")
>
>
ACK
- Cole
More information about the virt-tools-list
mailing list