Fix guest heartbeat status and reporting state
Fixed a few day one bugs: - Heartbeat status changes are not properly passed to VIM from GuestAgent. - Heartbeat reporting state is not properly updated in guestServer when guest heartbeat is enabled. These bugs could cause heartbeat status/states mismatch among VIM-guestAgent-guestServer and result in intermittent issues. Change-Id: I2198760345821fa4af0437af252e3ec6a39978d8 Signed-off-by: Jack Ding <jack.ding@windriver.com>
This commit is contained in:
parent
6f183bd257
commit
89e4e574e8
@ -855,18 +855,12 @@ int recv_from_guestServer ( unsigned int cmd, char * buf_ptr )
|
|||||||
if ( instInfo_ptr )
|
if ( instInfo_ptr )
|
||||||
{
|
{
|
||||||
string state ;
|
string state ;
|
||||||
string status;
|
|
||||||
|
|
||||||
if ( instInfo_ptr->heartbeat.reporting == true )
|
if ( instInfo_ptr->heartbeat.reporting == true )
|
||||||
state = "enabled" ;
|
state = "enabled" ;
|
||||||
else
|
else
|
||||||
state = "disabled" ;
|
state = "disabled" ;
|
||||||
|
|
||||||
if ( instInfo_ptr->heartbeating == true )
|
|
||||||
status = "enabled" ;
|
|
||||||
else
|
|
||||||
status = "disabled" ;
|
|
||||||
|
|
||||||
if ( cmd == MTC_EVENT_HEARTBEAT_ILLHEALTH )
|
if ( cmd == MTC_EVENT_HEARTBEAT_ILLHEALTH )
|
||||||
{
|
{
|
||||||
ilog ("%s %s ill health notification\n", hostname.c_str(), instInfo_ptr->uuid.c_str());
|
ilog ("%s %s ill health notification\n", hostname.c_str(), instInfo_ptr->uuid.c_str());
|
||||||
@ -879,6 +873,7 @@ int recv_from_guestServer ( unsigned int cmd, char * buf_ptr )
|
|||||||
instInfo_ptr->heartbeating = true ;
|
instInfo_ptr->heartbeating = true ;
|
||||||
ilog ("%s %s is now heartbeating\n", hostname.c_str(), instInfo_ptr->uuid.c_str());
|
ilog ("%s %s is now heartbeating\n", hostname.c_str(), instInfo_ptr->uuid.c_str());
|
||||||
}
|
}
|
||||||
|
string status = "enabled";
|
||||||
rc = guestVimApi_svc_event ( hostname, uuid, state, status, instInfo_ptr->restart_to_str);
|
rc = guestVimApi_svc_event ( hostname, uuid, state, status, instInfo_ptr->restart_to_str);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -888,11 +883,11 @@ int recv_from_guestServer ( unsigned int cmd, char * buf_ptr )
|
|||||||
instInfo_ptr->heartbeating = false ;
|
instInfo_ptr->heartbeating = false ;
|
||||||
wlog ("%s %s is not heartbeating\n", hostname.c_str(), instInfo_ptr->uuid.c_str());
|
wlog ("%s %s is not heartbeating\n", hostname.c_str(), instInfo_ptr->uuid.c_str());
|
||||||
}
|
}
|
||||||
|
string status = "disabled";
|
||||||
rc = guestVimApi_svc_event ( hostname, uuid, state, status, "0");
|
rc = guestVimApi_svc_event ( hostname, uuid, state, status, "0");
|
||||||
}
|
}
|
||||||
if ( rc != PASS )
|
if ( rc != PASS )
|
||||||
{
|
{
|
||||||
/* TODO: make this an elog before delivery */
|
|
||||||
elog ("%s %s failed to send state change 'event' to vim (rc:%d)\n",
|
elog ("%s %s failed to send state change 'event' to vim (rc:%d)\n",
|
||||||
hostname.c_str(), instInfo_ptr->uuid.c_str(), rc );
|
hostname.c_str(), instInfo_ptr->uuid.c_str(), rc );
|
||||||
}
|
}
|
||||||
|
@ -337,8 +337,8 @@ int recv_from_guestAgent ( unsigned int cmd, char * buf_ptr )
|
|||||||
state.c_str());
|
state.c_str());
|
||||||
|
|
||||||
get_instInv_ptr()->add_inst ( uuid, instance );
|
get_instInv_ptr()->add_inst ( uuid, instance );
|
||||||
|
instInfo * instInfo_ptr = get_instInv_ptr()->get_inst ( uuid );
|
||||||
manage_reporting_state ( &instance, state );
|
manage_reporting_state ( instInfo_ptr, state );
|
||||||
}
|
}
|
||||||
if (daemon_get_cfg_ptr()->debug_level )
|
if (daemon_get_cfg_ptr()->debug_level )
|
||||||
get_instInv_ptr()->print_instances();
|
get_instInv_ptr()->print_instances();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user