[lxc-devel] [lxd/master] Bugfixes

stgraber on Github lxc-bot at linuxcontainers.org
Thu May 21 15:41:26 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 301 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200521/f1406a0c/attachment.bin>
-------------- next part --------------
From 928bf63bb303f872cc4b62cd9f7cadfd343747c3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 21 May 2020 11:13:11 -0400
Subject: [PATCH 1/2] lxd/qemu: Handle quoted raw.qemu
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #7333

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/instance/drivers/driver_qemu.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go
index 3f431e2e3c..5b4878e312 100644
--- a/lxd/instance/drivers/driver_qemu.go
+++ b/lxd/instance/drivers/driver_qemu.go
@@ -20,6 +20,7 @@ import (
 
 	"github.com/flosch/pongo2"
 	"github.com/gorilla/websocket"
+	"github.com/kballard/go-shellquote"
 	"github.com/pborman/uuid"
 	"github.com/pkg/errors"
 	"golang.org/x/sys/unix"
@@ -774,7 +775,11 @@ func (vm *qemu) Start(stateful bool) error {
 	}
 
 	if vm.expandedConfig["raw.qemu"] != "" {
-		fields := strings.Split(vm.expandedConfig["raw.qemu"], " ")
+		fields, err := shellquote.Split(vm.expandedConfig["raw.qemu"])
+		if err != nil {
+			op.Done(err)
+			return err
+		}
 		qemuCmd = append(qemuCmd, fields...)
 	}
 

From 5007a03f285a7de7c052b777d11dc15b0ad240c6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Thu, 21 May 2020 11:18:47 -0400
Subject: [PATCH 2/2] lxd/main_forkproxy: Reduce logging
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We only want to log initial connection errors and obvious kernel
problems that would break the proxy. Connection related issues should be
only logged when in debug mode.

Closes #7332

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/main_forkproxy.go | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lxd/main_forkproxy.go b/lxd/main_forkproxy.go
index 6c1735b94c..8a7376cb3b 100644
--- a/lxd/main_forkproxy.go
+++ b/lxd/main_forkproxy.go
@@ -15,6 +15,7 @@ import (
 	"github.com/spf13/cobra"
 	"golang.org/x/sys/unix"
 
+	"github.com/lxc/lxd/lxd/daemon"
 	"github.com/lxc/lxd/lxd/device"
 	deviceConfig "github.com/lxc/lxd/lxd/device/config"
 	"github.com/lxc/lxd/shared"
@@ -834,12 +835,12 @@ func genericRelay(dst net.Conn, src net.Conn, timeout bool) {
 
 	select {
 	case errSnd := <-chSend:
-		if errSnd != nil {
+		if daemon.Debug && errSnd != nil {
 			fmt.Printf("Warning: Error while sending data: %v\n", errSnd)
 		}
 
 	case errRcv := <-chRecv:
-		if errRcv != nil {
+		if daemon.Debug && errRcv != nil {
 			fmt.Printf("Warning: Error while reading data: %v\n", errRcv)
 		}
 	}
@@ -927,12 +928,12 @@ func unixRelay(dst io.ReadWriteCloser, src io.ReadWriteCloser) {
 
 	select {
 	case errSnd := <-chSend:
-		if errSnd != nil {
+		if daemon.Debug && errSnd != nil {
 			fmt.Printf("Warning: Error while sending data: %v\n", errSnd)
 		}
 
 	case errRcv := <-chRecv:
-		if errRcv != nil {
+		if daemon.Debug && errRcv != nil {
 			fmt.Printf("Warning: Error while reading data: %v\n", errRcv)
 		}
 	}


More information about the lxc-devel mailing list