Bug 1374725

Summary: Output command {"execute": "guest-info"} includes unsupported qemu-ga-win commands
Product: Red Hat Enterprise Linux 7 Reporter: Gu Nini <ngu>
Component: virtio-winAssignee: Yvugenfi <yvugenfi>
virtio-win sub component: qemu-ga-win QA Contact: Virtualization Bugs <virt-bugs>
Status: CLOSED ERRATA Docs Contact:
Severity: unspecified    
Priority: unspecified CC: chayang, huding, juzhang, lijin, lmiksik, xiagao
Version: 7.3   
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-01 12:53:08 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:
Bug Depends On:    
Bug Blocks: 1401400    

Description Gu Nini 2016-09-09 13:23:32 UTC
Description of problem:
The output of command {"execute": "guest-info"} includes some unsupported qemu-ga-win commands

Version-Release number of selected component (if applicable):
Host kernel: 3.10.0-501.el7.x86_64
Qemu-kvm-rhev: qemu-kvm-rhev-2.6.0-22.el7.x86_64
qemu-ga-win: qemu-ga-win-7.3.2-1

How reproducible:
100%

Steps to Reproduce:
1. Start a Win2016 x86_64 bit guest with guest agent cmd line:

    -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x10 \
    -chardev socket,id=qga0,path=/tmp/qga.sock,server,nowait \
    -device virtserialport,bus=virtio-serial0.0,nr=2,chardev=qga0,id=qga0,name=org.qemu.guest_agent.0 \

2. After the guest boots up, install virtio serial driver and qemu-ga-win-7.3.2-1 inside the guest

3. In the host, issue qemu-ga-win cmd '{"execute": "guest-info"}': 
# nc -U /tmp/qga.sock
{"execute": "guest-info"}
{"return": {"version": "0.12.1", "supported_commands": [{"enabled": true, "name": "guest-set-user-password"}, {"enabled": true, "name": "guest-set-vcpus"}, {"enabled": true, "name": "guest-get-vcpus"}, {"enabled": true, "name": "guest-network-get-interfaces"}, {"enabled": true, "name": "guest-suspend-hybrid"}, {"enabled": true, "name": "guest-suspend-ram"}, {"enabled": true, "name": "guest-suspend-disk"}, {"enabled": true, "name": "guest-fstrim"}, {"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-set-time"}, {"enabled": true, "name": "guest-get-time"}, {"enabled": true, "name": "guest-ping"}, {"enabled": true, "name": "guest-sync"}, {"enabled": true, "name": "guest-sync-delimited"}]}}
{"execute":"guest-network-get-interfaces"}
{"error": {"desc": "this feature or command is not currently supported"}

4. Try each commands in the output of cmd '{"execute": "guest-info"}' above


Actual results:
It's found following commands are not supported by qemu-ga-win:
"guest-set-vcpus"
"guest-network-get-interfaces"
"guest-suspend-hybrid"
"guest-suspend-ram"
"guest-suspend-disk"
"guest-fstrim"
"guest-file-flush"
"guest-file-seek"
"guest-file-write"
"guest-file-read"
"guest-file-close"
"guest-file-open"


Expected results:
Above unsupported commands of qemu-ga-win should not be included in command {"execute": "guest-info"} output

Additional info:

Comment 2 lijin 2016-09-14 06:32:50 UTC
too late for rhel7.3,postpone to rhel7.4

Comment 3 xiagao 2017-03-24 04:15:33 UTC
test in qemu-ga-win-7.4.3-1

# nc -U /tmp/qga.sock

{"execute": "guest-info"} 
{"return": {"version": "0.12.1", "supported_commands": [{"enabled": true, "name": "guest-set-user-password"}, {"enabled": true, "name": "guest-get-vcpus"}, {"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-shutdown"}, {"enabled": true, "name": "guest-info"}, {"enabled": true, "name": "guest-set-time"}, {"enabled": true, "name": "guest-get-time"}, {"enabled": true, "name": "guest-ping"}, {"enabled": true, "name": "guest-sync"}, {"enabled": true, "name": "guest-sync-delimited"}]}}

There still are "guest-suspend-disk" and  "guest-suspend-ram".  Does qemu-ga-win support these two cmd now ?


Reassigen it.

Comment 4 Yvugenfi@redhat.com 2017-03-26 13:35:35 UTC
(In reply to xiagao from comment #3)
> test in qemu-ga-win-7.4.3-1
> 
> # nc -U /tmp/qga.sock
> 
> {"execute": "guest-info"} 
> {"return": {"version": "0.12.1", "supported_commands": [{"enabled": true,
> "name": "guest-set-user-password"}, {"enabled": true, "name":
> "guest-get-vcpus"}, {"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-shutdown"}, {"enabled": true, "name": "guest-info"},
> {"enabled": true, "name": "guest-set-time"}, {"enabled": true, "name":
> "guest-get-time"}, {"enabled": true, "name": "guest-ping"}, {"enabled":
> true, "name": "guest-sync"}, {"enabled": true, "name":
> "guest-sync-delimited"}]}}
> 
> There still are "guest-suspend-disk" and  "guest-suspend-ram".  Does
> qemu-ga-win support these two cmd now ?
> 
> 
> Reassigen it.

Yes these commands are supported only if the guests supports them. Both of these commands call "GetPwrCapabilities" Windows API
in order to check if the command is supported on the guest. The result can depend on the dynamic setting on the guest as well.

"guest-suspend-disk" calls it with mode = "GUEST_SUSPEND_MODE_DISK" 
"guest-suspend-ram" calls it with mode = "GUEST_SUSPEND_MODE_RAM"

For "guest-suspend-disk" to be supported the guest should be configured to support S4.
For "guest-suspend-ram" to be supported the guest should be configured to support S3.

Comment 5 xiagao 2017-03-27 07:02:04 UTC
Verified this case in win2012r2.
In win2012r2 guest, I enable Hibernate and execuete "guest-suspend-disk" cmd in host, the guest was shutdown and can remember the info before when i boot it again.

I did not enable S3 in guest, get the error info in host
{"execute":"guest-suspend-ram"} 
{"error": {"desc": "Guest agent command failed, error was 'suspend-to-ram not supported by OS'"}}

Comment 6 xiagao 2017-03-27 07:02:30 UTC
test in qemu-ga-win-7.4.3-1

Comment 9 errata-xmlrpc 2017-08-01 12:53:08 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://access.redhat.com/errata/RHBA-2017:2341