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-devel

[Xen-devel] [patch] qemu-xen: pass-through: only parse single BDFs.

To: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [patch] qemu-xen: pass-through: only parse single BDFs.
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 1 Jun 2009 13:11:47 +1000
Cc: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>, Edwin Zhai <edwin.zhai@xxxxxxxxx>
Delivery-date: Sun, 31 May 2009 20:12:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090529065640.GA19665@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20090529065640.GA19665@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
As of "qemu-xen: hot-plug PCI devices at boot-time", the BDF string
that is parsed always contains a single bdf, not multiple bdf's delimited
by a '-'.

Cc: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Cc: Edwin Zhai <edwin.zhai@xxxxxxxxx>
Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

--- 

This patch requires "qemu-xen: hot-plug PCI devices at boot-time"

Index: ioemu-remote/hw/pass-through.c
===================================================================
--- ioemu-remote.orig/hw/pass-through.c 2009-06-01 12:49:30.000000000 +1000
+++ ioemu-remote/hw/pass-through.c      2009-06-01 12:52:16.000000000 +1000
@@ -825,11 +825,11 @@ static int token_value(char *token)
     return strtol(token, NULL, 16);
 }
 
-static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func,
-                    char **opt, int *vslot)
+static int parse_bdf(char **str, int *seg, int *bus, int *dev, int *func,
+                     char **opt, int *vslot)
 {
     char *token, *endptr;
-    const char *delim = ":.-";
+    const char *delim = ":.";
 
     if ( !(*str) ||
           ( !strchr(*str, ':') && !strchr(*str, '.')) )
@@ -945,7 +945,7 @@ int insert_to_pci_slot(char *bdf_slt)
     int seg, bus, dev, func, slot;
     char *opt;
 
-    if ( !next_bdf(&bdf_slt, &seg, &bus, &dev, &func, &opt, &slot) )
+    if ( !parse_bdf(&bdf_slt, &seg, &bus, &dev, &func, &opt, &slot) )
     {
         return -1;
     }
@@ -976,7 +976,7 @@ int bdf_to_slot(char *bdf_str)
     int seg, bus, dev, func, slot, i;
     char *opt;
 
-    if ( !next_bdf(&bdf_str, &seg, &bus, &dev, &func, &opt, &slot))
+    if ( !parse_bdf(&bdf_str, &seg, &bus, &dev, &func, &opt, &slot))
     {
         return -1;
     }

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