]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block: detect DKIOCGETBLOCKCOUNT/SIZE before use
authorJoelle van Dyne <j@getutm.app>
Mon, 15 Mar 2021 18:03:40 +0000 (11:03 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 25 Jun 2021 08:54:13 +0000 (10:54 +0200)
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>
block/file-posix.c

index f16d987c070a28e8d6cffc49dc9c5e2fad3fe3ec..74b8216077e0ee0303cfabab60ceb52f80f71e62 100644 (file)
@@ -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;