Skip to content

Commit

Permalink
Merge pull request #291 from stgraber/import
Browse files Browse the repository at this point in the history
Import LXD changes
  • Loading branch information
brauner authored Dec 9, 2023
2 parents 980b0d1 + 9bfec57 commit d65ccd4
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
6 changes: 5 additions & 1 deletion cmd/incus-agent/api_1.0.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,11 @@ func stopDevIncusServer(d *Daemon) error {
d.DevIncusRunning = false
d.DevIncusMu.Unlock()

return servers["DevIncus"].Close()
if servers["DevIncus"] != nil {
return servers["DevIncus"].Close()
}

return nil
}

func getClient(CID uint32, port int, serverCertificate string) (*http.Client, error) {
Expand Down
2 changes: 1 addition & 1 deletion doc/cloud-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ config:
```
```{tip}
See {doc}`How to validate user data cloud configuration <cloud-init:howto/debug_user_data>` for information on how to check whether the syntax is correct.
See {ref}`How to validate user data <cloud-init:check_user_data_cloud_config>` for information on how to check whether the syntax is correct.
```

## How to check the `cloud-init` status
Expand Down
8 changes: 7 additions & 1 deletion internal/server/instance/drivers/driver_qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,13 @@ func (d *qemu) validateStartup(stateful bool, statusCode api.StatusCode) error {
return err
}

stateDiskSizeStr := d.storagePool.Driver().Info().DefaultVMBlockFilesystemSize
// Don't access d.storagePool directly since it isn't populated at this stage.
pool, err := d.getStoragePool()
if err != nil {
return err
}

stateDiskSizeStr := pool.Driver().Info().DefaultVMBlockFilesystemSize
if rootDiskDevice["size.state"] != "" {
stateDiskSizeStr = rootDiskDevice["size.state"]
}
Expand Down
23 changes: 13 additions & 10 deletions internal/server/storage/drivers/driver_ceph_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,19 @@ func (d *ceph) CreateVolumeFromCopy(vol Volume, srcVol Volume, copySnapshots boo
return nil
}

// For VMs, also copy the filesystem volume.
if vol.IsVMBlock() {
srcFSVol := srcVol.NewVMBlockFilesystemVolume()
fsVol := vol.NewVMBlockFilesystemVolume()
err := d.CreateVolumeFromCopy(fsVol, srcFSVol, copySnapshots, false, op)
if err != nil {
return err
}

// Delete on revert.
revert.Add(func() { _ = d.DeleteVolume(fsVol, op) })
}

// Retrieve snapshots on the source.
snapshots := []string{}
if !srcVol.IsSnapshot() && copySnapshots {
Expand Down Expand Up @@ -433,16 +446,6 @@ func (d *ceph) CreateVolumeFromCopy(vol Volume, srcVol Volume, copySnapshots boo
revert.Add(func() { _ = d.DeleteVolume(vol, op) })
}

// For VMs, also copy the filesystem volume.
if vol.IsVMBlock() {
srcFSVol := srcVol.NewVMBlockFilesystemVolume()
fsVol := vol.NewVMBlockFilesystemVolume()
err := d.CreateVolumeFromCopy(fsVol, srcFSVol, false, false, op)
if err != nil {
return err
}
}

err = postCreateTasks(vol)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion internal/server/storage/s3/miniod/miniod.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
)

// minioHost is the host address that the local MinIO processes will listen on.
const minioHost = "[::1]"
const minioHost = "127.0.0.1"

// minioLockPrefix is the prefix used for per-bucket MinIO spawn lock.
const minioLockPrefix = "minio_"
Expand Down

0 comments on commit d65ccd4

Please sign in to comment.