Discussion:
[pve-devel] [PATCH qemu-server v3] better cleanup logging for migration
Dominik Csapak
2018-11-28 09:40:45 UTC
Permalink
if we migrate a vm we call cleanup but the logging looks like:

Starting cleanup for 101
trying to acquire lock...
OK
Configuration file 'nodes/pve-ceph-01/qemu-server/101.conf' does not exist

with this patch, we omit any logging in the case we do not have the config,
since we cannot know what to clean up

Signed-off-by: Dominik Csapak <***@proxmox.com>
---
changes from v2:
* use !-f config_file to check for the config
* better comment

PVE/CLI/qm.pm | 3 +++
1 file changed, 3 insertions(+)

diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index eceb9b3..26d4217 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -753,6 +753,9 @@ __PACKAGE__->register_method({
my $clean = $param->{'clean-shutdown'};
my $guest = $param->{'guest-requested'};

+ # return if we do not have the config anymore
+ return if !-f PVE::QemuConfig->config_file($vmid);
+
my $storecfg = PVE::Storage::config();
warn "Starting cleanup for $vmid\n";
--
2.11.0
Thomas Lamprecht
2018-11-28 10:05:20 UTC
Permalink
Post by Dominik Csapak
Starting cleanup for 101
trying to acquire lock...
OK
Configuration file 'nodes/pve-ceph-01/qemu-server/101.conf' does not exist
with this patch, we omit any logging in the case we do not have the config,
since we cannot know what to clean up
---
* use !-f config_file to check for the config
* better comment
PVE/CLI/qm.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/PVE/CLI/qm.pm b/PVE/CLI/qm.pm
index eceb9b3..26d4217 100755
--- a/PVE/CLI/qm.pm
+++ b/PVE/CLI/qm.pm
@@ -753,6 +753,9 @@ __PACKAGE__->register_method({
my $clean = $param->{'clean-shutdown'};
my $guest = $param->{'guest-requested'};
+ # return if we do not have the config anymore
+ return if !-f PVE::QemuConfig->config_file($vmid);
+
my $storecfg = PVE::Storage::config();
warn "Starting cleanup for $vmid\n";
applied, thanks!

Loading...