[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [virt-tools-list] [PATCH 2/3] cpu: add reset() function to reset cpu related variables to none



On 04/16/2013 07:02 AM, Guannan Ren wrote:
> ---
>  virtinst/CPU.py | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/virtinst/CPU.py b/virtinst/CPU.py
> index b3d451d..f9416da 100644
> --- a/virtinst/CPU.py
> +++ b/virtinst/CPU.py
> @@ -187,6 +187,15 @@ class CPU(XMLBuilderDomain.XMLBuilderDomain):
>                              get_converter=lambda s, x: _int_or_none(x),
>                              xpath="./cpu/topology/@threads")
>  
> +    def reset(self):
> +        self.match = None
> +        self.mode = None
> +        self.vendor = None
> +        self.model = None
> +
> +        for feature in self.features:
> +            self.remove_feature(feature)
> +
>      def copy_host_cpu(self):
>          """
>          Enact the equivalent of qemu -cpu host, pulling all info
> 

Looks fine, though we have a similar function named 'clear' with
VirtualDeviceAddress, so I'd say rename this to 'clear' for minor consistency.

Thanks,
Cole


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]