The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/8072

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) ===
On some distributions, the argument parser is very picky and needs
options to be passed first.

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From da09d9fec580938778af2daaa199e88cec0303ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Wed, 21 Oct 2020 12:36:30 -0400
Subject: [PATCH] lxd/storage/zfs: Fix argument ordering
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

On some distributions, the argument parser is very picky and needs
options to be passed first.

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/storage/drivers/driver_zfs_volumes.go | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lxd/storage/drivers/driver_zfs_volumes.go 
b/lxd/storage/drivers/driver_zfs_volumes.go
index 0f06215306..dd5de84e3a 100644
--- a/lxd/storage/drivers/driver_zfs_volumes.go
+++ b/lxd/storage/drivers/driver_zfs_volumes.go
@@ -565,17 +565,15 @@ func (d *zfs) CreateVolumeFromCopy(vol Volume, srcVol 
Volume, copySnapshots bool
                }
        } else {
                // Perform volume clone.
-               args := []string{
-                       "clone",
-                       srcSnapshot,
-                       d.dataset(vol, false),
-               }
+               args := []string{"clone"}
 
                if vol.contentType == ContentTypeBlock {
                        // Use volmode=none so volume is invisible until 
mounted.
                        args = append(args, "-o", "volmode=none")
                }
 
+               args = append(args, srcSnapshot, d.dataset(vol, false))
+
                // Clone the snapshot.
                _, err := shared.RunCommand("zfs", args...)
                if err != nil {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to