]> xenbits.xensource.com Git - qemu-xen-4.6-testing.git/commitdiff
pass-through: only parse single BDFs.
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 3 Jun 2009 14:39:26 +0000 (15:39 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 3 Jun 2009 14:39:26 +0000 (15:39 +0100)
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@jp.fujitsu.com>
Cc: Edwin Zhai <edwin.zhai@intel.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
hw/pass-through.c

index cf04924a67e3abee9ede0596713a34b40c5a114f..a848164fc8cfc52f04515beb1a4f41a73cba4d24 100644 (file)
@@ -828,11 +828,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, '.')) )
@@ -948,7 +948,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;
     }
@@ -979,7 +979,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;
     }