From: "Jan Beulich" Subject: [PATCH] linux: allow blkback to be a module Date: Tue, 28 Feb 2006 17:39:41 +0100 Message-ID: <44048ADD.76F0.0078.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part89ACC4DD.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part89ACC4DD.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline While the Kconfig changes also touch BLKDEV_TAP, these haven't been tested (as I found that many of the options that are disabled by default don't even build at present). Jan --=__Part89ACC4DD.0__= Content-Type: text/plain; name="xenlinux-modular-blkback.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="xenlinux-modular-blkback.patch" Index: head-2006-02-23/drivers/xen/Kconfig =================================================================== --- head-2006-02-23.orig/drivers/xen/Kconfig 2006-02-28 15:19:06.000000000 +0100 +++ head-2006-02-23/drivers/xen/Kconfig 2006-02-28 15:22:29.000000000 +0100 @@ -68,7 +68,7 @@ config XEN_UNPRIVILEGED_GUEST default n config XEN_BLKDEV_BACKEND - bool "Block-device backend driver" + tristate "Block-device backend driver" default y help The block-device backend driver allows the kernel to export its @@ -76,7 +76,7 @@ config XEN_BLKDEV_BACKEND interface. config XEN_BLKDEV_TAP_BE - bool "Block Tap support for backend driver (DANGEROUS)" + tristate "Block Tap support for backend driver (DANGEROUS)" depends on XEN_BLKDEV_BACKEND default n help @@ -145,7 +145,7 @@ config XEN_NETDEV_FRONTEND (domain 0), then you almost certainly want to say Y here. config XEN_BLKDEV_TAP - bool "Block device tap driver" + tristate "Block device tap driver" default n help This driver allows a VM to interact on block device channels Index: head-2006-02-23/drivers/xen/blkback/Makefile =================================================================== --- head-2006-02-23.orig/drivers/xen/blkback/Makefile 2006-02-23 11:55:09.000000000 +0100 +++ head-2006-02-23/drivers/xen/blkback/Makefile 2006-02-28 15:08:53.000000000 +0100 @@ -1,2 +1,3 @@ +obj-$(CONFIG_XEN_BLKDEV_BACKEND) := blkbk.o -obj-y := blkback.o xenbus.o interface.o vbd.o +blkbk-y := blkback.o xenbus.o interface.o vbd.o Index: head-2006-02-23/drivers/xen/blkback/blkback.c =================================================================== --- head-2006-02-23.orig/drivers/xen/blkback/blkback.c 2006-02-23 11:55:09.000000000 +0100 +++ head-2006-02-23/drivers/xen/blkback/blkback.c 2006-02-28 15:16:34.000000000 +0100 @@ -29,14 +29,10 @@ * 64 should be enough to keep us competitive with Linux. */ static int blkif_reqs = 64; -static int mmap_pages; +module_param_named(reqs, blkif_reqs, int, 0); +MODULE_PARM_DESC(reqs, "Number of blkback requests to allocate"); -static int __init set_blkif_reqs(char *str) -{ - get_option(&str, &blkif_reqs); - return 1; -} -__setup("blkif_reqs=", set_blkif_reqs); +static int mmap_pages; /* Run-time switchable: /sys/module/blkback/parameters/ */ static unsigned int log_stats = 0; @@ -574,10 +570,20 @@ static int __init blkif_init(void) list_add_tail(&pending_reqs[i].free_list, &pending_free); blkif_xenbus_init(); + __unsafe(THIS_MODULE); return 0; } -__initcall(blkif_init); +module_init(blkif_init); + +static void blkif_exit(void) +{ + BUG(); +} + +module_exit(blkif_exit); + +MODULE_LICENSE("Dual BSD/GPL"); /* * Local variables: --=__Part89ACC4DD.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part89ACC4DD.0__=--