aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2008-08-19 16:16:17 -0400
committerIngo Molnar <mingo@elte.hu>2008-08-20 06:40:07 -0400
commit6e833587e11ed0dbf12e647127f2650e2f80b26d (patch)
tree7ba3d76705547ed1377f87694e0b0e4391fe0015 /drivers/xen
parent170465ee7f5a9a2d0ac71285507e52642e040353 (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/xen')
-rw-r--r--drivers/xen/balloon.c2
-rw-r--r--drivers/xen/grant-table.c2
-rw-r--r--drivers/xen/xenbus/xenbus_probe.c8
3 files changed, 6 insertions, 6 deletions
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)) {