@@ -1692,6 +1692,7 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1692
1692
let info = channel. info . expect ( "assigned" ) ;
1693
1693
if channel. restore_state == RestoreState :: Unmatched {
1694
1694
tracing:: debug!(
1695
+ vtl = self . inner. assigned_channels. vtl as u8 ,
1695
1696
offer_id = offer_id. 0 ,
1696
1697
key = %channel. offer. key( ) ,
1697
1698
"matched channel"
@@ -1718,7 +1719,12 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1718
1719
// reference to it. Save the offer for reoffering immediately
1719
1720
// after the child releases it.
1720
1721
channel. state = ChannelState :: Reoffered ;
1721
- tracing:: info!( ?offer_id, key = %channel. offer. key( ) , "channel marked for reoffer" ) ;
1722
+ tracing:: info!(
1723
+ vtl = self . inner. assigned_channels. vtl as u8 ,
1724
+ offer_id = offer_id. 0 ,
1725
+ key = %channel. offer. key( ) ,
1726
+ "channel marked for reoffer"
1727
+ ) ;
1722
1728
}
1723
1729
1724
1730
channel. offer = offer;
@@ -1773,7 +1779,14 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1773
1779
. send_offer ( channel, version) ;
1774
1780
}
1775
1781
1776
- tracing:: info!( ?offer_id, %key, confidential_ring_buffer, confidential_external_memory, "new channel" ) ;
1782
+ tracing:: info!(
1783
+ vtl = self . inner. assigned_channels. vtl as u8 ,
1784
+ offer_id = offer_id. 0 ,
1785
+ %key,
1786
+ confidential_ring_buffer,
1787
+ confidential_external_memory,
1788
+ "new channel"
1789
+ ) ;
1777
1790
Ok ( offer_id)
1778
1791
}
1779
1792
@@ -1797,7 +1810,12 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1797
1810
1798
1811
/// Completes an open operation with `result`.
1799
1812
pub fn open_complete ( & mut self , offer_id : OfferId , result : i32 ) {
1800
- tracing:: debug!( offer_id = offer_id. 0 , result, "open complete" ) ;
1813
+ tracing:: debug!(
1814
+ vtl = self . inner. assigned_channels. vtl as u8 ,
1815
+ offer_id = offer_id. 0 ,
1816
+ result,
1817
+ "open complete"
1818
+ ) ;
1801
1819
1802
1820
let channel = & mut self . inner . channels [ offer_id] ;
1803
1821
match channel. state {
@@ -1808,6 +1826,7 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1808
1826
let channel_id = channel. info . expect ( "assigned" ) . channel_id ;
1809
1827
if result >= 0 {
1810
1828
tracelimit:: info_ratelimited!(
1829
+ vtl = self . inner. assigned_channels. vtl as u8 ,
1811
1830
offer_id = offer_id. 0 ,
1812
1831
channel_id = channel_id. 0 ,
1813
1832
result,
@@ -1816,6 +1835,7 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1816
1835
} else {
1817
1836
// Log channel open failures at error level for visibility.
1818
1837
tracelimit:: error_ratelimited!(
1838
+ vtl = self . inner. assigned_channels. vtl as u8 ,
1819
1839
offer_id = offer_id. 0 ,
1820
1840
channel_id = channel_id. 0 ,
1821
1841
result,
@@ -1844,6 +1864,7 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1844
1864
}
1845
1865
ChannelState :: OpeningClientRelease => {
1846
1866
tracing:: info!(
1867
+ vtl = self . inner. assigned_channels. vtl as u8 ,
1847
1868
offer_id = offer_id. 0 ,
1848
1869
result,
1849
1870
"opened channel (client released)"
@@ -1866,7 +1887,12 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1866
1887
| ChannelState :: Revoked
1867
1888
| ChannelState :: Reoffered
1868
1889
| ChannelState :: ClosingClientRelease => {
1869
- tracing:: error!( ?offer_id, state = ?channel. state, "invalid open complete" )
1890
+ tracing:: error!(
1891
+ vtl = self . inner. assigned_channels. vtl as u8 ,
1892
+ offer_id = offer_id. 0 ,
1893
+ state = ?channel. state,
1894
+ "invalid open complete"
1895
+ ) ;
1870
1896
}
1871
1897
}
1872
1898
}
@@ -1933,8 +1959,13 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1933
1959
1934
1960
/// Completes a channel close operation.
1935
1961
pub fn close_complete ( & mut self , offer_id : OfferId ) {
1962
+ tracing:: info!(
1963
+ vtl = self . inner. assigned_channels. vtl as u8 ,
1964
+ offer_id = offer_id. 0 ,
1965
+ "closed channel"
1966
+ ) ;
1967
+
1936
1968
let channel = & mut self . inner . channels [ offer_id] ;
1937
- tracing:: info!( offer_id = offer_id. 0 , "closed channel" ) ;
1938
1969
match channel. state {
1939
1970
ChannelState :: Closing {
1940
1971
reserved_state : Some ( reserved_state) ,
@@ -1985,7 +2016,12 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
1985
2016
| ChannelState :: Revoked
1986
2017
| ChannelState :: Reoffered
1987
2018
| ChannelState :: OpeningClientRelease => {
1988
- tracing:: error!( ?offer_id, state = ?channel. state, "invalid close complete" )
2019
+ tracing:: error!(
2020
+ vtl = self . inner. assigned_channels. vtl as u8 ,
2021
+ offer_id = offer_id. 0 ,
2022
+ state = ?channel. state,
2023
+ "invalid close complete"
2024
+ ) ;
1989
2025
}
1990
2026
}
1991
2027
}
@@ -2649,6 +2685,7 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
2649
2685
input : & protocol:: GpadlTeardown ,
2650
2686
) -> Result < ( ) , ChannelError > {
2651
2687
tracing:: debug!(
2688
+ vtl = self . inner. assigned_channels. vtl as u8 ,
2652
2689
channel_id = input. channel_id. 0 ,
2653
2690
gpadl_id = input. gpadl_id. 0 ,
2654
2691
"Received GPADL teardown request"
@@ -2686,6 +2723,7 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
2686
2723
2687
2724
if channel. state . is_revoked ( ) {
2688
2725
tracing:: trace!(
2726
+ vtl = self . inner. assigned_channels. vtl as u8 ,
2689
2727
channel_id = input. channel_id. 0 ,
2690
2728
gpadl_id = input. gpadl_id. 0 ,
2691
2729
"Gpadl teardown for revoked channel"
@@ -3255,14 +3293,21 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
3255
3293
3256
3294
info. modifying = true ;
3257
3295
info. monitor_page = monitor_page;
3258
- tracing:: debug!( "modifying connection parameters." ) ;
3296
+ tracing:: debug!(
3297
+ vtl = self . inner. assigned_channels. vtl as u8 ,
3298
+ "modifying connection parameters."
3299
+ ) ;
3259
3300
self . notifier . modify_connection ( request. into ( ) ) ?;
3260
3301
3261
3302
Ok ( ( ) )
3262
3303
}
3263
3304
3264
3305
pub fn complete_modify_connection ( & mut self , response : ModifyConnectionResponse ) {
3265
- tracing:: debug!( ?response, "modifying connection parameters complete" ) ;
3306
+ tracing:: debug!(
3307
+ vtl = self . inner. assigned_channels. vtl as u8 ,
3308
+ ?response,
3309
+ "modifying connection parameters complete"
3310
+ ) ;
3266
3311
3267
3312
// InitiateContact, Unload, and actual ModifyConnection messages are all sent to the relay
3268
3313
// as ModifyConnection requests, so use the server state to determine how to handle the
@@ -3314,7 +3359,12 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
3314
3359
3315
3360
let version = self . inner . state . get_version ( ) ;
3316
3361
let msg = Message :: parse ( & message. data , version) ?;
3317
- tracing:: trace!( ?msg, message. trusted, "received vmbus message" ) ;
3362
+ tracing:: trace!(
3363
+ vtl = self . inner. assigned_channels. vtl as u8 ,
3364
+ ?msg,
3365
+ message. trusted,
3366
+ "received vmbus message"
3367
+ ) ;
3318
3368
// Do not allow untrusted messages if the connection was established
3319
3369
// using a trusted message.
3320
3370
//
@@ -3465,6 +3515,7 @@ impl<'a, N: 'a + Notifier> ServerWithNotifier<'a, N> {
3465
3515
/// Releases a GPADL that is being torn down.
3466
3516
pub fn gpadl_teardown_complete ( & mut self , offer_id : OfferId , gpadl_id : GpadlId ) {
3467
3517
tracing:: debug!(
3518
+ vtl = self . inner. assigned_channels. vtl as u8 ,
3468
3519
offer_id = offer_id. 0 ,
3469
3520
gpadl_id = gpadl_id. 0 ,
3470
3521
"Gpadl teardown complete"
@@ -4155,7 +4206,7 @@ mod tests {
4155
4206
4156
4207
impl Notifier for TestNotifier {
4157
4208
fn notify ( & mut self , offer_id : OfferId , action : Action ) {
4158
- tracing:: debug!( ? offer_id, ?action, "notify" ) ;
4209
+ tracing:: debug!( offer_id = offer_id . 0 , ?action, "notify" ) ;
4159
4210
self . send . send ( ( offer_id, action) ) . unwrap ( )
4160
4211
}
4161
4212
0 commit comments