mirror of
https://github.com/lxc/incus
synced 2026-08-02 05:26:46 +00:00
commit
4596075585
@ -11074,6 +11074,12 @@ func (d *qemu) ExportQcow2Block(diskName string, blockIndex int) (func(), string
|
||||
return nil, "", err
|
||||
}
|
||||
|
||||
// Cleanup any leftover sockets.
|
||||
err = os.Remove(socketPath)
|
||||
if err != nil && !errors.Is(err, fs.ErrNotExist) {
|
||||
return nil, "", fmt.Errorf("Failed to remove stale migration socket %q: %w", socketPath, err)
|
||||
}
|
||||
|
||||
migrationSock, err := net.ListenUnix("unix", addr)
|
||||
if err != nil {
|
||||
return nil, "", fmt.Errorf("Error connecting to migration socket %q: %w", socketPath, err)
|
||||
|
||||
@ -758,7 +758,14 @@ func (r *pipeResponse) Render(w http.ResponseWriter) error {
|
||||
}
|
||||
|
||||
_, err := util.SafeCopy(w, r.reader)
|
||||
return err
|
||||
if err != nil {
|
||||
// It's too late to send a clean error back to the client, so
|
||||
// instead use the Go HTTP ErrAbortHandler logic to terminate the
|
||||
// connection. This does not cause the daemon itself to panic.
|
||||
panic(http.ErrAbortHandler)
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// String returns a quick description of the response.
|
||||
|
||||
@ -9123,8 +9123,8 @@ func (b *backend) qcow2BackupVolume(vol drivers.Volume, dbVol *db.StorageVolume,
|
||||
return err
|
||||
}
|
||||
|
||||
inst, deviceName, err := InstanceByVolumeName(b.state, b.name, projectName, vol.Name(), volumeDBType)
|
||||
if err != nil {
|
||||
inst, deviceName, err := InstanceByVolumeName(b.state, b.name, projectName, dbVol.Name, volumeDBType)
|
||||
if err != nil && !errors.Is(err, ErrVolumeNotAttachedToRunningInstance) {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user