all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] qm: cleanup: do dbus-vmstate safety cleanup silently when requested
@ 2025-08-04 13:29 Christoph Heiss
  2025-08-04 14:08 ` Thomas Lamprecht
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Heiss @ 2025-08-04 13:29 UTC (permalink / raw)
  To: pve-devel

First, moving to vm_stop_cleanup(), which is a better fit for this.
It gets called by the cleanup API method in case of unclean shutdown or
from inside the guest.

In every case, the dbus-vmstate daemon should _never_ be running at this
point, as it is started only before migration and stopped directly after
migration, before vm_stop_cleanup() is even called. So it should only be
left running in case of a crash during migration.

Calling it anyway here ensures that the daemon is always (cleanly) shut
down. As the dbus-vmstate is part of the VM scope unit, that would it
tear it down too as a last resort.

Fixes the following spurious warning when a VM was shutdown from inside
the guest:

  `failed to retrieve org.qemu.VMState1 owners: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owners of name 'org.qemu.VMState1': no such name`

Reported-by: Hannes Duerr <h.duerr@proxmox.com>
Reported-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
---
 src/PVE/CLI/qm.pm     | 3 ---
 src/PVE/QemuServer.pm | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/PVE/CLI/qm.pm b/src/PVE/CLI/qm.pm
index 3e778ad1..2e56e234 100755
--- a/src/PVE/CLI/qm.pm
+++ b/src/PVE/CLI/qm.pm
@@ -1056,9 +1056,6 @@ __PACKAGE__->register_method({
                     PVE::QemuServer::vm_stop_cleanup($storecfg, $vmid, $conf, 0, 0, 1);
                 }
 
-                # ensure that no dbus-vmstate helper is left running in any case
-                PVE::QemuServer::DBusVMState::qemu_del_dbus_vmstate($vmid);
-
                 PVE::GuestHelpers::exec_hookscript($conf, $vmid, 'post-stop');
 
                 $restart = eval { PVE::QemuServer::clear_reboot_request($vmid) };
diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 34d251a7..30ec58b1 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -6102,6 +6102,8 @@ sub vm_stop_cleanup {
     my ($storecfg, $vmid, $conf, $keepActive, $apply_pending_changes, $noerr) = @_;
 
     eval {
+        # ensure that no dbus-vmstate helper is left running in any case
+        PVE::QemuServer::DBusVMState::qemu_del_dbus_vmstate($vmid, quiet => $noerr);
 
         if (!$keepActive) {
             my $vollist = get_vm_volumes($conf);
-- 
2.50.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [pve-devel] [PATCH qemu-server] qm: cleanup: do dbus-vmstate safety cleanup silently when requested
  2025-08-04 13:29 [pve-devel] [PATCH qemu-server] qm: cleanup: do dbus-vmstate safety cleanup silently when requested Christoph Heiss
@ 2025-08-04 14:08 ` Thomas Lamprecht
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Lamprecht @ 2025-08-04 14:08 UTC (permalink / raw)
  To: pve-devel, Christoph Heiss

On Mon, 04 Aug 2025 15:29:56 +0200, Christoph Heiss wrote:
> First, moving to vm_stop_cleanup(), which is a better fit for this.
> It gets called by the cleanup API method in case of unclean shutdown or
> from inside the guest.
> 
> In every case, the dbus-vmstate daemon should _never_ be running at this
> point, as it is started only before migration and stopped directly after
> migration, before vm_stop_cleanup() is even called. So it should only be
> left running in case of a crash during migration.
> 
> [...]

Applied, tried to untangle the subject a bit, thanks!

[1/1] vmstate: improve cleaning up dbus-vmstate and avoid spurious warning
      commit: 067a0f55bbf155936861d8844c91dfc16b883c1d


_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-08-04 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-04 13:29 [pve-devel] [PATCH qemu-server] qm: cleanup: do dbus-vmstate safety cleanup silently when requested Christoph Heiss
2025-08-04 14:08 ` Thomas Lamprecht

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal