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
33 NBD_ATTR_CLIENT_FLAGS,33 NBD_ATTR_CLIENT_FLAGS,
34 NBD_ATTR_SOCKETS,34 NBD_ATTR_SOCKETS,
35 NBD_ATTR_DEAD_CONN_TIMEOUT,35 NBD_ATTR_DEAD_CONN_TIMEOUT,
36 NBD_ATTR_DEVICE_LIST,
36 __NBD_ATTR_MAX,37 __NBD_ATTR_MAX,
37};38};
38#define NBD_ATTR_MAX (__NBD_ATTR_MAX - 1)39#define NBD_ATTR_MAX (__NBD_ATTR_MAX - 1)
39 40
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 */
49enum {
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
56enum {
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
40/*64/*
41 * This is the format for multiple sockets with NBD_ATTR_SOCKETS65 * This is the format for multiple sockets with NBD_ATTR_SOCKETS
42 *66 *
@@ -66,6 +90,7 @@ enum { · 23 unmodified lines
66 NBD_CMD_DISCONNECT,90 NBD_CMD_DISCONNECT,
67 NBD_CMD_RECONFIGURE,91 NBD_CMD_RECONFIGURE,
68 NBD_CMD_LINK_DEAD,92 NBD_CMD_LINK_DEAD,
93 NBD_CMD_STATUS,
69 __NBD_CMD_MAX,94 __NBD_CMD_MAX,
70};95};
71#define NBD_CMD_MAX (__NBD_CMD_MAX - 1)96#define NBD_CMD_MAX (__NBD_CMD_MAX - 1)