Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite SCSI support in new package #1744

Merged
merged 1 commit into from
May 15, 2023
Merged

Rewrite SCSI support in new package #1744

merged 1 commit into from
May 15, 2023

Commits on May 15, 2023

  1. Rewrite SCSI support in new package

    The existing SCSI implementation in internal/uvm has evolved organically
    over time into what it is today. This creates unecessary difficulty when
    adding new features to the code, makes it harder to maintain, and has
    been a source of bugs.
    
    Additionally, there is a significant functional issue that the current
    scsi code tightly couples the idea of attaching a SCSI device to a VM,
    with the use/mounting of that device inside the VM. This creates
    difficulty when we want to re-use the same SCSI attachment multiple
    times, especially in the future when we will need to mount multiple
    partitions from a device.
    
    This is addressed here by largely rewriting the shim's SCSI code, and
    moving it to a new internal/uvm/scsi package. The new code features a
    main Manager type, which delegates to attachManager and mountManager for
    tracking of attachments to the VM, and mounting of devices inside the
    VM, respectively. attachManager and mountManager also rely on a set of
    interfaces for the actual backend implementation of interacting with a
    VM. This will also allow for easier testing of the scsi package in
    isolation in the future.
    
    One consequence of this change is it is no longer possible for the
    caller to request a specific UVM path for a SCSI mount. The support for
    this was already kind of a sham, because if the disk was already
    mounted, you would get back its existing mount path instead of the one
    you wanted, so the caller already had to handle that case. Additionally,
    I'm not aware of any reason why the specific location the disk is
    mounted is actually relevant. Because of these reasons, and to simplify
    the overall package interface, the mount path is determined by the scsi
    package, using a format string passed to the Manager at creation time.
    
    Signed-off-by: Kevin Parsons <kevpar@microsoft.com>
    kevpar committed May 15, 2023
    Configuration menu
    Copy the full SHA
    d98a2ef View commit details
    Browse the repository at this point in the history