diff --git a/virtrust/docs/002-virtrust-api.md b/virtrust/docs/002-virtrust-api.md index eaa2b3543e0f3efae2704c1b8aabb02e63349050..8b1232757a27e72ed7a48451d57984f3d8486981 100644 --- a/virtrust/docs/002-virtrust-api.md +++ b/virtrust/docs/002-virtrust-api.md @@ -7,7 +7,8 @@ ### 连接上下文 (ConnCtx) - **作用**:表示与 libvirt 的连接上下文 - **默认 URI**:`qemu:///session` -- **创建方式**:使用 `std::make_unique()` 创建,可通过 `SetUri()` 方法设置连接地址 +- **创建方式**:使用 `std::make_unique()` 创建,可通过 `SetUri(std::string uri)` 方法设置连接地址,可设置 + `qemu:///session`和`qemu:///system`,通过`GetUri()`方法可查看当前设置的uri ### 返回值 (VirtrustRc) 所有 API 函数都返回 `VirtrustRc` 枚举类型的返回值: diff --git a/virtrust/src/virtrust/api/domain.cpp b/virtrust/src/virtrust/api/domain.cpp index 8e267cedd85661542827b715b83e1272c2c3ca52..53a399dfac978403358433fd4c22139293d9d8ff 100644 --- a/virtrust/src/virtrust/api/domain.cpp +++ b/virtrust/src/virtrust/api/domain.cpp @@ -979,7 +979,7 @@ VirtrustRc DomainUndefine(const std::unique_ptr &conn, const std::strin if (tsbRet != 0) { VIRTRUST_LOG_ERROR("|DomainUndefine|END|returnF||tsb resource remove " "failed, maybe not exist tsb resource uuid: " - "{},domainName: {},use virsh to undefine domain.", + "{},domainName: {}.", uuid, domainName); return VirtrustRc::ERROR; } diff --git a/virtrust/src/virtrust/base/custom_logger.cpp b/virtrust/src/virtrust/base/custom_logger.cpp index 02d15fd8a162ddad47e6c6bef2a43d10e9832afd..42aa8e1a2fd984afc6ac50c79b38fba6e6212369 100644 --- a/virtrust/src/virtrust/base/custom_logger.cpp +++ b/virtrust/src/virtrust/base/custom_logger.cpp @@ -68,7 +68,7 @@ void Logger::Log(LogLevel level, std::string_view msg) void Logger::SetDisplayLogLevel(LogLevel level) { if (static_cast(level) >= static_cast(LogLevel::UNKNOWN)) { - fmt::print(stderr, "log level is invalid : {}", static_cast(level)); + fmt::print(stderr, "log level is invalid : {}\n", static_cast(level)); } if (LogAdapt::gSpdLogger != nullptr && LogAdapt::gSpdLogger->spdLogger != nullptr) { @@ -93,21 +93,21 @@ VirtrustRc Logger::InitLog(int logLevel, const char *path, int rotationFileSize, { if (logLevel < static_cast(LogLevel::TRACE) || logLevel > static_cast(LogLevel::CRITICAL)) { - fmt::print(stderr, "Invalid log level: {}", logLevel); + fmt::print(stderr, "Invalid log level: {}\n", logLevel); return VirtrustRc::ERROR; } int logType = (path != nullptr) ? FILE_TYPE : STDOUT_TYPE; auto rc = LogAdapt::ValidateParams(logType, path, rotationFileSize, rotationFileCount); if (rc != VirtrustRc::OK) { - fmt::print(stderr, "LogAdapt param validation failed, return: {}, msg: {}", static_cast(rc), + fmt::print(stderr, "LogAdapt param validation failed, return: {}, msg: {}\n", static_cast(rc), LogAdapt::gLastErrorMessage); return rc; } rc = LogAdapt::CreateInstance(logType, logLevel, path, rotationFileSize, rotationFileCount); if (rc != VirtrustRc::OK) { - fmt::print(stderr, "LogAdapt create instance failed, return: {}", static_cast(rc)); + fmt::print(stderr, "LogAdapt create instance failed, return: {}\n", static_cast(rc)); return rc; } diff --git a/virtrust/src/virtrust/link/migration_session.cpp b/virtrust/src/virtrust/link/migration_session.cpp index 15ac602efd783a5435d9f0e150e4f04082bb88d9..dd647337ddd73bc3e1769e9974bf1863a6695ccb 100644 --- a/virtrust/src/virtrust/link/migration_session.cpp +++ b/virtrust/src/virtrust/link/migration_session.cpp @@ -278,7 +278,7 @@ MigrateSessionRc MigrationSession::OnTransferResponseReceived(bool transferRet) if (tsbRet != 0) { VIRTRUST_LOG_ERROR("|OnTransferResponseReceived|END|returnF||tsb resource remove " "failed, maybe not exist tsb resource uuid: " - "{},domainName: {},use virsh to undefine domain.", + "{},domainName: {}.", sessionId_, domainName_); } }