Skip to content
Snippets Groups Projects
  1. Feb 09, 2018
  2. Jan 12, 2018
  3. Dec 21, 2017
  4. Dec 20, 2017
  5. Oct 18, 2017
    • Paolo Bonzini's avatar
      qemu-pr-helper: use new libmultipath API · b3f1c8c4
      Paolo Bonzini authored
      
      libmultipath has recently changed its API.  The new API supports multi-threaded
      clients better.  Unfortunately there is no backwards-compatibility, so we just
      switch to the new one.  Running QEMU compiled with the new library on the old
      library will likely crash, while doing the opposite will cause QEMU not to
      start at all (because udev, get_multipath_config and put_multipath_config
      are undefined).
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b3f1c8c4
  6. Sep 22, 2017
    • Paolo Bonzini's avatar
      scsi: add persistent reservation manager using qemu-pr-helper · 9bad2a6b
      Paolo Bonzini authored
      
      This adds a concrete subclass of pr-manager that talks to qemu-pr-helper.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9bad2a6b
    • Paolo Bonzini's avatar
      scsi: add multipath support to qemu-pr-helper · fe8fc5ae
      Paolo Bonzini authored
      
      Proper support of persistent reservation for multipath devices requires
      communication with the multipath daemon, so that the reservation is
      registered and applied when a path comes up.  The device mapper
      utilities provide a library to do so; this patch makes qemu-pr-helper.c
      detect multipath devices and, when one is found, delegate the operation
      to libmpathpersist.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fe8fc5ae
    • Paolo Bonzini's avatar
      scsi: build qemu-pr-helper · b855f8d1
      Paolo Bonzini authored
      
      Introduce a privileged helper to run persistent reservation commands.
      This lets virtual machines send persistent reservations without using
      CAP_SYS_RAWIO or out-of-tree patches.  The helper uses Unix permissions
      and SCM_RIGHTS to restrict access to processes that can access its socket
      and prove that they have an open file descriptor for a raw SCSI device.
      
      The next patch will also correct the usage of persistent reservations
      with multipath devices.
      
      It would also be possible to support for Linux's IOC_PR_* ioctls in
      the future, to support NVMe devices.  For now, however, only SCSI is
      supported.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b855f8d1
  7. Sep 21, 2017
    • Paolo Bonzini's avatar
      scsi, file-posix: add support for persistent reservation management · 7c9e5276
      Paolo Bonzini authored
      
      It is a common requirement for virtual machine to send persistent
      reservations, but this currently requires either running QEMU with
      CAP_SYS_RAWIO, or using out-of-tree patches that let an unprivileged
      QEMU bypass Linux's filter on SG_IO commands.
      
      As an alternative mechanism, the next patches will introduce a
      privileged helper to run persistent reservation commands without
      expanding QEMU's attack surface unnecessarily.
      
      The helper is invoked through a "pr-manager" QOM object, to which
      file-posix.c passes SG_IO requests for PERSISTENT RESERVE OUT and
      PERSISTENT RESERVE IN commands.  For example:
      
        $ qemu-system-x86_64
            -device virtio-scsi \
            -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
            -drive if=none,id=hd,driver=raw,file.filename=/dev/sdb,file.pr-manager=helper0
            -device scsi-block,drive=hd
      
      or:
      
        $ qemu-system-x86_64
            -device virtio-scsi \
            -object pr-manager-helper,id=helper0,path=/var/run/qemu-pr-helper.sock
            -blockdev node-name=hd,driver=raw,file.driver=host_device,file.filename=/dev/sdb,file.pr-manager=helper0
            -device scsi-block,drive=hd
      
      Multiple pr-manager implementations are conceivable and possible, though
      only one is implemented right now.  For example, a pr-manager could:
      
      - talk directly to the multipath daemon from a privileged QEMU
        (i.e. QEMU links to libmpathpersist); this makes reservation work
        properly with multipath, but still requires CAP_SYS_RAWIO
      
      - use the Linux IOC_PR_* ioctls (they require CAP_SYS_ADMIN though)
      
      - more interestingly, implement reservations directly in QEMU
        through file system locks or a shared database (e.g. sqlite)
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7c9e5276
  8. Sep 19, 2017
Loading