Commit 6f5e357
tree: fix generic device open failure
If scan_namespace is called with a generic device (e.g., /dev/ng0n1)
given, it fails to scan a namespace based on the generic device because
there's no entry point in /sys/block/ for the generic device.
This patch provides two helpers to change the given generic device name
to a block device name based on the instances:
ng0n1 -> nvme0n1
This patch fixes command failure:
root@vm:~/work/nvme-cli.git# nvme show-regs /dev/ng0n1
Unable to find ng0n1
get-property: Invalid argument
Signed-off-by: Minwoo Im <[email protected]>
[dwagner: also catch blkdev allocation failures]
Signed-off-by: Daniel Wagner <[email protected]>1 parent 342b186 commit 6f5e357
1 file changed
Lines changed: 38 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1864 | 1864 | | |
1865 | 1865 | | |
1866 | 1866 | | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
1867 | 1891 | | |
1868 | 1892 | | |
1869 | 1893 | | |
1870 | 1894 | | |
1871 | 1895 | | |
| 1896 | + | |
1872 | 1897 | | |
1873 | | - | |
1874 | | - | |
| 1898 | + | |
| 1899 | + | |
1875 | 1900 | | |
1876 | 1901 | | |
1877 | 1902 | | |
1878 | 1903 | | |
1879 | | - | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
1880 | 1911 | | |
1881 | 1912 | | |
1882 | 1913 | | |
1883 | 1914 | | |
| 1915 | + | |
| 1916 | + | |
1884 | 1917 | | |
1885 | 1918 | | |
1886 | 1919 | | |
1887 | 1920 | | |
| 1921 | + | |
| 1922 | + | |
1888 | 1923 | | |
1889 | 1924 | | |
1890 | 1925 | | |
| |||
0 commit comments