On 03.06.21 15:37, Paolo Bonzini wrote:
From: Joelle van Dyne <j...@getutm.app>
On Darwin (iOS), there are no system level APIs for directly accessing
host block devices. We detect this at configure time.
Signed-off-by: Joelle van Dyne <j...@getutm.app>
Message-Id: <20210315180341.31638-...@getutm.app>
Signed-off-by: Paolo Bonzini <pbonz...@redhat.com>
---
block/file-posix.c | 33 ++++++++++++++++++++++-----------
meson.build | 6 +++++-
qapi/block-core.json | 10 +++++++---
3 files changed, 34 insertions(+), 15 deletions(-)
[...]
diff --git a/qapi/block-core.json b/qapi/block-core.json
index 2ea294129e..2dd41be156 100644
--- a/qapi/block-core.json
+++ b/qapi/block-core.json
@@ -897,7 +897,8 @@
'discriminator': 'driver',
'data': {
'file': 'BlockStatsSpecificFile',
- 'host_device': 'BlockStatsSpecificFile',
+ 'host_device': { 'type': 'BlockStatsSpecificFile',
+ 'if': 'defined(HAVE_HOST_BLOCK_DEVICE)' },
'nvme': 'BlockStatsSpecificNvme' } }
##
@@ -2814,7 +2815,9 @@
{ 'enum': 'BlockdevDriver',
'data': [ 'blkdebug', 'blklogwrites', 'blkreplay', 'blkverify', 'bochs',
'cloop', 'compress', 'copy-on-read', 'dmg', 'file', 'ftp', 'ftps',
- 'gluster', 'host_cdrom', 'host_device', 'http', 'https', 'iscsi',
+ 'gluster', 'host_cdrom',
+ {'name': 'host_device', 'if': 'defined(HAVE_HOST_BLOCK_DEVICE)' },
Shouldn’t this be done for host_cdrom, too? (and below)
Apart from that, looks good to me.
+ 'http', 'https', 'iscsi',
'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels',
'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd',
{ 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' },
@@ -3996,7 +3999,8 @@
'ftps': 'BlockdevOptionsCurlFtps',
'gluster': 'BlockdevOptionsGluster',
'host_cdrom': 'BlockdevOptionsFile',
- 'host_device':'BlockdevOptionsFile',
+ 'host_device': { 'type': 'BlockdevOptionsFile',
+ 'if': 'defined(HAVE_HOST_BLOCK_DEVICE)' },
'http': 'BlockdevOptionsCurlHttp',
'https': 'BlockdevOptionsCurlHttps',
'iscsi': 'BlockdevOptionsIscsi',