47 ), zstd, zlib, gnutls)
49 softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c'))
50 softmmu_ss.add(files('block-ram-registrar.c'))
52 if get_option('qcow1').allowed()
53 block_ss.add(files('qcow.c'))
55 if get_option('vdi').allowed()
56 block_ss.add(files('vdi.c'))
58 if get_option('cloop').allowed()
59 block_ss.add(files('cloop.c'))
61 if get_option('bochs').allowed()
62 block_ss.add(files('bochs.c'))
64 if get_option('vvfat').allowed()
65 block_ss.add(files('vvfat.c'))
67 if get_option('dmg').allowed()
68 block_ss.add(files('dmg.c'))
70 if get_option('qed').allowed()
79 if get_option('parallels').allowed()
80 block_ss.add(files('parallels.c', 'parallels-ext.c'))
83 block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c'))
84 block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit])
85 block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c'))
86 block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c'))
87 if not get_option('replication').disabled()
88 block_ss.add(files('replication.c'))
90 block_ss.add(when: libaio, if_true: files('linux-aio.c'))
91 block_ss.add(when: linux_io_uring, if_true: files('io_uring.c'))
97 [blkio, 'blkio', files('blkio.c')],
98 [curl, 'curl', files('curl.c')],
99 [glusterfs, 'gluster', files('gluster.c')],
100 [libiscsi, 'iscsi', [files('iscsi.c'), libm]],
101 [libnfs, 'nfs', files('nfs.c')],
102 [libssh, 'ssh', files('ssh.c')],
103 [rbd, 'rbd', files('rbd.c')],
106 module_ss = ss.source_set()
107 module_ss.add(when: m[0], if_true: m[2])
109 modsrc += module_ss.all_sources()
111 block_modules += {m[1] : module_ss}
115 # those are not exactly regular block modules, so treat them apart
116 if get_option('dmg').allowed()
118 [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'],
119 [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c']
122 module_ss = ss.source_set()
123 module_ss.add(when: m[2], if_true: files(m[3]))
124 block_modules += {m[1] : module_ss}
129 module_block_py = find_program('../scripts/modules/module_block.py')
130 module_block_h = custom_target('module_block.h',
131 output: 'module_block.h',
133 command: [module_block_py, '@OUTPUT0@', modsrc])
134 block_ss.add(module_block_h)
136 wrapper_py = find_program('../scripts/block-coroutine-wrapper.py')
137 block_gen_c = custom_target('block-gen.c',
138 output: 'block-gen.c',
140 '../include/block/block-io.h',
141 '../include/block/dirty-bitmap.h',
142 '../include/block/block_int-io.h',
143 '../include/block/block-global-state.h',
144 '../include/sysemu/block-backend-global-state.h',
145 '../include/sysemu/block-backend-io.h',
148 command: [wrapper_py, '@OUTPUT@', '@INPUT@'])
149 block_ss.add(block_gen_c)
151 block_ss.add(files('stream.c'))
153 softmmu_ss.add(files('qapi-sysemu.c'))
158 modules += {'block': block_modules}