)]}'
{
  "commit": "36e2228e9cd0eaedb3ac67a4152728edbed61752",
  "tree": "dc1c409f2fbefd62ca71b82af53aa41aef775eee",
  "parents": [
    "c32220ec553c1bd13fe3f882a10d985132cb852d"
  ],
  "author": {
    "name": "Andrew Jeffery",
    "email": "andrew@codeconstruct.com.au",
    "time": "Fri May 03 16:55:51 2024 +0930"
  },
  "committer": {
    "name": "Hao Jiang",
    "email": "jianghao@google.com",
    "time": "Tue Jul 07 15:47:18 2026 -0700"
  },
  "message": "NVMeSensorMain: Split out NVMeDevice\n\nNVMeDevice was defined as a type to hold references to the MI and\nsubsystem instances across the lifetime of the device configuration\nprovided by EM.\n\nsetupMctpDevice() was a static function associated with these objects by\nway of taking them as parameters. A small trick here was the conversion\nof strong to weak pointers by way of the types specified for the formal\nparameters. The conversion enables the desired lifetime management of\nthe associated DBus objects, tying them to the EM configuration (and not\nthe lifetime of `mctpd` DBus objects).\n\nReally though, setupMctpDevice() could be better expressed as a method\non NVMeDevice: This way we can handle any smart-pointer type conversions\ninternal to the class\u0027 implementation, and applying this perspective\nincreases the testability of the code. A final benefit is that\nby isolating the code we can refactor it to add features without\nsignificantly impacting its readability. Ultimately the goal is to\ninsert a delay via a timer to mitigate stalling of the main thread due\nto recovery-related event-cycles.\n\nHere we purely do the code-motion that moves the implementation of\nsetupMctpEndpoint() out of NVMeSensorMain.cpp, along with defining a\nmethod that wraps its invocation.\n\nChange-Id: I498c43561dee61462e049b9ad43c987e1754ba0c\nSigned-off-by: Andrew Jeffery \u003candrew@codeconstruct.com.au\u003e\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6120b3f9a6d47bf13aee7ac48962b56087c84a71",
      "new_mode": 33188,
      "new_path": "src/NVMeDevice.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a1a0a245d48f86801c4fa6150c0c355e01b3a4f0",
      "new_mode": 33188,
      "new_path": "src/NVMeDevice.hpp"
    },
    {
      "type": "modify",
      "old_id": "daa2772ad188eb5f4da6c0b0fe86695624b5be96",
      "old_mode": 33188,
      "old_path": "src/NVMeSensorMain.cpp",
      "new_id": "7dec543e7b328cd1cb84d4b5f690018150094890",
      "new_mode": 33188,
      "new_path": "src/NVMeSensorMain.cpp"
    },
    {
      "type": "modify",
      "old_id": "9c0b69d1370c7271f1a95a3ea976ab47df36c487",
      "old_mode": 33188,
      "old_path": "src/meson.build",
      "new_id": "2363a2c5019118d4467084454dbef5c7c0ed2d72",
      "new_mode": 33188,
      "new_path": "src/meson.build"
    }
  ]
}
