Skip to content

Calculate image sizes for the Product string using MiB/KiB units#853

Merged
rdmark merged 1 commit intodevelopfrom
rdmark-issue852
Sep 30, 2022
Merged

Calculate image sizes for the Product string using MiB/KiB units#853
rdmark merged 1 commit intodevelopfrom
rdmark-issue852

Conversation

@rdmark
Copy link
Copy Markdown
Member

@rdmark rdmark commented Sep 22, 2022

Addresses #852

@rdmark rdmark marked this pull request as ready for review September 22, 2022 18:51
@rdmark rdmark requested a review from uweseimet September 22, 2022 18:51
@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark What's the incentive for this change? I'm not necessarily oppsing it, but would like to ask why you think that using MB is better than MiB.

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Sep 22, 2022

@uweseimet As discussed in the issue ticket, this idea here is to align with what a modern Linux or Windows (etc.) OS considers a megabyte. F.e. the example in the ticket is that if you create a 104857600 byte image file, which the host Linux OS calculates as 100 megabytes, RaSCSI reports it as a 104MB image when attached.

@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark Wouldn't this mean that a ZIP 100 medium is reported as 105 or so nstead of 100? Same for old drives with well-known capacity. Wouldn't this be confusing?

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Sep 22, 2022

@uweseimet For the Iomega ZIP example in particular, the references that we found is that the 100MB disk capacity was 100663296 bytes which translates to 96MiB I believe, or ~100.66 MB. (Although Iomega messed with the partitioning scheme over time and had several revisions of proprietary headers that decreased the actual capacity a bit.) Anyhow, the counter argument for a proprietary format like this is that you'd likely use a custom Product string to get the drivers to recognize the storage device, so users won't see the default "SCSI HD XXX MB" Product string anyways. See attached screenshot for an illustration.

The primary usecase for when the default Product string is shown, is when a user has created a blank non-removable drive image from scratch. In these cases, I think it makes sense to use this MiB calculation for the capacity.

sizes

@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark Well, there are probably pros and cons for this change. One of the other reviewers should decide ;-).

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Sep 22, 2022

@uweseimet Fair enough, that's your prerogative.

BTW, do you know the motivation behind having drive size calculated in the Product string like this in the first place? It seems redundant, while adding a bit of complexity to the code.

We don't do it for Generic Removable devices for instance.

@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark The motivation is that a product name change during operation would violate the standard. There are removable media drives that support different media types with different capacities. Different media would result in different names, even though the drive is still the same.

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Sep 22, 2022

@uweseimet This makes sense with regards to Removable device names being static. I'm still curious why we spell out drive sizes for SCSI HD devices though. There are other ways for RaSCSI (or the host OS) to tell you how large a drive image is, so it seems unnecessary to spell it out in the Product name. Just my two cents.

@uweseimet
Copy link
Copy Markdown
Contributor

uweseimet commented Sep 22, 2022

@rdmark There are drivers that (e.g. when booting) report the drives found (SCSI ID, LUN and name), and it is convenient to have the (static) capacity in the default name assigned by rascsi. Otherwise, if you use the default names, all drives would have the same names, and you do not know based on the boot message if the drive setup is correct.

@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark By the way, if somebody is using a tool that remembers its setup based on drive names (such tools exist) this PR is a breaking change. I don't use such a tool, so I would not be affected, though ;-).

@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Sep 22, 2022

@uweseimet If this PR gets merged I'll make sure to mention this in the release notes.

@uweseimet
Copy link
Copy Markdown
Contributor

@rdmark Sounds good.

@akuker
Copy link
Copy Markdown
Member

akuker commented Sep 30, 2022

If I'm the tie breaker, I agree with changing to MiB. I believe MiB would be more appropriate.

Could we put a link to https://en.wikipedia.org/wiki/Binary_prefix at the bottom of the page or something with an explanation? To be honest, I had to google the difference between them.

@rdmark rdmark merged commit 71e070b into develop Sep 30, 2022
@rdmark rdmark deleted the rdmark-issue852 branch September 30, 2022 02:31
@rdmark
Copy link
Copy Markdown
Member Author

rdmark commented Sep 30, 2022

I think users will instinctively know what it means. In 99% of cases MB is short for MiB, except for in early computer marketing lingo.

uweseimet added a commit that referenced this pull request Oct 1, 2022
commit 20ae4b3
Merge: 7c1ae8e 78bab77
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Sat Oct 1 10:44:39 2022 +0200

    Merge branch 'develop' into feature_memory_management

commit 7c1ae8e
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Sat Oct 1 10:35:27 2022 +0200

    Merged localizer changes from develop

commit cf19ecf
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Sat Oct 1 10:17:50 2022 +0200

    Merged changes from feature_more_unit_tests

commit 600e5b7
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Sat Oct 1 10:00:20 2022 +0200

    Formatting update

commit 303ea88
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Sat Oct 1 09:57:30 2022 +0200

    Improved transparency of geometry data

