[lxc-devel] [lxd/master] VM: Call MountInstanceSnapshot when mounting vm snapshots
tomponline on Github
lxc-bot at linuxcontainers.org
Tue Nov 3 16:29:32 UTC 2020
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 363 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201103/5b4e0616/attachment.bin>
-------------- next part --------------
From a15e4c882fc7062d356bce3e1b1c1b2670615605 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Tue, 3 Nov 2020 16:28:46 +0000
Subject: [PATCH] lxd/instance/drivers/driver/qemu: Call MountInstanceSnapshot
when mounting vm snapshots
Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
lxd/instance/drivers/driver_qemu.go | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go
index a05c27b9cd..7bcc0a60a2 100644
--- a/lxd/instance/drivers/driver_qemu.go
+++ b/lxd/instance/drivers/driver_qemu.go
@@ -413,6 +413,15 @@ func (vm *qemu) mount() (bool, error) {
return false, err
}
+ if vm.IsSnapshot() {
+ ourMount, err := pool.MountInstanceSnapshot(vm, nil)
+ if err != nil {
+ return false, err
+ }
+
+ return ourMount, nil
+ }
+
ourMount, err := pool.MountInstance(vm, nil)
if err != nil {
return false, err
More information about the lxc-devel
mailing list