| 1 | block_ss.add(genh) |
| 2 | block_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 | 'preallocate.c', |
| 25 | 'progress_meter.c', |
| 26 | 'qapi.c', |
| 27 | 'qcow2.c', |
| 28 | 'qcow2-bitmap.c', |
| 29 | 'qcow2-cache.c', |
| 30 | 'qcow2-cluster.c', |
| 31 | 'qcow2-refcount.c', |
| 32 | 'qcow2-snapshot.c', |
| 33 | 'qcow2-threads.c', |
| 34 | 'quorum.c', |
| 35 | 'raw-format.c', |
| 36 | 'reqlist.c', |
| 37 | 'snapshot.c', |
| 38 | 'snapshot-access.c', |
| 39 | 'throttle.c', |
| 40 | 'throttle-groups.c', |
| 41 | 'write-threshold.c', |
| 42 | ), zstd, zlib) |
| 43 | |
| 44 | system_ss.add(when: 'CONFIG_TCG', if_true: files('blkreplay.c')) |
| 45 | system_ss.add(files('block-ram-registrar.c')) |
| 46 | |
| 47 | if get_option('qcow1').allowed() |
| 48 | block_ss.add(files('qcow.c')) |
| 49 | endif |
| 50 | if get_option('vdi').allowed() |
| 51 | block_ss.add(files('vdi.c')) |
| 52 | endif |
| 53 | if get_option('vhdx').allowed() |
| 54 | block_ss.add(files( |
| 55 | 'vhdx-endian.c', |
| 56 | 'vhdx-log.c', |
| 57 | 'vhdx.c' |
| 58 | )) |
| 59 | endif |
| 60 | if get_option('vmdk').allowed() |
| 61 | block_ss.add(files('vmdk.c')) |
| 62 | endif |
| 63 | if get_option('vpc').allowed() |
| 64 | block_ss.add(files('vpc.c')) |
| 65 | endif |
| 66 | if get_option('cloop').allowed() |
| 67 | block_ss.add(files('cloop.c')) |
| 68 | endif |
| 69 | if get_option('bochs').allowed() |
| 70 | block_ss.add(files('bochs.c')) |
| 71 | endif |
| 72 | if get_option('vvfat').allowed() |
| 73 | block_ss.add(files('vvfat.c')) |
| 74 | endif |
| 75 | if get_option('dmg').allowed() |
| 76 | block_ss.add(files('dmg.c')) |
| 77 | endif |
| 78 | if get_option('qed').allowed() |
| 79 | block_ss.add(files( |
| 80 | 'qed-check.c', |
| 81 | 'qed-cluster.c', |
| 82 | 'qed-l2-cache.c', |
| 83 | 'qed-table.c', |
| 84 | 'qed.c', |
| 85 | )) |
| 86 | endif |
| 87 | if get_option('parallels').allowed() |
| 88 | block_ss.add(files('parallels.c', 'parallels-ext.c')) |
| 89 | endif |
| 90 | |
| 91 | if host_os == 'windows' |
| 92 | block_ss.add(files('file-win32.c', 'win32-aio.c')) |
| 93 | else |
| 94 | block_ss.add(files('file-posix.c'), coref, iokit) |
| 95 | endif |
| 96 | block_ss.add(when: libiscsi, if_true: files('iscsi-opts.c')) |
| 97 | if host_os == 'linux' |
| 98 | block_ss.add(files('nvme.c')) |
| 99 | endif |
| 100 | if get_option('replication').allowed() |
| 101 | block_ss.add(files('replication.c')) |
| 102 | endif |
| 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')) |
| 105 | |
| 106 | block_modules = {} |
| 107 | |
| 108 | modsrc = [] |
| 109 | foreach m : [ |
| 110 | [blkio, 'blkio', files('blkio.c')], |
| 111 | [curl, 'curl', files('curl.c')], |
| 112 | [libiscsi, 'iscsi', files('iscsi.c')], |
| 113 | [libnfs, 'nfs', files('nfs.c')], |
| 114 | [libssh, 'ssh', files('ssh.c')], |
| 115 | [rbd, 'rbd', files('rbd.c')], |
| 116 | ] |
| 117 | if m[0].found() |
| 118 | module_ss = ss.source_set() |
| 119 | module_ss.add(when: m[0], if_true: m[2]) |
| 120 | if enable_modules |
| 121 | modsrc += m[2] |
| 122 | endif |
| 123 | block_modules += {m[1] : module_ss} |
| 124 | endif |
| 125 | endforeach |
| 126 | |
| 127 | # those are not exactly regular block modules, so treat them apart |
| 128 | if get_option('dmg').allowed() |
| 129 | foreach m : [ |
| 130 | [liblzfse, 'dmg-lzfse', liblzfse, 'dmg-lzfse.c'], |
| 131 | [libbzip2, 'dmg-bz2', [glib, libbzip2], 'dmg-bz2.c'] |
| 132 | ] |
| 133 | if m[0].found() |
| 134 | module_ss = ss.source_set() |
| 135 | module_ss.add(when: m[2], if_true: files(m[3])) |
| 136 | block_modules += {m[1] : module_ss} |
| 137 | endif |
| 138 | endforeach |
| 139 | endif |
| 140 | |
| 141 | module_block_py = find_program('../scripts/modules/module_block.py') |
| 142 | module_block_h = custom_target('module_block.h', |
| 143 | output: 'module_block.h', |
| 144 | input: modsrc, |
| 145 | command: [module_block_py, '@OUTPUT0@', modsrc]) |
| 146 | block_ss.add(module_block_h) |
| 147 | |
| 148 | wrapper_py = find_program('../scripts/block-coroutine-wrapper.py') |
| 149 | block_gen_c = custom_target('block-gen.c', |
| 150 | output: 'block-gen.c', |
| 151 | input: files( |
| 152 | '../include/block/block-io.h', |
| 153 | '../include/block/dirty-bitmap.h', |
| 154 | '../include/block/block_int-io.h', |
| 155 | '../include/block/block-global-state.h', |
| 156 | '../include/system/block-backend-global-state.h', |
| 157 | '../include/system/block-backend-io.h', |
| 158 | 'coroutines.h' |
| 159 | ), |
| 160 | command: [wrapper_py, '@OUTPUT@', '@INPUT@']) |
| 161 | block_ss.add(block_gen_c) |
| 162 | |
| 163 | block_ss.add(files('stream.c')) |
| 164 | |
| 165 | system_ss.add(files('qapi-system.c')) |
| 166 | |
| 167 | subdir('export') |
| 168 | subdir('monitor') |
| 169 | |
| 170 | modules += {'block': block_modules} |