diff options
author | Jeremy Fitzhardinge <jeremy@goop.org> | 2008-08-19 16:16:17 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-20 06:40:07 -0400 |
commit | 6e833587e11ed0dbf12e647127f2650e2f80b26d (patch) | |
tree | 7ba3d76705547ed1377f87694e0b0e4391fe0015 /drivers | |
parent | 170465ee7f5a9a2d0ac71285507e52642e040353 (diff) |
xen: clean up domain mode predicates
There are four operating modes Xen code may find itself running in:
- native
- hvm domain
- pv dom0
- pv domU
Clean up predicates for testing for these states to make them more consistent.
Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Cc: Xen-devel <xen-devel@lists.xensource.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/xen-blkfront.c | 2 | ||||
-rw-r--r-- | drivers/char/hvc_xen.c | 6 | ||||
-rw-r--r-- | drivers/input/xen-kbdfront.c | 4 | ||||
-rw-r--r-- | drivers/net/xen-netfront.c | 6 | ||||
-rw-r--r-- | drivers/video/xen-fbfront.c | 4 | ||||
-rw-r--r-- | drivers/xen/balloon.c | 2 | ||||
-rw-r--r-- | drivers/xen/grant-table.c | 2 | ||||
-rw-r--r-- | drivers/xen/xenbus/xenbus_probe.c | 8 |
8 files changed, 17 insertions, 17 deletions
diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 3ca643cafccd..d5e753255153 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -1032,7 +1032,7 @@ static struct xenbus_driver blkfront = { | |||
1032 | 1032 | ||
1033 | static int __init xlblk_init(void) | 1033 | static int __init xlblk_init(void) |
1034 | { | 1034 | { |
1035 | if (!is_running_on_xen()) | 1035 | if (!xen_domain()) |
1036 | return -ENODEV; | 1036 | return -ENODEV; |
1037 | 1037 | ||
1038 | if (register_blkdev(XENVBD_MAJOR, DEV_NAME)) { | 1038 | if (register_blkdev(XENVBD_MAJOR, DEV_NAME)) { |
diff --git a/drivers/char/hvc_xen.c b/drivers/char/hvc_xen.c index 6b70aa66a587..538ceea5e7df 100644 --- a/drivers/char/hvc_xen.c +++ b/drivers/char/hvc_xen.c | |||
@@ -108,8 +108,8 @@ static int __init xen_init(void) | |||
108 | { | 108 | { |
109 | struct hvc_struct *hp; | 109 | struct hvc_struct *hp; |
110 | 110 | ||
111 | if (!is_running_on_xen() || | 111 | if (!xen_pv_domain() || |
112 | is_initial_xendomain() || | 112 | xen_initial_domain() || |
113 | !xen_start_info->console.domU.evtchn) | 113 | !xen_start_info->console.domU.evtchn) |
114 | return -ENODEV; | 114 | return -ENODEV; |
115 | 115 | ||
@@ -142,7 +142,7 @@ static void __exit xen_fini(void) | |||
142 | 142 | ||
143 | static int xen_cons_init(void) | 143 | static int xen_cons_init(void) |
144 | { | 144 | { |
145 | if (!is_running_on_xen()) | 145 | if (!xen_pv_domain()) |
146 | return 0; | 146 | return 0; |
147 | 147 | ||
148 | hvc_instantiate(HVC_COOKIE, 0, &hvc_ops); | 148 | hvc_instantiate(HVC_COOKIE, 0, &hvc_ops); |
diff --git a/drivers/input/xen-kbdfront.c b/drivers/input/xen-kbdfront.c index 9ce3b3baf3a2..3ab6362f043c 100644 --- a/drivers/input/xen-kbdfront.c +++ b/drivers/input/xen-kbdfront.c | |||
@@ -335,11 +335,11 @@ static struct xenbus_driver xenkbd = { | |||
335 | 335 | ||
336 | static int __init xenkbd_init(void) | 336 | static int __init xenkbd_init(void) |
337 | { | 337 | { |
338 | if (!is_running_on_xen()) | 338 | if (!xen_domain()) |
339 | return -ENODEV; | 339 | return -ENODEV; |
340 | 340 | ||
341 | /* Nothing to do if running in dom0. */ | 341 | /* Nothing to do if running in dom0. */ |
342 | if (is_initial_xendomain()) | 342 | if (xen_initial_domain()) |
343 | return -ENODEV; | 343 | return -ENODEV; |
344 | 344 | ||
345 | return xenbus_register_frontend(&xenkbd); | 345 | return xenbus_register_frontend(&xenkbd); |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index c749bdba214c..3c3dd403f5dd 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -1794,10 +1794,10 @@ static struct xenbus_driver netfront = { | |||
1794 | 1794 | ||
1795 | static int __init netif_init(void) | 1795 | static int __init netif_init(void) |
1796 | { | 1796 | { |
1797 | if (!is_running_on_xen()) | 1797 | if (!xen_domain()) |
1798 | return -ENODEV; | 1798 | return -ENODEV; |
1799 | 1799 | ||
1800 | if (is_initial_xendomain()) | 1800 | if (xen_initial_domain()) |
1801 | return 0; | 1801 | return 0; |
1802 | 1802 | ||
1803 | printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); | 1803 | printk(KERN_INFO "Initialising Xen virtual ethernet driver.\n"); |
@@ -1809,7 +1809,7 @@ module_init(netif_init); | |||
1809 | 1809 | ||
1810 | static void __exit netif_exit(void) | 1810 | static void __exit netif_exit(void) |
1811 | { | 1811 | { |
1812 | if (is_initial_xendomain()) | 1812 | if (xen_initial_domain()) |
1813 | return; | 1813 | return; |
1814 | 1814 | ||
1815 | xenbus_unregister_driver(&netfront); | 1815 | xenbus_unregister_driver(&netfront); |
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index 47ed39b52f9c..a463b3dd837b 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c | |||
@@ -680,11 +680,11 @@ static struct xenbus_driver xenfb = { | |||
680 | 680 | ||
681 | static int __init xenfb_init(void) | 681 | static int __init xenfb_init(void) |
682 | { | 682 | { |
683 | if (!is_running_on_xen()) | 683 | if (!xen_domain()) |
684 | return -ENODEV; | 684 | return -ENODEV; |
685 | 685 | ||
686 | /* Nothing to do if running in dom0. */ | 686 | /* Nothing to do if running in dom0. */ |
687 | if (is_initial_xendomain()) | 687 | if (xen_initial_domain()) |
688 | return -ENODEV; | 688 | return -ENODEV; |
689 | 689 | ||
690 | return xenbus_register_frontend(&xenfb); | 690 | return xenbus_register_frontend(&xenfb); |
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index fff987b10e0f..a51f3e17a5fd 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
@@ -419,7 +419,7 @@ static int __init balloon_init(void) | |||
419 | unsigned long pfn; | 419 | unsigned long pfn; |
420 | struct page *page; | 420 | struct page *page; |
421 | 421 | ||
422 | if (!is_running_on_xen()) | 422 | if (!xen_pv_domain()) |
423 | return -ENODEV; | 423 | return -ENODEV; |
424 | 424 | ||
425 | pr_info("xen_balloon: Initialising balloon driver.\n"); | 425 | pr_info("xen_balloon: Initialising balloon driver.\n"); |
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c index e9e11168616a..06592b9da83c 100644 --- a/drivers/xen/grant-table.c +++ b/drivers/xen/grant-table.c | |||
@@ -508,7 +508,7 @@ static int __devinit gnttab_init(void) | |||
508 | unsigned int max_nr_glist_frames, nr_glist_frames; | 508 | unsigned int max_nr_glist_frames, nr_glist_frames; |
509 | unsigned int nr_init_grefs; | 509 | unsigned int nr_init_grefs; |
510 | 510 | ||
511 | if (!is_running_on_xen()) | 511 | if (!xen_domain()) |
512 | return -ENODEV; | 512 | return -ENODEV; |
513 | 513 | ||
514 | nr_grant_frames = 1; | 514 | nr_grant_frames = 1; |
diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c index 57ceb5346b74..7f24a98a446f 100644 --- a/drivers/xen/xenbus/xenbus_probe.c +++ b/drivers/xen/xenbus/xenbus_probe.c | |||
@@ -814,7 +814,7 @@ static int __init xenbus_probe_init(void) | |||
814 | DPRINTK(""); | 814 | DPRINTK(""); |
815 | 815 | ||
816 | err = -ENODEV; | 816 | err = -ENODEV; |
817 | if (!is_running_on_xen()) | 817 | if (!xen_domain()) |
818 | goto out_error; | 818 | goto out_error; |
819 | 819 | ||
820 | /* Register ourselves with the kernel bus subsystem */ | 820 | /* Register ourselves with the kernel bus subsystem */ |
@@ -829,7 +829,7 @@ static int __init xenbus_probe_init(void) | |||
829 | /* | 829 | /* |
830 | * Domain0 doesn't have a store_evtchn or store_mfn yet. | 830 | * Domain0 doesn't have a store_evtchn or store_mfn yet. |
831 | */ | 831 | */ |
832 | if (is_initial_xendomain()) { | 832 | if (xen_initial_domain()) { |
833 | /* dom0 not yet supported */ | 833 | /* dom0 not yet supported */ |
834 | } else { | 834 | } else { |
835 | xenstored_ready = 1; | 835 | xenstored_ready = 1; |
@@ -846,7 +846,7 @@ static int __init xenbus_probe_init(void) | |||
846 | goto out_unreg_back; | 846 | goto out_unreg_back; |
847 | } | 847 | } |
848 | 848 | ||
849 | if (!is_initial_xendomain()) | 849 | if (!xen_initial_domain()) |
850 | xenbus_probe(NULL); | 850 | xenbus_probe(NULL); |
851 | 851 | ||
852 | return 0; | 852 | return 0; |
@@ -937,7 +937,7 @@ static void wait_for_devices(struct xenbus_driver *xendrv) | |||
937 | unsigned long timeout = jiffies + 10*HZ; | 937 | unsigned long timeout = jiffies + 10*HZ; |
938 | struct device_driver *drv = xendrv ? &xendrv->driver : NULL; | 938 | struct device_driver *drv = xendrv ? &xendrv->driver : NULL; |
939 | 939 | ||
940 | if (!ready_to_wait_for_devices || !is_running_on_xen()) | 940 | if (!ready_to_wait_for_devices || !xen_domain()) |
941 | return; | 941 | return; |
942 | 942 | ||
943 | while (exists_disconnected_device(drv)) { | 943 | while (exists_disconnected_device(drv)) { |