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

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) ===
They have a filesystem config volume too, so need to also use this check.

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From a829d0555c804a6228fce2940e96c26e5aefaaea Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Fri, 1 May 2020 15:30:34 +0100
Subject: [PATCH] lxd/storage/backend/lxd: Detect cached image filesystem
 changes for VM images too

They have a filesystem config volume too, so need to also use this check.

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/storage/backend_lxd.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lxd/storage/backend_lxd.go b/lxd/storage/backend_lxd.go
index ff06e96986..3cc6307e46 100644
--- a/lxd/storage/backend_lxd.go
+++ b/lxd/storage/backend_lxd.go
@@ -2041,7 +2041,8 @@ func (b *lxdBackend) EnsureImage(fingerprint string, op 
*operations.Operation) e
 
        // If an existing DB row was found, check if filesystem is the same as 
the current pool's filesystem.
        // If not we need to delete the existing cached image volume and 
re-create using new filesystem.
-       if imgDBVol != nil && contentType == drivers.ContentTypeFS {
+       // We need to do this for VM block images too, as they create a 
filesystem based config volume too.
+       if imgDBVol != nil {
                if b.Driver().Info().BlockBacking && 
imgDBVol.Config["block.filesystem"] != b.poolBlockFilesystem() {
                        logger.Debug("Filesystem of pool has changed since 
cached image volume created, regenerating image volume")
                        err = b.DeleteImage(fingerprint, op)
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to