diff --git a/patches/pve-qemu-8.1-vitastor.patch b/patches/pve-qemu-8.1-vitastor.patch new file mode 100644 index 00000000..82482c25 --- /dev/null +++ b/patches/pve-qemu-8.1-vitastor.patch @@ -0,0 +1,190 @@ +Index: pve-qemu-kvm-8.1.2/block/meson.build +=================================================================== +--- pve-qemu-kvm-8.1.2.orig/block/meson.build ++++ pve-qemu-kvm-8.1.2/block/meson.build +@@ -123,6 +123,7 @@ foreach m : [ + [libnfs, 'nfs', files('nfs.c')], + [libssh, 'ssh', files('ssh.c')], + [rbd, 'rbd', files('rbd.c')], ++ [vitastor, 'vitastor', files('vitastor.c')], + ] + if m[0].found() + module_ss = ss.source_set() +Index: pve-qemu-kvm-8.1.2/meson.build +=================================================================== +--- pve-qemu-kvm-8.1.2.orig/meson.build ++++ pve-qemu-kvm-8.1.2/meson.build +@@ -1303,6 +1303,26 @@ if not get_option('rbd').auto() or have_ + endif + endif + ++vitastor = not_found ++if not get_option('vitastor').auto() or have_block ++ libvitastor_client = cc.find_library('vitastor_client', has_headers: ['vitastor_c.h'], ++ required: get_option('vitastor')) ++ if libvitastor_client.found() ++ if cc.links(''' ++ #include ++ int main(void) { ++ vitastor_c_create_qemu(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ++ return 0; ++ }''', dependencies: libvitastor_client) ++ vitastor = declare_dependency(dependencies: libvitastor_client) ++ elif get_option('vitastor').enabled() ++ error('could not link libvitastor_client') ++ else ++ warning('could not link libvitastor_client, disabling') ++ endif ++ endif ++endif ++ + glusterfs = not_found + glusterfs_ftruncate_has_stat = false + glusterfs_iocb_has_stat = false +@@ -2123,6 +2143,7 @@ if numa.found() + endif + config_host_data.set('CONFIG_OPENGL', opengl.found()) + config_host_data.set('CONFIG_RBD', rbd.found()) ++config_host_data.set('CONFIG_VITASTOR', vitastor.found()) + config_host_data.set('CONFIG_RDMA', rdma.found()) + config_host_data.set('CONFIG_SAFESTACK', get_option('safe_stack')) + config_host_data.set('CONFIG_SDL', sdl.found()) +@@ -4298,6 +4319,7 @@ summary_info += {'fdt support': fd + summary_info += {'libcap-ng support': libcap_ng} + summary_info += {'bpf support': libbpf} + summary_info += {'rbd support': rbd} ++summary_info += {'vitastor support': vitastor} + summary_info += {'smartcard support': cacard} + summary_info += {'U2F support': u2f} + summary_info += {'libusb': libusb} +Index: pve-qemu-kvm-8.1.2/meson_options.txt +=================================================================== +--- pve-qemu-kvm-8.1.2.orig/meson_options.txt ++++ pve-qemu-kvm-8.1.2/meson_options.txt +@@ -186,6 +186,8 @@ option('lzo', type : 'feature', value : + description: 'lzo compression support') + option('rbd', type : 'feature', value : 'auto', + description: 'Ceph block device driver') ++option('vitastor', type : 'feature', value : 'auto', ++ description: 'Vitastor block device driver') + option('opengl', type : 'feature', value : 'auto', + description: 'OpenGL support') + option('rdma', type : 'feature', value : 'auto', +Index: pve-qemu-kvm-8.1.2/qapi/block-core.json +=================================================================== +--- pve-qemu-kvm-8.1.2.orig/qapi/block-core.json ++++ pve-qemu-kvm-8.1.2/qapi/block-core.json +@@ -3403,7 +3403,7 @@ + 'raw', 'rbd', + { 'name': 'replication', 'if': 'CONFIG_REPLICATION' }, + 'pbs', +- 'ssh', 'throttle', 'vdi', 'vhdx', ++ 'ssh', 'throttle', 'vdi', 'vhdx', 'vitastor', + { 'name': 'virtio-blk-vfio-pci', 'if': 'CONFIG_BLKIO' }, + { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' }, + { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' }, +@@ -4465,6 +4465,28 @@ + '*server': ['InetSocketAddressBase'] } } + + ## ++# @BlockdevOptionsVitastor: ++# ++# Driver specific block device options for vitastor ++# ++# @image: Image name ++# @inode: Inode number ++# @pool: Pool ID ++# @size: Desired image size in bytes ++# @config-path: Path to Vitastor configuration ++# @etcd-host: etcd connection address(es) ++# @etcd-prefix: etcd key/value prefix ++## ++{ 'struct': 'BlockdevOptionsVitastor', ++ 'data': { '*inode': 'uint64', ++ '*pool': 'uint64', ++ '*size': 'uint64', ++ '*image': 'str', ++ '*config-path': 'str', ++ '*etcd-host': 'str', ++ '*etcd-prefix': 'str' } } ++ ++## + # @ReplicationMode: + # + # An enumeration of replication modes. +@@ -4923,6 +4945,7 @@ + 'throttle': 'BlockdevOptionsThrottle', + 'vdi': 'BlockdevOptionsGenericFormat', + 'vhdx': 'BlockdevOptionsGenericFormat', ++ 'vitastor': 'BlockdevOptionsVitastor', + 'virtio-blk-vfio-pci': + { 'type': 'BlockdevOptionsVirtioBlkVfioPci', + 'if': 'CONFIG_BLKIO' }, +@@ -5360,6 +5383,17 @@ + '*encrypt' : 'RbdEncryptionCreateOptions' } } + + ## ++# @BlockdevCreateOptionsVitastor: ++# ++# Driver specific image creation options for Vitastor. ++# ++# @size: Size of the virtual disk in bytes ++## ++{ 'struct': 'BlockdevCreateOptionsVitastor', ++ 'data': { 'location': 'BlockdevOptionsVitastor', ++ 'size': 'size' } } ++ ++## + # @BlockdevVmdkSubformat: + # + # Subformat options for VMDK images +@@ -5581,6 +5615,7 @@ + 'ssh': 'BlockdevCreateOptionsSsh', + 'vdi': 'BlockdevCreateOptionsVdi', + 'vhdx': 'BlockdevCreateOptionsVhdx', ++ 'vitastor': 'BlockdevCreateOptionsVitastor', + 'vmdk': 'BlockdevCreateOptionsVmdk', + 'vpc': 'BlockdevCreateOptionsVpc' + } } +Index: pve-qemu-kvm-8.1.2/scripts/ci/org.centos/stream/8/x86_64/configure +=================================================================== +--- pve-qemu-kvm-8.1.2.orig/scripts/ci/org.centos/stream/8/x86_64/configure ++++ pve-qemu-kvm-8.1.2/scripts/ci/org.centos/stream/8/x86_64/configure +@@ -30,7 +30,7 @@ + --with-suffix="qemu-kvm" \ + --firmwarepath=/usr/share/qemu-firmware \ + --target-list="x86_64-softmmu" \ +---block-drv-rw-whitelist="qcow2,raw,file,host_device,nbd,iscsi,rbd,blkdebug,luks,null-co,nvme,copy-on-read,throttle,gluster" \ ++--block-drv-rw-whitelist="qcow2,raw,file,host_device,nbd,iscsi,rbd,vitastor,blkdebug,luks,null-co,nvme,copy-on-read,throttle,gluster" \ + --audio-drv-list="" \ + --block-drv-ro-whitelist="vmdk,vhdx,vpc,https,ssh" \ + --with-coroutine=ucontext \ +@@ -176,6 +176,7 @@ + --enable-opengl \ + --enable-pie \ + --enable-rbd \ ++--enable-vitastor \ + --enable-rdma \ + --enable-seccomp \ + --enable-snappy \ +Index: pve-qemu-kvm-8.1.2/scripts/meson-buildoptions.sh +=================================================================== +--- pve-qemu-kvm-8.1.2.orig/scripts/meson-buildoptions.sh ++++ pve-qemu-kvm-8.1.2/scripts/meson-buildoptions.sh +@@ -153,6 +153,7 @@ meson_options_help() { + printf "%s\n" ' qed qed image format support' + printf "%s\n" ' qga-vss build QGA VSS support (broken with MinGW)' + printf "%s\n" ' rbd Ceph block device driver' ++ printf "%s\n" ' vitastor Vitastor block device driver' + printf "%s\n" ' rdma Enable RDMA-based migration' + printf "%s\n" ' replication replication support' + printf "%s\n" ' sdl SDL user interface' +@@ -416,6 +417,8 @@ _meson_option_parse() { + --disable-qom-cast-debug) printf "%s" -Dqom_cast_debug=false ;; + --enable-rbd) printf "%s" -Drbd=enabled ;; + --disable-rbd) printf "%s" -Drbd=disabled ;; ++ --enable-vitastor) printf "%s" -Dvitastor=enabled ;; ++ --disable-vitastor) printf "%s" -Dvitastor=disabled ;; + --enable-rdma) printf "%s" -Drdma=enabled ;; + --disable-rdma) printf "%s" -Drdma=disabled ;; + --enable-replication) printf "%s" -Dreplication=enabled ;; diff --git a/patches/qemu-8.1-vitastor.patch b/patches/qemu-8.1-vitastor.patch new file mode 100644 index 00000000..376741de --- /dev/null +++ b/patches/qemu-8.1-vitastor.patch @@ -0,0 +1,190 @@ +diff --git a/block/meson.build b/block/meson.build +index 529fc172c6..d542dc0609 100644 +--- a/block/meson.build ++++ b/block/meson.build +@@ -110,6 +110,7 @@ foreach m : [ + [libnfs, 'nfs', files('nfs.c')], + [libssh, 'ssh', files('ssh.c')], + [rbd, 'rbd', files('rbd.c')], ++ [vitastor, 'vitastor', files('vitastor.c')], + ] + if m[0].found() + module_ss = ss.source_set() +diff --git a/meson.build b/meson.build +index a9c4f28247..8496cf13f1 100644 +--- a/meson.build ++++ b/meson.build +@@ -1303,6 +1303,26 @@ if not get_option('rbd').auto() or have_block + endif + endif + ++vitastor = not_found ++if not get_option('vitastor').auto() or have_block ++ libvitastor_client = cc.find_library('vitastor_client', has_headers: ['vitastor_c.h'], ++ required: get_option('vitastor')) ++ if libvitastor_client.found() ++ if cc.links(''' ++ #include ++ int main(void) { ++ vitastor_c_create_qemu(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); ++ return 0; ++ }''', dependencies: libvitastor_client) ++ vitastor = declare_dependency(dependencies: libvitastor_client) ++ elif get_option('vitastor').enabled() ++ error('could not link libvitastor_client') ++ else ++ warning('could not link libvitastor_client, disabling') ++ endif ++ endif ++endif ++ + glusterfs = not_found + glusterfs_ftruncate_has_stat = false + glusterfs_iocb_has_stat = false +@@ -2119,6 +2139,7 @@ if numa.found() + endif + config_host_data.set('CONFIG_OPENGL', opengl.found()) + config_host_data.set('CONFIG_RBD', rbd.found()) ++config_host_data.set('CONFIG_VITASTOR', vitastor.found()) + config_host_data.set('CONFIG_RDMA', rdma.found()) + config_host_data.set('CONFIG_SAFESTACK', get_option('safe_stack')) + config_host_data.set('CONFIG_SDL', sdl.found()) +@@ -4286,6 +4307,7 @@ summary_info += {'fdt support': fdt_opt == 'disabled' ? false : fdt_opt} + summary_info += {'libcap-ng support': libcap_ng} + summary_info += {'bpf support': libbpf} + summary_info += {'rbd support': rbd} ++summary_info += {'vitastor support': vitastor} + summary_info += {'smartcard support': cacard} + summary_info += {'U2F support': u2f} + summary_info += {'libusb': libusb} +diff --git a/meson_options.txt b/meson_options.txt +index ae6d8f469d..e3d9f8404d 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -186,6 +186,8 @@ option('lzo', type : 'feature', value : 'auto', + description: 'lzo compression support') + option('rbd', type : 'feature', value : 'auto', + description: 'Ceph block device driver') ++option('vitastor', type : 'feature', value : 'auto', ++ description: 'Vitastor block device driver') + option('opengl', type : 'feature', value : 'auto', + description: 'OpenGL support') + option('rdma', type : 'feature', value : 'auto', +diff --git a/qapi/block-core.json b/qapi/block-core.json +index 2b1d493d6e..90673fdbdc 100644 +--- a/qapi/block-core.json ++++ b/qapi/block-core.json +@@ -3146,7 +3146,7 @@ + 'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', + 'raw', 'rbd', + { 'name': 'replication', 'if': 'CONFIG_REPLICATION' }, +- 'ssh', 'throttle', 'vdi', 'vhdx', ++ 'ssh', 'throttle', 'vdi', 'vhdx', 'vitastor', + { 'name': 'virtio-blk-vfio-pci', 'if': 'CONFIG_BLKIO' }, + { 'name': 'virtio-blk-vhost-user', 'if': 'CONFIG_BLKIO' }, + { 'name': 'virtio-blk-vhost-vdpa', 'if': 'CONFIG_BLKIO' }, +@@ -4196,6 +4196,28 @@ + '*key-secret': 'str', + '*server': ['InetSocketAddressBase'] } } + ++## ++# @BlockdevOptionsVitastor: ++# ++# Driver specific block device options for vitastor ++# ++# @image: Image name ++# @inode: Inode number ++# @pool: Pool ID ++# @size: Desired image size in bytes ++# @config-path: Path to Vitastor configuration ++# @etcd-host: etcd connection address(es) ++# @etcd-prefix: etcd key/value prefix ++## ++{ 'struct': 'BlockdevOptionsVitastor', ++ 'data': { '*inode': 'uint64', ++ '*pool': 'uint64', ++ '*size': 'uint64', ++ '*image': 'str', ++ '*config-path': 'str', ++ '*etcd-host': 'str', ++ '*etcd-prefix': 'str' } } ++ + ## + # @ReplicationMode: + # +@@ -4654,6 +4676,7 @@ + 'throttle': 'BlockdevOptionsThrottle', + 'vdi': 'BlockdevOptionsGenericFormat', + 'vhdx': 'BlockdevOptionsGenericFormat', ++ 'vitastor': 'BlockdevOptionsVitastor', + 'virtio-blk-vfio-pci': + { 'type': 'BlockdevOptionsVirtioBlkVfioPci', + 'if': 'CONFIG_BLKIO' }, +@@ -5089,6 +5112,17 @@ + '*cluster-size' : 'size', + '*encrypt' : 'RbdEncryptionCreateOptions' } } + ++## ++# @BlockdevCreateOptionsVitastor: ++# ++# Driver specific image creation options for Vitastor. ++# ++# @size: Size of the virtual disk in bytes ++## ++{ 'struct': 'BlockdevCreateOptionsVitastor', ++ 'data': { 'location': 'BlockdevOptionsVitastor', ++ 'size': 'size' } } ++ + ## + # @BlockdevVmdkSubformat: + # +@@ -5311,6 +5345,7 @@ + 'ssh': 'BlockdevCreateOptionsSsh', + 'vdi': 'BlockdevCreateOptionsVdi', + 'vhdx': 'BlockdevCreateOptionsVhdx', ++ 'vitastor': 'BlockdevCreateOptionsVitastor', + 'vmdk': 'BlockdevCreateOptionsVmdk', + 'vpc': 'BlockdevCreateOptionsVpc' + } } +diff --git a/scripts/ci/org.centos/stream/8/x86_64/configure b/scripts/ci/org.centos/stream/8/x86_64/configure +index d02b09a4b9..f0b5fbfef3 100755 +--- a/scripts/ci/org.centos/stream/8/x86_64/configure ++++ b/scripts/ci/org.centos/stream/8/x86_64/configure +@@ -30,7 +30,7 @@ + --with-suffix="qemu-kvm" \ + --firmwarepath=/usr/share/qemu-firmware \ + --target-list="x86_64-softmmu" \ +---block-drv-rw-whitelist="qcow2,raw,file,host_device,nbd,iscsi,rbd,blkdebug,luks,null-co,nvme,copy-on-read,throttle,gluster" \ ++--block-drv-rw-whitelist="qcow2,raw,file,host_device,nbd,iscsi,rbd,vitastor,blkdebug,luks,null-co,nvme,copy-on-read,throttle,gluster" \ + --audio-drv-list="" \ + --block-drv-ro-whitelist="vmdk,vhdx,vpc,https,ssh" \ + --with-coroutine=ucontext \ +@@ -176,6 +176,7 @@ + --enable-opengl \ + --enable-pie \ + --enable-rbd \ ++--enable-vitastor \ + --enable-rdma \ + --enable-seccomp \ + --enable-snappy \ +diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh +index d7020af175..94958eb6fa 100644 +--- a/scripts/meson-buildoptions.sh ++++ b/scripts/meson-buildoptions.sh +@@ -153,6 +153,7 @@ meson_options_help() { + printf "%s\n" ' qed qed image format support' + printf "%s\n" ' qga-vss build QGA VSS support (broken with MinGW)' + printf "%s\n" ' rbd Ceph block device driver' ++ printf "%s\n" ' vitastor Vitastor block device driver' + printf "%s\n" ' rdma Enable RDMA-based migration' + printf "%s\n" ' replication replication support' + printf "%s\n" ' sdl SDL user interface' +@@ -416,6 +417,8 @@ _meson_option_parse() { + --disable-qom-cast-debug) printf "%s" -Dqom_cast_debug=false ;; + --enable-rbd) printf "%s" -Drbd=enabled ;; + --disable-rbd) printf "%s" -Drbd=disabled ;; ++ --enable-vitastor) printf "%s" -Dvitastor=enabled ;; ++ --disable-vitastor) printf "%s" -Dvitastor=disabled ;; + --enable-rdma) printf "%s" -Drdma=enabled ;; + --disable-rdma) printf "%s" -Drdma=disabled ;; + --enable-replication) printf "%s" -Dreplication=enabled ;;