[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH] xl, fix for short BDF (without domain specified)
Hi,this patch fixes cases where an user sets pci device not mentioning its domain, ex. pci = ['01:00.0'] At now, xl recognizes this string as domain = 1, bus = 0, device = 0 func = 0 commit a5ed8a3a59d5abeb9dabfdf2d31fa524cf304dee Author: Sergey Tovpeko <tovpeko@xxxxxxxxx> Date: Tue Jul 6 23:31:50 2010 +0400 Check that BDF have been parsed correctly. Before that fix, BDF could be parsed incorrectly if user omitted domain in it. diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 208ecd6..9be1cbb 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -827,7 +827,7 @@ skip_vfb: p = strtok(buf2, ","); if (!p) goto skip_pci; - if (!sscanf(p, PCI_BDF_VDEVFN, &domain, &bus, &dev, &func, &vdevfn)) { + if (sscanf(p, PCI_BDF_VDEVFN, &domain, &bus, &dev, &func, &vdevfn) < 4) { sscanf(p, "%02x:%02x.%01x@%02x", &bus, &dev, &func, &vdevfn); domain = 0; } _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |