The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6960
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 61e458a6c1a64097f3474ac92d26c273ecbd93b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com> Date: Sat, 29 Feb 2020 04:18:11 -0500 Subject: [PATCH] lxd/storage/drivers: Don't use named temporary dirs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <stgra...@ubuntu.com> --- lxd/storage/drivers/driver_btrfs_volumes.go | 8 ++++---- lxd/storage/drivers/driver_zfs_volumes.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lxd/storage/drivers/driver_btrfs_volumes.go b/lxd/storage/drivers/driver_btrfs_volumes.go index a0593d0a75..ff3037da4b 100644 --- a/lxd/storage/drivers/driver_btrfs_volumes.go +++ b/lxd/storage/drivers/driver_btrfs_volumes.go @@ -122,7 +122,7 @@ func (d *btrfs) CreateVolumeFromBackup(vol Volume, snapshots []string, srcData i revert.Add(revertHook) // Create a temporary directory to unpack the backup into. - unpackDir, err := ioutil.TempDir(GetVolumeMountPath(d.name, vol.volType, ""), vol.name) + unpackDir, err := ioutil.TempDir(GetVolumeMountPath(d.name, vol.volType, ""), "backup.") if err != nil { return nil, nil, errors.Wrapf(err, "Failed to create temporary directory under '%s'", GetVolumeMountPath(d.name, vol.volType, "")) } @@ -298,7 +298,7 @@ func (d *btrfs) CreateVolumeFromMigration(vol Volume, conn io.ReadWriteCloser, v instancesPath := GetVolumeMountPath(d.name, vol.volType, "") // Create a temporary directory which will act as the parent directory of the received ro snapshot. - tmpVolumesMountPoint, err := ioutil.TempDir(instancesPath, vol.name) + tmpVolumesMountPoint, err := ioutil.TempDir(instancesPath, "migration.") if err != nil { return errors.Wrapf(err, "Failed to create temporary directory under '%s'", instancesPath) } @@ -579,7 +579,7 @@ func (d *btrfs) MigrateVolume(vol Volume, conn io.ReadWriteCloser, volSrcArgs *m instancesPath := GetVolumeMountPath(d.name, vol.volType, "") // Create a temporary directory which will act as the parent directory of the read-only snapshot. - tmpVolumesMountPoint, err := ioutil.TempDir(instancesPath, vol.name) + tmpVolumesMountPoint, err := ioutil.TempDir(instancesPath, "migration.") if err != nil { return errors.Wrapf(err, "Failed to create temporary directory under '%s'", instancesPath) } @@ -698,7 +698,7 @@ func (d *btrfs) BackupVolume(vol Volume, targetPath string, optimized bool, snap sourceVolume := vol.MountPath() containersPath := GetVolumeMountPath(d.name, vol.volType, "") - tmpContainerMntPoint, err := ioutil.TempDir(containersPath, vol.name) + tmpContainerMntPoint, err := ioutil.TempDir(containersPath, "backup.") if err != nil { return errors.Wrapf(err, "Failed to create temporary directory under '%s'", containersPath) } diff --git a/lxd/storage/drivers/driver_zfs_volumes.go b/lxd/storage/drivers/driver_zfs_volumes.go index 4ab254ab22..d31ff2447f 100644 --- a/lxd/storage/drivers/driver_zfs_volumes.go +++ b/lxd/storage/drivers/driver_zfs_volumes.go @@ -213,7 +213,7 @@ func (d *zfs) CreateVolumeFromBackup(vol Volume, snapshots []string, srcData io. revert.Add(revertHook) // Create a temporary directory to unpack the backup into. - unpackDir, err := ioutil.TempDir(GetVolumeMountPath(d.name, vol.volType, ""), vol.name) + unpackDir, err := ioutil.TempDir(GetVolumeMountPath(d.name, vol.volType, ""), "backup.") if err != nil { return nil, nil, errors.Wrapf(err, "Failed to create temporary directory under '%s'", GetVolumeMountPath(d.name, vol.volType, "")) }
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel