History log of /openbmc/phosphor-state-manager/scheduled_host_transition.cpp (Results 1 – 19 of 19)
Revision Date Author Comments
# 3ff5a360 17-Jun-2024 Manojkiran Eda <manojkiran.eda@gmail.com>

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://githu

Fix spelling mistakes using codespell

This commit corrects various spelling mistakes throughout the
repository. The corrections were made automatically using `codespell`[1]
tool.

[1]: https://github.com/codespell-project/codespell

Change-Id: I1068afac44652ab3d9bfe58bb6e19d359d84f20e
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>

show more ...


# 9a286db2 17-Jan-2024 Patrick Williams <patrick@stwcx.xyz>

reduce dbus string constants

There are a large number of dbus constants scattered throughout the
code that could/should be obtained from phosphor-dbus-interface values.
Perform minor refactoring to

reduce dbus string constants

There are a large number of dbus constants scattered throughout the
code that could/should be obtained from phosphor-dbus-interface values.
Perform minor refactoring to greatly reduce the number of string
constants.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ie8700bc90611d21eee7160f4686bc978fe0a0eb4

show more ...


# 60a238dd 03-Jan-2024 Andrew Geissler <geissonator@yahoo.com>

scheduled-host: handle bmc-not-ready error

The BMC Ready feature introduced a new d-bus error when a power on
request is made and the BMC is not at a Ready state.

If someone were to utilize the sch

scheduled-host: handle bmc-not-ready error

The BMC Ready feature introduced a new d-bus error when a power on
request is made and the BMC is not at a Ready state.

If someone were to utilize the scheduled transition feature in a way
where they set it to some time in the future, powered their BMC off, and
then powered back on at some later time past the scheduled time, then
the scheduling function will try and start a power on immediately.

This power on would occur prior to the BMC being at Ready, resulting in
the error being returned and the scheduling service failing. Handle the
error during the initialization phase of the service by rescheduling the
operation 60s into the future.

Tested:
- Verified that when BMC was not at Ready state that error was handled
correctly, 60s delay was added on to power on request, and 60s later
it worked successfully.

Change-Id: Ifd97b77e3161667f549e946d843c5f4d0638be74
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>

show more ...


# 7e969cb9 23-Aug-2023 Patrick Williams <patrick@stwcx.xyz>

sdbus++: use non-deprecated namespaces

The sdbusplus repository has deprecated some namespaces and they are
currently only enabled with the SDBUSPP_REMOVE_DEPRECATED_NAMESPACE
guard. Switch to the

sdbus++: use non-deprecated namespaces

The sdbusplus repository has deprecated some namespaces and they are
currently only enabled with the SDBUSPP_REMOVE_DEPRECATED_NAMESPACE
guard. Switch to the new namespace names.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I9f67e74a02616d8ea2241c18758308f2b669672d

show more ...


# 63f7b1a3 24-Jul-2023 Andrew Geissler <geissonator@yahoo.com>

time: changes to support 64bit time

Upstream changed the default of the time_t definition to go from 32bit
to 64bit. Utilize the std::chrono::duration class to abstract the max.

Tested:
- Confirmed

time: changes to support 64bit time

Upstream changed the default of the time_t definition to go from 32bit
to 64bit. Utilize the std::chrono::duration class to abstract the max.

Tested:
- Confirmed it compiles with latest yocto

Change-Id: I53096d976bfa9fcd74faf8ebac9dccf204264aa6
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>

show more ...


# 211d972d 07-Apr-2022 Patrick Williams <patrick@stwcx.xyz>

sched-host-tran: support multi-host

The State.Host objects are now templated, so the ScheduledHostTransition
similarly needs to be templated.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Cha

sched-host-tran: support multi-host

The State.Host objects are now templated, so the ScheduledHostTransition
similarly needs to be templated.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I60751dbe5fff5e3c0c2c7a19515524cf5f6bc8f7

show more ...


# 68a8c31d 03-Dec-2021 Andrew Geissler <geissonator@yahoo.com>

host-restart: set restart reason on scheduling use

When the scheduling feature is the reason for a power on of the system,
set the RestartCause property appropriately.

This prop

host-restart: set restart reason on scheduling use

When the scheduling feature is the reason for a power on of the system,
set the RestartCause property appropriately.

This property is used by other software on some systems to guide
partition behaviors in the host code.

Tested:
- Utilize the scheduling feature to start a boot of the system and
verified the RestartCause was set to ScheduledPowerOn

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I9f7e88ccf214d01a18c6641b0a016ff5576ccf5f

show more ...


# 8583b3b9 06-Oct-2021 Patrick Williams <patrick@stwcx.xyz>

catch exceptions as const

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I2afb405177268451e44f0aff8417777a00d292d9


# ad65b2d6 21-Sep-2021 Andrew Geissler <geissonator@yahoo.com>

clang: do not break string literals

The community decided to allow string literals to go past the 80 char
limit. Update the clang file used by state-manager and change a few of
the s

clang: do not break string literals

