[virt-tools-list] [virt-manager PATCH v2 2/3] helper function for removing cpu features

Chen Hanxiao chenhanxiao at cn.fujitsu.com
Tue Dec 3 02:10:42 UTC 2013



> -----Original Message-----
> From: Cole Robinson [mailto:crobinso at redhat.com]
> Sent: Tuesday, December 03, 2013 2:56 AM
> To: Chen Hanxiao; virt-tools-list at redhat.com
> Subject: Re: [virt-tools-list] [virt-manager PATCH v2 2/3] helper function
for
> removing cpu features
> 
> On 11/26/2013 07:56 AM, Chen Hanxiao wrote:
> > From: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> >
> > Introduce helper function to remove cpu features
> >
> > Signed-off-by: Chen Hanxiao <chenhanxiao at cn.fujitsu.com>
> > ---
> >  virtinst/cpu.py | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> >
> > diff --git a/virtinst/cpu.py b/virtinst/cpu.py
> > index 4318b56..b7c5484 100644
> > --- a/virtinst/cpu.py
> > +++ b/virtinst/cpu.py
> > @@ -74,6 +74,15 @@ class CPU(XMLBuilder):
> >          for name in cpu.features.names():
> >              self.add_feature(name)
> >
> > +    def clear_cpu(self):
> > +        self.mode = None
> > +        self.match = None
> > +        self.model = None
> > +        self.vendor = None
> > +
> > +        for feature in self.features:
> > +            self.remove_feature(feature)
> > +
> >      def vcpus_from_topology(self):
> >          """
> >          Determine the CPU count represented by topology, or 1 if
> >
> 
> 
> We define a 'clear()' method in xmlbuilder which should do what you want
for
> any object. So this patch shouldn't be required.
> 
> And with this patch gone, just squash patch 1 and 3 together into one
> functional change.

Thanks for your comments
I'll change it in the next version.

Thanks!

> 
> Thanks,
> Cole





More information about the virt-tools-list mailing list