[pve-devel] [PATCH v2 container 0/3] Set and check locks for container backups

Dietmar Maurer dietmar at proxmox.com
Fri Jan 15 19:18:18 CET 2016


> Fixes: #847

Thought a bit more about it. During backup, we wo

PVE::LXC::lock_aquire($vmid);

at backup start, and 

PVE::LXC::lock_release($vmid);

when we are done. 

So instead, we should try to get that lock when we start/stop a VM.
The current code does not acquire the lock in start/stop, and I think 
this is the wrong part.

And maybe we should use the same code as in QemuServer, where the vzdump
lock code is simply:

sub lock_vm {
    my ($self, $vmid) = @_;

-    $self->cmd ("qm set $vmid --lock backup");
+    $self->cmd ("pct set $vmid --lock backup");
}

sub unlock_vm {
    my ($self, $vmid) = @_;

-    $self->cmd ("qm unlock $vmid");
+    $self->cmd ("pct unlock $vmid");
}


Another question is if we can use the same locking mechanism 
as LCX in PVE::LXC::lock_aquire($vmid)?




More information about the pve-devel mailing list