common: fix: add emit_added calls

Add these calls to make bmcweb and mapper aware of our DBus interfaces.

Adding emit_added() should be safe to do since the interface already
exists and the function is idempotent.

Also set the activation status of the current software version to
'Active' after 'initDevice' returns.

Tested: on Tyan S8030

Restarting BIOS sw manager without this patch yields

```
{
  "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_7868",
  "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
  "Description": "Unknown image",
  "Id": "HostSPIFlash_7868",
  "Name": "Software Inventory",
  "Status": {
    "Health": "Warning",
    "HealthRollup": "OK",
    "State": "Disabled"
  },
  "Updateable": true,
  "Version": "Unknown"
}
```

which is wrong since there is currently a sw version enabled.

First testing update process without this patch

```
curl -k --insecure --user root:root -H Content-Type:multipart/form-data -X POST -F 'UpdateParameters={"Targets":["/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_7868"],"@Redfish.OperationApplyTime":"Immediate"};type=application/json' -F 'UpdateFile=@pldm-package-s8030-host-v4.01.bin;type=application/octet-stream' https://${bmc}/redfish/v1/UpdateService/update-multipart
```

yields

```
{
  "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_5637",
  "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
  "Description": "Unknown image",
  "Id": "HostSPIFlash_5637",
  "Name": "Software Inventory",
  "Status": {
    "Health": "OK",
    "HealthRollup": "OK",
    "State": "Enabled"
  },
  "Updateable": true,
  "Version": "mycompversion"
}
```

BIOS update process completes and bmcweb shows fw inventory as expected

Starting the update process (with this patch):
```
curl -k --insecure --user root:root -H Content-Type:multipart/form-data -X POST -F 'UpdateParameters={"Targets":["/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_8460"],"@Redfish.OperationApplyTime":"Immediate"};type=application/json' -F 'UpdateFile=@pldm-package-s8030-host-v4.01.bin;type=application/octet-stream' https://${bmc}/redfish/v1/UpdateService/update-multipart
```

Task returned from starting update process
```
{
  "@odata.id": "/redfish/v1/TaskService/Tasks/2",
  "@odata.type": "#Task.v1_4_3.Task",
  "Id": "2",
  "TaskState": "Running",
  "TaskStatus": "OK"
}
```

After update:
```
curl --insecure --user root:root https://${bmc}/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_918
```

```
{
  "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_918",
  "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
  "Description": "Unknown image",
  "Id": "HostSPIFlash_918",
  "Name": "Software Inventory",
  "Status": {
    "Health": "OK",
    "HealthRollup": "OK",
    "State": "Enabled"
  },
  "Updateable": true,
  "Version": "mycompversion"
}
```

So we concluded that the fw inventory is correct even without the patch
but on initial start of the BIOS sw manager the fw inventory is not
correct.

After restarting the BIOS sw manager with this patch:

```
{
  "@odata.id": "/redfish/v1/UpdateService/FirmwareInventory/HostSPIFlash_2291",
  "@odata.type": "#SoftwareInventory.v1_1_0.SoftwareInventory",
  "Description": "Unknown image",
  "Id": "HostSPIFlash_2291",
  "Name": "Software Inventory",
  "Status": {
    "Health": "OK",
    "HealthRollup": "OK",
    "State": "Enabled"
  },
  "Updateable": true,
  "Version": "Unknown"
}
```

Change-Id: I3aee245311b30e1ceba50d16598f940bb87626b0
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/common/src/device.cpp b/common/src/device.cpp
index 1e4b810..bba2d2b 100644
--- a/common/src/device.cpp
+++ b/common/src/device.cpp
@@ -173,6 +173,8 @@
         std::make_unique<SoftwareActivationProgress>(
             ctx, objPath.c_str(), SoftwareActivationProgressProperties{0});
 
+    softwarePending->softwareActivationProgress->emit_added();
+
     softwarePending->setActivationBlocksTransition(true);
 
     softwarePending->setActivation(
diff --git a/common/src/software.cpp b/common/src/software.cpp
index 339275a..819f7be 100644
--- a/common/src/software.cpp
+++ b/common/src/software.cpp
@@ -33,6 +33,8 @@
 {
     std::string objPath = baseObjPathSoftware + swid;
 
+    emit_added();
+
     debug("{SWID}: created dbus interfaces on path {OBJPATH}", "SWID", swid,
           "OBJPATH", objPath);
 };
@@ -142,6 +144,8 @@
     std::string path = objectPath;
     activationBlocksTransition =
         std::make_unique<SoftwareActivationBlocksTransition>(ctx, path.c_str());
+
+    activationBlocksTransition->emit_added();
 }
 
 void Software::setActivation(SoftwareActivation::Activations act)
diff --git a/common/src/software_manager.cpp b/common/src/software_manager.cpp
index 6c971e8..d8493b7 100644
--- a/common/src/software_manager.cpp
+++ b/common/src/software_manager.cpp
@@ -181,6 +181,9 @@
         if (device->softwareCurrent)
         {
             co_await device->softwareCurrent->createInventoryAssociations(true);
+
+            device->softwareCurrent->setActivation(
+                SoftwareActivation::Activations::Active);
         }
     }