Skip to content

Commit d33cb3f

Browse files
committed
incusd/instance/qemu: Don't overtake operations on console retrieval
This fixes an issue where we'd get both stopped and migrated events during live-migration as the console retrieval happening during the migration would mark the migration operation as completed, turning the final stop operation into its own entity rather than completing the migration operation. Signed-off-by: Stéphane Graber <[email protected]>
1 parent 51a8dc4 commit d33cb3f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/server/instance/drivers/driver_qemu.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -9329,7 +9329,10 @@ func (d *qemu) ConsoleLog() (string, error) {
93299329
return "", err
93309330
}
93319331

9332-
defer op.Done(nil)
9332+
// Only mark the operation as done if only processing the console retrieval.
9333+
if op.Action() == operationlock.ActionConsoleRetrieve {
9334+
defer op.Done(nil)
9335+
}
93339336

93349337
// Check if the agent is running.
93359338
monitor, err := qmp.Connect(d.monitorPath(), qemuSerialChardevName, d.getMonitorEventHandler(), d.QMPLogFilePath())

0 commit comments

Comments
 (0)