diff --git a/cmd/incus/main.go b/cmd/incus/main.go index 6e208890d52..2441864009e 100644 --- a/cmd/incus/main.go +++ b/cmd/incus/main.go @@ -206,7 +206,7 @@ For help with any of those, simply call them with --help.`)) profileCmd := cmdProfile{global: &globalCmd} app.AddCommand(profileCmd.Command()) - // profile sub-command + // project sub-command projectCmd := cmdProject{global: &globalCmd} app.AddCommand(projectCmd.Command()) diff --git a/internal/server/instance/drivers/driver_qemu.go b/internal/server/instance/drivers/driver_qemu.go index da5efaa797b..6a8953dd59d 100644 --- a/internal/server/instance/drivers/driver_qemu.go +++ b/internal/server/instance/drivers/driver_qemu.go @@ -3764,11 +3764,11 @@ func (d *qemu) addDriveConfig(qemuDev map[string]string, bootIndexes map[string] aioMode = "threads" cacheMode = "unsafe" // Use host cache, but ignore all sync requests from guest. } + } - // Special case ISO images as cdroms. - if driveConf.FSType == "iso9660" { - media = "cdrom" - } + // Special case ISO images as cdroms. + if driveConf.FSType == "iso9660" { + media = "cdrom" } // Check if the user has overridden the bus. diff --git a/internal/server/storage/backend.go b/internal/server/storage/backend.go index 26fe5b10462..3c342d6b3bf 100644 --- a/internal/server/storage/backend.go +++ b/internal/server/storage/backend.go @@ -6809,6 +6809,11 @@ func (b *backend) CreateCustomVolumeFromISO(projectName string, volName string, // Check whether we are allowed to create volumes. req := api.StorageVolumesPost{ Name: volName, + StorageVolumePut: api.StorageVolumePut{ + Config: map[string]string{ + "size": fmt.Sprintf("%d", size), + }, + }, } err := b.state.DB.Cluster.Transaction(b.state.ShutdownCtx, func(ctx context.Context, tx *db.ClusterTx) error { @@ -6824,11 +6829,7 @@ func (b *backend) CreateCustomVolumeFromISO(projectName string, volName string, // Get the volume name on storage. volStorageName := project.StorageVolume(projectName, volName) - config := map[string]string{ - "size": fmt.Sprintf("%d", size), - } - - vol := b.GetVolume(drivers.VolumeTypeCustom, drivers.ContentTypeISO, volStorageName, config) + vol := b.GetVolume(drivers.VolumeTypeCustom, drivers.ContentTypeISO, volStorageName, req.Config) volExists, err := b.driver.HasVolume(vol) if err != nil { @@ -6905,7 +6906,7 @@ func (b *backend) CreateCustomVolumeFromBackup(srcBackup backup.Info, srcData io Name: srcBackup.Name, } - err := b.state.DB.Cluster.Transaction(context.TODO(), func(ctx context.Context, tx *db.ClusterTx) error { + err := b.state.DB.Cluster.Transaction(b.state.ShutdownCtx, func(ctx context.Context, tx *db.ClusterTx) error { return project.AllowVolumeCreation(tx, srcBackup.Project, req) }) if err != nil {