Re: [PATCH] netlink: specs: add specification for NBD
From: Hristo Venev <hidden>
Date: 2026-02-17 17:40:50
Also in:
linux-block
On Tue, 2026-02-17 at 12:17 +0000, Donald Hunter wrote:
There are yamllint errors: make -C tools/net/ynl lint make: Entering directory '/home/donaldh/net-next/tools/net/ynl' yamllint ../../../Documentation/netlink/specs ../../../Documentation/netlink/specs/nbd.yaml 159:81 error line too long (104 > 80 characters) (line- length) 169:6 error syntax error: expected <block end>, but found '<block mapping start>' (syntax) 170:7 error wrong indentation: expected 5 but found 6 (indentation)
Thanks, I will fix the lint errors in v2.
quoted
+doc: See :file:`drivers/block/nbd.c`Prefer to see a meaningful doc string here.
I will add more proper documentation in v2. I couldn't find any existing documentation of this netlink interface, so I guess I will write it myself.
quoted
+attribute-sets: + - + name: nbd-attrs + name-prefix: nbd-attr- + doc: Configuration policy attributes, used for CONNECT + attributes: + - + name: unspec + value: 0 + type: unusedNo need for unspec in the attribute list, ynl codegen does the right thing.
For me `pyynl.ynl_gen_c --mode uapi --header` no longer generates `NBD_ATTR_UNSPEC` if I remove this. Is there a YNL property to specify the name of the zero value of the attribute set? If not, should I remove it anyway, changing the generated header?
quoted
+ name: device-item-attrs + name-prefix: nbd-device-item- + doc: | + This is the format for multiple devices with :code:`NBD_ATTR_DEVICE_LIST` + + .. code-block:: + + [NBD_ATTR_DEVICE_LIST] + [NBD_DEVICE_ITEM] + [NBD_DEVICE_INDEX] + [NBD_DEVICE_CONNECTED] + attributes: + - + name: unspec + value: 0 + type: unusedNot required.
The same question applies here.
quoted
+ name: device-attrs + name-prefix: nbd-device- + attr-max-name: nbd-device-attr-max + attributes: + - + name: unspec + value: 0 + type: unusedNot required.
The same question applies here.
quoted
+ name: sock-item-attrs + name-prefix: nbd-sock-item- + doc: | + This is the format for multiple sockets with :code:`NBD_ATTR_SOCKETS` + + .. code-block:: + + [NBD_ATTR_SOCKETS] + [NBD_SOCK_ITEM] + [NBD_SOCK_FD] + [NBD_SOCK_ITEM] + [NBD_SOCK_FD] + attributes: + - + name: unspec + value: 0 + type: unusedNot required.
The same question applies here.
quoted
+ name: sock-attrs + name-prefix: nbd-sock- + attributes: + - + name: unspec + value: 0 + type: unusedNot required.
The same question applies here.
quoted
+operations: + enum-model: unified + name-prefix: nbd-cmd- + list: + - + name: unspec + value: 0 + doc: NBD_CMD_UNSPEC
A similar question applies here. If I remove this, `pyynl.ynl_gen_c --mode uapi --header` no longer generates `NBD_CMD_UNSPEC`. Is there a YNL property to generate it? If not, should I remove it anyway?
quoted
+ - + name: connect + doc: See :file:`drivers/block/nbd.c`, :code:`nbd_genl_connect()`Prefer to see meaningful doc string (same for other ops)
I guess I will have to document the four operations in v2 as well.
quoted
+ attribute-set: nbd-attrs + dont-validate: [strict]nbd.c has strict & dump, should this be [strict, dump] ? (same for other ops)
The NBD operations don't have `dump`, only `do`, so adding `dump` to `dont-validate` does not change the output of `pyynl.ynl_gen_c --mode kernel --source`. Should I add it anyway?