Bug 1882719 - qemu-ga service still active and can work after qemu-guest-agent been removed
Summary: qemu-ga service still active and can work after qemu-guest-agent been removed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: qemu-kvm
Version: 8.3
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: rc
: 8.3
Assignee: Marc-Andre Lureau
QA Contact: dehanmeng
URL:
Whiteboard:
: 1882720 (view as bug list)
Depends On:
Blocks: 1910220
TreeView+ depends on / blocked
 
Reported: 2020-09-25 12:43 UTC by Lili Zhu
Modified: 2021-02-22 15:40 UTC (History)
9 users (show)

Fixed In Version: qemu-kvm-5.1.0-15.module+el8.3.1+8772+a3fdeccd
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1910220 (view as bug list)
Environment:
Last Closed: 2021-02-22 15:39:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lili Zhu 2020-09-25 12:43:36 UTC
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.

Comment 1 John Ferlan 2020-09-25 16:34:10 UTC
*** Bug 1882720 has been marked as a duplicate of this bug. ***

Comment 2 Marc-Andre Lureau 2020-09-28 11:02:08 UTC
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.

Comment 14 dehanmeng 2020-11-17 03:22:27 UTC
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

Comment 15 dehanmeng 2020-12-23 03:00:33 UTC
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

Comment 16 Marc-Andre Lureau 2020-12-23 07:26:39 UTC
(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

Comment 18 errata-xmlrpc 2021-02-22 15:39:38 UTC
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


Note You need to log in before you can comment on or make changes to this bug.