[CRIU] Re: [PATCH]

Cyrill Gorcunov gorcunov at openvz.org
Thu Sep 13 08:49:58 EDT 2012


On Thu, Sep 13, 2012 at 04:44:14PM +0400, Pavel Emelyanov wrote:
> On 09/13/2012 04:35 PM, Cyrill Gorcunov wrote:
> > On Thu, Sep 13, 2012 at 04:10:47PM +0400, Pavel Emelyanov wrote:
> >> On 09/13/2012 03:49 PM, Cyrill Gorcunov wrote:
> >>> While I've not yet implemented support for slaves ttys without master
> >>> peers better to  exit with error instead of hanging on restore.
> >>>
> >>> 	Cyrill
> >>
> >>> +int tty_check_orphans(void)
> >>> +{
> >>> +	int i;
> >>> +
> >>> +	for (i = 0; i < (MAX_TTYS << 1) - 1; i += 2) {
> >>> +		int a = test_bit(i, tty_bitmap);
> >>> +		int b = test_bit(i + 1, tty_bitmap);
> >>> +
> >>> +		if (a && (a ^ b)) {
> >>> +			pr_err("Found slave without master\n");
> >>
> >> Why a && a ^ b == slave && !master ?
> > 
> > static int tty_gen_id(int major, int index)
> > {
> > 	return (index << 1) + (major == TTYAUX_MAJOR);
> > }
> > 
> > the odd bits are for masters while evens -- for slaves.
> > The cycle a bit inefficient I should rather use shifts,
> > but it's temporary solution.
> 
> OMG :( It's brain dead. I'll wait for proper slaves w/o masters fix.

OK, as I said it is temp solution as urgent fix (as to bits -- i don't
get what's scared you here, except the fact that we don't use fast cpu
instructions to find bits).


More information about the CRIU mailing list