George Dunlap
2012-May-25 16:34 UTC
[PATCH] libxl: When checking BDF of existing slots, function should be decimal, not hex
# HG changeset patch # User George Dunlap <george.dunlap@eu.citrix.com> # Date 1337961666 0 # Node ID 1c28051020488782f1277dd60a2418324580297e # Parent 69c3ae25bb1ddcb0ea44b7566d36d34e9d6a70aa libxl: When checking BDF of existing slots, function should be decimal, not hex Spotted-by: Konrad Wilk <konrad.wilk@oracle.com> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -480,7 +480,7 @@ static int pciback_dev_has_slot(libxl__g return ERROR_FAIL; } - while(fscanf(f, "%x:%x:%x.%x\n", &dom, &bus, &dev, &func)==4) { + while(fscanf(f, "%x:%x:%x.%d\n", &dom, &bus, &dev, &func)==4) { if(dom == pcidev->domain && bus == pcidev->bus && dev == pcidev->dev
Konrad Rzeszutek Wilk
2012-May-25 20:27 UTC
Re: [PATCH] libxl: When checking BDF of existing slots, function should be decimal, not hex
On Fri, May 25, 2012 at 04:34:17PM +0000, George Dunlap wrote:> # HG changeset patch > # User George Dunlap <george.dunlap@eu.citrix.com> > # Date 1337961666 0 > # Node ID 1c28051020488782f1277dd60a2418324580297e > # Parent 69c3ae25bb1ddcb0ea44b7566d36d34e9d6a70aa > libxl: When checking BDF of existing slots, function should be decimal, not hex > > Spotted-by: Konrad Wilk <konrad.wilk@oracle.com>Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>> Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> > > diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c > --- a/tools/libxl/libxl_pci.c > +++ b/tools/libxl/libxl_pci.c > @@ -480,7 +480,7 @@ static int pciback_dev_has_slot(libxl__g > return ERROR_FAIL; > } > > - while(fscanf(f, "%x:%x:%x.%x\n", &dom, &bus, &dev, &func)==4) { > + while(fscanf(f, "%x:%x:%x.%d\n", &dom, &bus, &dev, &func)==4) { > if(dom == pcidev->domain > && bus == pcidev->bus > && dev == pcidev->dev > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel
Ian Campbell
2012-May-29 09:00 UTC
Re: [PATCH] libxl: When checking BDF of existing slots, function should be decimal, not hex
On Fri, 2012-05-25 at 21:27 +0100, Konrad Rzeszutek Wilk wrote:> On Fri, May 25, 2012 at 04:34:17PM +0000, George Dunlap wrote: > > # HG changeset patch > > # User George Dunlap <george.dunlap@eu.citrix.com> > > # Date 1337961666 0 > > # Node ID 1c28051020488782f1277dd60a2418324580297e > > # Parent 69c3ae25bb1ddcb0ea44b7566d36d34e9d6a70aa > > libxl: When checking BDF of existing slots, function should be decimal, not hex > > > > Spotted-by: Konrad Wilk <konrad.wilk@oracle.com> > > Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > > Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>A PCI func can be at most 7 I think so %x vs %d probably doesn''t have any real impact under normal use. Applied though.> > > > diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c > > --- a/tools/libxl/libxl_pci.c > > +++ b/tools/libxl/libxl_pci.c > > @@ -480,7 +480,7 @@ static int pciback_dev_has_slot(libxl__g > > return ERROR_FAIL; > > } > > > > - while(fscanf(f, "%x:%x:%x.%x\n", &dom, &bus, &dev, &func)==4) { > > + while(fscanf(f, "%x:%x:%x.%d\n", &dom, &bus, &dev, &func)==4) { > > if(dom == pcidev->domain > > && bus == pcidev->bus > > && dev == pcidev->dev > > > > _______________________________________________ > > Xen-devel mailing list > > Xen-devel@lists.xen.org > > http://lists.xen.org/xen-devel > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel
Seemingly Similar Threads
- [PATCH 0 of 4 v3] Add commands to automatically prep devices for pass-through
- [PATCH V3 REBASE 1/2] libxl_qmp: Introduce libxl__qmp_pci_del
- [PATCH] libxl: fix segfault on device assignement
- [PATCH 1 of 2] libxl: fix cold plugged PCI devices with stubdomains
- [PATCH]: add libxl python binding