WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] vt-d: Fix PCI=device parsing.

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] vt-d: Fix PCI=device parsing.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Oct 2007 14:50:20 -0700
Delivery-date: Mon, 22 Oct 2007 14:50:39 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxxxxxxxx>
# Date 1193059605 -3600
# Node ID 24c2745f939ff1bb221b0a753c2a0cbc8b21da97
# Parent  368f563f2fd0909ba28a41a7c80d5ebdb9b9bda5
vt-d: Fix PCI=device parsing.
Signed-off-by: Weidong Han <weidong.han@xxxxxxxxx>
---
 tools/ioemu/hw/pass-through.c     |   12 ++++++------
 tools/python/xen/lowlevel/xc/xc.c |   12 ++++++------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff -r 368f563f2fd0 -r 24c2745f939f tools/ioemu/hw/pass-through.c
--- a/tools/ioemu/hw/pass-through.c     Mon Oct 22 14:22:39 2007 +0100
+++ b/tools/ioemu/hw/pass-through.c     Mon Oct 22 14:26:45 2007 +0100
@@ -39,11 +39,10 @@ static int next_bdf(char **str, int *seg
 {
     char *token;
 
-    token = strchr(*str, ',');
-    if ( !token )
+    if ( !(*str) || !strchr(*str, ',') )
         return 0;
-    token++;
-
+
+    token = *str;
     *seg  = token_value(token);
     token = strchr(token, ',') + 1;
     *bus  = token_value(token);
@@ -51,8 +50,9 @@ static int next_bdf(char **str, int *seg
     *dev  = token_value(token);
     token = strchr(token, ',') + 1;
     *func  = token_value(token);
-
-    *str = token;
+    token = strchr(token, ',');
+    *str = token ? token + 1 : NULL;
+
     return 1;
 }
 
diff -r 368f563f2fd0 -r 24c2745f939f tools/python/xen/lowlevel/xc/xc.c
--- a/tools/python/xen/lowlevel/xc/xc.c Mon Oct 22 14:22:39 2007 +0100
+++ b/tools/python/xen/lowlevel/xc/xc.c Mon Oct 22 14:26:45 2007 +0100
@@ -543,11 +543,10 @@ static int next_bdf(char **str, int *seg
 {
     char *token;
 
-    token = strchr(*str, ',');
-    if ( !token )
+    if ( !(*str) || !strchr(*str, ',') )
         return 0;
-    token++;
-
+
+    token = *str;
     *seg  = token_value(token);
     token = strchr(token, ',') + 1;
     *bus  = token_value(token);
@@ -555,8 +554,9 @@ static int next_bdf(char **str, int *seg
     *dev  = token_value(token);
     token = strchr(token, ',') + 1;
     *func  = token_value(token);
-
-    *str = token;
+    token = strchr(token, ',');
+    *str = token ? token + 1 : NULL;
+
     return 1;
 }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] vt-d: Fix PCI=device parsing., Xen patchbot-unstable <=