[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 1/2] rangeset: add RANGESETF_no_print flag
On 22.11.21 11:28, Oleksandr Andrushchenko wrote: > From: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx> > > There are range sets which should not be printed, so introduce a flag > which allows marking those as such. Implement relevant logic to skip > such entries while printing. > > Suggested-by: Jan Beulich <jbeulich@xxxxxxxx> > Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@xxxxxxxx> > --- > xen/common/rangeset.c | 3 +++ > xen/include/xen/rangeset.h | 3 +++ > 2 files changed, 6 insertions(+) > > diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c > index 885b6b15c229..939883a1d145 100644 > --- a/xen/common/rangeset.c > +++ b/xen/common/rangeset.c > @@ -575,6 +575,9 @@ void rangeset_domain_printk( > > list_for_each_entry ( r, &d->rangesets, rangeset_list ) > { > + if ( r->flags & RANGESETF_no_print ) > + continue; > + > printk(" "); > rangeset_printk(r); > printk("\n"); > diff --git a/xen/include/xen/rangeset.h b/xen/include/xen/rangeset.h > index 135f33f6066f..543540a88b6f 100644 > --- a/xen/include/xen/rangeset.h > +++ b/xen/include/xen/rangeset.h > @@ -51,6 +51,9 @@ void rangeset_limit( > /* Pretty-print range limits in hexadecimal. */ > #define _RANGESETF_prettyprint_hex 0 > #define RANGESETF_prettyprint_hex (1U << _RANGESETF_prettyprint_hex) > +/* Do not print entries marked with this flag. */ > +#define _RANGESETF_no_print 1 > +#define RANGESETF_no_print (1U << _RANGESETF_no_print) > > bool_t __must_check rangeset_is_empty( > const struct rangeset *r); This will also require: diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c index 939883a1d145..ea27d651723b 100644 --- a/xen/common/rangeset.c +++ b/xen/common/rangeset.c @@ -433,7 +433,7 @@ struct rangeset *rangeset_new( INIT_LIST_HEAD(&r->range_list); r->nr_ranges = -1; - BUG_ON(flags & ~RANGESETF_prettyprint_hex); + BUG_ON(flags & ~(RANGESETF_prettyprint_hex | RANGESETF_no_print)); r->flags = flags; Or we just remove BUG_ON now Thank you, Oleksandr
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |