From: Andrii Anisov <andrii.anisov@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: sstabellini@kernel.org, andrii_anisov@epam.com,
George.Dunlap@eu.citrix.com, andrew.cooper3@citrix.com,
ian.jackson@eu.citrix.com, tim@xen.org, paul.durrant@citrix.com,
jbeulich@suse.com, wei.liu2@citrix.com
Subject: [RFC 5/6] rangeset_domain_printk() refactoring
Date: Thu, 16 Feb 2017 14:03:29 +0200 [thread overview]
Message-ID: <1487246610-8298-6-git-send-email-andrii.anisov@gmail.com> (raw)
In-Reply-To: <1487246610-8298-1-git-send-email-andrii.anisov@gmail.com>
From: Andrii Anisov <andrii_anisov@epam.com>
rangeset_domain_printk() is split into generic rangeset_list_printk() function
and domain specific common/domain.c:domain_rangeset_printk().
Signed-off-by: Andrii Anisov <andrii_anisov@epam.com>
---
xen/common/domain.c | 14 ++++++++++++++
xen/common/keyhandler.c | 2 +-
xen/common/rangeset.c | 15 +++------------
xen/include/xen/domain.h | 3 +++
xen/include/xen/rangeset.h | 4 ++--
5 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/xen/common/domain.c b/xen/common/domain.c
index 47c45f2..9b68e2f 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -1560,6 +1560,20 @@ void domain_rangeset_destroy(struct domain *d,
rangeset_destroy(r, &d->rangesets_lock);
}
+void domain_rangeset_printk(
+ struct domain *d)
+{
+ printk("Rangesets belonging to domain %u:\n", d->domain_id);
+
+ spin_lock(&d->rangesets_lock);
+
+ if ( list_empty(&d->rangesets) )
+ printk(" None\n");
+
+ rangeset_list_printk(&d->rangesets);
+
+ spin_unlock(&d->rangesets_lock);
+}
/*
* Local variables:
diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c
index 16de6e8..4f237f0 100644
--- a/xen/common/keyhandler.c
+++ b/xen/common/keyhandler.c
@@ -320,7 +320,7 @@ static void dump_domains(unsigned char key)
arch_dump_domain_info(d);
- rangeset_domain_printk(d);
+ domain_rangeset_printk(d);
dump_pageframe_info(d);
diff --git a/xen/common/rangeset.c b/xen/common/rangeset.c
index a8b5a5d..c18fb21 100644
--- a/xen/common/rangeset.c
+++ b/xen/common/rangeset.c
@@ -455,26 +455,17 @@ void rangeset_printk(
read_unlock(&r->lock);
}
-void rangeset_domain_printk(
- struct domain *d)
+void rangeset_list_printk(
+ struct list_head *list)
{
struct rangeset *r;
- printk("Rangesets belonging to domain %u:\n", d->domain_id);
-
- spin_lock(&d->rangesets_lock);
-
- if ( list_empty(&d->rangesets) )
- printk(" None\n");
-
- list_for_each_entry ( r, &d->rangesets, rangeset_list )
+ list_for_each_entry ( r, list, rangeset_list )
{
printk(" ");
rangeset_printk(r);
printk("\n");
}
-
- spin_unlock(&d->rangesets_lock);
}
/*
diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
index 3d9c652..b2dca15 100644
--- a/xen/include/xen/domain.h
+++ b/xen/include/xen/domain.h
@@ -114,4 +114,7 @@ struct rangeset *domain_rangeset_new(struct domain *d, char *name,
void domain_rangeset_destroy(struct domain *d,
struct rangeset *r);
+void domain_rangeset_printk(
+ struct domain *d);
+
#endif /* __XEN_DOMAIN_H__ */
diff --git a/xen/include/xen/rangeset.h b/xen/include/xen/rangeset.h
index cc795d1..8fd8164 100644
--- a/xen/include/xen/rangeset.h
+++ b/xen/include/xen/rangeset.h
@@ -81,8 +81,8 @@ void rangeset_swap(struct rangeset *a, struct rangeset *b);
/* Rangeset pretty printing. */
void rangeset_printk(
struct rangeset *r);
-void rangeset_domain_printk(
- struct domain *d);
+void rangeset_list_printk(
+ struct list_head *list);
#endif /* __XEN_RANGESET_H__ */
--
2.7.4
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-02-16 12:03 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-16 12:03 [RFC 0/6] Rangeset generalisation Andrii Anisov
2017-02-16 12:03 ` [RFC 1/6] rangeset_new() refactoring Andrii Anisov
2017-02-16 12:14 ` Paul Durrant
2017-02-16 13:15 ` Andrii Anisov
2017-02-16 12:03 ` [RFC 2/6] rangeset_destroy() refactoring Andrii Anisov
2017-02-16 12:26 ` Paul Durrant
2017-02-16 14:26 ` Andrii Anisov
2017-02-16 14:29 ` Paul Durrant
2017-02-16 16:22 ` Andrii Anisov
2017-02-16 16:37 ` Paul Durrant
2017-02-16 12:03 ` [RFC 3/6] Drop rangeset_domain_initialise() Andrii Anisov
2017-02-16 12:03 ` [RFC 4/6] rangeset_domain_destroy() refactoring Andrii Anisov
2017-02-16 12:03 ` Andrii Anisov [this message]
2017-02-16 12:03 ` [RFC 6/6] Drop domain remains from rangeset Andrii Anisov
2017-02-16 12:29 ` [RFC 0/6] Rangeset generalisation Paul Durrant
2017-02-16 12:45 ` Andrii Anisov
2017-02-16 12:50 ` Paul Durrant
2017-02-16 13:07 ` Andrii Anisov
2017-02-16 13:24 ` Andrii Anisov
2017-02-16 14:02 ` Paul Durrant
2017-02-16 14:28 ` Andrii Anisov
2017-02-16 13:25 ` Jan Beulich
2017-02-16 13:37 ` Andrii Anisov
2017-02-16 13:42 ` Andrii Anisov
2017-02-16 14:30 ` Jan Beulich
2017-02-16 17:39 ` George Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487246610-8298-6-git-send-email-andrii.anisov@gmail.com \
--to=andrii.anisov@gmail.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=andrii_anisov@epam.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=paul.durrant@citrix.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).