Hi Rusty, Lguest should depend on BLOCK too , without BLOCK set I get this error: ... drivers/block/lguest_blk.c: In function 'end_entire_request': drivers/block/lguest_blk.c:80: error: implicit declaration of function 'end_that_request_first' drivers/block/lguest_blk.c:80: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:82: error: implicit declaration of function 'add_disk_randomness' drivers/block/lguest_blk.c:82: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:83: error: implicit declaration of function 'blkdev_dequeue_request' drivers/block/lguest_blk.c:84: error: implicit declaration of function 'end_that_request_last' drivers/block/lguest_blk.c: In function 'lgb_irq': drivers/block/lguest_blk.c:128: error: implicit declaration of function 'blk_start_queue' drivers/block/lguest_blk.c:128: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c: In function 'req_to_dma': drivers/block/lguest_blk.c:148: error: implicit declaration of function 'rq_for_each_bio' drivers/block/lguest_blk.c:148: error: expected ';' before '{' token drivers/block/lguest_blk.c:145: warning: unused variable 'idx' drivers/block/lguest_blk.c:145: warning: unused variable 'i' drivers/block/lguest_blk.c: In function 'setup_req': drivers/block/lguest_blk.c:185: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c: In function 'do_write': drivers/block/lguest_blk.c:202: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c: In function 'do_read': drivers/block/lguest_blk.c:215: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c: In function 'do_lgb_request': drivers/block/lguest_blk.c:234: error: implicit declaration of function 'elv_next_request' drivers/block/lguest_blk.c:234: warning: assignment makes pointer from integer without a cast drivers/block/lguest_blk.c:239: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:246: error: implicit declaration of function 'blk_fs_request' drivers/block/lguest_blk.c:247: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:248: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:253: error: implicit declaration of function 'rq_data_dir' drivers/block/lguest_blk.c:260: error: implicit declaration of function 'blk_stop_queue' drivers/block/lguest_blk.c: In function 'lguestblk_probe': drivers/block/lguest_blk.c:304: error: implicit declaration of function 'register_blkdev' drivers/block/lguest_blk.c:313: error: implicit declaration of function 'alloc_disk' drivers/block/lguest_blk.c:313: warning: assignment makes pointer from integer without a cast drivers/block/lguest_blk.c:322: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:322: error: implicit declaration of function 'blk_init_queue' drivers/block/lguest_blk.c:323: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:335: error: implicit declaration of function 'blk_queue_max_hw_segments' drivers/block/lguest_blk.c:335: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:341: error: implicit declaration of function 'blk_queue_segment_boundary' drivers/block/lguest_blk.c:341: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:349: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:360: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:373: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:374: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:375: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:376: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:378: error: implicit declaration of function 'set_capacity' drivers/block/lguest_blk.c:379: error: implicit declaration of function 'add_disk' drivers/block/lguest_blk.c:382: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:392: error: implicit declaration of function 'blk_cleanup_queue' drivers/block/lguest_blk.c:392: error: dereferencing pointer to incomplete type drivers/block/lguest_blk.c:394: error: implicit declaration of function 'put_disk' drivers/block/lguest_blk.c:396: error: implicit declaration of function 'unregister_blkdev' make[2]: *** [drivers/block/lguest_blk.o] Error 1 make[1]: *** [drivers/block] Error 2 .... Signed-off-by: Gabriel Craciunescu <nix.or.die@googlemail.com> --- Documentation/lguest/lguest.txt | 1 + drivers/lguest/Kconfig | 2 +- 2 files changed, 2 insertions(+), 1 deletions(-) diff --git a/Documentation/lguest/lguest.txt b/Documentation/lguest/lguest.txt index 821617b..4e7408c 100644 --- a/Documentation/lguest/lguest.txt +++ b/Documentation/lguest/lguest.txt @@ -33,6 +33,7 @@ Running Lguest: CONFIG_EXPERIMENTAL=y ("Prompt for development and/or incomplete code/drivers") CONFIG_PARAVIRT=y ("Paravirtualization support (EXPERIMENTAL)") CONFIG_LGUEST=y/m ("Linux hypervisor example code") + CONFIG_BLOCK=y ("Enable the block layer") and I recommend: CONFIG_HZ=100 ("Timer frequency")[2] diff --git a/drivers/lguest/Kconfig b/drivers/lguest/Kconfig index 43d901f..4bc0577 100644 --- a/drivers/lguest/Kconfig +++ b/drivers/lguest/Kconfig @@ -1,6 +1,6 @@ config LGUEST tristate "Linux hypervisor example code" - depends on X86 && PARAVIRT && NET && EXPERIMENTAL && !X86_PAE + depends on X86 && PARAVIRT && NET && EXPERIMENTAL && BLOCK && !X86_PAE select LGUEST_GUEST select HVC_DRIVER ---help---
Rusty Russell
2007-Jul-29 17:25 UTC
[PATCH] Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n
On Sun, 2007-07-29 at 17:18 +0200, Gabriel C wrote:> Hi Rusty, > > Lguest should depend on BLOCK too , without BLOCK set I get this error:Hi Gabriel, Thanks for the report! It's probably better to fix this properly rather than hack it as I did for NET. Linus, please apply: Gabriel C reports lguest doesn't compile with CONFIG_BLOCK=n. Fix this by introducing a config var for the block device, which depends on LGUEST && BLOCK. Do the same for the net driver, rather then depending gratuitously on CONFIG_NET. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> diff -r 9e987fcabb16 drivers/block/Makefile --- a/drivers/block/Makefile Mon Jul 30 09:47:25 2007 +1000 +++ b/drivers/block/Makefile Mon Jul 30 10:02:32 2007 +1000 @@ -31,4 +31,4 @@ obj-$(CONFIG_BLK_DEV_UB) += ub.o obj-$(CONFIG_BLK_DEV_UB) += ub.o obj-$(CONFIG_XEN_BLKDEV_FRONTEND) += xen-blkfront.o -obj-$(CONFIG_LGUEST_GUEST) += lguest_blk.o +obj-$(CONFIG_LGUEST_BLOCK) += lguest_blk.o diff -r 9e987fcabb16 drivers/lguest/Kconfig --- a/drivers/lguest/Kconfig Mon Jul 30 09:47:25 2007 +1000 +++ b/drivers/lguest/Kconfig Mon Jul 30 10:03:39 2007 +1000 @@ -1,6 +1,6 @@ config LGUEST config LGUEST tristate "Linux hypervisor example code" - depends on X86 && PARAVIRT && NET && EXPERIMENTAL && !X86_PAE + depends on X86 && PARAVIRT && EXPERIMENTAL && !X86_PAE select LGUEST_GUEST select HVC_DRIVER ---help--- @@ -18,3 +18,11 @@ config LGUEST_GUEST The guest needs code built-in, even if the host has lguest support as a module. The drivers are tiny, so we build them in too. + +config LGUEST_NET + tristate + depends on LGUEST_GUEST && NET + +config LGUEST_BLOCK + tristate + depends on LGUEST_GUEST && BLOCK diff -r 9e987fcabb16 drivers/net/Makefile --- a/drivers/net/Makefile Mon Jul 30 09:47:25 2007 +1000 +++ b/drivers/net/Makefile Mon Jul 30 10:02:22 2007 +1000 @@ -177,7 +177,7 @@ obj-$(CONFIG_HPLANCE) += hplance.o 7990. obj-$(CONFIG_HPLANCE) += hplance.o 7990.o obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o obj-$(CONFIG_EQUALIZER) += eql.o -obj-$(CONFIG_LGUEST_GUEST) += lguest_net.o +obj-$(CONFIG_LGUEST_NET) += lguest_net.o obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o obj-$(CONFIG_MIPS_SIM_NET) += mipsnet.o