Skip to contentSkip to conversation

BLOCK=n , LGUEST=m/y compile error

PATCH New Gabriel C 3 participants 7 messages Jul 29, 2007 – Jul 31, 2007

Subsystems (4)
lore
Share & tools
lore

Gabriel C

author
#0 lore raw

PATCH 1/1 BLOCK=n , LGUEST=m/y compile error

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

....

---

 Documentation/lguest/lguest.txt |    1 +
 drivers/lguest/Kconfig          |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
Documentation/lguest/lguest.txt +1 -0
index 821617b..4e7408c 100644
@@ -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]
drivers/lguest/Kconfig +1 -1
index 43d901f..4bc0577 100644
@@ -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---
#1 lore raw

PATCH 1/1 Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n

Quoted 3 lines · Gabriel C

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.

drivers/block/Makefile +1 -1
diff -r 9e987fcabb16 drivers/block/Makefile
@@ -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
drivers/lguest/Kconfig +9 -1
diff -r 9e987fcabb16 drivers/lguest/Kconfig
@@ -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
drivers/net/Makefile +1 -1
diff -r 9e987fcabb16 drivers/net/Makefile
@@ -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
#2 lore raw

Re: [PATCH] Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n

Quoted 18 lines · Rusty Russell

[...]
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.
[...]
diff -r 9e987fcabb16 drivers/lguest/Kconfig

drivers/lguest/Kconfig Mon Jul 30 10:03:39 2007 +1000 renamed from drivers/lguest/Kconfig Mon Jul 30 09:47:25 2007 +1000 +1 -1
@@ -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---

drivers/lguest/Kconfig Mon Jul 30 10:03:39 2007 +1000 config LGUEST_GUEST · line 24

Quoted 7 lines
drivers/lguest/Kconfig Mon Jul 30 10:03:39 2007 +1000 renamed from drivers/lguest/Kconfig Mon Jul 30 09:47:25 2007 +1000 +4 -0
@@ -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

default y ?

drivers/lguest/Kconfig Mon Jul 30 10:03:39 2007 +1000 config LGUEST_GUEST · line 28

Quoted 4 lines
drivers/lguest/Kconfig Mon Jul 30 10:03:39 2007 +1000 renamed from drivers/lguest/Kconfig Mon Jul 30 09:47:25 2007 +1000 +4 -0
+
+config LGUEST_BLOCK
+       tristate
+       depends on LGUEST_GUEST && BLOCK

default y ?

I /think/ the default "y" would also automatically become "m" if any of the dependencies are modules ... probably need to test this, though.

Satyam

#3 lore raw

Re: [PATCH] Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n

Quoted 6 lines · Satyam Sharma

Review

Quoted 3 lines · Rusty Russell
(quoted diff) +3 -0
+config LGUEST_NET
+       tristate
+       depends on LGUEST_GUEST && NET

default y ?

Thanks, that does work better. Clean configs get an "N" otherwise 8(

Quoted 2 lines

I /think/ the default "y" would also automatically become "m" if any of the dependencies are modules ... probably need to test this, though.

No, it doesn't seem to. But LGUEST_GUEST is a bool anyway, so it's OK.

Thanks!
Rusty.
==
Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n

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.

drivers/block/Makefile +1 -1
diff -r 9e987fcabb16 drivers/block/Makefile
@@ -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
drivers/lguest/Kconfig +11 -1
diff -r 9e987fcabb16 drivers/lguest/Kconfig
@@ -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,13 @@ 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
+	default y
+	depends on LGUEST_GUEST && NET
+
+config LGUEST_BLOCK
+	default y
+	tristate
+	depends on LGUEST_GUEST && BLOCK
drivers/net/Makefile +1 -1
diff -r 9e987fcabb16 drivers/net/Makefile
@@ -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
author
#4 lore raw

Re: [PATCH] Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n

Quoted 9 lines · Rusty Russell
Quoted 5 lines · Satyam Sharma

drivers/lguest/Kconfig config LGUEST_GUEST · line 25

Quoted 3 lines · Rusty Russell
drivers/lguest/Kconfig +3 -0
+config LGUEST_NET
+       tristate
+       depends on LGUEST_GUEST && NET

default y ?

Thanks, that does work better. Clean configs get an "N" otherwise 8(

Quoted 7 lines
Quoted 2 lines

I /think/ the default "y" would also automatically become "m" if any of the dependencies are modules ... probably need to test this, though.

No, it doesn't seem to. But LGUEST_GUEST is a bool anyway, so it's OK.

Thanks!
Rusty.

Works fine this way.

BTW the wrong patch without the default y got merged.

Quoted 59 lines

==
Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n

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.

diff -r 9e987fcabb16 drivers/block/Makefile

drivers/block/Makefile +1 -1
@@ -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

drivers/lguest/Kconfig +11 -1
@@ -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,13 @@ 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
+	default y
+	depends on LGUEST_GUEST && NET
+
+config LGUEST_BLOCK
+	default y
+	tristate
+	depends on LGUEST_GUEST && BLOCK

diff -r 9e987fcabb16 drivers/net/Makefile

drivers/net/Makefile +1 -1
@@ -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
#5 lore raw

PATCH 1/1 Fix lguest driver config options

Quoted 1 line · Gabriel C

BTW the wrong patch without the default y got merged.

Thanks. Linus, please apply.

Lguest drivers need to default to "Y" otherwise they're never selected for new builds. We don't bother prompting, because they're less than 4k combined.

drivers/lguest/Kconfig +2 -0
diff -r e6b25e5473dc drivers/lguest/Kconfig
@@ -21,8 +21,10 @@ config LGUEST_GUEST
 
 config LGUEST_NET
 	tristate
+	default y
 	depends on LGUEST_GUEST && NET
 
 config LGUEST_BLOCK
 	tristate
+	default y
 	depends on LGUEST_GUEST && BLOCK
author
#6 lore raw

Re: [PATCH] Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n

In reply to Rusty Russell
Quoted 10 lines · Rusty Russell
Quoted 3 lines · Gabriel C

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.

You are welcome :)

Yes your solution is better :)

Gabriel