[lxc-devel] [lxd/master] lxc/instance/drivers/qemu: Support ephemeral VMs

monstermunchkin on Github lxc-bot at linuxcontainers.org
Fri Jul 3 15:31:31 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/20200703/3ddbc2b7/attachment.bin>
-------------- next part --------------
From 7d585316c6edcd19426dd3ddde0e167d878e5856 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Fri, 3 Jul 2020 17:30:50 +0200
Subject: [PATCH] lxc/instance/drivers/qemu: Support ephemeral VMs

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 lxd/instance/drivers/driver_qemu.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lxd/instance/drivers/driver_qemu.go b/lxd/instance/drivers/driver_qemu.go
index 1645a8652a..e51553873c 100644
--- a/lxd/instance/drivers/driver_qemu.go
+++ b/lxd/instance/drivers/driver_qemu.go
@@ -511,6 +511,9 @@ func (vm *qemu) onStop(target string) error {
 		if err != nil {
 			return err
 		}
+	} else if vm.ephemeral {
+		// Destroy ephemeral virtual machines
+		err = vm.Delete()
 	}
 
 	if op != nil {


More information about the lxc-devel mailing list