lvm: disable error channel for vgs/pvs commands.

Having an error channel can result in unwanted devices, e.g.:
"/dev//dev/mapper/test: read failed after 0 of 4096 at 0: Input/output error"
This commit is contained in:
Andrius Štikonas 2017-09-04 19:55:08 +01:00
parent 4a39e453dc
commit 0badfebcb1
2 changed files with 2 additions and 2 deletions

View File

@ -299,7 +299,7 @@ QString LvmDevice::getField(const QString& fieldName, const QString& vgName)
if (!vgName.isEmpty()) {
args << vgName;
}
ExternalCommand cmd(QStringLiteral("lvm"), args);
ExternalCommand cmd(QStringLiteral("lvm"), args, QProcess::ProcessChannelMode::SeparateChannels);
if (cmd.run(-1) && cmd.exitCode() == 0) {
return cmd.output().trimmed();
}

View File

@ -242,7 +242,7 @@ QString lvm2_pv::getpvField(const QString& fieldName, const QString& deviceNode
if (!deviceNode.isEmpty()) {
args << deviceNode;
}
ExternalCommand cmd(QStringLiteral("lvm"), args);
ExternalCommand cmd(QStringLiteral("lvm"), args, QProcess::ProcessChannelMode::SeparateChannels);
if (cmd.run(-1) && cmd.exitCode() == 0) {
return cmd.output().trimmed();
}