Bug 808012 - Need to mark the unsupported commands of virtagent in the return of "guest-info"
Need to mark the unsupported commands of virtagent in the return of "guest-info"
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
6.3
Unspecified Unspecified
medium Severity medium
: rc
: ---
Assigned To: Jeff Cody
Virtualization Bugs
:
Depends On:
Blocks: 820481
  Show dependency treegraph
 
Reported: 2012-03-29 06:51 EDT by Qunfang Zhang
Modified: 2012-06-19 16:11 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-06-19 16:11:00 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Qunfang Zhang 2012-03-29 06:51:48 EDT
Description of problem:
Currently the "guest-info" virtagent command will returns all commands that are supported or unsupported.  And all of the are under the "supported_commands" list. 
We know that some of them are not supported in 6.3 but this may confuse customers.  As when sending a command like {"execute":"guest-file-open", "arguments":{"path":"/tmp/testqga","mode":"w+"}}. it will returns "unsupported command" though they are in the supported list.

It looks trival but it's fine to fix it.  For example, mark the "enabled" to false instead of true, etc.

 {"execute":"guest-info"}
{"return": {"version": "1.0", "supported_commands": [{"enabled": true, "name": "guest-suspend-hybrid"}, {"enabled": true, "name": "guest-suspend-ram"}, {"enabled": true, "name": "guest-suspend-disk"}, {"enabled": true, "name": "guest-fsfreeze-thaw"}, {"enabled": true, "name": "guest-fsfreeze-freeze"}, {"enabled": true, "name": "guest-fsfreeze-status"}, {"enabled": true, "name": "guest-file-flush"}, {"enabled": true, "name": "guest-file-seek"}, {"enabled": true, "name": "guest-file-write"}, {"enabled": true, "name": "guest-file-read"}, {"enabled": true, "name": "guest-file-close"}, {"enabled": true, "name": "guest-file-open"}, {"enabled": true, "name": "guest-shutdown"}, {"enabled": true, "name": "guest-info"}, {"enabled": true, "name": "guest-ping"}, {"enabled": true, "name": "guest-sync"}]}}


Version-Release number of selected component (if applicable):
qemu-kvm-0.12.1.2-2.265.el6.x86_64
qemu-guest-agent-0.12.1.2-2.265.el6.x86_64

How reproducible:
Always

Steps to Reproduce:
1.Boot a guest with virtio serial or isa serial attached. 
 /usr/libexec/qemu-kvm -M rhel6.3.0 -cpu Conroe -enable-kvm -m 2G -smp 2,sockets=1,cores=2,threads=1 -name rhel6.3 -uuid 26427d77-37e8-4217-ad98-140b16fa18f4 -device virtio-serial-pci,id=virtio-serial0,max_ports=16,bus=pci.0,addr=0x4 -drive file=/dev/vg-qzhang/lv-rhel6.3,if=none,id=drive-virtio-disk0,format=qcow2,cache=none,werror=stop,rerror=stop,aio=native -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x5,drive=drive-virtio-disk0,id=virtio-disk0 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=net0,mac=00:1a:2a:15:10:19,bus=pci.0 -drive file=/home/boot.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -chardev socket,path=/tmp/qga.sock,server,nowait,id=qga0 -device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0,bus=virtio-serial0.0 -vnc :10 -usb -device usb-tablet,id=input0 -device virtio-balloon-pci,id=balloon0,addr=0x7 -monitor stdio -boot c -rtc-td-hack -rtc base=localtime -qmp tcp:0:4444,server,nowait


2. Install qemu-guest-agent-0.12.1.2-2.265.el6.x86_64 inside guest.

3.On host: # nc -U /tmp/qga.sock
  
4. Inside guest: 
#qemu-ga -m virtio-serial -p /dev/virtio-ports/org.qemu.guest_agent.0

5. Send command on host from the socket of step 3

# nc -U /tmp/qga.sock

 {"execute":"guest-info"}

6. {"execute":"guest-file-open", "arguments":{"path":"/tmp/testqga","mode":"w+"}}
{"error": {"class": "Unsupported", "data": {}}}


Actual results:
After step 5: 

{"return": {"version": "1.0", "supported_commands": [{"enabled": true, "name": "guest-suspend-hybrid"}, {"enabled": true, "name": "guest-suspend-ram"}, {"enabled": true, "name": "guest-suspend-disk"}, {"enabled": true, "name": "guest-fsfreeze-thaw"}, {"enabled": true, "name": "guest-fsfreeze-freeze"}, {"enabled": true, "name": "guest-fsfreeze-status"}, {"enabled": true, "name": "guest-file-flush"}, {"enabled": true, "name": "guest-file-seek"}, {"enabled": true, "name": "guest-file-write"}, {"enabled": true, "name": "guest-file-read"}, {"enabled": true, "name": "guest-file-close"}, {"enabled": true, "name": "guest-file-open"}, {"enabled": true, "name": "guest-shutdown"}, {"enabled": true, "name": "guest-info"}, {"enabled": true, "name": "guest-ping"}, {"enabled": true, "name": "guest-sync"}]}}

After step 6: 

{"error": {"class": "Unsupported", "data": {}}}

Expected results:
Mark the unsupported commands to make user know that are not supported yet.


Additional info:
Comment 2 Luiz Capitulino 2012-03-29 09:25:23 EDT
I think this is really minor and should be moved to 6.4.

Assigning to Jeff.
Comment 3 Jeff Cody 2012-05-31 14:10:23 EDT
I believe this issue was contained to the guest-file-* operations, and as such moving to the blacklists as specified in bug #819900 will also fix this bug.
Comment 4 Luiz Capitulino 2012-06-01 13:03:15 EDT
Not exactly, Jeff. Commands like the guest-suspend ones may not be available in all systems. However, guest-info will return them. This happens on OpenBSD for example.

Maybe, the guest-file-* ones are the ones that really mattered to us and thus this issue will be quite minor when your patches are applied. But the issue does exist upstream though.
Comment 5 Ademar Reis 2012-06-19 16:11:00 EDT
With the support for blacklists (bug #819900) this feature turns to be unecessary for RHEL (may still make sense upstream for OpenBSD and alikes).

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