diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2016-02-25 17:33:19 +0000 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2016-02-25 17:33:19 +0000 |
| commit | 67ef811ed1452efe9d60c4baa20c8ef6ea0cfe87 (patch) | |
| tree | cf93350db027542b1a64756f8bb0b683d5837173 /qga/commands-posix.c | |
| parent | 0c6940d086f39bbf725d96104abe46da87429cb6 (diff) | |
| parent | e55eb806dbb97f53794b0c2f86983d34f6696845 (diff) | |
| download | focaccia-qemu-67ef811ed1452efe9d60c4baa20c8ef6ea0cfe87.tar.gz focaccia-qemu-67ef811ed1452efe9d60c4baa20c8ef6ea0cfe87.zip | |
Merge remote-tracking branch 'remotes/mdroth/tags/qga-pull-2016-02-25-tag' into staging
qemu-ga patch queue for 2.6 * fix w32 build breakage when VSS enabled * fix up wchar handling in guest-set-user-password * fix re-install handling for w32 MSI installer * add w32 support for guest-get-vcpus * add support for enums in guest-file-seek SEEK params instead of relying on platform-specific integer values # gpg: Signature made Thu 25 Feb 2016 16:59:13 GMT using RSA key ID F108B584 # gpg: Good signature from "Michael Roth <flukshun@gmail.com>" # gpg: aka "Michael Roth <mdroth@utexas.edu>" # gpg: aka "Michael Roth <mdroth@linux.vnet.ibm.com>" * remotes/mdroth/tags/qga-pull-2016-02-25-tag: qga: fix w32 breakage due to missing osdep.h includes qga: check utf8-to-utf16 conversion qga: fix off-by-one length check qga: use wide-chars constants for wchar_t comparisons qga: use size_t for wcslen() return value qga: use more idiomatic qemu-style eol operators qga: implement the guest-get-vcpus for windows qemu-ga: Fixed minor version switch issue qga: Support enum names in guest-file-seek Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'qga/commands-posix.c')
| -rw-r--r-- | qga/commands-posix.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 9589b2d634..9f51faea80 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -550,31 +550,24 @@ GuestFileWrite *qmp_guest_file_write(int64_t handle, const char *buf_b64, } struct GuestFileSeek *qmp_guest_file_seek(int64_t handle, int64_t offset, - int64_t whence_code, Error **errp) + GuestFileWhence *whence_code, + Error **errp) { GuestFileHandle *gfh = guest_file_handle_find(handle, errp); GuestFileSeek *seek_data = NULL; FILE *fh; int ret; int whence; + Error *err = NULL; if (!gfh) { return NULL; } /* We stupidly exposed 'whence':'int' in our qapi */ - switch (whence_code) { - case QGA_SEEK_SET: - whence = SEEK_SET; - break; - case QGA_SEEK_CUR: - whence = SEEK_CUR; - break; - case QGA_SEEK_END: - whence = SEEK_END; - break; - default: - error_setg(errp, "invalid whence code %"PRId64, whence_code); + whence = ga_parse_whence(whence_code, &err); + if (err) { + error_propagate(errp, err); return NULL; } |