[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] xl, fix for short BDF (without domain specified)


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Sergey Tovpeko <tsv.devel@xxxxxxxxx>
  • Date: Wed, 07 Jul 2010 12:27:40 +0400
  • Delivery-date: Wed, 07 Jul 2010 01:31:32 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type; b=OSZ6U/oidJRw6Ymc5GB9Go2gPKLUNMJGFmejsLzYjJh2ZI2PdwndnUL3brgcGbeHqj J6nJV8TmhTJOqRVKNsqT43is0xxgyqFmeNnqydLfqh+rjv2hnyy1yodsvcex3dQjLLBF jrKuXgvMcBiKPdMO++kG+JIw9K2TLzx7sZn3E=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.