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

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) ===
This is needed as QEMU will normally acquire a lock on the block device
backing the instance, preventing any further reader/writer to it.

Closes #7745

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 637d4973de5f69ecb7d5513cd16e97c947bdd4ec Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Tue, 25 Aug 2020 17:57:01 -0400
Subject: [PATCH] lxd/storage: Refuse BLOCK_AND_RSYNC with running instance
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is needed as QEMU will normally acquire a lock on the block device
backing the instance, preventing any further reader/writer to it.

Closes #7745

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/storage/backend_lxd.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lxd/storage/backend_lxd.go b/lxd/storage/backend_lxd.go
index 4e13013eab..c4f34c08d6 100644
--- a/lxd/storage/backend_lxd.go
+++ b/lxd/storage/backend_lxd.go
@@ -1475,6 +1475,11 @@ func (b *lxdBackend) MigrateInstance(inst 
instance.Instance, conn io.ReadWriteCl
        logger.Debug("MigrateInstance started")
        defer logger.Debug("MigrateInstance finished")
 
+       // rsync+dd can't handle running source instances
+       if inst.IsRunning() && args.MigrationType.FSType == 
migration.MigrationFSType_BLOCK_AND_RSYNC {
+               return fmt.Errorf("Rsync based migration doesn't support 
running virtual machines")
+       }
+
        volType, err := InstanceTypeToVolumeType(inst.Type())
        if err != nil {
                return err
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to