Skip to content

Commit

Permalink
Merge pull request #81 from liangxiao1/upstream
Browse files Browse the repository at this point in the history
procinterrupts: check xen-dyn-event more flexible
Acked-by: Neil Horman <nhorman@tuxdriver.com>
  • Loading branch information
nhorman authored Oct 18, 2018
2 parents 864b689 + 0ba1d8a commit ca8c12f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion procinterrupts.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ GList* collect_full_irq_list()

while (!feof(file)) {
int number;
int is_xen_dyn = 0;
struct irq_info *info;
char *c;
char *savedline = NULL;
Expand All @@ -188,9 +189,13 @@ GList* collect_full_irq_list()

savedline = strdup(line);
irq_name = strtok_r(savedline, " ", &savedptr);
if (strstr(irq_name, "xen-dyn") != NULL)
is_xen_dyn = 1;
last_token = strtok_r(NULL, " ", &savedptr);
while ((p = strtok_r(NULL, " ", &savedptr))) {
irq_name = last_token;
if (strstr(irq_name, "xen-dyn") != NULL)
is_xen_dyn = 1;
last_token = p;
}

Expand All @@ -210,7 +215,7 @@ GList* collect_full_irq_list()
info = calloc(sizeof(struct irq_info), 1);
if (info) {
info->irq = number;
if (strstr(irq_name, "xen-dyn-event") != NULL) {
if (strstr(irq_name, "-event") != NULL && is_xen_dyn == 1) {
info->type = IRQ_TYPE_VIRT_EVENT;
info->class = IRQ_VIRT_EVENT;
} else {
Expand Down

0 comments on commit ca8c12f

Please sign in to comment.