1block_ss.add(genh) 2block_ss.add(files( 3 'accounting.c', 4 'aio_task.c', 5 'amend.c', 6 'backup.c', 7 'blkdebug.c', 8 'blklogwrites.c', 9 'blkverify.c', 10 'block-backend.c', 11 'block-copy.c', 12 'commit.c', 13 'copy-before-write.c', 14 'copy-on-read.c', 15 'create.c', 16 'crypto.c', 17 'dirty-bitmap.c', 18 'filter-compress.c', 19 'graph-lock.c', 20 'io.c', 21 'mirror.c', 22 'nbd.c', 23 'null.c', 24 'plug.c', 25 'preallocate.c', 26 'progress_meter.c', 27 'qapi.c', 28 'qcow2.c', 29 'qcow2-bitmap.c', 30 'qcow2-cache.c', 31 'qcow2-cluster.c', 32 'qcow2-refcount.c', 33 'qcow2-snapshot.c', 34 'qcow2-threads.c', 35 'quorum.c', 36 'raw-format.c', 37 'reqlist.c', 38 'snapshot.c', 39 'snapshot-access.c', 40 'throttle.c', 41 'throttle-groups.c', 42 'write-threshold.c', 43), zstd, zlib, gnutls) 44 45system_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c')) 46system_ss.add(files('block-ram-registrar.c')) 47 48if get_option('qcow1').allowed() 49 block_ss.add(files('qcow.c')) 50endif 51if get_option('vdi').allowed() 52 block_ss.add(files('vdi.c')) 53endif 54if get_option('vhdx').allowed() 55 block_ss.add(files( 56 'vhdx-endian.c', 57 'vhdx-log.c', 58 'vhdx.c' 59 )) 60endif 61if get_option('vmdk').allowed() 62 block_ss.add(files('vmdk.c')) 63endif 64if get_option('vpc').allowed() 65 block_ss.add(files('vpc.c')) 66endif 67if get_option('cloop').allowed() 68 block_ss.add(files('cloop.c')) 69endif 70if get_option('bochs').allowed() 71 block_ss.add(files('bochs.c')) 72endif 73if get_option('vvfat').allowed() 74 block_ss.add(files('vvfat.c')) 75endif 76if get_option('dmg').allowed() 77 block_ss.add(files('dmg.c')) 78endif 79if get_option('qed').allowed() 80 block_ss.add(files( 81 'qed-check.c', 82 'qed-cluster.c', 83 'qed-l2-cache.c', 84 'qed-table.c', 85 'qed.c', 86 )) 87endif 88if get_option('parallels').allowed() 89 block_ss.add(files('parallels.c', 'parallels-ext.c')) 90endif 91 92block_ss.add(when: 'CONFIG_WIN32', if_true: files('file-win32.c', 'win32-aio.c')) 93block_ss.add(when: 'CONFIG_POSIX', if_true: [files('file-posix.c'), coref, iokit]) 94block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c')) 95block_ss.add(when: 'CONFIG_LINUX', if_true: files('nvme.c')) 96if get_option('replication').allowed() 97 block_ss.add(files('replication.c')) 98endif 99block_ss.add(when: libaio, if_true: files('linux-aio.c')) 100block_ss.add(when: linux_io_uring, if_true: files('io_uring.c')) 101 102block_modules = {} 103 104modsrc = [] 105foreach m : [ 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')], 113] 114 if m[0].found() 115 module_ss = ss.source_set() 116 module_ss.add(when: m[0], if_true: m[2]) 117 if enable_modules 118 modsrc += module_ss.all_sources() 119 endif 120 block_modules += {m[1] : module_ss} 121 endif 122endforeach 123 124# those are not exactly regular block modules, so treat them apart 125if get_option('dmg').allowed() 126 foreach m : [ 127 [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'], 128 [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c'] 129 ] 130 if m[0].found() 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} 134 endif 135 endforeach 136endif 137 138module_block_py = find_program('../scripts/modules/module_block.py') 139module_block_h = custom_target('module_block.h', 140 output: 'module_block.h', 141 input: modsrc, 142 command: [module_block_py, '@OUTPUT0@', modsrc]) 143block_ss.add(module_block_h) 144 145wrapper_py = find_program('../scripts/block-coroutine-wrapper.py') 146block_gen_c = custom_target('block-gen.c', 147 output: 'block-gen.c', 148 input: files( 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', 155 'coroutines.h' 156 ), 157 command: [wrapper_py, '@OUTPUT@', '@INPUT@']) 158block_ss.add(block_gen_c) 159 160block_ss.add(files('stream.c')) 161 162system_ss.add(files('qapi-sysemu.c')) 163 164subdir('export') 165subdir('monitor') 166 167modules += {'block': block_modules} 168