Index: qemu-6.1+dfsg/qapi/block-core.json =================================================================== --- qemu-6.1+dfsg.orig/qapi/block-core.json +++ qemu-6.1+dfsg/qapi/block-core.json @@ -2838,7 +2838,7 @@ 'luks', 'nbd', 'nfs', 'null-aio', 'null-co', 'nvme', 'parallels', 'preallocate', 'qcow', 'qcow2', 'qed', 'quorum', 'raw', 'rbd', { 'name': 'replication', 'if': 'defined(CONFIG_REPLICATION)' }, - 'ssh', 'throttle', 'vdi', 'vhdx', 'vmdk', 'vpc', 'vvfat' ] } + 'ssh', 'throttle', 'vdi', 'vhdx', 'vitastor', 'vmdk', 'vpc', 'vvfat' ] } ## # @BlockdevOptionsFile: @@ -3763,6 +3763,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. @@ -4134,6 +4156,7 @@ 'throttle': 'BlockdevOptionsThrottle', 'vdi': 'BlockdevOptionsGenericFormat', 'vhdx': 'BlockdevOptionsGenericFormat', + 'vitastor': 'BlockdevOptionsVitastor', 'vmdk': 'BlockdevOptionsGenericCOWFormat', 'vpc': 'BlockdevOptionsGenericFormat', 'vvfat': 'BlockdevOptionsVVFAT' @@ -4523,6 +4546,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 @@ -4718,6 +4752,7 @@ 'ssh': 'BlockdevCreateOptionsSsh', 'vdi': 'BlockdevCreateOptionsVdi', 'vhdx': 'BlockdevCreateOptionsVhdx', + 'vitastor': 'BlockdevCreateOptionsVitastor', 'vmdk': 'BlockdevCreateOptionsVmdk', 'vpc': 'BlockdevCreateOptionsVpc' } } Index: qemu-6.1+dfsg/block/meson.build =================================================================== --- qemu-6.1+dfsg.orig/block/meson.build +++ qemu-6.1+dfsg/block/meson.build @@ -78,6 +78,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-6.1+dfsg/configure =================================================================== --- qemu-6.1+dfsg.orig/configure +++ qemu-6.1+dfsg/configure @@ -375,6 +375,7 @@ trace_file="trace" spice="$default_feature" spice_protocol="auto" rbd="auto" +vitastor="auto" smartcard="auto" u2f="auto" libusb="auto" @@ -1292,6 +1293,10 @@ for opt do ;; --enable-rbd) rbd="enabled" ;; + --disable-vitastor) vitastor="disabled" + ;; + --enable-vitastor) vitastor="enabled" + ;; --disable-xfsctl) xfs="no" ;; --enable-xfsctl) xfs="yes" @@ -1916,6 +1921,7 @@ disabled with --disable-FEATURE, default spice spice spice-protocol spice-protocol rbd rados block device (rbd) + vitastor vitastor block device libiscsi iscsi support libnfs nfs support smartcard smartcard support (libcacard) @@ -5202,7 +5208,7 @@ if test "$skip_meson" = no; then -Dcapstone=$capstone -Dslirp=$slirp -Dfdt=$fdt -Dbrlapi=$brlapi \ -Dcurl=$curl -Dglusterfs=$glusterfs -Dbzip2=$bzip2 -Dlibiscsi=$libiscsi \ -Dlibnfs=$libnfs -Diconv=$iconv -Dcurses=$curses -Dlibudev=$libudev\ - -Drbd=$rbd -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse -Dlibxml2=$libxml2 \ + -Drbd=$rbd -Dvitastor=$vitastor -Dlzo=$lzo -Dsnappy=$snappy -Dlzfse=$lzfse -Dlibxml2=$libxml2 \ -Dlibdaxctl=$libdaxctl -Dlibpmem=$libpmem -Dlinux_io_uring=$linux_io_uring \ -Dgnutls=$gnutls -Dnettle=$nettle -Dgcrypt=$gcrypt -Dauth_pam=$auth_pam \ -Dzstd=$zstd -Dseccomp=$seccomp -Dvirtfs=$virtfs -Dcap_ng=$cap_ng \ Index: qemu-6.1+dfsg/meson.build =================================================================== --- qemu-6.1+dfsg.orig/meson.build +++ qemu-6.1+dfsg/meson.build @@ -729,6 +729,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 @@ -1264,6 +1284,7 @@ config_host_data.set('CONFIG_LIBNFS', li 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()) @@ -3075,6 +3096,7 @@ summary_info += {'bpf support': libbpf.f # TODO: add back protocol and server version summary_info += {'spice support': config_host.has_key('CONFIG_SPICE')} summary_info += {'rbd support': rbd.found()} +summary_info += {'vitastor support': vitastor.found()} summary_info += {'xfsctl support': config_host.has_key('CONFIG_XFS')} summary_info += {'smartcard support': cacard.found()} summary_info += {'U2F support': u2f.found()} Index: qemu-6.1+dfsg/meson_options.txt =================================================================== --- qemu-6.1+dfsg.orig/meson_options.txt +++ qemu-6.1+dfsg/meson_options.txt @@ -102,6 +102,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',