diff options
author | Joelle van Dyne <j@getutm.app> | 2021-03-15 11:03:40 -0700 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-06-25 10:54:13 +0200 |
commit | 09e20abddaf94ff27dcced1df81f69a713627a94 (patch) | |
tree | 5ee60f589f172455e6cc140d18282beef1a78931 /block/file-posix.c | |
parent | 267cd53f5fbbbf9bdf18c526144ab0bd22ab40f8 (diff) | |
download | qemu-09e20abddaf94ff27dcced1df81f69a713627a94.zip qemu-09e20abddaf94ff27dcced1df81f69a713627a94.tar.gz qemu-09e20abddaf94ff27dcced1df81f69a713627a94.tar.bz2 |
block: detect DKIOCGETBLOCKCOUNT/SIZE before use
iOS hosts do not have these defined so we fallback to the
default behaviour.
Co-authored-by: Warner Losh <imp@bsdimp.com>
Signed-off-by: Joelle van Dyne <j@getutm.app>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block/file-posix.c')
-rw-r--r-- | block/file-posix.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/file-posix.c b/block/file-posix.c index f16d987..74b8216 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2341,7 +2341,7 @@ again: } } #endif -#if defined(__APPLE__) && defined(__MACH__) +#if defined(DKIOCGETBLOCKCOUNT) && defined(DKIOCGETBLOCKSIZE) if (size == 0) { uint64_t sectors = 0; uint32_t sector_size = 0; |