mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
RedfishPkg/RedfishDiscover: Disconnect Redfish service
Disconnect REST EX instance by setting configuration to NULL. This also closes the underlying protocols, such HTTP. Signed-off-by: Abner Chang <abner.chang@amd.com>
This commit is contained in:
parent
034f87419b
commit
969d3c5d34
1 changed files with 26 additions and 2 deletions
|
|
@ -3,7 +3,7 @@
|
|||
The implementation of EFI Redfish Discover Protocol.
|
||||
|
||||
(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
|
||||
Copyright (c) 2022, AMD Incorporated. All rights reserved.
|
||||
Copyright (c) 2026, Advanced Micro Devices, Inc. All rights reserved.
|
||||
Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
|
||||
Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
|
||||
Copyright (c) 2023, Mike Maslenkin <mike.maslenkin@gmail.com> <BR>
|
||||
|
|
@ -1644,12 +1644,18 @@ RedfishServiceReleaseService (
|
|||
IN EFI_REDFISH_DISCOVERED_LIST *InstanceList
|
||||
)
|
||||
{
|
||||
EFI_STATUS Status;
|
||||
UINTN NumService;
|
||||
BOOLEAN AnyFailRelease;
|
||||
EFI_REDFISH_DISCOVERED_INSTANCE *ThisRedfishInstance;
|
||||
EFI_REDFISH_DISCOVERED_INTERNAL_LIST *DiscoveredRedfishInstance;
|
||||
EFI_REST_EX_PROTOCOL *RestExProtocol;
|
||||
|
||||
DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry.\n", __func__));
|
||||
if (InstanceList == NULL) {
|
||||
return EFI_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry, to release %d Redfish instance(s).\n", __func__, InstanceList->NumberOfServiceFound));
|
||||
|
||||
if (IsListEmpty (&mRedfishInstanceList)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a:No any discovered Redfish service.\n", __func__));
|
||||
|
|
@ -1662,6 +1668,24 @@ RedfishServiceReleaseService (
|
|||
DiscoveredRedfishInstance = (EFI_REDFISH_DISCOVERED_INTERNAL_LIST *)GetFirstNode (&mRedfishInstanceList);
|
||||
do {
|
||||
if (DiscoveredRedfishInstance->Instance == ThisRedfishInstance) {
|
||||
//
|
||||
// Disable REST EX instance by setting configuration to NULL.
|
||||
// This also closes the underlying protocols, such HTTP.
|
||||
//
|
||||
Status = gBS->LocateProtocol (&gEfiRestExProtocolGuid, NULL, (VOID **)&RestExProtocol);
|
||||
if (!EFI_ERROR (Status)) {
|
||||
Status = RestExProtocol->Configure (
|
||||
RestExProtocol,
|
||||
NULL
|
||||
);
|
||||
}
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_MANAGEABILITY, "%a: REST EX connection is closed.\n", __func__));
|
||||
} else {
|
||||
DEBUG ((DEBUG_MANAGEABILITY, "%a: REST EX connection is not propery closed.\n", __func__));
|
||||
}
|
||||
|
||||
RemoveEntryList (&DiscoveredRedfishInstance->NextInstance);
|
||||
FreeInformationData (&ThisRedfishInstance->Information);
|
||||
FreePool ((VOID *)ThisRedfishInstance);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue