History

nbd: add a status netlink command

Allow users to query the status of existing nbd devices. Right now this only returns whether or not the device is connected, but could be extended in the future to include more information.

Josef Bacik committed 9 years ago

Commit 47d902b1 parent 560bc4b2 files · +133 −0Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/nbd-netlink.h+25−0
@@ -33,10 +33,34 @@ enum { · 32 unmodified lines
3333 NBD_ATTR_CLIENT_FLAGS,
3434 NBD_ATTR_SOCKETS,
3535 NBD_ATTR_DEAD_CONN_TIMEOUT,
36+ NBD_ATTR_DEVICE_LIST,
3637 __NBD_ATTR_MAX,
3738 };
3839 #define NBD_ATTR_MAX (__NBD_ATTR_MAX - 1)
3940
41+/*
42+ * This is the format for multiple devices with NBD_ATTR_DEVICE_LIST
43+ *
44+ * [NBD_ATTR_DEVICE_LIST]
45+ * [NBD_DEVICE_ITEM]
46+ * [NBD_DEVICE_INDEX]
47+ * [NBD_DEVICE_CONNECTED]
48+ */
49+enum {
50+ NBD_DEVICE_ITEM_UNSPEC,
51+ NBD_DEVICE_ITEM,
52+ __NBD_DEVICE_ITEM_MAX,
53+};
54+#define NBD_DEVICE_ITEM_MAX (__NBD_DEVICE_ITEM_MAX - 1)
55+
56+enum {
57+ NBD_DEVICE_UNSPEC,
58+ NBD_DEVICE_INDEX,
59+ NBD_DEVICE_CONNECTED,
60+ __NBD_DEVICE_MAX,
61+};
62+#define NBD_DEVICE_ATTR_MAX (__NBD_DEVICE_MAX - 1)
63+
4064 /*
4165 * This is the format for multiple sockets with NBD_ATTR_SOCKETS
4266 *
@@ -66,6 +90,7 @@ enum { · 23 unmodified lines
6690 NBD_CMD_DISCONNECT,
6791 NBD_CMD_RECONFIGURE,
6892 NBD_CMD_LINK_DEAD,
93+ NBD_CMD_STATUS,
6994 __NBD_CMD_MAX,
7095 };
7196 #define NBD_CMD_MAX (__NBD_CMD_MAX - 1)