Description of problem: qemu-ga service still active and can work after qemu-guest-agent been removed Version-Release number of selected component (if applicable): qemu-guest-agent-5.1.0-9.module+el8.3.0+8182+ac9ced32.x86_64 systemd-239-40.el8.x86_64 libvirt-6.6.0-6.el8.x86_64 How reproducible: 100% Steps to Reproduce: 1. check qemu-guest-agent service ● qemu-guest-agent.service - QEMU Guest Agent Loaded: loaded (/usr/lib/systemd/system/qemu-guest-agent.service; disabled; vendor preset: enabled) Active: active (running) since Thu 2020-09-24 15:57:08 CST; 22min ago Main PID: 905 (qemu-ga) Tasks: 2 (limit: 8164) Memory: 2.1M CGroup: /system.slice/qemu-guest-agent.service └─905 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist=guest-file-open,guest-file-close,guest-file-read,guest-file-> Sep 24 15:57:08 server.lab.eng.pek2.redhat.com systemd[1]: Started QEMU Guest Agent. 2. remove qemu-guest-agent package # yum remove qemu-guest-agent -y 3. check qemu-guest-agent packages # rpm -q qemu-guest-agent package qemu-guest-agent is not installed 4. check qemu-guest-agent service # systemctl status qemu-guest-agent ● qemu-guest-agent.service Loaded: not-found (Reason: Unit qemu-guest-agent.service not found.) Active: active (running) since Thu 2020-09-24 15:57:08 CST; 34min ago Main PID: 905 (qemu-ga) Tasks: 2 (limit: 8164) Memory: 2.1M CGroup: /system.slice/qemu-guest-agent.service └─905 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist=guest-file-open,guest-file-close,guest-file-read,guest-file-> Sep 24 15:57:08 server.lab.eng.pek2.redhat.com systemd[1]: Started QEMU Guest Agent. Sep 24 16:31:50 server.lab.eng.pek2.redhat.com systemd[1]: qemu-guest-agent.service: Current command vanished from the unit file, execution of the command list won't be resumed. 5. ping guest using qemu-agent-command # virsh qemu-agent-command server '{"execute":"guest-info"}' ; echo $? {"return":{"version":"5.1.0","supported_commands":[{"enabled":true,"name":"guest-get-osinfo","success-response":true},{"enabled":true,"name":"guest-get-timezone","success-response":true}... 0 5. execute some guest agent cmd from host # virsh domtime server Time: 1601037719 Expected results: Check the qemu-guest-agent after uninstallation, # systemctl status qemu-guest-agent Unit qemu-guest-agent.service could not be found. Additional info: Tried with rhel7.9 os with qemu-guest-agent-2.12.0-3.el7.x86_64, will get the expected result.
*** Bug 1882720 has been marked as a duplicate of this bug. ***
Sent fix to rhvirt-patches: "[RHEL-8.3.0 qemu-kvm PATCH] redhat: add (un/pre)install systemd hooks for qemu-ga" We may need a similar patch for other branches/versions.
Reproduce with version qemu-kvm-5.1.0-13.module+el8.3.0+8424+5ea525c5 Steps to Reproduce like comment 0 Actual result: (on host): [root@dell-per440-06 ~]# nc -U /tmp/qga.sock {"execute":"guest-ping"} {"return": {}} {"execute":"guest-ping"} {"return": {}} (on guest): ● qemu-guest-agent.service Loaded: not-found (Reason: Unit qemu-guest-agent.service not found.) Active: active (running) (thawing) since Tue 2020-11-17 11:14:55 CST; 32s ago Main PID: 2991 (qemu-ga) Tasks: 2 (limit: 88157) Memory: 1.0M CGroup: /system.slice/qemu-guest-agent.service └─2991 /usr/bin/qemu-ga --method=virtio-serial --path=/dev/virtio-ports/org.qemu.guest_agent.0 --blacklist=guest-file-open,guest-file-close,guest-file-read,guest-file-write,guest-file-seek,guest-file-flush,guest-exec,guest-exec-status -F/etc/qemu-ga/fsfreeze-hook Nov 17 11:14:55 vm-73-139.lab.eng.pek2.redhat.com systemd[1]: Started QEMU Guest Agent. Nov 17 11:15:05 vm-73-139.lab.eng.pek2.redhat.com qemu-ga[2991]: info: guest-ping called Nov 17 11:15:17 vm-73-139.lab.eng.pek2.redhat.com systemd[1]: qemu-guest-agent.service: Current command vanished from the unit file, execution of the command list won't be resumed. Expected results: Unit qemu-guest-agent.service could not be found. Verified with version qemu-kvm-5.1.0-15.module+el8.3.1+8772+a3fdeccd Steps to Reproduce like comment 0 Actual result: (on host): {"execute":"guest-ping"} {"return": {}} {"execute":"guest-ping"} (on guest): Unit qemu-guest-agent.service could not be found. Expected results: as above
Hit this issue on guest rhel8.4.0 with pkg qemu-kvm-4.2.0-38.module+el8.4.0+9133+5346b06d. should this bz be cloned? thanks
(In reply to dehanmeng from comment #15) > Hit this issue on guest rhel8.4.0 with pkg > qemu-kvm-4.2.0-38.module+el8.4.0+9133+5346b06d. should this bz be cloned? > thanks yes, please
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:8.3 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:0639