VirtualBox

Changeset 60025 in vbox


Ignore:
Timestamp:
Mar 15, 2016 9:28:41 AM (9 years ago)
Author:
vboxsync
Message:

VBoxManage: Tweak the rawdisk fix for nvme devices to be more versatile if other devices pick up the new naming scheme. The code checks now whether the last character of the string is a digit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxInternalManage.cpp

    r60011 r60025  
    3838#include <VBox/log.h>
    3939
     40#include <iprt/ctype.h>
    4041#include <iprt/file.h>
    4142#include <iprt/getopt.h>
     
    16631664#if defined(RT_OS_LINUX)
    16641665                    /*
    1665                      * Check whether raw disk points to a nvme disk, the naming scheme
    1666                      * is slightly different there.
     1666                     * Check whether raw disk ends with a digit. In that case
     1667                     * insert a p before adding the partition number.
     1668                     * This is used for nvme devices only currently which look like
     1669                     * /dev/nvme0n1p1 but might be extended to other devices in the
     1670                     * future.
    16671671                     */
    1668                     if (rawdisk.startsWith("/dev/nvme"))
     1672                    size_t cchRawDisk = rawdisk.length();
     1673                    if (RT_C_IS_DIGIT(pszRawName[cchRawDisk - 1]))
    16691674                        RTStrAPrintf(&psz,
    16701675                                     "%sp%u",
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette