WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 06/11] unplug emulated devices

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 06/11] unplug emulated devices
From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Date: Mon, 10 May 2010 15:20:42 +0100
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Delivery-date: Mon, 10 May 2010 07:27:13 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Add a xen_unplug command line option to the kernel to unplug
xen emulated devices.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
---
 arch/x86/xen/enlighten.c |   30 +++++++++++++++++++++++++++++-
 1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index b9de0f8..7b923fc 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -35,6 +35,7 @@
 #include <xen/interface/memory.h>
 #include <xen/interface/hvm/hvm_op.h>
 #include <xen/interface/hvm/params.h>
+#include <xen/interface/platform_pci.h>
 #include <xen/features.h>
 #include <xen/page.h>
 #include <xen/hvm.h>
@@ -78,6 +79,7 @@ struct shared_info xen_dummy_shared_info;
 void *xen_initial_gdt;
 
 int xen_have_vector_callback;
+int unplug;
 
 /*
  * Point at some empty memory to start with. We map the real shared_info
@@ -1302,8 +1304,34 @@ void __init xen_guest_init(void)
                generic_interrupt_extension = do_hvm_pv_evtchn_intr;
                xen_have_vector_callback = 1;
        }
-
+       if (unplug) {
+               /* unplug emulated devices */
+               outw(UNPLUG_ALL, XEN_IOPORT_UNPLUG);
+       }
        have_vcpu_info_placement = 0;
        x86_init.irqs.intr_init = xen_init_IRQ;
 }
 
+static int __init parse_unplug(char *arg)
+{
+       char *p, *q;
+
+       for (p = arg; p; p = q) {
+               q = strchr(arg, ',');
+               if (q)
+                       *q++ = '\0';
+               if (!strcmp(p, "all"))
+                       unplug |= UNPLUG_ALL;
+               else if (!strcmp(p, "ide-disks"))
+                       unplug |= UNPLUG_ALL_IDE_DISKS;
+               else if (!strcmp(p, "aux-ide-disks"))
+                       unplug |= UNPLUG_AUX_IDE_DISKS;
+               else if (!strcmp(p, "nics"))
+                       unplug |= UNPLUG_ALL_NICS;
+               else
+                       printk(KERN_WARNING "unrecognised option '%s' "
+                                "in module parameter 'dev_unplug'\n", p);
+       }
+       return 0;
+}
+early_param("xen_unplug", parse_unplug);
-- 
1.5.4.3


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 06/11] unplug emulated devices, Stefano Stabellini <=