43 ), zstd, zlib, gnutls)
45 system_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
46 system_ss.add(files('block-ram-registrar.c'))
48 if get_option('qcow1').allowed()
49 block_ss.add(files('qcow.c'))
51 if get_option('vdi').allowed()
52 block_ss.add(files('vdi.c'))
54 if get_option('vhdx').allowed()
61 if get_option('vmdk').allowed()
62 block_ss.add(files('vmdk.c'))
64 if get_option('vpc').allowed()
65 block_ss.add(files('vpc.c'))
67 if get_option('cloop').allowed()
68 block_ss.add(files('cloop.c'))
70 if get_option('bochs').allowed()
71 block_ss.add(files('bochs.c'))
73 if get_option('vvfat').allowed()
74 block_ss.add(files('vvfat.c'))
76 if get_option('dmg').allowed()
77 block_ss.add(files('dmg.c'))
79 if get_option('qed').allowed()
88 if get_option('parallels').allowed()
89 block_ss.add(files('parallels.c', 'parallels-ext.c'))
92 block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
93 block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
94 block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
95 block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
96 if get_option('replication').allowed()
97 block_ss.add(files('replication.c'))
99 block_ss.add(when: libaio, if_true: files('linux-aio.c'))
100 block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
106 [blkio, 'blkio', files('blkio.c')],
107 [curl, 'curl', files('curl.c')],
108 [glusterfs, 'gluster', files('gluster.c')],
109 [libiscsi, 'iscsi', [files('iscsi.c'), libm]],
110 [libnfs, 'nfs', files('nfs.c')],
111 [libssh, 'ssh', files('ssh.c')],
112 [rbd, 'rbd', files('rbd.c')],
115 module_ss = ss.source_set()
116 module_ss.add(when: m[0], if_true: m[2])
118 modsrc += module_ss.all_sources()
120 block_modules += {m[1] : module_ss}
124 # those are not exactly regular block modules, so treat them apart
125 if get_option('dmg').allowed()
127 [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'],
128 [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c']
131 module_ss = ss.source_set()
132 module_ss.add(when: m[2], if_true: files(m[3]))
133 block_modules += {m[1] : module_ss}
138 module_block_py = find_program('../scripts/modules/module_block.py')
139 module_block_h = custom_target('module_block.h',
140 output: 'module_block.h',
142 command: [module_block_py, '@OUTPUT0@', modsrc])
143 block_ss.add(module_block_h)
145 wrapper_py = find_program('../scripts/block-coroutine-wrapper.py')
146 block_gen_c = custom_target('block-gen.c',
147 output: 'block-gen.c',
149 '../include/block/block-io.h',
150 '../include/block/dirty-bitmap.h',
151 '../include/block/block_int-io.h',
152 '../include/block/block-global-state.h',
153 '../include/sysemu/block-backend-global-state.h',
154 '../include/sysemu/block-backend-io.h',
157 command: [wrapper_py, '@OUTPUT@', '@INPUT@'])
158 block_ss.add(block_gen_c)
160 block_ss.add(files('stream.c'))
162 system_ss.add(files('qapi-sysemu.c'))
167 modules += {'block': block_modules}