commit 78bab77
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Fri Sep 30 19:20:19 2022 -0700

    Swedish localization update 2022-09 (#874)

    * Swedish localization updates

    * Use LUN for compactness

commit 05e0a78
Merge: 71e070b 1938a8b
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Fri Sep 30 18:57:51 2022 -0700

    Merge pull request #851 from akuker/rdmark-rename-host-bridge

    Rename the Host Bridge INQUIRY product to RASCSI BRIDGE

commit dee929f
Author: Uwe Seimet <Uwe.Seimet@seimet.de>
Date:   Fri Sep 30 10:45:12 2022 +0200

    Fixed memory issue reported by valgrind

commit 71e070b
Merge: 3c8e7db 922c3b2
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Thu Sep 29 19:31:42 2022 -0700

    Merge pull request #853 from akuker/rdmark-issue852

    Calculate image sizes for the Product string using MiB/KiB units

commit 3c8e7db
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Tue Sep 27 17:38:34 2022 -0700

    Allow the selecting of target dir when uploading or downloading files (#867)

    Uses a single endpoint for downloading files
    Adds a select field to pick target dir for both download and upload forms
    Moves the Macproxy/Netatalk helptext into the helptext blocks, and the related status messages down into the page footer

commit 3ac3abb
Merge: b04962d 70c073e
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Tue Sep 27 07:52:24 2022 -0700

    Merge pull request #868 from nucleogenic/webui-pytest-warn-on-delete-failures

    Display a warning when Pytest fixtures fail to delete a file

commit 70c073e
Author: nucleogenic <nr@nucleogenic.com>
Date:   Tue Sep 27 15:39:58 2022 +0100

    Display a warning when Pytest fixtures fail to delete a file

commit b04962d
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Tue Sep 27 06:09:18 2022 -0700

    Swedish translations in localizer.cpp (#865)

    * Swedish translations

    * Fix typos

commit 5da3d6c
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Mon Sep 26 17:44:41 2022 -0700

    Introduce info.html template and use it to render detailed info (#863)

    new:
    - new templates to render structured info contents in
    - get_diskinfo() class method that calls disktype and returns the results
    - /diskinfo endpoint in the Flask app that renders the results from get_diskinfo()

    changed:
    - /logs/show and /scsi/info endpoints in the Flask app render in templates
    - Now using the "RaSCSI Reloaded Control Page" header to function as the link back to the homepage (instead of the github project) which is in line with how most webapps work
    - Removed the center style for "Attached!" to allow the ? button to be placed on the same line
    - Remove individual device info, and introduced show all device info in a template

commit edbaaf6
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Sun Sep 25 17:37:28 2022 -0700

    Web UI tweaks: Detaching removable devices; SCSI-1 drive profiles (#854)

    * Display the Detach action for injected removable media

    * Flag three DEC drives as SCSI-1

commit ed12853
Merge: 016a616 75b0994
Author: nucleogenic <nr@nucleogenic.com>
Date:   Mon Sep 26 00:18:06 2022 +0100

    Merge pull request #846 from nucleogenic/webui-json-responses

    JSON API and test suite for web UI

commit 75b0994
Author: nucleogenic <nr@nucleogenic.com>
Date:   Sun Sep 25 18:15:35 2022 +0100

    Add missing asserts to API tests

commit a142af5
Author: nucleogenic <nr@nucleogenic.com>
Date:   Sat Sep 24 03:10:01 2022 +0100

    Improve organisation of tests

commit 6f7e611
Author: nucleogenic <nr@nucleogenic.com>
Date:   Sat Sep 24 03:10:11 2022 +0100

    Add missing dev dependency flake8

commit f8e5870
Author: nucleogenic <nr@nucleogenic.com>
Date:   Sat Sep 24 00:20:49 2022 +0100

    Update comments

commit 663de06
Author: nucleogenic <nr@nucleogenic.com>
Date:   Thu Sep 22 21:41:12 2022 +0100

    Added tests for extracting .sit and .7z archive formats

commit 65c2286
Author: nucleogenic <nr@nucleogenic.com>
Date:   Tue Sep 20 01:56:22 2022 +0100

    Fix shell exit issue in web/start.sh

commit 8062e5f
Author: nucleogenic <nr@nucleogenic.com>
Date:   Tue Sep 20 00:33:47 2022 +0100

    Updates to allow tests to run against a remote RaSCSI instance

commit 1a15c4c
Author: nucleogenic <nr@nucleogenic.com>
Date:   Mon Sep 19 17:00:59 2022 +0100

    Expose env info to API clients

commit 0e6147e
Author: nucleogenic <nr@nucleogenic.com>
Date:   Mon Sep 19 14:21:31 2022 +0100

    Setup pytest, flake8, black + add API tests

commit 26aa5eb
Author: nucleogenic <nr@nucleogenic.com>
Date:   Mon Sep 19 14:20:12 2022 +0100

    Update Dockerfiles to allow testing of additional RaSCSI web UI features

commit 6ad436c
Author: nucleogenic <nr@nucleogenic.com>
Date:   Mon Sep 19 14:18:53 2022 +0100

    Add --headless option to easyinstall.sh, enable web auth by default on standalone web UI installs

commit dd40d71
Author: nucleogenic <nr@nucleogenic.com>
Date:   Mon Sep 19 14:16:34 2022 +0100

    Fix issue causing stale reservations after loading a config

commit fb8f306
Author: nucleogenic <nr@nucleogenic.com>
Date:   Mon Sep 26 00:00:18 2022 +0100

    Implement response generator for HTML and JSON requests

    Supporting updates to web.py and templates

commit 1e9a7d2
Author: nucleogenic <nr@nucleogenic.com>
Date:   Thu Sep 22 01:20:22 2022 +0100

    Move flattening of file type lists to template layer

commit 4ef2e20
Author: nucleogenic <nr@nucleogenic.com>
Date:   Sat Sep 10 02:58:47 2022 +0100

    Update get_supported_locales to return a JSON serializable result

commit edf65a8
Author: nucleogenic <nr@nucleogenic.com>
Date:   Sat Sep 10 02:58:35 2022 +0100

    Update RaCtlCmds methods to return JSON serializable results

commit 922c3b2
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Thu Sep 22 11:50:47 2022 -0700

    Calculate image sizes for the Product string using MiB/KiB units

commit 1938a8b
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Thu Sep 22 09:03:36 2022 -0700

    Rename the Host Bridge INQUIRY product to RASCSI BRIDGE, as expected by the RASETHER.SYS driver.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants