[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/2] rangeset: add RANGESETF_no_print flag


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "roger.pau@xxxxxxxxxx" <roger.pau@xxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Mon, 22 Nov 2021 11:27:08 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tEQY6jR2gOzNvayT3tUbzzm2GEqQpjyo1tu8DQC3CWY=; b=hwyEBDLYfrJDPOIq/sSKWkFwGiMIWmewl30YyIj+4RWHh6UMz5oQZfKKVpdAtHKHwVtFyE8wmTWWBPDdWw9jSylnplr3xdGoLpG8aWkePf7USA1arz7H81OqHXHuHs6sC3esRNwIGXMW5wgMg/vN6ILmrm20UNkm3/RomSK/Gov2k2ty7iVc8FuKOUBjG8lnc2+g8jOdaalAHun3mXexcTaDJSVKw3ou5nrCInULXdalfwAtejm3uJs3MzsB+JveMLnE5GPnCuMIF8wIIF8qJavaM7Tj91W3XqUT9/56fDceBzJvlzoyJuFLi5rnUjPraSj/BlNMohn9zSqV8+khIA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=efX9ff765zK9HPULJlJV+EFiiTZrZDvfvh7Y9B+p3YO/vYxBWeQmgTHlByYub5QJEtwsSUf8OeJW22xnltJlZ4NevnWGCT8vTkEYS78BvHiQjxVjkUwnbrCT/1PVMVLVRkiyO4h2donUqmAaEutgzbhU6cHhaANC6WUEiUG229i4LbhV4Mluvt7ATTst3+dU4ng7bU6FC1+wkJU2M5l8H4s+fxpgx8kDV332ioh7r/bhBYwxn1bo3iKJL1pAjfu6Eu5wGvmdPNo4FJ2DCgNdY2HuXbD4+Uv51v8YQgGIQSUX/OSD5MDYtEXemfwKq4VWl6NS4zlRvU3JyVMRqs52zg==
  • Cc: "jbeulich@xxxxxxxx" <jbeulich@xxxxxxxx>, Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Delivery-date: Mon, 22 Nov 2021 11:27:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHX34NQb/OdxzJcEUqRnDxd7565ZKwPaLyA
  • Thread-topic: [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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.