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/
Home Products Support Community News


[Xen-changelog] [xen-unstable] tools/libxl/xl: fix for short BDF (withou

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] tools/libxl/xl: fix for short BDF (without domain specified)
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 09 Jul 2010 04:50:28 -0700
Delivery-date: Fri, 09 Jul 2010 04:50:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1278606138 -3600
# Node ID 49394a999fa127f01bfa4e4bd8893adfa42dde8a
# Parent  29e5451510780220ed7bd65417feb0f6adad6942
tools/libxl/xl: fix for short BDF (without domain specified)

Check that BDF have been parsed correctly.  Before this fix, BDF could
be parsed incorrectly if user omitted the domain.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Contributed-by: Sergey Tovpeko <tsv.devel@xxxxxxxxx>
Acked-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
 tools/libxl/xl_cmdimpl.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff -r 29e545151078 -r 49394a999fa1 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Thu Jul 08 16:50:34 2010 +0100
+++ b/tools/libxl/xl_cmdimpl.c  Thu Jul 08 17:22:18 2010 +0100
@@ -833,9 +833,12 @@ skip_vfb:
             p = strtok(buf2, ",");
             if (!p)
                 goto skip_pci;
-            if (!sscanf(p, PCI_BDF_VDEVFN, &domain, &bus, &dev, &func, 
&vdevfn)) {
-                sscanf(p, "%02x:%02x.%01x@%02x", &bus, &dev, &func, &vdevfn);
+            if (sscanf(p, PCI_BDF_VDEVFN, &domain, &bus, &dev, &func, &vdevfn) 
< 4) {
                 domain = 0;
+                if (sscanf(p, "%02x:%02x.%01x@%02x", &bus, &dev, &func, 
&vdevfn) < 3) {
+                    fprintf(stderr,"xl: Unable to parse pci bdf (%s)\n", p);
+                    goto skip_pci;
+                }
             libxl_device_pci_init(*pcidevs + *num_pcidevs, domain, bus, dev, 
func, vdevfn);
             (*pcidevs)[*num_pcidevs].msitranslate = pci_msitranslate;

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] tools/libxl/xl: fix for short BDF (without domain specified), Xen patchbot-unstable <=