getClient returns the current guest agent client under the clientMu lock, so callers observe a consistent (non-mid-transition) snapshot.
()
| 849 | // getClient returns the current guest agent client under the clientMu lock, |
| 850 | // so callers observe a consistent (non-mid-transition) snapshot. |
| 851 | func (a *HostAgent) getClient() *guestagentclient.GuestAgentClient { |
| 852 | a.clientMu.Lock() |
| 853 | defer a.clientMu.Unlock() |
| 854 | return a.client |
| 855 | } |
| 856 | |
| 857 | func (a *HostAgent) getOrCreateClient(ctx context.Context) (*guestagentclient.GuestAgentClient, error) { |
| 858 | a.clientMu.Lock() |
no test coverage detected