2017-12-09 15:27:13

by Vincent Legoll

[permalink] [raw]
Subject: [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

No need to get into the submenu to disable all VIRTIO-related
config entries.

This makes it easier to disable all VIRTIO config options
without entering the submenu. It will also enable one
to see that en/dis-abled state from the outside menu.

This is only intended to change menuconfig UI, not change
the config dependencies.

Signed-off-by: Vincent Legoll <[email protected]>
---
drivers/virtio/Kconfig | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
index cff773f15b7e..d485a63a8233 100644
--- a/drivers/virtio/Kconfig
+++ b/drivers/virtio/Kconfig
@@ -5,7 +5,10 @@ config VIRTIO
bus, such as CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_MMIO, CONFIG_RPMSG
or CONFIG_S390_GUEST.

-menu "Virtio drivers"
+menuconfig VIRTIO_MENU
+ bool "Virtio drivers"
+
+if VIRTIO_MENU

config VIRTIO_PCI
tristate "PCI driver for virtio devices"
@@ -79,4 +82,4 @@ config VIRTIO_MMIO_CMDLINE_DEVICES

If unsure, say 'N'.

-endmenu
+endif # VIRTIO_MENU
--
2.14.1


2017-12-21 06:44:44

by Andrei Vagin

[permalink] [raw]
Subject: Re: virtio: make VIRTIO a menuconfig to ease disabling it all

On Sat, Dec 09, 2017 at 04:26:57PM +0100, Vincent Legoll wrote:
> No need to get into the submenu to disable all VIRTIO-related
> config entries.
>
> This makes it easier to disable all VIRTIO config options
> without entering the submenu. It will also enable one
> to see that en/dis-abled state from the outside menu.
>
> This is only intended to change menuconfig UI, not change
> the config dependencies.
>
> Signed-off-by: Vincent Legoll <[email protected]>
> ---
> drivers/virtio/Kconfig | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
> index cff773f15b7e..d485a63a8233 100644
> --- a/drivers/virtio/Kconfig
> +++ b/drivers/virtio/Kconfig
> @@ -5,7 +5,10 @@ config VIRTIO
> bus, such as CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_MMIO, CONFIG_RPMSG
> or CONFIG_S390_GUEST.
>
> -menu "Virtio drivers"
> +menuconfig VIRTIO_MENU
> + bool "Virtio drivers"

Hi Vincent,

make localyesconfig and make localmodconfig doesn't work with this
patch.

My scenario looks like this:
* Create a virtual machine with Ubuntu 14.04 in GCE
* git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
* cd linux-next
* curl -o .config https://raw.githubusercontent.com/avagin/criu/linux-next/scripts/linux-next-config
* make localyesconfig

Without this patch:

$ cat .config | grep VIRTIO
CONFIG_BLK_MQ_VIRTIO=y
CONFIG_VIRTIO_BLK=y
# CONFIG_VIRTIO_BLK_SCSI is not set
CONFIG_SCSI_VIRTIO=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_CONSOLE=y
# CONFIG_HW_RANDOM_VIRTIO is not set
CONFIG_VIRTIO=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_PCI_LEGACY=y
CONFIG_VIRTIO_BALLOON=y
# CONFIG_VIRTIO_INPUT is not set
CONFIG_VIRTIO_MMIO=y
CONFIG_VIRTIO_MMIO_CMDLINE_DEVICES=y
# CONFIG_RPMSG_VIRTIO is not set
# CONFIG_CRYPTO_DEV_VIRTIO is not set


With this patch:

$ cat .config | grep VIRTIO
CONFIG_BLK_MQ_VIRTIO=y
# CONFIG_VIRTIO_BLK is not set
CONFIG_SCSI_VIRTIO=y
# CONFIG_VIRTIO_NET is not set
CONFIG_CAIF_VIRTIO=y
# CONFIG_VIRTIO_CONSOLE is not set
# CONFIG_HW_RANDOM_VIRTIO is not set
CONFIG_VIRTIO=y
# CONFIG_VIRTIO_MENU is not set
# CONFIG_RPMSG_VIRTIO is not set
# CONFIG_CRYPTO_DEV_VIRTIO is not set


You can see that with this patch CONFIG_VIRTIO_BLK is not set.
It is wrong, and the kernel with this config will not be able to boot.

We can add "default y" to fix this problem.

https://travis-ci.org/avagin/linux/jobs/313348334
https://travis-ci.org/avagin/linux/jobs/318491188

Thanks,
Andrei

> +
> +if VIRTIO_MENU
>
> config VIRTIO_PCI
> tristate "PCI driver for virtio devices"
> @@ -79,4 +82,4 @@ config VIRTIO_MMIO_CMDLINE_DEVICES
>
> If unsure, say 'N'.
>
> -endmenu
> +endif # VIRTIO_MENU

2017-12-21 10:53:56

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

Vincent Legoll <[email protected]> writes:

> No need to get into the submenu to disable all VIRTIO-related
> config entries.
>
> This makes it easier to disable all VIRTIO config options
> without entering the submenu. It will also enable one
> to see that en/dis-abled state from the outside menu.
>
> This is only intended to change menuconfig UI, not change
> the config dependencies.
>
> Signed-off-by: Vincent Legoll <[email protected]>
> ---
> drivers/virtio/Kconfig | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
> index cff773f15b7e..d485a63a8233 100644
> --- a/drivers/virtio/Kconfig
> +++ b/drivers/virtio/Kconfig
> @@ -5,7 +5,10 @@ config VIRTIO
> bus, such as CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_MMIO, CONFIG_RPMSG
> or CONFIG_S390_GUEST.
>
> -menu "Virtio drivers"
> +menuconfig VIRTIO_MENU
> + bool "Virtio drivers"
> +
> +if VIRTIO_MENU

This breaks all existing .configs *and* defconfigs that use VIRTIO.

Please don't do that.

If you make it default y then everything will continue to work.

cheers


diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
index d485a63a8233..35897649c24f 100644
--- a/drivers/virtio/Kconfig
+++ b/drivers/virtio/Kconfig
@@ -7,6 +7,7 @@ config VIRTIO

menuconfig VIRTIO_MENU
bool "Virtio drivers"
+ default y

if VIRTIO_MENU


2017-12-21 16:23:18

by Vincent Legoll

[permalink] [raw]
Subject: Re: [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

Hello,

thanks for the help, and sorry for the poor patch,

On Thu, Dec 21, 2017 at 11:53 AM, Michael Ellerman <[email protected]> wrote:
> This breaks all existing .configs *and* defconfigs that use VIRTIO.
>
> Please don't do that.
>
> If you make it default y then everything will continue to work.

Do you want me to respin it with the added default ?

Tchuss

--
Vincent Legoll

2017-12-22 02:12:38

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

Vincent Legoll <[email protected]> writes:

> Hello,
>
> thanks for the help, and sorry for the poor patch,
>
> On Thu, Dec 21, 2017 at 11:53 AM, Michael Ellerman <[email protected]> wrote:
>> This breaks all existing .configs *and* defconfigs that use VIRTIO.
>>
>> Please don't do that.
>>
>> If you make it default y then everything will continue to work.
>
> Do you want me to respin it with the added default ?

Yes please, either that or revert it.

cheers

2018-01-02 22:40:12

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

Michael Ellerman <[email protected]> writes:

> Vincent Legoll <[email protected]> writes:
>
>> Hello,
>>
>> thanks for the help, and sorry for the poor patch,
>>
>> On Thu, Dec 21, 2017 at 11:53 AM, Michael Ellerman <[email protected]> wrote:
>>> This breaks all existing .configs *and* defconfigs that use VIRTIO.
>>>
>>> Please don't do that.
>>>
>>> If you make it default y then everything will continue to work.
>>
>> Do you want me to respin it with the added default ?
>
> Yes please, either that or revert it.

This still seems to be broken.

cheers

2018-01-03 09:49:33

by Vincent Legoll

[permalink] [raw]
Subject: [PATCH, v2] virtio: make VIRTIO a menuconfig to ease disabling it

No need to get into the submenu to disable all VIRTIO-related
config entries.

This makes it easier to disable all VIRTIO config options
without entering the submenu. It will also enable one
to see that en/dis-abled state from the outside menu.

This is only intended to change menuconfig UI, not change
the config dependencies.

v2: Added "default y" to avoid breaking existing configs

Signed-off-by: Vincent Legoll <[email protected]>

2018-01-03 09:49:37

by Vincent Legoll

[permalink] [raw]
Subject: [PATCH] [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

No need to get into the submenu to disable all VIRTIO-related
config entries.

This makes it easier to disable all VIRTIO config options
without entering the submenu. It will also enable one
to see that en/dis-abled state from the outside menu.

This is only intended to change menuconfig UI, not change
the config dependencies.

v2: add "default y" to avoid breaking existing configs

Signed-off-by: Vincent Legoll <[email protected]>
---
drivers/virtio/Kconfig | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
index cff773f15b7e..290a1875e1d3 100644
--- a/drivers/virtio/Kconfig
+++ b/drivers/virtio/Kconfig
@@ -5,7 +5,11 @@ config VIRTIO
bus, such as CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_MMIO, CONFIG_RPMSG
or CONFIG_S390_GUEST.

-menu "Virtio drivers"
+menuconfig VIRTIO_MENU
+ bool "Virtio drivers"
+ default y
+
+if VIRTIO_MENU

config VIRTIO_PCI
tristate "PCI driver for virtio devices"
@@ -79,4 +83,4 @@ config VIRTIO_MMIO_CMDLINE_DEVICES

If unsure, say 'N'.

-endmenu
+endif # VIRTIO_MENU
--
2.11.0

2018-01-07 03:25:30

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH] [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

On 01/03/18 01:49, Vincent Legoll wrote:
> No need to get into the submenu to disable all VIRTIO-related
> config entries.
>
> This makes it easier to disable all VIRTIO config options
> without entering the submenu. It will also enable one
> to see that en/dis-abled state from the outside menu.
>
> This is only intended to change menuconfig UI, not change
> the config dependencies.
>
> v2: add "default y" to avoid breaking existing configs
>
> Signed-off-by: Vincent Legoll <[email protected]>

For a single patch (not 2 or more in a series), please just use one
email with the patch description etc. in it. No need for a cover letter.

> ---
> drivers/virtio/Kconfig | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
> index cff773f15b7e..290a1875e1d3 100644
> --- a/drivers/virtio/Kconfig
> +++ b/drivers/virtio/Kconfig
> @@ -5,7 +5,11 @@ config VIRTIO
> bus, such as CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_MMIO, CONFIG_RPMSG
> or CONFIG_S390_GUEST.
>
> -menu "Virtio drivers"
> +menuconfig VIRTIO_MENU
> + bool "Virtio drivers"
> + default y

The 2 lines above should be indented only with 1 tab. They should not line up
with the help text above (help text is indented more than other Kconfig lines).

After that little style thing is fixed, you can add:

Reviewed-by: Randy Dunlap <[email protected]>
Tested-by: Randy Dunlap <[email protected]> # works for me

and even though this will disable the drivers that are listed immediately
inside this if/endif block, there are several other drivers that select VIRTIO,
so it can be slightly tricky to figure out what is causing CONFIG_VIRTIO
to be enabled after having disabled CONFIG_VIRTIO_MENU.

Thanks.

> +
> +if VIRTIO_MENU
>
> config VIRTIO_PCI
> tristate "PCI driver for virtio devices"
> @@ -79,4 +83,4 @@ config VIRTIO_MMIO_CMDLINE_DEVICES
>
> If unsure, say 'N'.
>
> -endmenu
> +endif # VIRTIO_MENU
>


--
~Randy

2018-01-07 11:34:10

by Vincent Legoll

[permalink] [raw]
Subject: [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

No need to get into the submenu to disable all VIRTIO-related
config entries.

This makes it easier to disable all VIRTIO config options
without entering the submenu. It will also enable one
to see that en/dis-abled state from the outside menu.

This is only intended to change menuconfig UI, not change
the config dependencies.

v2: Added "default y" to avoid breaking existing configs
v3: Fixed wrong indentation, added *-by from Randy

Signed-off-by: Vincent Legoll <[email protected]>
Reviewed-by: Randy Dunlap <[email protected]>
Tested-by: Randy Dunlap <[email protected]> # works for me
---
drivers/virtio/Kconfig | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig
index cff773f15b7e..35897649c24f 100644
--- a/drivers/virtio/Kconfig
+++ b/drivers/virtio/Kconfig
@@ -5,7 +5,11 @@ config VIRTIO
bus, such as CONFIG_VIRTIO_PCI, CONFIG_VIRTIO_MMIO, CONFIG_RPMSG
or CONFIG_S390_GUEST.

-menu "Virtio drivers"
+menuconfig VIRTIO_MENU
+ bool "Virtio drivers"
+ default y
+
+if VIRTIO_MENU

config VIRTIO_PCI
tristate "PCI driver for virtio devices"
@@ -79,4 +83,4 @@ config VIRTIO_MMIO_CMDLINE_DEVICES

If unsure, say 'N'.

-endmenu
+endif # VIRTIO_MENU
--
2.14.1

2018-01-23 04:32:13

by Michael Ellerman

[permalink] [raw]
Subject: Ping Re: [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

Vincent Legoll <[email protected]> writes:

> No need to get into the submenu to disable all VIRTIO-related
> config entries.
>
> This makes it easier to disable all VIRTIO config options
> without entering the submenu. It will also enable one
> to see that en/dis-abled state from the outside menu.
>
> This is only intended to change menuconfig UI, not change
> the config dependencies.
>
> v2: Added "default y" to avoid breaking existing configs
> v3: Fixed wrong indentation, added *-by from Randy
>
> Signed-off-by: Vincent Legoll <[email protected]>
> Reviewed-by: Randy Dunlap <[email protected]>
> Tested-by: Randy Dunlap <[email protected]> # works for me
> ---
> drivers/virtio/Kconfig | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)

This has been broken in linux-next for ~6 weeks now, can we please merge
this and get it fixed.

cheers

2018-01-23 08:08:46

by Vincent Legoll

[permalink] [raw]
Subject: Re: Ping Re: [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

On 1/23/18, Michael Ellerman <[email protected]> wrote:
> This has been broken in linux-next for ~6 weeks now, can we please merge
> this and get it fixed.

Added Stephen Rothwell to cc

--
Vincent Legoll

2018-01-28 10:15:15

by Michael Ellerman

[permalink] [raw]
Subject: Re: Ping Re: [PATCH] virtio: make VIRTIO a menuconfig to ease disabling it all

Vincent Legoll <[email protected]> writes:
> On 1/23/18, Michael Ellerman <[email protected]> wrote:
>> This has been broken in linux-next for ~6 weeks now, can we please merge
>> this and get it fixed.
>
> Added Stephen Rothwell to cc

It should be fixed in the virtio tree, which the other Michael and Jason
maintain AFAIK.

cheers