13 'copy-before-write.c',
42 ), zstd, zlib, gnutls)
44 system_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
45 system_ss.add(files('block-ram-registrar.c'))
47 if get_option('qcow1').allowed()
48 block_ss.add(files('qcow.c'))
50 if get_option('vdi').allowed()
51 block_ss.add(files('vdi.c'))
53 if get_option('vhdx').allowed()
60 if get_option('vmdk').allowed()
61 block_ss.add(files('vmdk.c'))
63 if get_option('vpc').allowed()
64 block_ss.add(files('vpc.c'))
66 if get_option('cloop').allowed()
67 block_ss.add(files('cloop.c'))
69 if get_option('bochs').allowed()
70 block_ss.add(files('bochs.c'))
72 if get_option('vvfat').allowed()
73 block_ss.add(files('vvfat.c'))
75 if get_option('dmg').allowed()
76 block_ss.add(files('dmg.c'))
78 if get_option('qed').allowed()
87 if get_option('parallels').allowed()
88 block_ss.add(files('parallels.c', 'parallels-ext.c'))
91 if host_os == 'windows'
92 block_ss.add(files('file-win32.c', 'win32-aio.c'))
94 block_ss.add(files('file-posix.c'), coref, iokit)
96 block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
98 block_ss.add(files('nvme.c'))
100 if get_option('replication').allowed()
101 block_ss.add(files('replication.c'))
103 block_ss.add(when: libaio, if_true: files('linux-aio.c'))
104 block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
110 [blkio, 'blkio', files('blkio.c')],
111 [curl, 'curl', files('curl.c')],
112 [glusterfs, 'gluster', files('gluster.c')],
113 [libiscsi, 'iscsi', [files('iscsi.c'), libm]],
114 [libnfs, 'nfs', files('nfs.c')],
115 [libssh, 'ssh', files('ssh.c')],
116 [rbd, 'rbd', files('rbd.c')],
119 module_ss = ss.source_set()
120 module_ss.add(when: m[0], if_true: m[2])
122 modsrc += module_ss.all_sources()
124 block_modules += {m[1] : module_ss}
128 # those are not exactly regular block modules, so treat them apart
129 if get_option('dmg').allowed()
131 [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'],
132 [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c']
135 module_ss = ss.source_set()
136 module_ss.add(when: m[2], if_true: files(m[3]))
137 block_modules += {m[1] : module_ss}
142 module_block_py = find_program('../scripts/modules/module_block.py')
143 module_block_h = custom_target('module_block.h',
144 output: 'module_block.h',
146 command: [module_block_py, '@OUTPUT0@', modsrc])
147 block_ss.add(module_block_h)
149 wrapper_py = find_program('../scripts/block-coroutine-wrapper.py')
150 block_gen_c = custom_target('block-gen.c',
151 output: 'block-gen.c',
153 '../include/block/block-io.h',
154 '../include/block/dirty-bitmap.h',
155 '../include/block/block_int-io.h',
156 '../include/block/block-global-state.h',
157 '../include/sysemu/block-backend-global-state.h',
158 '../include/sysemu/block-backend-io.h',
161 command: [wrapper_py, '@OUTPUT@', '@INPUT@'])
162 block_ss.add(block_gen_c)
164 block_ss.add(files('stream.c'))
166 system_ss.add(files('qapi-sysemu.c'))
171 modules += {'block': block_modules}