From 0a850285ce9949caa9f9bf519f20061d013d0134 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 3 Jun 2009 15:39:26 +0100 Subject: [PATCH] pass-through: only parse single BDFs. 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 Cc: Edwin Zhai Signed-off-by: Simon Horman --- hw/pass-through.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/pass-through.c b/hw/pass-through.c index cf04924a..a848164f 100644 --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -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; } -- 2.39.5