On 3/6/20 11:59 AM, Gabriel Krisman Bertazi wrote:
+static const char *const connection_state_names[] = {
+ [ISCSI_CONN_UP] = "up",
+ [ISCSI_CONN_DOWN] = "down",
+ [ISCSI_CONN_FAILED] = "failed"
+};
+
+static ssize_t show_conn_state(struct device *dev,
+
Bart Van Assche writes:
> How about removing the loop as follows?
>
Hey, Thanks for the review.
I understand designated initializers :-P
My point was following the pattern of the other statuses sysfs files in
the iSCSI layer.
But, I really don't mind. What do you think of v3 below?
-- >8
On 3/5/20 11:20 AM, Gabriel Krisman Bertazi wrote:
Bart Van Assche writes:
On 3/5/20 7:35 AM, Gabriel Krisman Bertazi wrote:
+static const struct {
+ int value;
+ char *name;
+} connection_state_names[] = {
+ {ISCSI_CONN_UP, "up"},
+ {ISCSI_CONN_DOWN, "down"},
+
Bart Van Assche writes:
> On 3/5/20 7:35 AM, Gabriel Krisman Bertazi wrote:
>> +static const struct {
>> +int value;
>> +char *name;
>> +} connection_state_names[] = {
>> +{ISCSI_CONN_UP, "up"},
>> +{ISCSI_CONN_DOWN, "down"},
>> +{ISCSI_CONN_FAILED, "failed"}
>> +};
>> +
>>
On 3/5/20 7:35 AM, Gabriel Krisman Bertazi wrote:
+static const struct {
+ int value;
+ char *name;
+} connection_state_names[] = {
+ {ISCSI_CONN_UP, "up"},
+ {ISCSI_CONN_DOWN, "down"},
+ {ISCSI_CONN_FAILED, "failed"}
+};
+
+static const char
If an iSCSI connection happens to fail while the daemon isn't
running (due to a crash or for another reason), the kernel failure
report is not received. When the daemon restarts, there is insufficient
kernel state in sysfs for it to know that this happened. open-iscsi
tries to reopen every