From 13640099311a6eace0c335c5f5dc39c7df0b9a23 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 14 Dec 2022 17:18:55 +0300 Subject: [PATCH] Add patches for pve-qemu-kvm 7.1 (PVE 7.3) and pve-qemu-kvm 6.2 (PVE 7.2) --- patches/pve-qemu-6.2-vitastor.patch | 169 ++++++++++++++++++++++++++++ patches/pve-qemu-7.1-vitastor.patch | 169 ++++++++++++++++++++++++++++ 2 files changed, 338 insertions(+) create mode 100644 patches/pve-qemu-6.2-vitastor.patch create mode 100644 patches/pve-qemu-7.1-vitastor.patch diff --git a/patches/pve-qemu-6.2-vitastor.patch b/patches/pve-qemu-6.2-vitastor.patch new file mode 100644 index 00000000..ad3f0e15 --- /dev/null +++ b/patches/pve-qemu-6.2-vitastor.patch @@ -0,0 +1,169 @@ +Index: qemu/block/meson.build +=================================================================== +--- qemu.orig/block/meson.build ++++ qemu/block/meson.build +@@ -91,6 +91,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: qemu/meson.build +=================================================================== +--- qemu.orig/meson.build ++++ qemu/meson.build +@@ -838,6 +838,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'), kwargs: static_kwargs) ++ 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 +@@ -1459,6 +1479,7 @@ config_host_data.set('CONFIG_LINUX_AIO', + config_host_data.set('CONFIG_LINUX_IO_URING', linux_io_uring.found()) + config_host_data.set('CONFIG_LIBPMEM', libpmem.found()) + config_host_data.set('CONFIG_RBD', rbd.found()) ++config_host_data.set('CONFIG_VITASTOR', vitastor.found()) + config_host_data.set('CONFIG_SDL', sdl.found()) + config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) + config_host_data.set('CONFIG_SECCOMP', seccomp.found()) +@@ -3424,6 +3445,7 @@ if spice_protocol.found() + summary_info += {' spice server support': spice} + endif + summary_info += {'rbd support': rbd} ++summary_info += {'vitastor support': vitastor} + summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')} + summary_info += {'smartcard support': cacard} + summary_info += {'U2F support': u2f} +Index: qemu/meson_options.txt +=================================================================== +--- qemu.orig/meson_options.txt ++++ qemu/meson_options.txt +@@ -121,6 +121,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('gtk', type : 'feature', value : 'auto', + description: 'GTK+ user interface') + option('sdl', type : 'feature', value : 'auto', +Index: qemu/qapi/block-core.json +=================================================================== +--- qemu.orig/qapi/block-core.json ++++ qemu/qapi/block-core.json +@@ -3179,7 +3179,7 @@ + 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd', + { 'name': 'replication', 'if': 'CONFIG_REPLICATION' }, + 'pbs', +- 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } ++ 'ssh', 'throttle', 'vdi', 'vhdx', 'vitastor', 'vmdk', 'vpc', 'vvfat' ] } + + ## + # @BlockdevOptionsFile: +@@ -4125,6 +4125,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. +@@ -4520,6 +4542,7 @@ + 'throttle': 'BlockdevOptionsThrottle', + 'vdi': 'BlockdevOptionsGenericFormat', + 'vhdx': 'BlockdevOptionsGenericFormat', ++ 'vitastor': 'BlockdevOptionsVitastor', + 'vmdk': 'BlockdevOptionsGenericCOWFormat', + 'vpc': 'BlockdevOptionsGenericFormat', + 'vvfat': 'BlockdevOptionsVVFAT' +@@ -4910,6 +4933,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 +@@ -5108,6 +5142,7 @@ + 'ssh': 'BlockdevCreateOptionsSsh', + 'vdi': 'BlockdevCreateOptionsVdi', + 'vhdx': 'BlockdevCreateOptionsVhdx', ++ 'vitastor': 'BlockdevCreateOptionsVitastor', + 'vmdk': 'BlockdevCreateOptionsVmdk', + 'vpc': 'BlockdevCreateOptionsVpc' + } } +Index: qemu/scripts/ci/org.centos/stream/8/x86_64/configure +=================================================================== +--- qemu.orig/scripts/ci/org.centos/stream/8/x86_64/configure ++++ qemu/scripts/ci/org.centos/stream/8/x86_64/configure +@@ -31,7 +31,7 @@ + --with-git=meson \ + --with-git-submodules=update \ + --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 \ +@@ -183,6 +183,7 @@ + --enable-opengl \ + --enable-pie \ + --enable-rbd \ ++--enable-vitastor \ + --enable-rdma \ + --enable-seccomp \ + --enable-snappy \ diff --git a/patches/pve-qemu-7.1-vitastor.patch b/patches/pve-qemu-7.1-vitastor.patch new file mode 100644 index 00000000..5fbc9ba5 --- /dev/null +++ b/patches/pve-qemu-7.1-vitastor.patch @@ -0,0 +1,169 @@ +Index: qemu/block/meson.build +=================================================================== +--- qemu.orig/block/meson.build ++++ qemu/block/meson.build +@@ -111,6 +111,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: qemu/meson.build +=================================================================== +--- qemu.orig/meson.build ++++ qemu/meson.build +@@ -967,6 +967,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'), kwargs: static_kwargs) ++ 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 +@@ -1802,6 +1822,7 @@ config_host_data.set('CONFIG_NUMA', numa + config_host_data.set('CONFIG_OPENGL', opengl.found()) + config_host_data.set('CONFIG_PROFILER', get_option('profiler')) + 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_SDL', sdl.found()) + config_host_data.set('CONFIG_SDL_IMAGE', sdl_image.found()) +@@ -3965,6 +3986,7 @@ if spice_protocol.found() + summary_info += {' spice server support': spice} + endif + 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: qemu/meson_options.txt +=================================================================== +--- qemu.orig/meson_options.txt ++++ qemu/meson_options.txt +@@ -167,6 +167,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: qemu/qapi/block-core.json +=================================================================== +--- qemu.orig/qapi/block-core.json ++++ qemu/qapi/block-core.json +@@ -3209,7 +3209,7 @@ + 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd', + { 'name': 'replication', 'if': 'CONFIG_REPLICATION' }, + 'pbs', +- 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } ++ 'ssh', 'throttle', 'vdi', 'vhdx', 'vitastor', 'vmdk', 'vpc', 'vvfat' ] } + + ## + # @BlockdevOptionsFile: +@@ -4149,6 +4149,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. +@@ -4593,6 +4615,7 @@ + 'throttle': 'BlockdevOptionsThrottle', + 'vdi': 'BlockdevOptionsGenericFormat', + 'vhdx': 'BlockdevOptionsGenericFormat', ++ 'vitastor': 'BlockdevOptionsVitastor', + 'vmdk': 'BlockdevOptionsGenericCOWFormat', + 'vpc': 'BlockdevOptionsGenericFormat', + 'vvfat': 'BlockdevOptionsVVFAT' +@@ -4985,6 +5008,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 +@@ -5182,6 +5216,7 @@ + 'ssh': 'BlockdevCreateOptionsSsh', + 'vdi': 'BlockdevCreateOptionsVdi', + 'vhdx': 'BlockdevCreateOptionsVhdx', ++ 'vitastor': 'BlockdevCreateOptionsVitastor', + 'vmdk': 'BlockdevCreateOptionsVmdk', + 'vpc': 'BlockdevCreateOptionsVpc' + } } +Index: qemu/scripts/ci/org.centos/stream/8/x86_64/configure +=================================================================== +--- qemu.orig/scripts/ci/org.centos/stream/8/x86_64/configure ++++ qemu/scripts/ci/org.centos/stream/8/x86_64/configure +@@ -31,7 +31,7 @@ + --with-git=meson \ + --with-git-submodules=update \ + --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 \ +@@ -179,6 +179,7 @@ + --enable-opengl \ + --enable-pie \ + --enable-rbd \ ++--enable-vitastor \ + --enable-rdma \ + --enable-seccomp \ + --enable-snappy \