mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-18 06:44:23 +01:00
runtime: Fix ordering of trace spans
A significant number of trace calls did not use a parent context that would create proper span ordering in trace output. Add local context to functions for use in trace calls to facilitate proper span ordering. Additionally, change whether trace function returns context in some functions in virtcontainers and use existing context rather than background context in bindMount() so that span exists as a child of a parent span. Fixes #1355 Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
This commit is contained in:
@@ -212,7 +212,7 @@ func testQemuAddDevice(t *testing.T, devInfo interface{}, devType deviceType, ex
|
||||
arch: &qemuArchBase{},
|
||||
}
|
||||
|
||||
err := q.addDevice(devInfo, devType)
|
||||
err := q.addDevice(context.Background(), devInfo, devType)
|
||||
assert.NoError(err)
|
||||
assert.Exactly(q.qemuConfig.Devices, expected)
|
||||
}
|
||||
@@ -402,9 +402,9 @@ func TestHotplugUnsupportedDeviceType(t *testing.T) {
|
||||
config: qemuConfig,
|
||||
}
|
||||
|
||||
_, err := q.hotplugAddDevice(&memoryDevice{0, 128, uint64(0), false}, fsDev)
|
||||
_, err := q.hotplugAddDevice(context.Background(), &memoryDevice{0, 128, uint64(0), false}, fsDev)
|
||||
assert.Error(err)
|
||||
_, err = q.hotplugRemoveDevice(&memoryDevice{0, 128, uint64(0), false}, fsDev)
|
||||
_, err = q.hotplugRemoveDevice(context.Background(), &memoryDevice{0, 128, uint64(0), false}, fsDev)
|
||||
assert.Error(err)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user