Changeset View
Changeset View
Standalone View
Standalone View
src/core/raid/softwareraid.cpp
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Line(s) | |||||
78 | } | 78 | } | ||
79 | 79 | | |||
80 | qint64 SoftwareRAID::partitionSize(QString &partitionPath) const | 80 | qint64 SoftwareRAID::partitionSize(QString &partitionPath) const | ||
81 | { | 81 | { | ||
82 | Q_UNUSED(partitionPath) | 82 | Q_UNUSED(partitionPath) | ||
83 | return 0; | 83 | return 0; | ||
84 | } | 84 | } | ||
85 | 85 | | |||
86 | bool SoftwareRAID::growArray(Report &report, const QStringList &devices) | 86 | bool SoftwareRAID::growArray(Report &report, const QStringList &devices, const QString &name) | ||
87 | { | 87 | { | ||
88 | Q_UNUSED(report) | 88 | //add device from list | ||
89 | Q_UNUSED(devices) | 89 | QString path = QStringLiteral("/dev/") + name; | ||
90 | for (const QString &p : qAsConst(devices)) { | ||||
91 | QStringList args = {path,QStringLiteral("--add")} | ||||
cjlcarvalho: Missing semicolon | |||||
cjlcarvalho: Use
```
mdadm --manage --add path args
```
instead of
```
mdadm path --add args
``` | |||||
92 | | ||||
93 | args << p; | ||||
94 | ExternalCommand cmd(report, QStringLiteral("mdadm"), args); | ||||
95 | | ||||
96 | cmd.write(QByteArrayLiteral("y")); | ||||
97 | | ||||
98 | if (!cmd.run(-1) || cmd.exitCode() != 0) | ||||
90 | return false; | 99 | return false; | ||
cjlcarvalho: Please indent | |||||
100 | //array to be grown after adding after every device | ||||
101 | } | ||||
102 | return true; | ||||
91 | } | 103 | } | ||
92 | 104 | | |||
93 | bool SoftwareRAID::shrinkArray(Report &report, const QStringList &devices) | 105 | bool SoftwareRAID::shrinkArray(Report &report, const QStringList &devices) | ||
94 | { | 106 | { | ||
95 | Q_UNUSED(report) | 107 | Q_UNUSED(report) | ||
96 | Q_UNUSED(devices) | 108 | Q_UNUSED(devices) | ||
97 | return false; | 109 | return false; | ||
98 | } | 110 | } | ||
▲ Show 20 Lines • Show All 506 Lines • Show Last 20 Lines |
Missing semicolon