[libvirt] [PATCH v2 2/5] cgroup: refactor virCgroup

Hu Tao hutao at cn.fujitsu.com
Fri Feb 8 01:00:29 UTC 2013


On Thu, Feb 07, 2013 at 03:33:46PM +0000, Daniel P. Berrange wrote:
> On Mon, Feb 04, 2013 at 03:40:58PM +0800, Hu Tao wrote:
> > This patch adds a new structure, virCgroupItem, to represent
> > a cgroup directory(named cgroup item). cgroup directory is
> > created when needed and removed if no one is using it.
> > ---
> >  src/libvirt_private.syms |   2 +
> >  src/util/vircgroup.c     | 541 ++++++++++++++++++++++++++++++++++++++++++++++-
> >  src/util/vircgroup.h     |   8 +
> >  3 files changed, 545 insertions(+), 6 deletions(-)
> > 
> > diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
> > index c589236..f5138af 100644
> > --- a/src/libvirt_private.syms
> > +++ b/src/libvirt_private.syms
> > @@ -73,6 +73,8 @@ virCapabilitiesSetMacPrefix;
> >  
> >  
> >  # cgroup.h
> > +virCgroup2Free;
> > +virCgroup2New;
> >  virCgroupAddTask;
> >  virCgroupAddTaskController;
> >  virCgroupAllowDevice;
> 
> I'm sorry, this approach will just not work. If you want to refactor
> code, you need to actually do refactoring. What you've done here is
> write a completely new set of APIs with new names. Then delete the
> old ones in the next patch. That isn't refactoring & makes it impossible
> to sensibly review this.

Well, then I'll squash 2, 3, 4, 5 into a big one.




More information about the libvir-list mailing list