manager: add getBlobManager as an exported method
getBlobManager will allow a library to get ahold of the BlobManager for
registration purposes.
Change-Id: I75f41601d10d59293c7752da8307507cc2c88434
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/main.cpp b/main.cpp
index a28a232..e0828db 100644
--- a/main.cpp
+++ b/main.cpp
@@ -39,8 +39,6 @@
namespace blobs
{
-static std::unique_ptr<BlobManager> manager;
-
static ipmi_ret_t handleBlobCommand(ipmi_cmd_t cmd, const uint8_t* reqBuf,
uint8_t* replyCmdBuf, size_t* dataLen)
{
@@ -60,7 +58,8 @@
return IPMI_CC_INVALID;
}
- return processBlobCommand(command, manager.get(), &crc, reqBuf, replyCmdBuf,
+ BlobManager* manager = getBlobManager();
+ return processBlobCommand(command, manager, &crc, reqBuf, replyCmdBuf,
dataLen);
}
@@ -76,9 +75,8 @@
oemRouter->registerHandler(oem::obmcOemNumber, oem::blobTransferCmd,
handleBlobCommand);
- manager = std::make_unique<BlobManager>();
-
#if ENABLE_EXAMPLE
+ BlobManager* manager = getBlobManager();
manager->registerHandler(std::move(std::make_unique<ExampleBlobHandler>()));
#endif
}