[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 1/3] console: allow log level threshold adjustments
> +static void do_inc_thresh(unsigned char key, struct cpu_user_regs *regs) > +{ > + ++*lower_thresh_adj; > + do_adj_thresh(key); > +} > + > +static void do_dec_thresh(unsigned char key, struct cpu_user_regs *regs) > +{ > + if ( *lower_thresh_adj ) > + --*lower_thresh_adj; > + do_adj_thresh(key); > +} > + > +static void __putstr(const char *); > +static void printk_start_of_line(const char *); > + > +static void do_loglvl_op(const struct xen_sysctl_loglvl_thresh *op, > + int *lower, int *upper, const char *which) > +{ > + if ( op->lower_thresh < 0 && op->upper_thresh < 0 ) > + return; > + > + if ( op->lower_thresh >= 0 ) > + *lower = op->lower_thresh; > + > + if ( op->upper_thresh >= 0 ) > + *upper = op->upper_thresh; > + ..snip.. > + case XEN_SYSCTL_LOGLVL_set: > + if ( (op->host.lower_thresh >= 0 && op->host.upper_thresh >= 0 && > + op->host.lower_thresh > op->host.upper_thresh) || > + (op->guest.lower_thresh >= 0 && op->guest.upper_thresh >= 0 && > + op->guest.lower_thresh > op->guest.upper_thresh) ) > + return -EINVAL; > + > + do_loglvl_op(&op->host, &xenlog_lower_thresh, > + &xenlog_upper_thresh, "standard"); The keyboard and the sysctl both allow the user to go beyound the XENLOG_ values we have. That is you could set the lower and upper threshold to be at 9 (or more) say. It will have the same effect as XENLOG_DEBUG (which is 4) as printk_prefix_check seems to have a simple < check. But perhaps to be correct only accept only proper values? Not allow the system admin to set the level to say 31415? _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |