[CRIU] [PATCH] Attempt to restore cgroups
Tycho Andersen
tycho.andersen at canonical.com
Thu Jul 3 06:25:20 PDT 2014
Hi Pavel,
On Thu, Jul 03, 2014 at 12:06:30PM +0400, Pavel Emelyanov wrote:
> On 07/02/2014 10:45 PM, Tycho Andersen wrote:
> > Hi Pavel,
> >
> > On Wed, Jul 02, 2014 at 12:12:10AM +0400, Pavel Emelyanov wrote:
> >>> +{
> >>> + struct cgroup_dir *cur;
> >>> + CgroupDirEntry *cde;
> >>> + void *m;
> >>> + int i = 0;
> >>> +
> >>> + m = xmalloc(n_dirs * (sizeof(CgroupDirEntry *) + sizeof(CgroupDirEntry)));
> >>> + *ents = m;
> >>> + if (!m)
> >>> + return -1;
> >>> +
> >>> + cde = m + n_dirs * sizeof(CgroupDirEntry *);
> >>
> >> Just for the record -- we have the xptr_pull() helper that can help putting
> >> objects one-by-one in the single-malloc-ed memory segment. You can find the
> >> good (I hope) example of it in the core_entry_alloc().
> >
> > So after playing with this for a bit it isn't entirely clear how I can
> > condense the code using xptr_pull. The implementation above is one I
> > copied from dump_sets(), which has the same protobuf type problem.
>
> I don't insist on using the xptr_pull() :) I just pointed one out, if you
> find it inappropriate for your code it's OK.
Ok cool :-)
> > I have the rest of the changes suggested in this thread prepared,
> > so I can post those or if you can clarify xptr_pull, I can make this
> > change as well.
>
> Cool! Looking forward to the patch series :)
Just posted it. I am working now on moving the restore properties part
out of the restoring directories part, but since that can wait I
figured I'd post the rest now.
Thanks!
Tycho
More information about the CRIU
mailing list