File tree 1 file changed +6
-3
lines changed
bin/propolis-server/src/lib/vm
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -256,9 +256,6 @@ impl<'a> VmEnsureNotStarted<'a> {
256
256
// When the runtime is returned to this thread, it must not be dropped.
257
257
// That means that the path between this result and returning an
258
258
// `Ok(VmEnsureObjectsCreated)` must be infallible.
259
- //
260
- // `VmEnsureObjectsCreated` (and later state transitions) take care to
261
- // `shutdown_background` the runtime.
262
259
let result: InitResult = tokio:: task:: spawn_blocking ( move || {
263
260
// Create the runtime that will host tasks created by
264
261
// VMM components (e.g. block device runtime tasks).
@@ -341,6 +338,12 @@ impl<'a> VmEnsureNotStarted<'a> {
341
338
/// Represents an instance ensure request that has proceeded far enough to
342
339
/// create a set of VM objects, but that has not yet installed those objects as
343
340
/// an `ActiveVm` or notified the requestor that its request is complete.
341
+ ///
342
+ /// WARNING: dropping `VmEnsureObjectsCreated` is a panic risk since dropping
343
+ /// the contained `tokio::runtime::Runtime` on in a worker thread will panic. It
344
+ /// is probably a bug to drop `VmEnsureObjectsCreated`, as it is expected users
345
+ /// will quickly call [`VmEnsureObjectsCreated::ensure_active`], but if you
346
+ /// must, take care in handling the contained `vmm_rt`.
344
347
pub ( crate ) struct VmEnsureObjectsCreated < ' a > {
345
348
log : & ' a slog:: Logger ,
346
349
vm : & ' a Arc < super :: Vm > ,
You can’t perform that action at this time.
0 commit comments