]> git.proxmox.com Git - mirror_qemu.git/commit - qga/commands-win32.c
qga: Support enum names in guest-file-seek
authorEric Blake <eblake@redhat.com>
Tue, 9 Feb 2016 21:27:16 +0000 (14:27 -0700)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 25 Feb 2016 15:48:50 +0000 (09:48 -0600)
commit0b4b49387cce8358783a493004b77c1603b34b5c
treedebae516d511132c0a7155aa62148c26615666af
parent774ae4254d3910f1c94ad6ed44d14cbea0e6a2f2
qga: Support enum names in guest-file-seek

Magic constants are a pain to use, especially when we run the
risk that our choice of '1' for QGA_SEEK_CUR might differ from
the host or guest's choice of SEEK_CUR.  Better is to use an
enum value, via a qapi alternate type for back-compatibility.

With this,
 {"command":"guest-file-seek", "arguments":{"handle":1,
  "offset":0, "whence":"cur"}}
becomes a synonym for the older
 {"command":"guest-file-seek", "arguments":{"handle":1,
  "offset":0, "whence":1}}

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/commands-posix.c
qga/commands-win32.c
qga/commands.c
qga/guest-agent-core.h
qga/qapi-schema.json
tests/test-qga.c