From 6e0ae479388582149efe39a6c35e82e32c8d5eee Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 19 Mar 2025 02:36:02 +0300 Subject: [PATCH] Add Proxmox QEMU 9.2 patch --- patches/pve-qemu-9.2-vitastor.patch | 172 ++++++++++++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 patches/pve-qemu-9.2-vitastor.patch diff --git a/patches/pve-qemu-9.2-vitastor.patch b/patches/pve-qemu-9.2-vitastor.patch new file mode 100644 index 00000000..1d093325 --- /dev/null +++ b/patches/pve-qemu-9.2-vitastor.patch @@ -0,0 +1,172 @@ +Index: pve-qemu-kvm-9.2.0/block/meson.build +=================================================================== +--- pve-qemu-kvm-9.2.0.orig/block/meson.build ++++ pve-qemu-kvm-9.2.0/block/meson.build +@@ -126,6 +126,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-9.2.0/meson.build +=================================================================== +--- pve-qemu-kvm-9.2.0.orig/meson.build ++++ pve-qemu-kvm-9.2.0/meson.build +@@ -1590,6 +1590,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 +@@ -2478,6 +2498,7 @@ endif + config_host_data.set('CONFIG_OPENGL', opengl.found()) + config_host_data.set('CONFIG_PLUGIN', get_option('plugins')) + 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_RELOCATABLE', get_option('relocatable')) + config_host_data.set('CONFIG_SAFESTACK', get_option('safe_stack')) +@@ -4789,6 +4810,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-9.2.0/meson_options.txt +=================================================================== +--- pve-qemu-kvm-9.2.0.orig/meson_options.txt ++++ pve-qemu-kvm-9.2.0/meson_options.txt +@@ -200,6 +200,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-9.2.0/qapi/block-core.json +=================================================================== +--- pve-qemu-kvm-9.2.0.orig/qapi/block-core.json ++++ pve-qemu-kvm-9.2.0/qapi/block-core.json +@@ -3481,7 +3481,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' }, +@@ -4592,6 +4592,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. +@@ -5054,6 +5076,7 @@ + 'throttle': 'BlockdevOptionsThrottle', + 'vdi': 'BlockdevOptionsGenericFormat', + 'vhdx': 'BlockdevOptionsGenericFormat', ++ 'vitastor': 'BlockdevOptionsVitastor', + 'virtio-blk-vfio-pci': + { 'type': 'BlockdevOptionsVirtioBlkVfioPci', + 'if': 'CONFIG_BLKIO' }, +@@ -5501,6 +5524,20 @@ + '*encrypt' : 'RbdEncryptionCreateOptions' } } + + ## ++# @BlockdevCreateOptionsVitastor: ++# ++# Driver specific image creation options for Vitastor. ++# ++# @location: Where to store the new image file. This location cannot ++# point to a snapshot. ++# ++# @size: Size of the virtual disk in bytes ++## ++{ 'struct': 'BlockdevCreateOptionsVitastor', ++ 'data': { 'location': 'BlockdevOptionsVitastor', ++ 'size': 'size' } } ++ ++## + # @BlockdevVmdkSubformat: + # + # Subformat options for VMDK images +@@ -5722,6 +5759,7 @@ + 'ssh': 'BlockdevCreateOptionsSsh', + 'vdi': 'BlockdevCreateOptionsVdi', + 'vhdx': 'BlockdevCreateOptionsVhdx', ++ 'vitastor': 'BlockdevCreateOptionsVitastor', + 'vmdk': 'BlockdevCreateOptionsVmdk', + 'vpc': 'BlockdevCreateOptionsVpc' + } } +Index: pve-qemu-kvm-9.2.0/scripts/meson-buildoptions.sh +=================================================================== +--- pve-qemu-kvm-9.2.0.orig/scripts/meson-buildoptions.sh ++++ pve-qemu-kvm-9.2.0/scripts/meson-buildoptions.sh +@@ -174,6 +174,7 @@ meson_options_help() { + printf "%s\n" ' qga-vss build QGA VSS support (broken with MinGW)' + printf "%s\n" ' qpl Query Processing Library support' + 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" ' rust Rust support' +@@ -455,6 +456,8 @@ _meson_option_parse() { + --disable-qpl) printf "%s" -Dqpl=disabled ;; + --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-relocatable) printf "%s" -Drelocatable=true ;;