[libvirt] [PATCH 1/1] lxc: use our own hand-rolled code in place of unlockpt and grantpt

Serge E. Hallyn serge.hallyn at canonical.com
Mon Oct 17 13:26:07 UTC 2011


Quoting Eli Qiao (taget at linux.vnet.ibm.com):
> hi Serge :

Thanks for taking a look.

>     I checked the code ,  only in lxc_controller.c call virFileOpenTtyAt().
>     I didn't test the path, but my suggestion is that modify the
> utility function in /src/util/util.c instead of adding a new
> function.

But virFileOpenTtyAt() is called by virFileOpenTty() in the same
file.  So we really do want a new function using its own versions of
grantpt+unlockpt, because I think that, when we can, we want to continue
using the glibc versions.

So the safe approach seemed to me to be: put the container-specific
code into src/lxc/lxc_controller.c, then (in a separate patch) just fold
virFileOpenTtyAt(), straight into virFileOpenTty().

If you agree, I'll post a new version incorporating your other feedback,
especially the garish use of alloca :)

(If you disagree, please feel free to send your own patch - I'm in no
way attached to having my version included, I mainly wanted to point out
the bug)

thanks,
-serge




More information about the libvir-list mailing list