Hello community,
here is the log from the commit of package ppc64-diag for openSUSE:Factory checked in at 2014-03-11 17:28:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ppc64-diag (Old)
and /work/SRC/openSUSE:Factory/.ppc64-diag.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ppc64-diag"
Changes:
--------
--- /work/SRC/openSUSE:Factory/ppc64-diag/ppc64-diag.changes 2014-01-30 12:52:25.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.ppc64-diag.new/ppc64-diag.changes 2014-03-11 17:28:24.000000000 +0100
@@ -1,0 +2,6 @@
+Mon Mar 10 12:41:50 UTC 2014 - jloeser@suse.com
+
+- version update to 2.6.3 (BNC#867346, FATE#315459)
+ No upstream changelog provided
+
+-------------------------------------------------------------------
Old:
----
ppc64-diag-2.6.2.tar.gz
New:
----
ppc64-diag-2.6.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ppc64-diag.spec ++++++
--- /var/tmp/diff_new_pack.TK6wPo/_old 2014-03-11 17:28:25.000000000 +0100
+++ /var/tmp/diff_new_pack.TK6wPo/_new 2014-03-11 17:28:25.000000000 +0100
@@ -18,7 +18,7 @@
Url: http://sourceforge.net/projects/linux-diag/files/ppc64-diag
Name: ppc64-diag
-Version: 2.6.2
+Version: 2.6.3
Release: 0
Summary: Linux for Power Platform Diagnostics
License: EPL-1.0
++++++ ppc64-diag-2.6.2.tar.gz -> ppc64-diag-2.6.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/common/platform.c new/ppc64-diag-2.6.3/common/platform.c
--- old/ppc64-diag-2.6.2/common/platform.c 1970-01-01 01:00:00.000000000 +0100
+++ new/ppc64-diag-2.6.3/common/platform.c 2014-03-07 10:15:01.000000000 +0100
@@ -0,0 +1,51 @@
+/**
+ * @file platform.c
+ *
+ * Copyright (C) 2014 IBM Corporation
+ * See 'COPYRIGHT' for License of this code
+ *
+ * @author Aruna Balakrishnaiah
+ */
+
+#include
+#include
+
+#include "platform.h"
+
+#define LENGTH 512
+
+const char *__platform_name[] = {
+ "Unknown",
+ "PowerKVM Host",
+ "PowerKVM pSeries Guest",
+ "PowerVM pSeries LPAR",
+ /* Add new platforms name here */
+};
+
+int
+get_platform(void)
+{
+ int rc = PLATFORM_UNKNOWN;
+ FILE *fp;
+ char line[LENGTH];
+
+ if((fp = fopen(PLATFORM_FILE, "r")) == NULL)
+ return rc;
+
+ while (fgets(line, LENGTH, fp)) {
+ if (strstr(line, "PowerNV")) {
+ rc = PLATFORM_POWERKVM;
+ break;
+ } else if (strstr(line, "pSeries (emulated by qemu)")) {
+ rc = PLATFORM_POWERKVM_GUEST;
+ break;
+ } else if (strstr(line, "pSeries")) {
+ rc = PLATFORM_PSERIES_LPAR;
+ /* catch model for PowerNV guest */
+ continue;
+ }
+ }
+
+ fclose(fp);
+ return rc;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/common/platform.h new/ppc64-diag-2.6.3/common/platform.h
--- old/ppc64-diag-2.6.2/common/platform.h 1970-01-01 01:00:00.000000000 +0100
+++ new/ppc64-diag-2.6.3/common/platform.h 2014-03-07 10:15:01.000000000 +0100
@@ -0,0 +1,31 @@
+/**
+ * Copyright (C) 2014 IBM Corporation
+ * See 'COPYRIGHT' for License of this code.
+ */
+
+#ifndef PLATFORM_H
+#define PLARFORM_H
+
+#define PLATFORM_FILE "/proc/cpuinfo"
+
+enum {
+ PLATFORM_UNKNOWN = 0,
+ PLATFORM_POWERKVM,
+ PLATFORM_POWERKVM_GUEST,
+ PLATFORM_PSERIES_LPAR,
+ /* Add new platforms here */
+ PLATFORM_MAX,
+};
+
+extern const char *__platform_name[];
+
+extern int get_platform(void);
+
+static inline const char * __power_platform_name(int platform)
+{
+ if (platform > PLATFORM_UNKNOWN && platform < PLATFORM_MAX)
+ return __platform_name[platform];
+
+ return __platform_name[PLATFORM_UNKNOWN];
+}
+#endif
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/diags/diag_encl.c new/ppc64-diag-2.6.3/diags/diag_encl.c
--- old/ppc64-diag-2.6.2/diags/diag_encl.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/diags/diag_encl.c 2014-03-07 10:15:01.000000000 +0100
@@ -19,6 +19,7 @@
#include "encl_util.h"
#include "diag_encl.h"
+#include "platform.c"
static struct option long_options[] = {
{"cmp_prev", no_argument, NULL, 'c'},
@@ -488,11 +489,19 @@
main(int argc, char *argv[])
{
int failure = 0, option_index, rc;
+ int platform = 0;
char path[128];
DIR *edir, *sdir;
struct dirent *sdirent, *edirent;
struct dev_vpd *diagnosed = NULL;
+ platform = get_platform();
+ if (platform != PLATFORM_PSERIES_LPAR) {
+ fprintf(stderr, "%s is not supported on the %s platform\n",
+ argv[0], __power_platform_name(platform));
+ return -1;
+ }
+
memset(&cmd_opts, 0, sizeof(cmd_opts));
for (;;) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/diags/encl_led.c new/ppc64-diag-2.6.3/diags/encl_led.c
--- old/ppc64-diag-2.6.2/diags/encl_led.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/diags/encl_led.c 2014-03-07 10:15:01.000000000 +0100
@@ -14,6 +14,7 @@
#include "encl_util.h"
#include "encl_led.h"
+#include "platform.c"
static struct {
char *mtm;
@@ -160,6 +161,7 @@
main(int argc, char **argv)
{
int rc, option_index, i;
+ int platform = 0;
int list_opt = 0, verbose = 0, found = 0;
int fault_setting = LED_SAME, ident_setting = LED_SAME;
const char *enclosure = NULL, *component = NULL;
@@ -167,6 +169,14 @@
struct dev_vpd vpd;
progname = argv[0];
+
+ platform = get_platform();
+ if (platform != PLATFORM_PSERIES_LPAR) {
+ fprintf(stderr, "%s is not supported on the %s platform\n",
+ argv[0], __power_platform_name(platform));
+ exit(1);
+ }
+
for (;;) {
option_index = 0;
rc = getopt_long(argc, argv, "f:hi:lvV", long_options,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/ela/Makefile new/ppc64-diag-2.6.3/ela/Makefile
--- old/ppc64-diag-2.6.2/ela/Makefile 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/ela/Makefile 2014-03-07 10:15:01.000000000 +0100
@@ -4,7 +4,7 @@
include ../rules.mk
-CMDS = explain_syslog add_regex
+CMDS = explain_syslog add_regex syslog_to_svclog
CATALOG = message_catalog/cxgb3 message_catalog/e1000e \
message_catalog/exceptions message_catalog/reporters \
message_catalog/gpfs
@@ -12,13 +12,6 @@
message_catalog/with_regex/e1000e \
message_catalog/with_regex/gpfs
MANPAGES = doc/explain_syslog.8.gz doc/syslog_to_svclog.8.gz
-ARCH := $(shell uname -p)
-ifeq ($(ARCH), ppc)
- CMDS += syslog_to_svclog
-endif
-ifeq ($(ARCH), ppc64)
- CMDS += syslog_to_svclog
-endif
COMMON_OBJS = rr.tab.o lex.rr.o ev.tab.o lex.ev.o date.o
ES_OBJS = explain_syslog.o catalogs.o $(COMMON_OBJS)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/ela/add_regex.cpp new/ppc64-diag-2.6.3/ela/add_regex.cpp
--- old/ppc64-diag-2.6.2/ela/add_regex.cpp 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/ela/add_regex.cpp 2014-03-07 10:15:01.000000000 +0100
@@ -4,6 +4,9 @@
#include
#include <iostream>
#include "catalogs.h"
+extern "C" {
+#include "platform.c"
+}
static const char *progname;
@@ -17,8 +20,17 @@
{
const char *catalog_dir = ELA_CATALOG_DIR;
int c;
+ int platform = 0;
progname = argv[0];
+
+ platform = get_platform();
+ if (platform != PLATFORM_PSERIES_LPAR) {
+ cerr << progname << ": is not supported on the " <<
+ __power_platform_name(platform) << " platform" << endl;
+
+ exit(1);
+ }
opterr = 0;
while ((c = getopt(argc, argv, "C:")) != -1) {
switch (c) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/ela/explain_syslog.cpp new/ppc64-diag-2.6.3/ela/explain_syslog.cpp
--- old/ppc64-diag-2.6.2/ela/explain_syslog.cpp 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/ela/explain_syslog.cpp 2014-03-07 10:15:01.000000000 +0100
@@ -11,6 +11,9 @@
#include <iostream>
#include "catalogs.h"
+extern "C" {
+#include "platform.c"
+}
static const char *progname;
bool debug = 0;
@@ -106,6 +109,7 @@
int main(int argc, char **argv)
{
int c;
+ int platform = 0;
time_t begin_date = 0, end_date = 0;
const char *catalog_dir = ELA_CATALOG_DIR;
const char *msg_path = NULL;
@@ -113,6 +117,15 @@
vector::iterator ie;
progname = argv[0];
+
+ platform = get_platform();
+ if (platform != PLATFORM_PSERIES_LPAR) {
+ cerr << progname << ": is not supported on the "
+ << __power_platform_name(platform) << " platform" << endl;
+
+ exit(1);
+ }
+
opterr = 0;
while ((c = getopt(argc, argv, "b:C:de:hm:M")) != -1) {
switch (c) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/ela/syslog_to_svclog.cpp new/ppc64-diag-2.6.3/ela/syslog_to_svclog.cpp
--- old/ppc64-diag-2.6.2/ela/syslog_to_svclog.cpp 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/ela/syslog_to_svclog.cpp 2014-03-07 10:15:01.000000000 +0100
@@ -33,6 +33,9 @@
#include "catalogs.h"
#include
+extern "C" {
+#include "platform.c"
+}
#define SYSLOG_PATH "/var/log/messages"
#define LAST_EVENT_PATH "/var/log/ppc64-diag/last_syslog_event"
@@ -668,8 +671,18 @@
{
int c, result;
int args_seen[0x100] = { 0 };
+ int platform = 0;
progname = argv[0];
+
+ platform = get_platform();
+ if (platform != PLATFORM_PSERIES_LPAR) {
+ cerr << progname << ": is not supported on the "
+ << __power_platform_name(platform) << " platform" << endl;
+
+ exit(1);
+ }
+
opterr = 0;
while ((c = getopt(argc, argv, "b:C:de:Fhm:M")) != -1) {
if (isalpha(c))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/lpd/files.c new/ppc64-diag-2.6.3/lpd/files.c
--- old/ppc64-diag-2.6.2/lpd/files.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/lpd/files.c 2014-03-07 10:15:01.000000000 +0100
@@ -8,6 +8,7 @@
* @author Vasant Hegde
*/
+#include
#include
#include
#include
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/lpd/lp_diag.c new/ppc64-diag-2.6.3/lpd/lp_diag.c
--- old/ppc64-diag-2.6.2/lpd/lp_diag.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/lpd/lp_diag.c 2014-03-07 10:15:01.000000000 +0100
@@ -19,6 +19,7 @@
#include
#include
+#include "platform.c"
#include "lp_diag.h"
#include "lp_util.h"
@@ -1146,8 +1147,16 @@
int repair_flag = 0;
int event_id = 0;
int repair_id = 0;
+ int platform = 0;
char *next_char;
+ platform = get_platform();
+ if (platform != PLATFORM_PSERIES_LPAR) {
+ fprintf(stderr, "%s is not supported on the %s platform\n",
+ argv[0], __power_platform_name(platform));
+ return 1;
+ }
+
opterr = 0;
while ((c = getopt_long(argc, argv, LP_DIAG_ARGS,
longopts, NULL)) != EOF) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/lpd/servicelog.c new/ppc64-diag-2.6.3/lpd/servicelog.c
--- old/ppc64-diag-2.6.2/lpd/servicelog.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/lpd/servicelog.c 2014-03-07 10:15:01.000000000 +0100
@@ -8,6 +8,7 @@
* @author Vasant Hegde
*/
+#include
#include
#include "lp_diag.h"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/lpd/usysident.c new/ppc64-diag-2.6.3/lpd/usysident.c
--- old/ppc64-diag-2.6.2/lpd/usysident.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/lpd/usysident.c 2014-03-07 10:15:01.000000000 +0100
@@ -23,6 +23,7 @@
#include
#include
+#include "platform.c"
#include "lp_diag.h"
#define CMD_LINE_OPTIONS "d:l:s:-:thV"
@@ -93,6 +94,7 @@
int rc = 0;
int trunc = 0;
int truncated = 0;
+ int platform = 0;
char temp[LOCATION_LENGTH];
char dloc[LOCATION_LENGTH];
char *dvalue = NULL;
@@ -102,6 +104,13 @@
struct loc_code *current;
struct loc_code *list = NULL;
+ platform = get_platform();
+ if (platform != PLATFORM_PSERIES_LPAR) {
+ fprintf(stderr, "%s is not supported on the %s platform\n",
+ argv[0], __power_platform_name(platform));
+ return 1;
+ }
+
opterr = 0;
while ((c = getopt(argc, argv, CMD_LINE_OPTIONS)) != -1) {
switch (c) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/ppc64-diag.spec new/ppc64-diag-2.6.3/ppc64-diag.spec
--- old/ppc64-diag-2.6.2/ppc64-diag.spec 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/ppc64-diag.spec 2014-03-07 10:15:01.000000000 +0100
@@ -1,5 +1,5 @@
Name: ppc64-diag
-Version: 2.6.2
+Version: 2.6.3
Release: 0
Summary: PowerLinux Platform Diagnostics
Group: System Environment/Base
@@ -7,13 +7,17 @@
Packager: IBM Corp.
Vendor: IBM Corp.
ExclusiveArch: ppc ppc64
-BuildRequires: libservicelog-devel, libvpd-devel, flex, perl, /usr/bin/yacc
+BuildRequires: libservicelog-devel, flex, perl, /usr/bin/yacc
+BuildRequires: libvpd-devel
+BuildRequires: librtas-devel >= 1.3.9
BuildRequires: ncurses-devel
-Requires: servicelog, /usr/sbin/lsvpd, /sbin/chkconfig
-# PRRN RTAS event notification handler depends on below librtas
-# and powerpc-utils versions.
-Requires: librtas >= 1.3.8
-Requires: powerpc-utils >= 1.2.16
+
+Requires: servicelog, /sbin/chkconfig
+# PCI hotplug support on PowerKVM guest depends on below
+# powerpc-utils version.
+Requires: powerpc-utils >= 1.2.19
+# Light Path Diagnostics depends on below lsvpd version.
+Requires: lsvpd >= 1.7.1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: ppc64-diag-%{version}.tar.gz
@@ -78,6 +82,11 @@
fi
%changelog
+* Fri Mar 07 2014 - Vasant Hegde - 2.6.3
+- Added platform validation code
+- Add support for hotplugging qemu pci devices via RTAS event
+- Minor bug fixes in rtas_errd code
+
* Tue Aug 20 2013 - Vasant Hegde - 2.6.2
- Minor bug fix in diag_encl and encl_led
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rtas_errd/Makefile new/ppc64-diag-2.6.3/rtas_errd/Makefile
--- old/ppc64-diag-2.6.2/rtas_errd/Makefile 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/rtas_errd/Makefile 2014-03-07 10:15:01.000000000 +0100
@@ -10,7 +10,7 @@
RTAS_ERRD_OBJS = rtas_errd.o epow.o dump.o guard.o eeh.o update.o \
files.o config.o diag_support.o ela.o v6ela.o servicelog.o \
- signal.o prrn.o
+ signal.o prrn.o hotplug.o
RTAS_ERRD_LIBS = -lrtas -lrtasevent -lservicelog -lsqlite3
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rtas_errd/convert_dt_node_props.c new/ppc64-diag-2.6.3/rtas_errd/convert_dt_node_props.c
--- old/ppc64-diag-2.6.2/rtas_errd/convert_dt_node_props.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/rtas_errd/convert_dt_node_props.c 2014-03-07 10:15:01.000000000 +0100
@@ -14,6 +14,7 @@
#include
#include
#include
+#include "platform.c"
#define MAX_IRQ_SERVERS_PER_CPU 16
@@ -119,12 +120,22 @@
int
main(int argc, char *argv[]) {
int option_index, rc, i;
+ int platform = 0;
char *context=NULL, *from=NULL, *to=NULL;
uint32_t interruptserver, drcindex;
unsigned long drc_tmp_idx;
uint32_t intservs_array[MAX_IRQ_SERVERS_PER_CPU];
char drcname[20];
+ platform = get_platform();
+ switch (platform) {
+ case PLATFORM_UNKNOWN:
+ case PLATFORM_POWERKVM:
+ fprintf(stderr, "%s: is not supported on the %s platform\n",
+ argv[0], __power_platform_name(platform));
+ return -1;
+ }
+
for (;;) {
option_index = 0;
rc = getopt_long(argc, argv, "hc:f:t:", long_options,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rtas_errd/epow.c new/ppc64-diag-2.6.3/rtas_errd/epow.c
--- old/ppc64-diag-2.6.2/rtas_errd/epow.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/rtas_errd/epow.c 2014-03-07 10:15:01.000000000 +0100
@@ -375,7 +375,7 @@
*
* @param event pointer to the RTAS event
*/
-void
+int
check_epow(struct event *event)
{
pid_t child;
@@ -411,5 +411,5 @@
}
}
- return;
+ return current_status;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rtas_errd/extract_platdump.c new/ppc64-diag-2.6.3/rtas_errd/extract_platdump.c
--- old/ppc64-diag-2.6.2/rtas_errd/extract_platdump.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/rtas_errd/extract_platdump.c 2014-03-07 10:15:01.000000000 +0100
@@ -18,6 +18,7 @@
#include
#include
#include "rtas_errd.h"
+#include "platform.c"
#define DUMP_HDR_PREFIX_OFFSET 0x16 /* prefix size in dump header */
#define DUMP_HDR_FNAME_OFFSET 0x18 /* suggested filename in dump header */
@@ -344,8 +345,18 @@
main(int argc, char *argv[])
{
int option_index, rc, fail=0;
+ int platform = 0;
uint64_t dump_tag;
+ platform = get_platform();
+ switch (platform) {
+ case PLATFORM_UNKNOWN:
+ case PLATFORM_POWERKVM:
+ fprintf(stderr, "%s: is not supported on the %s platform\n",
+ argv[0], __power_platform_name(platform));
+ return -1;
+ }
+
for (;;) {
option_index = 0;
rc = getopt_long(argc, argv, "hv", long_options,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rtas_errd/hotplug.c new/ppc64-diag-2.6.3/rtas_errd/hotplug.c
--- old/ppc64-diag-2.6.2/rtas_errd/hotplug.c 1970-01-01 01:00:00.000000000 +0100
+++ new/ppc64-diag-2.6.3/rtas_errd/hotplug.c 2014-03-07 10:15:01.000000000 +0100
@@ -0,0 +1,98 @@
+/**
+ * @file hotplug.c
+ *
+ * Copyright (C) 2013 IBM Corporation
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include "rtas_errd.h"
+
+#define DRMGR_PROGRAM "/usr/sbin/drmgr"
+#define DRMGR_PROGRAM_NOPATH "drmgr"
+
+void handle_hotplug_event(struct event *re)
+{
+ struct rtas_event_hdr *rtas_hdr = re->rtas_hdr;
+ struct rtas_hotplug_scn *hotplug;
+ pid_t child;
+ int status, rc;
+ char drc_index[11];
+ char *drmgr_args[] = { DRMGR_PROGRAM_NOPATH, "-c", NULL, NULL, NULL,
+ NULL, NULL, "-d4", "-V", NULL};
+
+ /* Retrieve Hotplug section */
+ if (rtas_hdr->version >= 6) {
+ hotplug = rtas_get_hotplug_scn(re->rtas_event);
+
+ /* Build drmgr argument list */
+ dbg("Build drmgr command\n");
+
+ switch (hotplug->type) {
+ case RTAS_HP_TYPE_PCI:
+ drmgr_args[2] = "pci";
+ drmgr_args[6] = "-n";
+ break;
+ default:
+ dbg("Unknown or unsupported hotplug type %d\n",
+ hotplug->type);
+ return;
+ }
+
+ switch (hotplug->action) {
+ case RTAS_HP_ACTION_ADD:
+ drmgr_args[3] = "-a";
+ break;
+ case RTAS_HP_ACTION_REMOVE:
+ drmgr_args[3] = "-r";
+ break;
+ default:
+ dbg("Unknown hotplug action %d\n", hotplug->action);
+ return;
+ }
+
+ switch (hotplug->identifier) {
+ case RTAS_HP_ID_DRC_INDEX:
+ drmgr_args[4] = "-s";
+ snprintf(drc_index, 11, "%#x", hotplug->u1.drc_index);
+ drmgr_args[5] = drc_index;
+ break;
+ default:
+ dbg("Unknown or unsupported hotplug identifier %d\n",
+ hotplug->identifier);
+ return;
+ }
+
+ dbg("run: %s %s %s %s %s %s %s\n", drmgr_args[0],
+ drmgr_args[1], drmgr_args[2], drmgr_args[3],
+ drmgr_args[4], drmgr_args[5], drmgr_args[6]);
+
+ /* invoke drmgr */
+ dbg("Invoke drmgr command\n");
+
+ child = fork();
+ if (child == -1) {
+ log_msg(NULL, "%s cannot be run to handle a hotplug event, %s",
+ DRMGR_PROGRAM, strerror(errno));
+ return;
+ } else if (child == 0) {
+ /* child process */
+ rc = execv(DRMGR_PROGRAM, drmgr_args);
+
+ /* shouldn't get here */
+ log_msg(NULL, "Couldn not exec %s in response to hotplug event, %s",
+ DRMGR_PROGRAM, strerror(errno));
+ exit(1);
+ }
+
+ child = waitpid(child, &status, 0);
+
+ dbg("drmgr call exited with %d\n", WEXITSTATUS(status));
+ }
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rtas_errd/rtas_errd.c new/ppc64-diag-2.6.3/rtas_errd/rtas_errd.c
--- old/ppc64-diag-2.6.2/rtas_errd/rtas_errd.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/rtas_errd/rtas_errd.c 2014-03-07 10:15:01.000000000 +0100
@@ -17,6 +17,7 @@
#include
#include
#include "rtas_errd.h"
+#include "platform.c"
/**
* @var debug
@@ -137,7 +138,10 @@
case RTAS_HDR_TYPE_EPOW:
dbg("Entering check_epow()");
- check_epow(event);
+ if (check_epow(event) <= 0) {
+ dbg("Recevied EPOW 0 (all is normal) event");
+ return 0;
+ }
break;
case RTAS_HDR_TYPE_PLATFORM_ERROR:
@@ -160,6 +164,11 @@
*/
return 0;
+ case RTAS_HDR_TYPE_HOTPLUG:
+ dbg("Entering Hotplug handler");
+ handle_hotplug_event(event);
+ break;
+
default:
/* Nothing to do for this event */
break;
@@ -369,6 +378,16 @@
#ifdef DEBUG
int f_flag = 0, s_flag = 0;
#endif
+ int platform = 0;
+
+ platform = get_platform();
+ switch (platform) {
+ case PLATFORM_UNKNOWN:
+ case PLATFORM_POWERKVM:
+ fprintf(stderr, "%s: is not supported on the %s platform\n",
+ argv[0], __power_platform_name(platform));
+ return -1;
+ }
while ((c = getopt_long(argc, argv, RTAS_ERRD_ARGS,
longopts, NULL)) != EOF) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rtas_errd/rtas_errd.h new/ppc64-diag-2.6.3/rtas_errd/rtas_errd.h
--- old/ppc64-diag-2.6.2/rtas_errd/rtas_errd.h 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/rtas_errd/rtas_errd.h 2014-03-07 10:15:01.000000000 +0100
@@ -152,7 +152,7 @@
/* epow.c */
void epow_timer_handler(int, siginfo_t, void *);
-void check_epow(struct event *);
+int check_epow(struct event *);
/* servicelog.c */
time_t get_event_date(struct event *event);
@@ -169,4 +169,7 @@
/* prrn.c */
void handle_prrn_event(struct event *);
+/* hotplug.c */
+void handle_hotplug_event(struct event *);
+
#endif /* _RTAS_ERRD_H */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rtas_errd/servicelog.c new/ppc64-diag-2.6.3/rtas_errd/servicelog.c
--- old/ppc64-diag-2.6.2/rtas_errd/servicelog.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/rtas_errd/servicelog.c 2014-03-07 10:15:01.000000000 +0100
@@ -126,8 +126,6 @@
{
struct sl_callout *callout = event->sl_entry->callouts;
- event->flags |= RE_SERVICEABLE;
-
if (!callout) {
event->sl_entry->callouts = (struct sl_callout *)malloc(
sizeof(*callout));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rtas_errd/v6ela.c new/ppc64-diag-2.6.3/rtas_errd/v6ela.c
--- old/ppc64-diag-2.6.2/rtas_errd/v6ela.c 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/rtas_errd/v6ela.c 2014-03-07 10:15:01.000000000 +0100
@@ -272,9 +272,6 @@
frupn, frusn, ccin);
}
- if (event->flags & RE_SERVICEABLE)
- event->sl_entry->serviceable = 1;
-
if ((usrhdr->action & 0x8000) && (usrhdr->action & 0x0800))
event->sl_entry->call_home_status = SL_CALLHOME_CANDIDATE;
@@ -472,7 +469,6 @@
MSGMENUGPEL_EVENT, msg);
}
- event->sl_entry->serviceable = 1;
event->sl_entry->call_home_status = SL_CALLHOME_NONE;
snprintf(menu_num_str, 20, "#%d", menu_num);
@@ -582,6 +578,10 @@
rtas_data->event_subtype = usrhdr->event_type;
}
+ /* Enable serviceable flag based on "Error Action Flags" */
+ if (usrhdr->action & RTAS_UH_ACTION_SERVICE)
+ event->sl_entry->serviceable = 1;
+
/*
* if a "primary SRC" section exists, this is an SRC; otherwise, it
* is a menugoal
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ppc64-diag-2.6.2/rules.mk new/ppc64-diag-2.6.3/rules.mk
--- old/ppc64-diag-2.6.2/rules.mk 2013-08-20 13:21:13.000000000 +0200
+++ new/ppc64-diag-2.6.3/rules.mk 2014-03-07 10:15:01.000000000 +0100
@@ -70,12 +70,14 @@
TARBALL = $(PROJECT)-$(VERSION).tar.gz
TARBALL_FILES = Makefile rules.mk COPYRIGHT $(SPECFILENAME)
TB_DIR = $(PROJECT)-$(VERSION)
+COM_DIR = common
# Build a tarball of the source code
BUILD_TARBALL = \
$(shell \
echo CVS > ./ignore; \
mkdir $(TB_DIR); \
+ cp -R $(COM_DIR) $(TB_DIR); \
cp -R $(SUBDIRS) $(TARBALL_FILES) $(TB_DIR); \
tar -zcf $(TARBALL) -X ./ignore $(TB_DIR);)
@@ -88,6 +90,9 @@
# Uncomment this for debug builds
CFLAGS += -g -DDEBUG
+# Build with common directory included
+CFLAGS += -I $(ROOT_DIR)/$(COM_DIR)
+
# Build with version string
AM_CFLAGS = -DVERSION='"$(VERSION)"'
@@ -97,6 +102,9 @@
# Uncomment this for debug builds
CXXFLAGS += -g -DDEBUG
+# Build with common directory included
+CXXFLAGS += -I $(ROOT_DIR)/$(COM_DIR)
+
# Build with version string
AM_CXXFLAGS = -DVERSION='"$(VERSION)"'
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org