[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/11] block: detect DKIOCGETBLOCKCOUNT/SIZE before use
From: |
Paolo Bonzini |
Subject: |
[PATCH 10/11] block: detect DKIOCGETBLOCKCOUNT/SIZE before use |
Date: |
Thu, 24 Jun 2021 20:04:22 +0200 |
From: Joelle van Dyne <j@getutm.app>
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 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block/file-posix.c b/block/file-posix.c
index f16d987c07..74b8216077 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;
--
2.31.1
- [PATCH v5 00/11] block: file-posix queue, Paolo Bonzini, 2021/06/24
- [PATCH 01/11] file-posix: fix max_iov for /dev/sg devices, Paolo Bonzini, 2021/06/24
- [PATCH 02/11] scsi-generic: pass max_segments via max_iov field in BlockLimits, Paolo Bonzini, 2021/06/24
- [PATCH 03/11] osdep: provide ROUND_DOWN macro, Paolo Bonzini, 2021/06/24
- [PATCH 04/11] block-backend: align max_transfer to request alignment, Paolo Bonzini, 2021/06/24
- [PATCH 07/11] block: feature detection for host block support, Paolo Bonzini, 2021/06/24
- [PATCH 10/11] block: detect DKIOCGETBLOCKCOUNT/SIZE before use,
Paolo Bonzini <=
- [PATCH 09/11] block: try BSD disk size ioctls one after another, Paolo Bonzini, 2021/06/24
- [PATCH 05/11] block: add max_hw_transfer to BlockLimits, Paolo Bonzini, 2021/06/24
- [PATCH 06/11] file-posix: try BLKSECTGET on block devices too, do not round to power of 2, Paolo Bonzini, 2021/06/24
- [PATCH 08/11] block: check for sys/disk.h, Paolo Bonzini, 2021/06/24
- [PATCH 11/11] file-posix: handle EINTR during ioctl, Paolo Bonzini, 2021/06/24