[lxc-devel] [lxd/master] VM fixes

stgraber on Github lxc-bot at linuxcontainers.org
Wed Mar 4 21:32:59 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 376 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200304/9a848140/attachment.bin>
-------------- next part --------------
From 597d0d86144d393b2c671a26764460f28fabcd71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 4 Mar 2020 22:17:59 +0100
Subject: [PATCH 1/2] lxd-agent: Load vhost module
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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

diff --git a/lxd-agent/main_agent.go b/lxd-agent/main_agent.go
index e5961ec694..3d959c7f33 100644
--- a/lxd-agent/main_agent.go
+++ b/lxd-agent/main_agent.go
@@ -15,6 +15,7 @@ import (
 	"golang.org/x/sys/unix"
 
 	"github.com/lxc/lxd/lxd/instance/instancetype"
+	"github.com/lxc/lxd/lxd/util"
 	"github.com/lxc/lxd/lxd/vsock"
 	"github.com/lxc/lxd/shared"
 	"github.com/lxc/lxd/shared/logger"
@@ -98,6 +99,12 @@ func (c *cmdAgent) Run(cmd *cobra.Command, args []string) error {
 	// Mount shares from host.
 	c.mountHostShares()
 
+	// Load the kernel driver.
+	err = util.LoadModule("vsock")
+	if err != nil {
+		return errors.Wrap(err, "Unable to load the vsock kernel module")
+	}
+
 	// Setup the listener.
 	l, err := vsock.Listen(8443)
 	if err != nil {

From 76aa1e268f9b899950caef01dede7733bbcd5110 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Wed, 4 Mar 2020 22:30:36 +0100
Subject: [PATCH 2/2] lxd/storage/zfs: Fix default VM size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxd/storage/drivers/driver_zfs_volumes.go | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lxd/storage/drivers/driver_zfs_volumes.go b/lxd/storage/drivers/driver_zfs_volumes.go
index d31ff2447f..9b374521c6 100644
--- a/lxd/storage/drivers/driver_zfs_volumes.go
+++ b/lxd/storage/drivers/driver_zfs_volumes.go
@@ -762,8 +762,12 @@ func (d *zfs) GetVolumeUsage(vol Volume) (int64, error) {
 }
 
 func (d *zfs) SetVolumeQuota(vol Volume, size string, op *operations.Operation) error {
-	if size == "" {
-		size = "0"
+	if size == "" || size == "0" {
+		if vol.contentType == ContentTypeBlock {
+			size = defaultBlockSize
+		} else {
+			size = "0"
+		}
 	}
 
 	// Convert to bytes.


More information about the lxc-devel mailing list