From: Sheng Yang <sheng@linux.intel.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>,
Ian Pratt <Ian.Pratt@eu.citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
xen-devel <xen-devel@lists.xensource.com>,
linux-kernel@vger.kernel.org, Sheng Yang <sheng@linux.intel.com>
Subject: [PATCH 6/7] xen: Unified checking for Xen of PV drivers to xenbus_register_frontend()
Date: Mon, 1 Mar 2010 17:38:34 +0800 [thread overview]
Message-ID: <1267436315-24486-7-git-send-email-sheng@linux.intel.com> (raw)
In-Reply-To: <1267436315-24486-1-git-send-email-sheng@linux.intel.com>
Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
drivers/block/xen-blkfront.c | 3 ---
drivers/input/xen-kbdfront.c | 3 ---
drivers/net/xen-netfront.c | 5 -----
drivers/video/xen-fbfront.c | 3 ---
include/xen/xenbus.h | 3 +++
5 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
index 05a31e5..d6465c1 100644
--- a/drivers/block/xen-blkfront.c
+++ b/drivers/block/xen-blkfront.c
@@ -1068,9 +1068,6 @@ static struct xenbus_driver blkfront = {
static int __init xlblk_init(void)
{
- if (!xen_domain())
- return -ENODEV;
-
if (register_blkdev(XENVBD_MAJOR, DEV_NAME)) {
printk(KERN_WARNING "xen_blk: can't get major %d with name %s\n",
XENVBD_MAJOR, DEV_NAME);
diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c
index c721c0a..febffc3 100644
--- a/drivers/input/xen-kbdfront.c
+++ b/drivers/input/xen-kbdfront.c
@@ -338,9 +338,6 @@ static struct xenbus_driver xenkbd_driver = {
static int __init xenkbd_init(void)
{
- if (!xen_domain())
- return -ENODEV;
-
/* Nothing to do if running in dom0. */
if (xen_initial_domain())
return -ENODEV;
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index a869b45..d89fd0b 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1804,14 +1804,9 @@ static struct xenbus_driver netfront_driver = {
static int __init netif_init(void)
{
- if (!xen_domain())
- return -ENODEV;
-
if (xen_initial_domain())
return 0;
- printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n");
-
return xenbus_register_frontend(&netfront_driver);
}
module_init(netif_init);
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index 603598f..daff72f 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -683,9 +683,6 @@ static struct xenbus_driver xenfb_driver = {
static int __init xenfb_init(void)
{
- if (!xen_domain())
- return -ENODEV;
-
/* Nothing to do if running in dom0. */
if (xen_initial_domain())
return -ENODEV;
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index b9763ba..9f68cf5 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -43,6 +43,7 @@
#include <xen/interface/grant_table.h>
#include <xen/interface/io/xenbus.h>
#include <xen/interface/io/xs_wire.h>
+#include <xen/xen.h>
/* Register callback to watch this node. */
struct xenbus_watch
@@ -112,6 +113,8 @@ static inline int __must_check
xenbus_register_frontend(struct xenbus_driver *drv)
{
WARN_ON(drv->owner != THIS_MODULE);
+ if (!xen_domain())
+ return -ENODEV;
return __xenbus_register_frontend(drv, THIS_MODULE, KBUILD_MODNAME);
}
--
1.5.4.5
next prev parent reply other threads:[~2010-03-01 9:37 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-01 9:38 [PATCH 0/7][v4] PV extension of HVM (Hybrid) for Xen Sheng Yang
2010-03-01 9:38 ` [PATCH 1/7] xen: add support for hvm_op Sheng Yang
2010-03-01 9:38 ` [PATCH 2/7] xen: Import cpuid.h from Xen Sheng Yang
2010-03-01 9:38 ` [PATCH 3/7] xen/hvm: Xen PV extension of HVM initialization Sheng Yang
2010-03-02 1:02 ` [Xen-devel] " Jeremy Fitzhardinge
2010-03-02 1:38 ` Sheng Yang
2010-03-02 1:43 ` Jeremy Fitzhardinge
2010-03-02 9:22 ` Ian Campbell
2010-03-02 20:17 ` Jeremy Fitzhardinge
2010-03-03 11:35 ` Stefano Stabellini
2010-03-03 17:35 ` Jeremy Fitzhardinge
2010-03-03 17:41 ` Stefano Stabellini
2010-03-04 10:18 ` Ian Campbell
2010-03-01 9:38 ` [PATCH 4/7] xen: The entrance for PV extension of HVM Sheng Yang
2010-03-02 1:05 ` [Xen-devel] " Jeremy Fitzhardinge
2010-03-02 1:41 ` Sheng Yang
2010-03-01 9:38 ` [PATCH 5/7] xen: Make event channel work with " Sheng Yang
2010-03-02 1:38 ` [Xen-devel] " Jeremy Fitzhardinge
2010-03-02 5:48 ` Sheng Yang
2010-03-03 18:31 ` Jeremy Fitzhardinge
2010-03-04 5:37 ` Sheng Yang
2010-03-04 11:58 ` Stefano Stabellini
2010-03-08 22:31 ` Jeremy Fitzhardinge
2010-03-01 9:38 ` Sheng Yang [this message]
2010-03-02 1:45 ` [Xen-devel] [PATCH 6/7] xen: Unified checking for Xen of PV drivers to xenbus_register_frontend() Jeremy Fitzhardinge
2010-03-01 9:38 ` [PATCH 7/7] xen: Enable grant table and xenbus for PV extension of HVM Sheng Yang
2010-03-01 17:38 ` [LKML] " Konrad Rzeszutek Wilk
2010-03-02 1:13 ` Sheng Yang
2010-03-02 1:21 ` Sheng Yang
2010-03-02 13:41 ` Konrad Rzeszutek Wilk
2010-03-02 14:09 ` Ian Campbell
2010-03-02 0:42 ` [Xen-devel] [PATCH 0/7][v4] PV extension of HVM (Hybrid) for Xen Jeremy Fitzhardinge
2010-03-02 1:26 ` Sheng Yang
2010-03-02 1:32 ` Jeremy Fitzhardinge
2010-03-02 1:34 ` Sheng Yang
2010-03-02 3:20 ` Dong, Eddie
-- strict thread matches above, loose matches on Subject: below --
2010-02-08 8:05 [PATCH 0/7][v3] PV featured HVM(Hybrid) " Sheng Yang
2010-02-08 8:05 ` [PATCH 6/7] xen: Unified checking for Xen of PV drivers to xenbus_register_frontend() Sheng Yang
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=1267436315-24486-7-git-send-email-sheng@linux.intel.com \
--to=sheng@linux.intel.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Pratt@eu.citrix.com \
--cc=jeremy.fitzhardinge@citrix.com \
--cc=keir.fraser@eu.citrix.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.