Description of problem: Start and migrate vm in session mode, after migration, try to list vm by "virsh list", vm can't be listed. Version-Release number of selected component (if applicable): libvirt-9.0.0-5.el9.x86_64 libvirt-8.5.0-7.4.el9_1.x86_64 libvirt-8.0.0-8.5.el9_0.x86_64 libvirt-8.0.0-5.6.module+el8.6.0 libvirt-7.0.0-14.1.module+el8.4.0 How reproducible: 100% Steps to Reproduce: 1. Start a vm in session node 2. Migrate vm to another host $ virsh migrate vm qemu+ssh://{target_host}/session --live --p2p --undefinesource --persistent 3. Try to list vm on target host $ virsh list Id Name State -------------------- $ virsh list --all Id Name State ----------------------- - vm shut off Actual results: As step3, active vm can't be listed after migration in session mode. Expected results: Active vm can be listed after migration in session mode. Additional info: For local booted vm, the "run" dir has following content: └── /home/fjin/.cache/libvirt/qemu/run ├── /home/fjin/.cache/libvirt/qemu/run/autostarted ├── /home/fjin/.cache/libvirt/qemu/run/dbus ├── /home/fjin/.cache/libvirt/qemu/run/driver.pid ├── /home/fjin/.cache/libvirt/qemu/run/passt ├── /home/fjin/.cache/libvirt/qemu/run/slirp ├── /home/fjin/.cache/libvirt/qemu/run/vm.pid └── /home/fjin/.cache/libvirt/qemu/run/vm.xml For migrated vm, the "run" dir has following content: └── /home/fjin/.cache/libvirt/qemu/run ├── /home/fjin/.cache/libvirt/qemu/run/autostarted ├── /home/fjin/.cache/libvirt/qemu/run/dbus ├── /home/fjin/.cache/libvirt/qemu/run/passt └── /home/fjin/.cache/libvirt/qemu/run/slirp
Additional info: This bug can't be reproduced with unix protocol: $ virsh migrate vm --desturi qemu+unix:///session?socket=/tmp/22222-sock --live --p2p --migrateuri unix:///tmp/33333-sock
Hi Fangge, I think it's not a bug. The guest can be listed if you login the target host with non-root user directly instead of login with root user then switching to non-root user, because the env is different between these two ways. So we can list the guest on the target host after migration by: (1)Login the target host with non-root user directly, execute 'virsh list' (2)List the guest on the remote host: $ virsh -c qemu+ssh://test@*.*.com/session list And the pid file of guest is: $ ll $XDG_RUNTIME_DIR/libvirt/qemu/run/ total 24 -rw-------. 1 test test 0 Feb 15 10:12 autostarted drwxrwx---. 2 test test 40 Feb 15 10:12 dbus -rw-r--r--. 1 test test 7 Feb 15 10:12 driver.pid drwxr-xr-x. 2 test test 40 Feb 15 10:12 passt drwxr-xr-x. 2 test test 40 Feb 15 10:12 slirp drwxrwx---. 2 test test 80 Feb 15 10:23 swtpm -rw-r--r--. 1 test test 7 Feb 15 10:23 test.pid -rw-------. 1 test test 16261 Feb 15 10:23 test.xml