treewide: Codify memory pinning

This enforces movability constraints.

Change-Id: I49dbd43a791c1d70eb7e97f30708231c053901d9
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/test/test_ethernet_interface.cpp b/test/test_ethernet_interface.cpp
index e9f3973..884224b 100644
--- a/test/test_ethernet_interface.cpp
+++ b/test/test_ethernet_interface.cpp
@@ -24,7 +24,7 @@
 class TestEthernetInterface : public stdplus::gtest::TestWithTmp
 {
   public:
-    sdbusplus::bus_t bus;
+    stdplus::Pinned<sdbusplus::bus_t> bus;
     std::filesystem::path confDir;
     TestManager manager;
     MockEthernetInterface interface;
@@ -36,8 +36,9 @@
     {
     }
 
-    static MockEthernetInterface makeInterface(sdbusplus::bus_t& bus,
-                                               TestManager& manager)
+    static MockEthernetInterface
+        makeInterface(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                      TestManager& manager)
     {
         AllIntfInfo info{InterfaceInfo{.idx = 1, .flags = 0, .name = "test0"}};
         return {bus, manager, info, "/xyz/openbmc_test/network"sv,
diff --git a/test/test_network_manager.cpp b/test/test_network_manager.cpp
index 2e51ac1..7e39665 100644
--- a/test/test_network_manager.cpp
+++ b/test/test_network_manager.cpp
@@ -19,7 +19,7 @@
 class TestNetworkManager : public stdplus::gtest::TestWithTmp
 {
   protected:
-    sdbusplus::bus_t bus;
+    stdplus::Pinned<sdbusplus::bus_t> bus;
     TestManager manager;
     TestNetworkManager() :
         bus(sdbusplus::bus::new_default()),
diff --git a/test/test_network_manager.hpp b/test/test_network_manager.hpp
index eaf853b..68d5088 100644
--- a/test/test_network_manager.hpp
+++ b/test/test_network_manager.hpp
@@ -32,7 +32,8 @@
 
 struct TestManager : TestManagerData, Manager
 {
-    inline TestManager(sdbusplus::bus_t& bus, stdplus::zstring_view path,
+    inline TestManager(stdplus::PinnedRef<sdbusplus::bus_t> bus,
+                       stdplus::zstring_view path,
                        const std::filesystem::path& dir) :
         Manager(bus, reloadForManager(), path, dir)
     {