Skip to content

Commit

Permalink
incusd/instance/qemu: Don't overtake operations on console retrieval
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
stgraber committed Nov 15, 2024
1 parent 51a8dc4 commit d33cb3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/server/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -9329,7 +9329,10 @@ func (d *qemu) ConsoleLog() (string, error) {
return "", err
}

defer op.Done(nil)
// Only mark the operation as done if only processing the console retrieval.
if op.Action() == operationlock.ActionConsoleRetrieve {
defer op.Done(nil)
}

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

0 comments on commit d33cb3f

Please sign in to comment.