mirror of https://github.com/schoebel/mars
marsadm: check attach state
This commit is contained in:
parent
0bab62f434
commit
4690deb873
|
@ -2798,6 +2798,7 @@ int make_log_finalize(struct mars_global *global, struct mars_dent *dent)
|
||||||
struct mars_rotate *rot;
|
struct mars_rotate *rot;
|
||||||
struct trans_logger_brick *trans_brick;
|
struct trans_logger_brick *trans_brick;
|
||||||
struct copy_brick *copy_brick;
|
struct copy_brick *copy_brick;
|
||||||
|
bool is_attached;
|
||||||
int status = -EINVAL;
|
int status = -EINVAL;
|
||||||
|
|
||||||
CHECK_PTR(parent, err);
|
CHECK_PTR(parent, err);
|
||||||
|
@ -2949,6 +2950,9 @@ int make_log_finalize(struct mars_global *global, struct mars_dent *dent)
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
is_attached = !!rot->trans_brick;
|
||||||
|
_show_actual(rot->parent_path, "is-attached", is_attached);
|
||||||
|
|
||||||
if (rot->trans_brick)
|
if (rot->trans_brick)
|
||||||
_show_rate(rot, &rot->replay_limiter, rot->trans_brick->power.led_on, "replay_rate");
|
_show_rate(rot, &rot->replay_limiter, rot->trans_brick->power.led_on, "replay_rate");
|
||||||
if (rot->copy_brick)
|
if (rot->copy_brick)
|
||||||
|
|
|
@ -853,6 +853,7 @@ sub leave_res {
|
||||||
my $status = get_link($tmp);
|
my $status = get_link($tmp);
|
||||||
ldie "switch '$tmp' is not off\n" if $status;
|
ldie "switch '$tmp' is not off\n" if $status;
|
||||||
}
|
}
|
||||||
|
check_status($cmd, $res, "is-attached", 0, 0, 1);
|
||||||
foreach my $tmp (glob("$mars/resource-$res/actual-$host/*")) {
|
foreach my $tmp (glob("$mars/resource-$res/actual-$host/*")) {
|
||||||
my $status = get_link($tmp);
|
my $status = get_link($tmp);
|
||||||
ldie "running status '$tmp' is not off\n" if $status;
|
ldie "running status '$tmp' is not off\n" if $status;
|
||||||
|
|
Loading…
Reference in New Issue