46 ), zstd, zlib, gnutls)
48 softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
49 softmmu_ss.add(files('block-ram-registrar.c'))
51 if get_option('qcow1').allowed()
52 block_ss.add(files('qcow.c'))
54 if get_option('vdi').allowed()
55 block_ss.add(files('vdi.c'))
57 if get_option('cloop').allowed()
58 block_ss.add(files('cloop.c'))
60 if get_option('bochs').allowed()
61 block_ss.add(files('bochs.c'))
63 if get_option('vvfat').allowed()
64 block_ss.add(files('vvfat.c'))
66 if get_option('dmg').allowed()
67 block_ss.add(files('dmg.c'))
69 if get_option('qed').allowed()
78 if get_option('parallels').allowed()
79 block_ss.add(files('parallels.c', 'parallels-ext.c'))
82 block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
83 block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
84 block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
85 block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
86 if not get_option('replication').disabled()
87 block_ss.add(files('replication.c'))
89 block_ss.add(when: libaio, if_true: files('linux-aio.c'))
90 block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
96 [blkio, 'blkio', files('blkio.c')],
97 [curl, 'curl', files('curl.c')],
98 [glusterfs, 'gluster', files('gluster.c')],
99 [libiscsi, 'iscsi', [files('iscsi.c'), libm]],
100 [libnfs, 'nfs', files('nfs.c')],
101 [libssh, 'ssh', files('ssh.c')],
102 [rbd, 'rbd', files('rbd.c')],
105 module_ss = ss.source_set()
106 module_ss.add(when: m[0], if_true: m[2])
108 modsrc += module_ss.all_sources()
110 block_modules += {m[1] : module_ss}
114 # those are not exactly regular block modules, so treat them apart
115 if get_option('dmg').allowed()
117 [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'],
118 [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c']
121 module_ss = ss.source_set()
122 module_ss.add(when: m[2], if_true: files(m[3]))
123 block_modules += {m[1] : module_ss}
128 module_block_py = find_program('../scripts/modules/module_block.py')
129 module_block_h = custom_target('module_block.h',
130 output: 'module_block.h',
132 command: [module_block_py, '@OUTPUT0@', modsrc])
133 block_ss.add(module_block_h)
135 wrapper_py = find_program('../scripts/block-coroutine-wrapper.py')
136 block_gen_c = custom_target('block-gen.c',
137 output: 'block-gen.c',
139 '../include/block/block-io.h',
140 '../include/block/block-global-state.h',
141 '../include/sysemu/block-backend-io.h',
144 command: [wrapper_py, '@OUTPUT@', '@INPUT@'])
145 block_ss.add(block_gen_c)
147 block_ss.add(files('stream.c'))
149 softmmu_ss.add(files('qapi-sysemu.c'))
154 modules += {'block': block_modules}