Skip to content
  • Stefan Hajnoczi's avatar
    90fc91d5
    block/export: convert vhost-user-blk server to block export API · 90fc91d5
    Stefan Hajnoczi authored
    
    
    Use the new QAPI block exports API instead of defining our own QOM
    objects.
    
    This is a large change because the lifecycle of VuBlockDev needs to
    follow BlockExportDriver. QOM properties are replaced by QAPI options
    objects.
    
    VuBlockDev is renamed VuBlkExport and contains a BlockExport field.
    Several fields can be dropped since BlockExport already has equivalents.
    
    The file names and meson build integration will be adjusted in a future
    patch. libvhost-user should probably be built as a static library that
    is linked into QEMU instead of as a .c file that results in duplicate
    compilation.
    
    The new command-line syntax is:
    
      $ qemu-storage-daemon \
          --blockdev file,node-name=drive0,filename=test.img \
          --export vhost-user-blk,node-name=drive0,id=export0,unix-socket=/tmp/vhost-user-blk.sock
    
    Note that unix-socket is optional because we may wish to accept chardevs
    too in the future.
    
    Markus noted that supported address families are not explicit in the
    QAPI schema. It is unlikely that support for more address families will
    be added since file descriptor passing is required and few address
    families support it. If a new address family needs to be added, then the
    QAPI 'features' syntax can be used to advertize them.
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-id: 20200924151549.913737-12-stefanha@redhat.com
    [Skip test on big-endian host architectures because this device doesn't
    support them yet (as already mentioned in a code comment).
    --Stefan]
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    90fc91d5
    block/export: convert vhost-user-blk server to block export API
    Stefan Hajnoczi authored
    
    
    Use the new QAPI block exports API instead of defining our own QOM
    objects.
    
    This is a large change because the lifecycle of VuBlockDev needs to
    follow BlockExportDriver. QOM properties are replaced by QAPI options
    objects.
    
    VuBlockDev is renamed VuBlkExport and contains a BlockExport field.
    Several fields can be dropped since BlockExport already has equivalents.
    
    The file names and meson build integration will be adjusted in a future
    patch. libvhost-user should probably be built as a static library that
    is linked into QEMU instead of as a .c file that results in duplicate
    compilation.
    
    The new command-line syntax is:
    
      $ qemu-storage-daemon \
          --blockdev file,node-name=drive0,filename=test.img \
          --export vhost-user-blk,node-name=drive0,id=export0,unix-socket=/tmp/vhost-user-blk.sock
    
    Note that unix-socket is optional because we may wish to accept chardevs
    too in the future.
    
    Markus noted that supported address families are not explicit in the
    QAPI schema. It is unlikely that support for more address families will
    be added since file descriptor passing is required and few address
    families support it. If a new address family needs to be added, then the
    QAPI 'features' syntax can be used to advertize them.
    
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-id: 20200924151549.913737-12-stefanha@redhat.com
    [Skip test on big-endian host architectures because this device doesn't
    support them yet (as already mentioned in a code comment).
    --Stefan]
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Loading