hw/i386/vmport: Set EAX to -1 on failed and unsupported commands
commit0342ee761ef27a0def476dab3e284f924b3c801e
authorLiran Alon <liran.alon@oracle.com>
Thu, 12 Mar 2020 16:54:19 +0000 (12 18:54 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 10 Jun 2020 16:09:44 +0000 (10 12:09 -0400)
tree3c72df6987377ef170bf9e28c764162188e710d3
parentb889212973dabee119a1ab21326a27fc51b88d6d
hw/i386/vmport: Set EAX to -1 on failed and unsupported commands

This is used as a signal for VMware Tools to know if a command it
attempted to invoke, failed or is unsupported. As a result, VMware Tools
will either report failure to user or fallback to another backdoor command
in attempt to perform some operation.

A few examples:
* open-vm-tools TimeSyncReadHost() function fallbacks to
CMD_GETTIMEFULL command when CMD_GETTIMEFULL_WITH_LAG
fails/unsupported.
* open-vm-tools Hostinfo_NestingSupported() function verifies
EAX != -1 to check for success.
* open-vm-tools Hostinfo_VCPUInfoBackdoor() functions checks
if reserved-bit is set to indicate command is unimplemented.

Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
Signed-off-by: Liran Alon <liran.alon@oracle.com>
Message-Id: <20200312165431.82118-5-liran.alon@oracle.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/core/machine.c
hw/i386/vmport.c