virtio-blk: Fix kconfig option
Subsystems (2)
PATCH 1/1 virtio-blk: Fix kconfig option
CONFIG_VIRTIO isn't exposed, everything else is supposed to select it instead.
--- drivers/block/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/block/Kconfig +2 -1
@@ -521,7 +521,8 @@ config XEN_BLKDEV_BACKEND config VIRTIO_BLK tristate "Virtio block driver (EXPERIMENTAL)" - depends on EXPERIMENTAL && VIRTIO + select VIRTIO + depends on EXPERIMENTAL ---help--- This is the virtual block driver for virtio. It can be used with lguest or QEMU based VMMs (like KVM or Xen). Say Y or M.
Signature · 1 line
1.7.10.4
Whoops, need VIRTIO_RING too
From 79dc9ae40e40cefd6079e4197cac858a1d59e1d8 Mon Sep 17 00:00:00 2001
From: Kent Overstreet <[email protected]>
Date: Sun, 2 Sep 2012 21:44:37 -0700
Subject: [PATCH] virtio-blk: Fix kconfig option
CONFIG_VIRTIO isn't exposed, everything else is supposed to select it instead.
--- drivers/block/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/block/Kconfig +3 -1
@@ -521,7 +521,9 @@ config XEN_BLKDEV_BACKEND config VIRTIO_BLK tristate "Virtio block driver (EXPERIMENTAL)" - depends on EXPERIMENTAL && VIRTIO + select VIRTIO + select VIRTIO_RING + depends on EXPERIMENTAL ---help--- This is the virtual block driver for virtio. It can be used with lguest or QEMU based VMMs (like KVM or Xen). Say Y or M.
Signature · 1 line
1.7.10.4
Whoops, need VIRTIO_RING too
Quoted 1 line
From
79dc9ae40e40cefd6079e4197cac858a1d59e1d8Mon Sep 17 00:00:00 2001
From: Kent Overstreet <[email protected]>
Date: Sun, 2 Sep 2012 21:44:37 -0700
Subject: [PATCH] virtio-blk: Fix kconfig option
CONFIG_VIRTIO isn't exposed, everything else is supposed to select it instead.
--- drivers/block/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/block/Kconfig +3 -1
@@ -521,7 +521,9 @@ config XEN_BLKDEV_BACKEND config VIRTIO_BLK tristate "Virtio block driver (EXPERIMENTAL)" - depends on EXPERIMENTAL && VIRTIO + select VIRTIO + select VIRTIO_RING + depends on EXPERIMENTAL ---help--- This is the virtual block driver for virtio. It can be used with lguest or QEMU based VMMs (like KVM or Xen). Say Y or M.
Signature · 1 line
1.7.10.4
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.
This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably virtio_pci in your case.
Cheers,
Rusty.
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.
Yes... VIRT_BLOCK isn't selecting it.
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.
virtio_mmio selects virtio as well.
drivers/virtio/Kconfig
config VIRTIO_MMIO
select VIRTIO
config VIRTIO_PCI
select VIRTIO
How about this:
config VIRTIO_BLK
depends on EXPERIMENTAL && (VIRTIO_PCI || VIRTIO_MMIO)
Signature · 1 line
Asias
Michael S. Tsirkin
maintainerQuoted 17 lines · Asias He
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.
virtio_mmioselects virtio as well.
drivers/virtio/Kconfig
configVIRTIO_MMIO
select VIRTIO
configVIRTIO_PCI
select VIRTIO
Quoted 3 lines
How about this:
configVIRTIO_BLKdepends on EXPERIMENTAL && (VIRTIO_PCI || VIRTIO_MMIO)
Isn't this exactly what depends on VIRTIO achieves?
Quoted 2 lines
Signature · 1 line
Asias
Quoted 18 lines · Michael S. Tsirkin
Quoted 17 lines · Asias He
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.
virtio_mmioselects virtio as well.
drivers/virtio/Kconfig
configVIRTIO_MMIO
select VIRTIO
configVIRTIO_PCI
select VIRTIO
Quoted 5 lines
Quoted 3 lines
How about this:
configVIRTIO_BLKdepends on EXPERIMENTAL && (VIRTIO_PCI || VIRTIO_MMIO)Isn't this exactly what depends on VIRTIO achieves?
Yes. But this gives the information that virtio_blk depends on one of the virtio transport: virito_pci or virtio_mmio.
Signature · 1 line
Asias
Michael S. Tsirkin
maintainerQuoted 19 lines · Asias He
Quoted 18 lines · Michael S. Tsirkin
Quoted 17 lines · Asias He
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.
virtio_mmioselects virtio as well.
drivers/virtio/Kconfig
configVIRTIO_MMIO
select VIRTIO
configVIRTIO_PCI
select VIRTIO
Quoted 8 lines
Quoted 5 lines
Quoted 3 lines
How about this:
configVIRTIO_BLKdepends on EXPERIMENTAL && (VIRTIO_PCI || VIRTIO_MMIO)Isn't this exactly what depends on VIRTIO achieves?
Yes. But this gives the information that
virtio_blkdepends on one of the virtio transport:virito_pciorvirtio_mmio.
It can work with any transport.
Quoted 2 lines
Signature · 1 line
Asias
Michael S. Tsirkin
maintainerQuoted 10 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.Cheers,
Rusty.
Actually balloon selects VIRTIO, I think it's a bug. Also isn't it time we dropped the experimental tag? Leaving it in for now.
-->
virtio-balloon: dependency fix
Devices should depend on virtio, not select it. It's supposed to be selected by the particular driver, e.g. VIRTIO_PCI.
Make balloon depend on VIRTIO and EXPERIMENTAL
(to match description).
--
drivers/virtio/Kconfig +1 -2
@@ -27,8 +27,7 @@ config VIRTIO_PCI config VIRTIO_BALLOON tristate "Virtio balloon driver (EXPERIMENTAL)" - select VIRTIO - select VIRTIO_RING + depends on EXPERIMENTAL && VIRTIO ---help--- This driver supports increasing and decreasing the amount of memory within a KVM guest.
Quoted 9 lines · Michael S. Tsirkin
Quoted 8 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.
Quoted 6 lines
Quoted 2 lines
Cheers,
Rusty.Actually balloon selects VIRTIO, I think it's a bug. Also isn't it time we dropped the experimental tag? Leaving it in for now.
Thanks, I applied this, and killed the EXPERIMENTAL in a separate patch.
Cheers,
Rusty.
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.
So are you saying virtio-blk depends on virtio-pci? If so, the kconfig should have that.
As is, VIRTIO_BLK just has:
depends on EXPERIMENTAL && VIRTIO
which is flat out broken.
Michael S. Tsirkin
maintainerQuoted 9 lines · Kent Overstreet
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.
Quoted 7 lines
So are you saying virtio-blk depends on virtio-pci? If so, the kconfig should have that.
As is,
VIRTIO_BLKjust has:depends on EXPERIMENTAL && VIRTIOwhich is flat out broken.
I don't think anything is broken.
Can you show an example of a broken configuration?
Signature · 1 line
MST
Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Kent Overstreet
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.So are you saying virtio-blk depends on virtio-pci? If so, the kconfig should have that.
Quoted 7 lines
Quoted 4 lines
As is,
VIRTIO_BLKjust has:depends on EXPERIMENTAL && VIRTIOwhich is flat out broken.
I don't think anything is broken.
Can you show an example of a broken configuration?
Do you not understand the difference between depends an selects? Or did you not read my original mail?
Flip off everything in drivers -> virtio
Now go to drivers -> block and try to turn on virtio-blk.
It's not listed!
Now go back to drivers -> virtio and turn on (randomly) balloon.
Go back to drivers -> block, and now you can turn on virtio-blk!
Do you see what's wrong with this picture?
Michael S. Tsirkin
maintainerQuoted 22 lines · Kent Overstreet
Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Kent Overstreet
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.So are you saying virtio-blk depends on virtio-pci? If so, the kconfig should have that.
Quoted 7 lines
Quoted 4 lines
As is,
VIRTIO_BLKjust has:depends on EXPERIMENTAL && VIRTIOwhich is flat out broken.
I don't think anything is broken.
Can you show an example of a broken configuration?
Quoted 7 lines
Do you not understand the difference between depends an selects? Or did you not read my original mail?
Flip off everything in drivers -> virtioNow go to drivers -> block and try to turn on virtio-blk.
It's not listed!
Yes. Because you disabled all virtio backends.
It does not make sense to have any frontends.
Quoted 5 lines
Now go back to drivers -> virtio and turn on (randomly) balloon.
Go back to drivers -> block, and now you can turn on virtio-blk!
Do you see what's wrong with this picture?
Yes. You got unlucky with your random guess.
It's a bug in balloon kconfig: it should not
select virtio.
I sent a patch to fix that yesterday.
Signature · 1 line
MST
Quoted 27 lines · Michael S. Tsirkin
Quoted 26 lines · Kent Overstreet
Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Kent Overstreet
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.So are you saying virtio-blk depends on virtio-pci? If so, the kconfig should have that.
Quoted 7 lines
Quoted 4 lines
As is,
VIRTIO_BLKjust has:depends on EXPERIMENTAL && VIRTIOwhich is flat out broken.
I don't think anything is broken.
Can you show an example of a broken configuration?Do you not understand the difference between depends an selects? Or did you not read my original mail?
Flip off everything in drivers -> virtio
Quoted 6 lines
Quoted 3 lines
Now go to drivers -> block and try to turn on virtio-blk.
It's not listed!
Yes. Because you disabled all virtio backends.
It does not make sense to have any frontends.
How's a user - or even another kernel developer who isn't familiar with virtio - supposed to know that?
I still don't know what exactly a virtio backend is - the term isn't even mentioned anywhere that I've seen.
Whatever it is though virtio-blk should be depending on _that_, not a config option that _isn't exposed in the menu_!
Quoted 10 lines
Quoted 5 lines
Now go back to drivers -> virtio and turn on (randomly) balloon.
Go back to drivers -> block, and now you can turn on virtio-blk!
Do you see what's wrong with this picture?
Yes. You got unlucky with your random guess.
It's a bug in balloon kconfig: it should not
select virtio.
I sent a patch to fix that yesterday.
Then it's also a bug in the comments at the top of drivers/virtio/Kconfig.
And besides that, how the _hell_ is a user supposed to know to turn on VIRTIO_PCI before VIRTIO_BLK? It's not documented anywhere (if that is what's supposed to happen! I still don't know) and even if it was documented, having one kconfig option depend on something that's exposed in a _completely different menu_ is just made of fail.
Michael S. Tsirkin
maintainerQuoted 55 lines · Kent Overstreet
Quoted 27 lines · Michael S. Tsirkin
Quoted 26 lines · Kent Overstreet
Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Kent Overstreet
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.So are you saying virtio-blk depends on virtio-pci? If so, the kconfig should have that.
Quoted 7 lines
Quoted 4 lines
As is,
VIRTIO_BLKjust has:depends on EXPERIMENTAL && VIRTIOwhich is flat out broken.
I don't think anything is broken.
Can you show an example of a broken configuration?Do you not understand the difference between depends an selects? Or did you not read my original mail?
Flip off everything in drivers -> virtioQuoted 6 lines
Quoted 3 lines
Now go to drivers -> block and try to turn on virtio-blk.
It's not listed!
Yes. Because you disabled all virtio backends.
It does not make sense to have any frontends.How's a user - or even another kernel developer who isn't familiar with virtio - supposed to know that?
I still don't know what exactly a virtio backend is - the term isn't even mentioned anywhere that I've seen.
Whatever it is though virtio-blk should be depending on _that_, not a config option that _isn't exposed in the
menu_!Quoted 10 lines
Quoted 5 lines
Now go back to drivers -> virtio and turn on (randomly) balloon.
Go back to drivers -> block, and now you can turn on virtio-blk!
Do you see what's wrong with this picture?
Yes. You got unlucky with your random guess.
It's a bug in balloon kconfig: it should not
select virtio.
I sent a patch to fix that yesterday.
Quoted 6 lines
Then it's also a bug in the comments at the top of
drivers/virtio/Kconfig.And besides that, how the _hell_ is a user supposed to know to turn on
VIRTIO_PCIbeforeVIRTIO_BLK? It's not documented anywhere (if that is what's supposed to happen! I still don't know)
Well, what kind of device do you have? Tell us :)
If it's a virtio pci device,
you need to enable virtio-pci and virtio-blk.
Quoted 3 lines
and even if it was
documented, having one kconfig option depend on something that's exposed in a_completelydifferentmenu_is just made of fail.
Fine, but why pick on virtio?
This is extremely common in kconfig.
For example, a ton of network drivers depend
on PCI, it's exactly the same thing.
Signature · 1 line
MST
Quoted 59 lines · Michael S. Tsirkin
Quoted 58 lines · Kent Overstreet
Quoted 27 lines · Michael S. Tsirkin
Quoted 26 lines · Kent Overstreet
Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Kent Overstreet
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.So are you saying virtio-blk depends on virtio-pci? If so, the kconfig should have that.
Quoted 7 lines
Quoted 4 lines
As is,
VIRTIO_BLKjust has:depends on EXPERIMENTAL && VIRTIOwhich is flat out broken.
I don't think anything is broken.
Can you show an example of a broken configuration?Do you not understand the difference between depends an selects? Or did you not read my original mail?
Flip off everything in drivers -> virtioQuoted 6 lines
Quoted 3 lines
Now go to drivers -> block and try to turn on virtio-blk.
It's not listed!
Yes. Because you disabled all virtio backends.
It does not make sense to have any frontends.How's a user - or even another kernel developer who isn't familiar with virtio - supposed to know that?
I still don't know what exactly a virtio backend is - the term isn't even mentioned anywhere that I've seen.
Whatever it is though virtio-blk should be depending on _that_, not a config option that _isn't exposed in the
menu_!Quoted 10 lines
Quoted 5 lines
Now go back to drivers -> virtio and turn on (randomly) balloon.
Go back to drivers -> block, and now you can turn on virtio-blk!
Do you see what's wrong with this picture?
Yes. You got unlucky with your random guess.
It's a bug in balloon kconfig: it should not
select virtio.
I sent a patch to fix that yesterday.Then it's also a bug in the comments at the top of
drivers/virtio/Kconfig.
Quoted 7 lines
Quoted 3 lines
And besides that, how the _hell_ is a user supposed to know to turn on
VIRTIO_PCIbeforeVIRTIO_BLK? It's not documented anywhere (if that is what's supposed to happen! I still don't know)Well, what kind of device do you have? Tell us :)
If it's a virtio pci device,
you need to enable virtio-pci and virtio-blk.
I run qemu with -drive if=virtio. You tell me!
Better yet, tell me how the user is supposed to figure it out!
Quoted 9 lines
Quoted 4 lines
and even if it was
documented, having one kconfig option depend on something that's exposed in a_completelydifferentmenu_is just made of fail.Fine, but why pick on virtio?
This is extremely common in kconfig.
For example, a ton of network drivers depend
on PCI, it's exactly the same thing.
Never noticed where CONFIG_PCI is exposed in bus options?
Nope, not the same thing.
Michael S. Tsirkin
maintainerQuoted 64 lines · Kent Overstreet
Quoted 63 lines · Michael S. Tsirkin
Quoted 61 lines · Kent Overstreet
Quoted 27 lines · Michael S. Tsirkin
Quoted 26 lines · Kent Overstreet
Quoted 13 lines · Michael S. Tsirkin
Quoted 12 lines · Kent Overstreet
Quoted 7 lines · Rusty Russell
Quoted 2 lines · Kent Overstreet
CONFIG_VIRTIOisn't exposed, everything else is supposed to select it instead.This is a slight mis-understanding. It's supposed to be selected by the particular driver, probably
virtio_pciin your case.So are you saying virtio-blk depends on virtio-pci? If so, the kconfig should have that.
Quoted 7 lines
Quoted 4 lines
As is,
VIRTIO_BLKjust has:depends on EXPERIMENTAL && VIRTIOwhich is flat out broken.
I don't think anything is broken.
Can you show an example of a broken configuration?Do you not understand the difference between depends an selects? Or did you not read my original mail?
Flip off everything in drivers -> virtioQuoted 6 lines
Quoted 3 lines
Now go to drivers -> block and try to turn on virtio-blk.
It's not listed!
Yes. Because you disabled all virtio backends.
It does not make sense to have any frontends.How's a user - or even another kernel developer who isn't familiar with virtio - supposed to know that?
I still don't know what exactly a virtio backend is - the term isn't even mentioned anywhere that I've seen.
Whatever it is though virtio-blk should be depending on _that_, not a config option that _isn't exposed in the
menu_!Quoted 10 lines
Quoted 5 lines
Now go back to drivers -> virtio and turn on (randomly) balloon.
Go back to drivers -> block, and now you can turn on virtio-blk!
Do you see what's wrong with this picture?
Yes. You got unlucky with your random guess.
It's a bug in balloon kconfig: it should not
select virtio.
I sent a patch to fix that yesterday.Then it's also a bug in the comments at the top of
drivers/virtio/Kconfig.And besides that, how the _hell_ is a user supposed to know to turn on
VIRTIO_PCIbeforeVIRTIO_BLK? It's not documented anywhere (if that is what's supposed to happen! I still don't know)
Quoted 5 lines
Quoted 3 lines
Well, what kind of device do you have? Tell us :)
If it's a virtio pci device,
you need to enable virtio-pci and virtio-blk.I run qemu with -drive if=virtio. You tell me!
-drive if= is a compatibility option. qemu makes an effort to guess what it is you want to do. Result is usually correct but it means people building their own kernels get confused.
For x86 kvm the modern equivalent is:
-device virtio-blk-pci,drive=foobar -drive if=no,...
If you use this you get what you asked for :).
Yes this usage is not documented anywhere, but this is not guest driver's problem.
Quoted 1 line
Better yet, tell me how the user is supposed to figure it out!
As usual when you do not know which driver to select. Boot a distro kernel and look around.
Where is your virtio device? On a pci bus? There you are.
Quoted 11 lines
Quoted 9 lines
Quoted 4 lines
and even if it was
documented, having one kconfig option depend on something that's exposed in a_completelydifferentmenu_is just made of fail.Fine, but why pick on virtio?
This is extremely common in kconfig.
For example, a ton of network drivers depend
on PCI, it's exactly the same thing.Never noticed where
CONFIG_PCIis exposed in bus options?
I see it:
CONFIG_PCI:
│ Find out whether you have a PCI motherboard. PCI is the name of a │ │ bus system, i.e. the way the CPU talks to the other stuff inside │ │ your box. Other bus systems are ISA, EISA, MicroChannel (MCA) or │ │ VESA. If you have PCI, say Y, otherwise N. │
Quoted 1 line
Nope, not the same thing.
You just happen to know what PCI is but not what VIRTIO PCI is. This is fair enough, but not sure how to help in this case. Your patch won't help though.
Signature · 1 line
MST
Quoted 4 lines · Kent Overstreet
Quoted 3 lines · Michael S. Tsirkin
Quoted 2 lines · Kent Overstreet
Do you not understand the difference between depends an selects? Or did you not read my original mail?
Now you're getting insulting.
It's normal for options to depend on other options. Sometimes they're directly nested (eg. E1000 depends on NETDEVICES, and it's nested under that option), sometimes they're not (eg. E1000 depends on PCI, which is selected elsewhere).
The fact that you are only just realizing this is not Michael's problem.
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Flip off everything in drivers -> virtio
Now go to drivers -> block and try to turn on virtio-blk.
It's not listed!
Yes. Because you disabled all virtio backends.
It does not make sense to have any frontends.How's a user - or even another kernel developer who isn't familiar with virtio - supposed to know that?
I get annoyed that menuconfig doesn't show options whose dependencies aren't possible, too. (I got bitten the other way: it doesn't show dependencies which can't be disabled, and I was trying to turn KALLSYMS off).
But as I found out just last week, the '/' key allows you to find any option, and shows what dependencies it has, and their values.
Hope that helps,
Rusty.
Quoted 8 lines · Rusty Russell
Quoted 4 lines · Kent Overstreet
Quoted 3 lines · Michael S. Tsirkin
Quoted 2 lines · Kent Overstreet
Do you not understand the difference between depends an selects? Or did you not read my original mail?
Now you're getting insulting.
Yes, but at least I'm not being intentionally obtuse.
Quoted 6 lines
It's normal for options to depend on other options. Sometimes they're directly nested (eg. E1000 depends on NETDEVICES, and it's nested under that option), sometimes they're not (eg. E1000 depends on PCI, which is selected elsewhere).
The fact that you are only just realizing this is not Michael's problem.
Like I said, I'm well aware of that. The issue here isn't the dependency, it's that it depends on something that isn't exposed anywhere!
Think about it from the user's pov. They check what VIRTIO_BLK depends on - just VIRTIO.
So they try to figure out how to flip on VIRTIO, or what VIRTIO even is.
See how that last step might be problematic? CONFIG_VIRTIO is not exposed! It doesn't even seem to control anything!
Go back to your example. Checking the dependencies for E1000 would tell you the user needs to flip on CONFIG_PCI. Done. Easy.
User checks the dependencies here and... what do _you_ expect people to do?
Look, depending on a kconfig option that's supposed to be user controllable but isn't exposed anywhere is flat out broken. The fact that it's in a different submenu just makes it worse.
The problem is that VIRTIO_BLK's dependencies are not actually specified in the kconfig. If it depends on VIRTIO_PCI, that's what the kconfig should say. If it depends on having any of multiple virtio backends enabled, then specify that!
depends VIRTIO_PCI || VIRTIO_WHATEVER
Or if you really want to have a fake config option that's enabled if you have any virtio backend enabled, fix the damn comments and naming!
How is anyone supposed to know that CONFIG_VIRTIO really means "any virtio backend?" Call it VIRTIO_ANY_BACKEND if that's what it really is.
And, if that is what you're doing with CONFIG_VIRTIO (I'm still not sure) the comment at the top of drivers/virtio/Kconfig is _wrong_:
# Virtio always gets selected by whoever wants it. VIRTIO
tristate
How is _anyone_ supposed to know that really means "VIRTIO gets selected by things that provide a virtio backend?"
C'mon, you've had to debug other people's code before. What would _you_ think if you were tripped up by something like that?
Quoted 12 lines
Quoted 11 lines
Quoted 8 lines
Quoted 5 lines
Flip off everything in drivers -> virtio
Now go to drivers -> block and try to turn on virtio-blk.
It's not listed!
Yes. Because you disabled all virtio backends.
It does not make sense to have any frontends.How's a user - or even another kernel developer who isn't familiar with virtio - supposed to know that?
Quoted 7 lines
I get annoyed that menuconfig doesn't show options whose dependencies aren't possible, too. (I got bitten the other way: it doesn't show dependencies which can't be disabled, and I was trying to turn KALLSYMS off).
But as I found out just last week, the '/' key allows you to find any option, and shows what dependencies it has, and their values.
Yep, use it all the time.
Quoted 11 lines · Kent Overstreet
Quoted 8 lines · Rusty Russell
Quoted 4 lines · Kent Overstreet
Quoted 3 lines · Michael S. Tsirkin
Quoted 2 lines · Kent Overstreet
Do you not understand the difference between depends an selects? Or did you not read my original mail?
Now you're getting insulting.
Yes, but at least I'm not being intentionally obtuse.
Insulting again. Wow.
It took me this long to understand your complaint. Perhaps I'm stupid. Or perhaps you are terrible at explaining yourself, and it is only through our patient and heroic efforts that we can comprehend you at all?
Quoted 10 lines
Think about it from the user's pov. They check what
VIRTIO_BLKdepends on - just VIRTIO.So they try to figure out how to flip on VIRTIO, or what VIRTIO even is.
See how that last step might be problematic?
CONFIG_VIRTIOis not exposed! It doesn't even seem to control anything!Go back to your example. Checking the dependencies for E1000 would tell you the user needs to flip on
CONFIG_PCI. Done. Easy.
Actually, it depends on NET_VENDOR_INTEL which depends on CONFIG_PCI, but yes, it's discoverable.
So your actual complaint is that:
1) CONFIG_VIRTIO is misleadingly documented both in comment and name.
2) It's not discoverable, since it's only selected via other things.
Quoted 2 lines
And, if that is what you're doing with
CONFIG_VIRTIO(I'm still not sure) the comment at the top ofdrivers/virtio/Kconfigis _wrong_:
As grep would show you, it's selected by LGUEST, S390_GUEST, RPMSG, VIRTIO_PCI and VIRTIO_MMIO (VIRTIO_BALLOON is a cut & paste bug, already patched by MST).
We could change every virtio device to depend on (CONFIG_LGUEST | CONFIG_S390_GUEST | CONFIG_RPMSG | CONFIG_VIRTIO_PCI | CONFIG_VIRTIO_MMIO), which is more discoverable but uglier. How's this workaround?
From: Rusty Russell <[email protected]>
Subject: virtio: add help to CONFIG_VIRTIO option.
Trying to enable a virtio driver (eg CONFIG_VIRTIO_BLK) is painful because it depends on CONFIG_VIRTIO. CONFIG_VIRTIO doesn't tell you how to turn it on (it's selected from anything which provides a virtio bus).
This patch at least adds some documentation, visible in menuconfig, as a hint.
drivers/virtio/Kconfig +4 -2
@@ -1,8 +1,10 @@ -# Virtio always gets selected by whoever wants it. config VIRTIO tristate + ---help--- + This option is selected by any driver which implements the virtio + bus, such as CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_MMIO, CONFIG_LGUEST, + CONFIG_RPMSG or CONFIG_S390_GUEST. -# Similarly the virtio ring implementation. config VIRTIO_RING tristate depends on VIRTIO