[LINUX] Transparent virtualization fixes.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 21 Jun 2006 15:54:09 +0000 (16:54 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 21 Jun 2006 15:54:09 +0000 (16:54 +0100)
Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c
linux-2.6-xen-sparse/drivers/xen/core/evtchn.c

index b8aca267781e31aea4ae162d5f9ae3f41f4d57f1..bb5cd5e7a472257a4886a0c887499e822eeb3eb4 100644 (file)
@@ -468,11 +468,11 @@ static int __init balloon_init(void)
        unsigned long pfn;
        struct page *page;
 
-       IPRINTK("Initialising balloon driver.\n");
-
        if (!is_running_on_xen())
                return -ENODEV;
 
+       IPRINTK("Initialising balloon driver.\n");
+
        current_pages = min(xen_start_info->nr_pages, max_pfn);
        totalram_pages = current_pages;
        target_pages  = current_pages;
index 9eaed5b3a21d085e0d1c74e01f7e6cda26ad57df..0969e213a090fbf994cf803010c6d13b3bfebd78 100644 (file)
@@ -109,6 +109,9 @@ static int __init setup_vcpu_hotplug_event(void)
        static struct notifier_block xsn_cpu = {
                .notifier_call = setup_cpu_watcher };
 
+       if (!is_running_on_xen())
+               return -ENODEV;
+
        register_cpu_notifier(&hotplug_cpu);
        register_xenstore_notifier(&xsn_cpu);
 
index 9ef160f4820a660cb1c44c3c203b1bc41275d058..7d57e105a4346812917013b17441d48673939a27 100644 (file)
@@ -666,6 +666,10 @@ static struct hw_interrupt_type pirq_type = {
 int irq_ignore_unhandled(unsigned int irq)
 {
        struct physdev_irq_status_query irq_status = { .irq = irq };
+
+       if (!is_running_on_xen())
+               return 0;
+
        (void)HYPERVISOR_physdev_op(PHYSDEVOP_irq_status_query, &irq_status);
        return !!(irq_status.flags & XENIRQSTAT_shared);
 }