From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sergey Tovpeko Subject: [PATCH] xl, fix for short BDF (without domain specified) Date: Wed, 07 Jul 2010 12:27:40 +0400 Message-ID: <4C343A7C.8000800@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050902070607030403080201" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------050902070607030403080201 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------050902070607030403080201 Content-Type: text/x-patch; name="bdf_parse.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="bdf_parse.diff" commit a5ed8a3a59d5abeb9dabfdf2d31fa524cf304dee Author: Sergey Tovpeko 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; } --------------050902070607030403080201 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------050902070607030403080201--