The community decided to allow string literals to go past the 80 char
limit. Update the clang file used by state-manager and change a few of
the strings to take advantage of this new setting.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I77dec79937fb71a43b10369846be47768c168856

show more ...


# 8ffdb269 20-Sep-2021 Andrew Geissler <geissonator@yahoo.com>

lg2: convert state-manager

This converts the rest of phosphor-state-manager over to the lg2
interface.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I387

lg2: convert state-manager

This converts the rest of phosphor-state-manager over to the lg2
interface.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I3878ec950b6a2b1ada93544cc021cecf14edfb46

show more ...


# aaa2e110 22-Apr-2021 Andrew Geissler <geissonator@yahoo.com>

sched-host-tran: change info trace to debug

This log was polluting the journal with unneeded information

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I36a72

sched-host-tran: change info trace to debug

This log was polluting the journal with unneeded information

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I36a72935f9ce47cbc131cf4f44fd351846ce8269

show more ...


# a59fca48 15-Mar-2021 Andrew Geissler <geissonator@yahoo.com>

reduce scheduled host transition logging

The BMC time can change periodically due to NTP or on some systems, via
periodic host commands. Change the logs that are impacted by this
tim

reduce scheduled host transition logging

The BMC time can change periodically due to NTP or on some systems, via
periodic host commands. Change the logs that are impacted by this
time change to debug so the journal is not filled up with them.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I38f5465755d525a75a8242ee48f651090d2978b6

show more ...


# e426b589 28-May-2020 Andrew Geissler <geissonator@yahoo.com>

clang-format: update to latest from docs repo

This is from openbmc/docs/style/cpp/.clang-format

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I5b80bb56845170

clang-format: update to latest from docs repo

This is from openbmc/docs/style/cpp/.clang-format

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I5b80bb568451706afb6d268b41e1a5357a2ca6db

show more ...


# dc059399 13-Mar-2020 Carol Wang <wangkair@cn.ibm.com>

sched-host-tran: code refactor

Move setProperty() and getService() to utils.cpp as public functions
which can be reused.

Change-Id: If62b67978349a80f8bd2026b5a749d5dedc556de

sched-host-tran: code refactor

Move setProperty() and getService() to utils.cpp as public functions
which can be reused.

Change-Id: If62b67978349a80f8bd2026b5a749d5dedc556de
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>

show more ...


# 1dbbef42 08-Mar-2020 Carol Wang <wangkair@cn.ibm.com>

sched-host-tran: store/restore the value of scheduled time and
requested transition

Store/restore the value of scheduled time and requested transition, in case
BMC is rebooted. After

sched-host-tran: store/restore the value of scheduled time and
requested transition

Store/restore the value of scheduled time and requested transition, in case
BMC is rebooted. After BMC is back, go on the host transition process based
on the stored values.

Tested:
1. Get current time
# date
Tue Mar 10 08:16:40 UTC 2020
2. Set scheduled time 08:25:00
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1583828700
3. Reboot BMC
4. Check sheduled time
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 1583828700
5. Do host transition after the scheduled time is reached.
6. Check the scheduled time again
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 0

Change-Id: I3bbae19a49e2fe84bf4e297e6daaa0461cbf2cb8
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>

show more ...


# ef7abe19 25-Feb-2020 Carol Wang <wangkair@cn.ibm.com>

sched-host-tran: handle with BMC time changing

Handle with different processes when BMC time is changed after scheduled time
is set.

Tested:
Case1: BMC time is changed to be

sched-host-tran: handle with BMC time changing

Handle with different processes when BMC time is changed after scheduled time
is set.

Tested:
Case1: BMC time is changed to be later than current time but still earlier than
scheduled time
1. Get current time
# date
Tue Feb 25 07:07:44 UTC 2020
# date +%s
1582614271
2. Schedule time, do host transition after at 07:20:00 around
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 1582615256
3. Change BMC time to 07:19:00 around
# busctl set-property xyz.openbmc_project.Time.Manager \
/xyz/openbmc_project/time/bmc xyz.openbmc_project.Time.EpochTime Elapsed \
t 1582615136000000
# date
Tue Feb 25 07:19:20 UTC 2020
# date +%s
1582615187
4. Host transition is done after 1 minute around,
instead of waiting 13 mins around.

Case2: BMC time is changed after scheduled time is reached
Following Case1, the scheduled time is reached already,
1. Change BMC time to 07:10:00 around
# busctl set-property xyz.openbmc_project.Time.Manager \
/xyz/openbmc_project/time/bmc xyz.openbmc_project.Time.EpochTime Elapsed \
t 1582614600000000
2. APP shows "The function Scheduled Host Transition is disabled", because
the scheduled time is reached already and the scheduled time has been set
to 0 after host transition is triggered.

Case3: BMC time is changed to be bigger than scheduled time before scheduled
time is reached
1. Set scheduled time 07:08:00 around
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1582787314
2. Change BMC time to 07:10:00 around
# busctl set-property xyz.openbmc_project.Time.Manager \
/xyz/openbmc_project/time/bmc xyz.openbmc_project.Time.EpochTime Elapsed \
t 1582787434000000
3. It will do host transition as requested.

Case4: BMC time is changed to be earlier than current time
1. Set scheduled time 07:10:00 around
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1582787434
2. Change BMC time to 07:08:00 around
# busctl set-property xyz.openbmc_project.Time.Manager \
/xyz/openbmc_project/time/bmc xyz.openbmc_project.Time.EpochTime Elapsed \
t 1582787314000000
3. App will wait 2 minutes more to do host transition.

Change-Id: I23228be944d1b2f71161317228c8b16d7f5ca4eb
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>

show more ...


# 6a5db3d3 20-Feb-2020 Carol Wang <wangkair@cn.ibm.com>

sched-host-tran: implement host transition process

Set the scheduled time and host transition to trigger power on/off.

Tested:
1. Check the state first
$ curl -k -H "X-Auth

sched-host-tran: implement host transition process

Set the scheduled time and host transition to trigger power on/off.

Tested:
1. Check the state first
$ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/state/host0
{
"data": {
"AttemptsLeft": 3,
"BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified",
"CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Off",
"OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
"RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.Off",
"RequestedTransition": "xyz.openbmc_project.State.Host.Transition.On",
"ScheduledTime": 0
},
"message": "200 OK",
"status": "ok"
}
2. Set a time in future
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1582184830
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 1582184830
3. Check the state again after scheduled time
Jan 15 06:38:20 WS-Seq-FW-2 phosphor-host-state-manager[442]: Host State transaction request
$ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/state/host0
{
"data": {
"AttemptsLeft": 3,
"BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified",
"CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Running",
"OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
"RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.On",
"RequestedTransition": "xyz.openbmc_project.State.Host.Transition.On",
"ScheduledTime": 0
},
"message": "200 OK",
"status": "ok"
}
4. Set quested transition to off
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition RequestedTransition \
s "xyz.openbmc_project.State.Host.Transition.Off"
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1582250580
$ curl -k -H "X-Auth-Token: $token" https://$bmc/xyz/openbmc_project/state/host0
{
"data": {
"AttemptsLeft": 3,
"BootProgress": "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified",
"CurrentHostState": "xyz.openbmc_project.State.Host.HostState.Off",
"OperatingSystemState": "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive",
"RequestedHostTransition": "xyz.openbmc_project.State.Host.Transition.Off"
"RequestedTransition": "xyz.openbmc_project.State.Host.Transition.Off",
"ScheduledTime": 0
},
"message": "200 OK",
"status": "ok"
}

Change-Id: Ib9f3a3984005d9187a9b98603ec1598d8992869e
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>

show more ...


# 4ca6f3f4 19-Feb-2020 Carol Wang <wangkair@cn.ibm.com>

sched-host-tran: handle with the scheduled time

Add the basic process to handle with the scheduled time

Tested:
1. Scheduled time is 0
# busctl set-property xyz.openbmc_pr

sched-host-tran: handle with the scheduled time

Add the basic process to handle with the scheduled time

Tested:
1. Scheduled time is 0
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1
------
Feb 19 08:09:47 witherspoon phosphor-scheduled-host-transition[28263]: \
The function Scheduled Host Transition is disabled.
2. Scheduled time is the past
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1582100042
------
Failed to set property ScheduledTime on interface xyz.openbmc_project.State.\
ScheduledHostTransition: Scheduled time is in the past
Feb 19 08:14:42 witherspoon phosphor-scheduled-host-transition[28263]: \
Scheduled time is earlier than current time. Fail to do host transition.
Feb 19 08:14:42 witherspoon phosphor-scheduled-host-transition[28263]: \
Scheduled time is in the past

Change-Id: I0b6a98dcb6d0e70336bf42fc88a633abf3e64633
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>

show more ...


# 71230efd 18-Feb-2020 Carol Wang <wangkair@cn.ibm.com>

sched-host-tran: add base interfaces for Scheduled Host Transition

Implement interfaces to get/set scheduledTime and requestedTransition.

Tested:
1. Check scheduledTime
# b

sched-host-tran: add base interfaces for Scheduled Host Transition

Implement interfaces to get/set scheduledTime and requestedTransition.

Tested:
1. Check scheduledTime
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 0
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime t 1
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition ScheduledTime
t 1
2. Check requestedTransition
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition RequestedTransition
s "xyz.openbmc_project.State.Host.Transition.On"
# busctl set-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition RequestedTransition \
s "xyz.openbmc_project.State.Host.Transition.Off"
# busctl get-property xyz.openbmc_project.State.ScheduledHostTransition \
/xyz/openbmc_project/state/host0 \
xyz.openbmc_project.State.ScheduledHostTransition RequestedTransition
s "xyz.openbmc_project.State.Host.Transition.Off"

Change-Id: Ie7da8034d37c1069db043772f35982ca821826ae
Signed-off-by: Carol Wang <wangkair@cn.ibm.com>

show more ...