Skip to content

Conversation

@agokarn
Copy link
Contributor

@agokarn agokarn commented Dec 16, 2025

This branch implements unified logging infrastructure for MigTD with support for structured, per-migration-request logging.

The PR addresses issues #571 and has the following changes -

  1. Conditionally initializes td_logger OR vmm_logger based on feature flag
  2. Ensures all subsequent logs are tagged with correct migration request ID
  3. Support for key-value pairs in log messages
  4. Existing log calls work as-is

@agokarn agokarn requested a review from jyao1 as a code owner December 16, 2025 20:53
@agokarn agokarn force-pushed the user/arthig/enable-unified-logging branch 2 times, most recently from 4f53a45 to 201c16b Compare December 16, 2025 23:41
@jyao1
Copy link
Contributor

jyao1 commented Dec 17, 2025

@mgudaram , please review as well.

@mgudaram
Copy link
Contributor

sure Jiewen, I will go over the changes.

3 => LevelFilter::Info,
4 => LevelFilter::Debug,
5 => LevelFilter::Trace,
_ => LevelFilter::Info, // Handle cases where the u8 doesn't map to a valid Level
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, 0 will match Info?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes. Is that ok?

Copy link
Contributor

@jyao1 jyao1 Jan 12, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Is that purposely? Or is it impossible case?
If former, why?
If latter, can we use panic() to ensure it will not happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. Is that purposely? Or is it impossible case? If former, why? If latter, can we use panic() to ensure it will not happen?

fixed

@mgudaram
Copy link
Contributor

mgudaram commented Jan 2, 2026

The changes look good to me. Just to summarize, it looks like the key-value pair will honor the concurrency and max loglevels for vmcall-raw interface are determined based on VMM's request for memory.

crypto = { path = "../crypto" }
futures-util = { version = "0.3.17", default-features = false }
lazy_static = { version = "1.0", features = ["spin_no_std"] }
log = { version = "0.4.29", features = ["kv", "release_max_level_off"] }
Copy link
Contributor Author

@agokarn agokarn Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgudaram this is now removed. Instead, the --debug will be used. Is that ok?

Image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgudaram this is now removed. Instead, the --debug will be used. Is that ok?

Image

We are probably thinking only from vmcall-raw point of view, but by removing "release_max_level_off" we might be enabling serial prints on release binary for other interfaces (like vmcall-vsock, virtio-vsock etc). IMO if we can isolate this change to only vmcall-raw, that would be ideal. @jyao1 please let me know your thoughts as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or while building other interfaces, build option "log/release_max_level_off" can be leveraged to get the same behavior on release binary without needing any code changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mgudaram and @jyao1 is there anything that needs to be addressed in this PR?

@agokarn agokarn force-pushed the user/arthig/enable-unified-logging branch 2 times, most recently from 2fb40e6 to feb7477 Compare January 13, 2026 05:33
	modified:   src/migtd/src/bin/migtd/main.rs
	modified:   src/migtd/src/migration/logging.rs
	modified:   src/migtd/src/migration/session.rs
	modified:   src/migtd/src/ratls/server_client.rs

Add init_vmm_logger

	modified:   src/migtd/src/bin/migtd/main.rs
	modified:   src/migtd/src/migration/logging.rs
	modified:   src/migtd/src/migration/session.rs
	modified:   src/migtd/src/ratls/server_client.rs

Fix incorrect log format.

Remove unneccesary changes.

	modified:   src/migtd/src/bin/migtd/main.rs
	modified:   src/migtd/src/migration/logging.rs
	modified:   src/migtd/src/migration/session.rs

Bug fixes

	modified:   src/migtd/src/bin/migtd/main.rs
	modified:   src/migtd/src/migration/logging.rs
	modified:   src/migtd/src/migration/session.rs

release_max_level_off not needed anymore.

	modified:   src/migtd/Cargo.toml
	modified:   src/migtd/src/bin/migtd/main.rs
	modified:   src/migtd/src/migration/logging.rs
	modified:   src/migtd/src/migration/session.rs

Address PR comments.

	modified:   sh_script/Azure/Makefile
        modified:   src/migtd/Cargo.toml
	modified:   src/migtd/src/bin/migtd/main.rs
	modified:   src/migtd/src/migration/logging.rs
	modified:   src/migtd/src/migration/session.rs

Fix formatting.

	modified:   sh_script/Azure/Makefile
	modified:   src/migtd/Cargo.toml
	modified:   src/migtd/src/bin/migtd/main.rs
	modified:   src/migtd/src/migration/logging.rs
	modified:   src/migtd/src/migration/session.rs

Fix formatting.

	modified:   sh_script/Azure/Makefile
	modified:   src/migtd/Cargo.toml
	modified:   src/migtd/src/bin/migtd/main.rs
	modified:   src/migtd/src/migration/logging.rs
	modified:   src/migtd/src/migration/session.rs
@agokarn agokarn force-pushed the user/arthig/enable-unified-logging branch from feb7477 to 04862e4 Compare January 13, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants