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

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) ===
Fixes #8071

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From 74c1e881df63a4d211e674e790459925a321ac5e Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Tue, 27 Oct 2020 17:24:08 +0000
Subject: [PATCH] lxd/instance/drivers: Write out updated backup.yaml after
 rename

Fixes #8071

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 lxd/instance/drivers/driver_lxc.go  | 5 +++++
 lxd/instance/drivers/driver_qemu.go | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/lxd/instance/drivers/driver_lxc.go 
b/lxd/instance/drivers/driver_lxc.go
index 0efab52699..a89a68e866 100644
--- a/lxd/instance/drivers/driver_lxc.go
+++ b/lxd/instance/drivers/driver_lxc.go
@@ -3747,6 +3747,11 @@ func (c *lxc) Rename(newName string) error {
        // Update lease files.
        network.UpdateDNSMasqStatic(c.state, "")
 
+       err = c.UpdateBackupFile()
+       if err != nil {
+               return err
+       }
+
        logger.Info("Renamed container", ctxMap)
 
        if c.IsSnapshot() {
diff --git a/lxd/instance/drivers/driver_qemu.go 
b/lxd/instance/drivers/driver_qemu.go
index ba1381043a..d5e81b5200 100644
--- a/lxd/instance/drivers/driver_qemu.go
+++ b/lxd/instance/drivers/driver_qemu.go
@@ -2751,6 +2751,11 @@ func (vm *qemu) Rename(newName string) error {
        // Update lease files.
        network.UpdateDNSMasqStatic(vm.state, "")
 
+       err = vm.UpdateBackupFile()
+       if err != nil {
+               return err
+       }
+
        logger.Info("Renamed instance", ctxMap)
 
        if vm.IsSnapshot() {
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to