diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-09-16 16:25:30 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-09-16 16:25:30 +0100 |
commit | 525009d04fa49567b0eba43f9ff3c17e560dabb7 (patch) | |
tree | 90efbde052569b8bbc71cdd5611ea9ba006d75e1 /include/qemu/osdep.h | |
parent | 8ee612722dc08830761516e761dde934c3753a14 (diff) | |
parent | b18a24a9f889bcf722754046130507d744a1b0b9 (diff) |
Merge remote-tracking branch 'remotes/berrange/tags/block-odirect-pull-request' into staging
block: improve error reporting for unsupported O_DIRECT
# gpg: Signature made Wed 16 Sep 2020 10:45:48 BST
# gpg: using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg: aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF
* remotes/berrange/tags/block-odirect-pull-request:
block/file: switch to use qemu_open/qemu_create for improved errors
util: give a specific error message when O_DIRECT doesn't work
util: introduce qemu_open and qemu_create with error reporting
util: add Error object for qemu_open_internal error reporting
util: refactor qemu_open_old to split off variadic args handling
util: rename qemu_open() to qemu_open_old()
util: split off a helper for dealing with O_CLOEXEC flag
monitor: simplify functions for getting a dup'd fdset entry
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include/qemu/osdep.h')
-rw-r--r-- | include/qemu/osdep.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 412962d91a..577d9e8315 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -497,10 +497,17 @@ int qemu_madvise(void *addr, size_t len, int advice); int qemu_mprotect_rwx(void *addr, size_t size); int qemu_mprotect_none(void *addr, size_t size); -int qemu_open(const char *name, int flags, ...); +/* + * Don't introduce new usage of this function, prefer the following + * qemu_open/qemu_create that take an "Error **errp" + */ +int qemu_open_old(const char *name, int flags, ...); +int qemu_open(const char *name, int flags, Error **errp); +int qemu_create(const char *name, int flags, mode_t mode, Error **errp); int qemu_close(int fd); int qemu_unlink(const char *name); #ifndef _WIN32 +int qemu_dup_flags(int fd, int flags); int qemu_dup(int fd); #endif int qemu_lock_fd(int fd, int64_t start, int64_t len, bool exclusive); |