Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/attestation/src/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ pub struct QveCollateral {

#[cfg(not(feature = "test"))]
mod attest_lib_binding {
use super::*;
#[cfg(feature = "attest-lib-ext")]
use super::QveCollateral;

extern "C" {
/// Get MigTD's Quote by passing tdx_report.
Expand Down
3 changes: 1 addition & 2 deletions src/migtd/src/bin/migtd/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,6 @@ fn handle_pre_mig() {
loop {
// Poll the async runtime to execute tasks
let _ = async_runtime::poll_tasks();
let mut data: Vec<u8> = Vec::new();

// The async task waiting for VMM response is always in the queue
let new_request = PENDING_REQUEST.lock().take();

Expand All @@ -481,6 +479,7 @@ fn handle_pre_mig() {
}
#[cfg(feature = "vmcall-raw")]
{
let mut data: Vec<u8> = Vec::new();
match request {
WaitForRequestResponse::StartMigration(wfr_info) => {
log::trace!(migration_request_id = wfr_info.mig_info.mig_request_id; "Processing StartMigration request\n");
Expand Down
1 change: 1 addition & 0 deletions src/migtd/src/migration/servtd_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ pub fn write_approved_servtd_ext_hash(servtd_ext_hash: &[u8]) -> Result<(), Migr
Ok(())
}

#[cfg(test)]
mod test {
use super::ServtdExt;

Expand Down
2 changes: 2 additions & 0 deletions src/migtd/src/migration/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ fn reject_request(
}

/// Log an error with an optional `migration_request_id` structured field.
#[cfg(feature = "vmcall-raw")]
macro_rules! log_request_error {
($request_id:expr, $($arg:tt)*) => {
if let Some(mig_request_id) = $request_id {
Expand Down Expand Up @@ -1032,6 +1033,7 @@ pub async fn exchange_msk(info: &MigrationInformation) -> Result<()> {
})?;
}

#[allow(unused_mut)]
let mut transport = setup_transport(
info.mig_info.mig_request_id,
#[cfg(any(feature = "vmcall-vsock", feature = "virtio-vsock"))]
Expand Down
14 changes: 7 additions & 7 deletions src/migtd/src/migration/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,21 @@ pub(super) type TransportType = virtio_serial::VirtioSerialPort;
pub(super) type TransportType = vsock::stream::VsockStream;

pub(super) async fn setup_transport(
mig_request_id: u64,
_mig_request_id: u64,
#[cfg(any(feature = "vmcall-vsock", feature = "virtio-vsock"))] migtd_cid: u64,
#[cfg(any(feature = "vmcall-vsock", feature = "virtio-vsock"))] mig_channel_port: u32,
) -> Result<TransportType> {
#[cfg(feature = "vmcall-raw")]
{
use vmcall_raw::stream::VmcallRaw;
let mut vmcall_raw_instance = VmcallRaw::new_with_mid(mig_request_id).map_err(|e| {
log::error!(migration_request_id = mig_request_id;
let mut vmcall_raw_instance = VmcallRaw::new_with_mid(_mig_request_id).map_err(|e| {
log::error!(migration_request_id = _mig_request_id;
"exchange_msk: Failed to create vmcall_raw_instance errorcode: {:?}\n", e);
MigrationResult::InvalidParameter
})?;

vmcall_raw_instance.connect().await.map_err(|e| {
log::error!(migration_request_id = mig_request_id;
log::error!(migration_request_id = _mig_request_id;
"exchange_msk: Failed to connect vmcall_raw_instance errorcode: {:?}\n", e);
MigrationResult::InvalidParameter
})?;
Expand All @@ -55,7 +55,7 @@ pub(super) async fn setup_transport(
let mut vsock = VsockStream::new()?;

#[cfg(feature = "vmcall-vsock")]
let mut vsock = VsockStream::new_with_cid(migtd_cid, mig_request_id)?;
let mut vsock = VsockStream::new_with_cid(migtd_cid, _mig_request_id)?;

// Establish the vsock connection with host
vsock
Expand All @@ -67,11 +67,11 @@ pub(super) async fn setup_transport(

pub(super) async fn shutdown_transport(
transport: &mut TransportType,
mig_request_id: u64,
_mig_request_id: u64,
) -> Result<()> {
#[cfg(feature = "vmcall-raw")]
transport.shutdown().await.map_err(|e| {
log::error!(migration_request_id = mig_request_id;
log::error!(migration_request_id = _mig_request_id;
"shutdown_transport: Failed to shutdown vmcall_raw_instance errorcode: {:?}\n", e);
MigrationResult::InvalidParameter
})?;
Expand Down
Loading