正在处理openbmc,我正在尝试通过busctl创建一个日志条目。我看到Create调用需要ssa{ss}:
# busctl introspect xyz.openbmc_project.Logging
/xyz/openbmc_project/logging xyz.openbmc_project.Logging.Create
interface - - - .Create
method ssa{ss} - -但是,我的呼叫尝试失败了:
# busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging xyz.openbmc_project.Logging.Create Create ssa{ss} 1 "This is a Test" "xyz.openbmc_project.Logging.Entry.Level.Error" "ARG1" "ARG2"
Failed to parse 'xyz.openbmc_project.Logging.Entry.Level.Error' number of array entries: Invalid argument猜测这个问题与参数的格式有关。有什么想法吗?
发布于 2020-09-23 15:00:20
我没有openbmc,所以我不能对此进行测试,但是您的声明中可能有一些地方是错误的。
ssa{ss}后面的数字指的是数组的长度,所以我认为它在错误的位置。我希望它位于两个字符串(在您的示例中为"This is a Test"和"xyz.openbmc_project.Logging.Entry.Level.Error" )之后
例如:
busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging xyz.openbmc_project.Logging.Create Create ssa{ss} "This is a Test" "xyz.openbmc_project.Logging.Entry.Level.Error" 1 "ARG1" "ARG2"我在https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/xyz/openbmc_project/Logging/Create.interface.yaml#L7找到了我认为是文档的东西
如果"ARG1"和"ARG2"是"KEY1"和"VALUE1",您的示例可能会更清晰。因为我认为如果你有两个键/值对,下面的情况是正确的:
busctl call xyz.openbmc_project.Logging /xyz/openbmc_project/logging xyz.openbmc_project.Logging.Create Create ssa{ss} "This is a Test" "xyz.openbmc_project.Logging.Entry.Level.Error" 2 "KEY1" "VALUE1" "KEY2" "VALUE2"在使用busctl时,我总是需要一些试验和错误才能正确地解决这个问题。在另一个终端上运行dbus-monitor有时对调试很有帮助。
https://stackoverflow.com/questions/64017530
复制相似问题