Bug 1101556

Summary: [RFE] qemu-ga should have a config file
Product: Red Hat Enterprise Linux 7 Reporter: Ademar Reis <areis>
Component: qemu-guest-agentAssignee: Marc-Andre Lureau <marcandre.lureau>
Status: CLOSED ERRATA QA Contact: Xueqiang Wei <xuwei>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: chayang, hhuang, jbelka, juzhang, lmiksik, marcandre.lureau, michen, mkenneth, mrezanin, ngu, qzhang, rbalakri, rpacheco, sherold, shuang, virt-maint, xutian, xuwei, zhengtli
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: qemu-guest-agent-2.5.0-3.el7 Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 1100579 Environment:
Last Closed: 2016-11-04 03:02:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1297673    
Bug Blocks: 1100579, 1110708, 1191019    

Description Ademar Reis 2014-05-27 13:59:29 UTC
+++ This bug was initially created as a clone of Bug #1100579 +++

Description of problem:
qemu-ga --help
...snip...
  -b, --blacklist   comma-separated list of RPCs to disable (no spaces, "?"
                    to list available RPCs)
qemu-ga -b?
guest-sync-delimited
guest-sync
guest-ping
guest-get-time
guest-set-time
guest-info
guest-shutdown
guest-file-open
guest-file-close
guest-file-read
guest-file-write
guest-file-seek
guest-file-flush
guest-fsfreeze-status
guest-fsfreeze-freeze
guest-fsfreeze-thaw
guest-fstrim
guest-suspend-disk
guest-suspend-ram
guest-suspend-hybrid
guest-network-get-interfaces
guest-get-vcpus
guest-set-vcpus

Because many blacklist values this is hell to put it directly on cmdline. qemu-ga should have feature to read a config file.

Version-Release number of selected component (if applicable):
qemu-guest-agent-0.12.1.2-2.415.el6_5.8.x86_64

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

--- Additional comment from RHEL Product and Program Management on 2014-05-23 04:13:17 BRT ---

Since this bug report was entered in bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

--- Additional comment from Jiri Belka on 2014-05-23 05:47:57 BRT ---

I meant real config file, not something like /etc/sysconfig/qemu-ga which would be sources into a RC script ;)

Comment 1 Marc-Andre Lureau 2015-07-01 13:48:44 UTC
sent patches:
https://lists.nongnu.org/archive/html/qemu-devel/2015-07/msg00139.html

Comment 2 Marc-Andre Lureau 2015-09-07 15:39:47 UTC
the patches have just been merged in upstream, delaying to rhel 7.3

Comment 3 Miroslav Rezanina 2016-04-18 09:27:19 UTC
Hi Marc,
do we want to have some default config file available in rhel 7.3? Or will we just go with supporting this feature?

Comment 4 Marc-Andre Lureau 2016-04-25 17:28:41 UTC
(In reply to Miroslav Rezanina from comment #3)
> Hi Marc,
> do we want to have some default config file available in rhel 7.3? Or will
> we just go with supporting this feature?

I don't think it's necessary, as qemu-ga rhel package ships with a sysconfig file. We would either have to break or duplicate this configuration and this could confuse users. Perhaps the next major rhel release could switch to the new configuration file and drop sysconfig file?

Comment 6 Xueqiang Wei 2016-07-05 10:09:26 UTC
Hi Marc,

I tested on kernel-3.10.0-422.el7.x86_64/qemu-guest-agent-2.5.0-2.el7.x86_64 as below steps:

Guest:
1. yum install qemu-gest-agent
2. systemctl stop qemu-guest-agent.service
3. cat >/etc/qemu/qemu-ga.conf <<EOF
[general]
blacklist=guest-info
4. qemu-ga

Host:
5: nc -U /home/chanel1
{"execute":"guest-info"}
6:
{"execute":"guest-ping"}
{"return": {}}

after step 5, the expected result:
{"error": {"class": "GenericError", "desc":
"The command guest-info has been disabled for this instance"}}

but the actual result: blacklist doesn't work
{"return": {"version": "2.5.0", "supported_commands": [{"enabled": true, "name": "guest-sync-delimited", "success-response": true}, {"enabled": true, "name": "guest-sync", "success-response": true}, {"enabled": true, "name": "guest-suspend-ram", "success-response": false}, {"enabled": true, "name": "guest-suspend-hybrid", "success-response": false}, {"enabled": true, "name": "guest-suspend-disk", "success-response": false}, {"enabled": true, "name": "guest-shutdown", "success-response": false}, {"enabled": true, "name": "guest-set-vcpus", "success-response": true}, {"enabled": true, "name": "guest-set-user-password", "success-response": true}, {"enabled": true, "name": "guest-set-time", "success-response": true}, {"enabled": true, "name": "guest-set-memory-blocks", "success-response": true}, {"enabled": true, "name": "guest-ping", "success-response": true}, {"enabled": true, "name": "guest-network-get-interfaces", "success-response": true}, {"enabled": true, "name": "guest-info", "success-response": true}, {"enabled": true, "name": "guest-get-vcpus", "success-response": true}, {"enabled": true, "name": "guest-get-time", "success-response": true}, {"enabled": true, "name": "guest-get-memory-blocks", "success-response": true}, {"enabled": true, "name": "guest-get-memory-block-info", "success-response": true}, {"enabled": true, "name": "guest-get-fsinfo", "success-response": true}, {"enabled": true, "name": "guest-fstrim", "success-response": true}, {"enabled": true, "name": "guest-fsfreeze-thaw", "success-response": true}, {"enabled": true, "name": "guest-fsfreeze-status", "success-response": true}, {"enabled": true, "name": "guest-fsfreeze-freeze-list", "success-response": true}, {"enabled": true, "name": "guest-fsfreeze-freeze", "success-response": true}, {"enabled": false, "name": "guest-file-write", "success-response": true}, {"enabled": false, "name": "guest-file-seek", "success-response": true}, {"enabled": false, "name": "guest-file-read", "success-response": true}, {"enabled": false, "name": "guest-file-open", "success-response": true}, {"enabled": false, "name": "guest-file-flush", "success-response": true}, {"enabled": false, "name": "guest-file-close", "success-response": true}, {"enabled": false, "name": "guest-exec-status", "success-response": true}, {"enabled": false, "name": "guest-exec", "success-response": true}]}}


I found this issue has fixed by commit e236d060cba8d2d6d26a7e076c895d2a6812dafb

And if the blacklist in /etc/sysconfig/qemu-ga, it works well.


I want to confirm with you:

1. if the test steps are ok?, if miss some steps, please tell me the correct steps
2. the config files /etc/sysconfig/qemu-ga and /etc/qemu/qemu-ga.conf are all in  use right? I fond if I start the qemu-guest-agent.service, /etc/sysconfig/qemu-ga will be used in the service.


Thank you very much.
Xueqiang

Comment 7 Marc-Andre Lureau 2016-07-05 10:27:55 UTC
(In reply to Xueqiang Wei from comment #6)

> 1. if the test steps are ok?, if miss some steps, please tell me the correct
> steps

The configuration location is wrong: /etc/qemu-ga/qemu-ga.conf

Comment 8 Xueqiang Wei 2016-07-05 12:16:08 UTC
(In reply to Marc-Andre Lureau from comment #7)
> (In reply to Xueqiang Wei from comment #6)
> 
> > 1. if the test steps are ok?, if miss some steps, please tell me the correct
> > steps
> 
> The configuration location is wrong: /etc/qemu-ga/qemu-ga.conf

Verified, the test result is passed. Thanks.

Comment 11 Miroslav Rezanina 2016-08-24 20:56:43 UTC
BZ moved to post due to missing documentation for the change. Adding missing man file will be handled with this BZ.

Comment 12 Marc-Andre Lureau 2016-08-30 16:03:29 UTC
to back the exception request:
this is very low risk, and easy to check

Comment 13 Miroslav Rezanina 2016-09-01 11:17:33 UTC
Fix included in qemu-guest-agent-2.5.0-3.el7

Comment 16 errata-xmlrpc 2016-11-04 03:02:43 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, 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://rhn.redhat.com/errata/RHBA-2016-2303.html