Dinar valeev
2015-08-17 16:14:29 UTC
From: Dinar Valeev <***@suse.com>
Don't mix platform name with distro name. PowerKVM is an IBM
distro. While platform name is OPAL.
Signed-off-by: Dinar Valeev <***@suse.com>
---
src/include/devicetreecollector.hpp | 2 +-
src/include/platformcollector.hpp | 2 +-
src/internal/sys_interface/platformcollector.cpp | 12 ++++++------
src/internal/updater.cpp | 2 +-
src/output/lscfg.cpp | 4 ++--
src/output/lsmcode.cpp | 2 +-
src/output/lsvio.cpp | 4 ++--
src/output/lsvpd.cpp | 2 +-
8 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/include/devicetreecollector.hpp b/src/include/devicetreecollector.hpp
index 3f833c4..a2fb76a 100755
--- a/src/include/devicetreecollector.hpp
+++ b/src/include/devicetreecollector.hpp
@@ -142,7 +142,7 @@ namespace lsvpd
/* Check whether we are on Opal based system */
inline bool isPlatformOPAL()
{
- return (platForm == PF_POWERKVM_HOST);
+ return (platForm == PF_OPAL);
}
/**
diff --git a/src/include/platformcollector.hpp b/src/include/platformcollector.hpp
index d95a675..a08aa89 100644
--- a/src/include/platformcollector.hpp
+++ b/src/include/platformcollector.hpp
@@ -22,7 +22,7 @@ using namespace std;
namespace lsvpd {
- enum platform { PF_NULL, PF_POWERVM_LPAR, PF_POWERKVM_HOST , PF_POWERKVM_PSERIES_GUEST, PF_ERROR };
+ enum platform { PF_NULL, PF_POWERVM_LPAR, PF_OPAL , PF_PSERIES_KVM_GUEST, PF_ERROR };
class PlatformCollector {
public:
diff --git a/src/internal/sys_interface/platformcollector.cpp b/src/internal/sys_interface/platformcollector.cpp
index a45e98c..c14f5b2 100644
--- a/src/internal/sys_interface/platformcollector.cpp
+++ b/src/internal/sys_interface/platformcollector.cpp
@@ -72,10 +72,10 @@ error:
while (getline(ifs, buf)) {
if (strstr(buf.c_str(), "PowerNV")) {
- platform_type = PF_POWERKVM_HOST;
+ platform_type = PF_OPAL;
break;
} else if (strstr(buf.c_str(), "pSeries (emulated by qemu)")) {
- platform_type = PF_POWERKVM_PSERIES_GUEST;
+ platform_type = PF_PSERIES_KVM_GUEST;
break;
} else if (strstr(buf.c_str(), "pSeries")) {
platform_type = PF_POWERVM_LPAR;
@@ -94,12 +94,12 @@ error:
{
get_platform();
switch(platform_type) {
- case PF_POWERKVM_HOST:
- return "PowerKVM Host";
+ case PF_OPAL:
+ return "OPAL";
case PF_POWERVM_LPAR:
return "PowerVM pSeries LPAR";
- case PF_POWERKVM_PSERIES_GUEST:
- return "PowerKVM pSeries Guest";
+ case PF_PSERIES_KVM_GUEST:
+ return "pSeries KVM Guest";
case PF_NULL:
case PF_ERROR:
return "Unknown";
diff --git a/src/internal/updater.cpp b/src/internal/updater.cpp
index 869c3fd..ed4f305 100755
--- a/src/internal/updater.cpp
+++ b/src/internal/updater.cpp
@@ -87,7 +87,7 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
+ case PF_PSERIES_KVM_GUEST:
case PF_ERROR:
cout<< "vpdupdate is not supported on the " << platform << endl;
return 1;
diff --git a/src/output/lscfg.cpp b/src/output/lscfg.cpp
index f9d4ae6..96b8854 100644
--- a/src/output/lscfg.cpp
+++ b/src/output/lscfg.cpp
@@ -657,7 +657,7 @@ int getCPUModelName(System *root, string &name)
* On PowerNV platform we get model name in device tree.
* On pSeries we have to rely on static file.
*/
- if (platform == PF_POWERKVM_HOST)
+ if (platform == PF_OPAL)
return OpalgetCPUModelName(root, name);
else
return getCPUModelNameFromList(root, name);
@@ -770,7 +770,7 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
+ case PF_PSERIES_KVM_GUEST:
case PF_ERROR:
cout<< argv[0] << " is not supported on the "
<< platform << endl;
diff --git a/src/output/lsmcode.cpp b/src/output/lsmcode.cpp
index ee7b5ae..24587f2 100644
--- a/src/output/lsmcode.cpp
+++ b/src/output/lsmcode.cpp
@@ -311,7 +311,7 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
+ case PF_PSERIES_KVM_GUEST:
case PF_NULL:
case PF_ERROR:
cout<< "lsmcode is not supported on the " << platform << endl;
diff --git a/src/output/lsvio.cpp b/src/output/lsvio.cpp
index 358c15e..647ef78 100644
--- a/src/output/lsvio.cpp
+++ b/src/output/lsvio.cpp
@@ -218,8 +218,8 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
- case PF_POWERKVM_HOST:
+ case PF_PSERIES_KVM_GUEST:
+ case PF_OPAL:
case PF_NULL:
case PF_ERROR:
cout<< "lsvio is not supported on the " << platform << endl;
diff --git a/src/output/lsvpd.cpp b/src/output/lsvpd.cpp
index 9406d53..185be05 100644
--- a/src/output/lsvpd.cpp
+++ b/src/output/lsvpd.cpp
@@ -403,7 +403,7 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
+ case PF_PSERIES_KVM_GUEST:
case PF_ERROR:
cout<< "lsvpd is not supported on the " << platform << " platform" << endl;
return 1;
Don't mix platform name with distro name. PowerKVM is an IBM
distro. While platform name is OPAL.
Signed-off-by: Dinar Valeev <***@suse.com>
---
src/include/devicetreecollector.hpp | 2 +-
src/include/platformcollector.hpp | 2 +-
src/internal/sys_interface/platformcollector.cpp | 12 ++++++------
src/internal/updater.cpp | 2 +-
src/output/lscfg.cpp | 4 ++--
src/output/lsmcode.cpp | 2 +-
src/output/lsvio.cpp | 4 ++--
src/output/lsvpd.cpp | 2 +-
8 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/src/include/devicetreecollector.hpp b/src/include/devicetreecollector.hpp
index 3f833c4..a2fb76a 100755
--- a/src/include/devicetreecollector.hpp
+++ b/src/include/devicetreecollector.hpp
@@ -142,7 +142,7 @@ namespace lsvpd
/* Check whether we are on Opal based system */
inline bool isPlatformOPAL()
{
- return (platForm == PF_POWERKVM_HOST);
+ return (platForm == PF_OPAL);
}
/**
diff --git a/src/include/platformcollector.hpp b/src/include/platformcollector.hpp
index d95a675..a08aa89 100644
--- a/src/include/platformcollector.hpp
+++ b/src/include/platformcollector.hpp
@@ -22,7 +22,7 @@ using namespace std;
namespace lsvpd {
- enum platform { PF_NULL, PF_POWERVM_LPAR, PF_POWERKVM_HOST , PF_POWERKVM_PSERIES_GUEST, PF_ERROR };
+ enum platform { PF_NULL, PF_POWERVM_LPAR, PF_OPAL , PF_PSERIES_KVM_GUEST, PF_ERROR };
class PlatformCollector {
public:
diff --git a/src/internal/sys_interface/platformcollector.cpp b/src/internal/sys_interface/platformcollector.cpp
index a45e98c..c14f5b2 100644
--- a/src/internal/sys_interface/platformcollector.cpp
+++ b/src/internal/sys_interface/platformcollector.cpp
@@ -72,10 +72,10 @@ error:
while (getline(ifs, buf)) {
if (strstr(buf.c_str(), "PowerNV")) {
- platform_type = PF_POWERKVM_HOST;
+ platform_type = PF_OPAL;
break;
} else if (strstr(buf.c_str(), "pSeries (emulated by qemu)")) {
- platform_type = PF_POWERKVM_PSERIES_GUEST;
+ platform_type = PF_PSERIES_KVM_GUEST;
break;
} else if (strstr(buf.c_str(), "pSeries")) {
platform_type = PF_POWERVM_LPAR;
@@ -94,12 +94,12 @@ error:
{
get_platform();
switch(platform_type) {
- case PF_POWERKVM_HOST:
- return "PowerKVM Host";
+ case PF_OPAL:
+ return "OPAL";
case PF_POWERVM_LPAR:
return "PowerVM pSeries LPAR";
- case PF_POWERKVM_PSERIES_GUEST:
- return "PowerKVM pSeries Guest";
+ case PF_PSERIES_KVM_GUEST:
+ return "pSeries KVM Guest";
case PF_NULL:
case PF_ERROR:
return "Unknown";
diff --git a/src/internal/updater.cpp b/src/internal/updater.cpp
index 869c3fd..ed4f305 100755
--- a/src/internal/updater.cpp
+++ b/src/internal/updater.cpp
@@ -87,7 +87,7 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
+ case PF_PSERIES_KVM_GUEST:
case PF_ERROR:
cout<< "vpdupdate is not supported on the " << platform << endl;
return 1;
diff --git a/src/output/lscfg.cpp b/src/output/lscfg.cpp
index f9d4ae6..96b8854 100644
--- a/src/output/lscfg.cpp
+++ b/src/output/lscfg.cpp
@@ -657,7 +657,7 @@ int getCPUModelName(System *root, string &name)
* On PowerNV platform we get model name in device tree.
* On pSeries we have to rely on static file.
*/
- if (platform == PF_POWERKVM_HOST)
+ if (platform == PF_OPAL)
return OpalgetCPUModelName(root, name);
else
return getCPUModelNameFromList(root, name);
@@ -770,7 +770,7 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
+ case PF_PSERIES_KVM_GUEST:
case PF_ERROR:
cout<< argv[0] << " is not supported on the "
<< platform << endl;
diff --git a/src/output/lsmcode.cpp b/src/output/lsmcode.cpp
index ee7b5ae..24587f2 100644
--- a/src/output/lsmcode.cpp
+++ b/src/output/lsmcode.cpp
@@ -311,7 +311,7 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
+ case PF_PSERIES_KVM_GUEST:
case PF_NULL:
case PF_ERROR:
cout<< "lsmcode is not supported on the " << platform << endl;
diff --git a/src/output/lsvio.cpp b/src/output/lsvio.cpp
index 358c15e..647ef78 100644
--- a/src/output/lsvio.cpp
+++ b/src/output/lsvio.cpp
@@ -218,8 +218,8 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
- case PF_POWERKVM_HOST:
+ case PF_PSERIES_KVM_GUEST:
+ case PF_OPAL:
case PF_NULL:
case PF_ERROR:
cout<< "lsvio is not supported on the " << platform << endl;
diff --git a/src/output/lsvpd.cpp b/src/output/lsvpd.cpp
index 9406d53..185be05 100644
--- a/src/output/lsvpd.cpp
+++ b/src/output/lsvpd.cpp
@@ -403,7 +403,7 @@ int main( int argc, char** argv )
string platform = PlatformCollector::get_platform_name();
switch (PlatformCollector::platform_type) {
- case PF_POWERKVM_PSERIES_GUEST:
+ case PF_PSERIES_KVM_GUEST:
case PF_ERROR:
cout<< "lsvpd is not supported on the " << platform << " platform" << endl;
return 1;
--
2.1.4
------------------------------------------------------------------------------
2.1.4
------------------------------------------------------------------------------