xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Tovpeko <tsv.devel@gmail.com>
To: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: [PATCH] xl, fix for short BDF (without domain specified)
Date: Wed, 07 Jul 2010 12:27:40 +0400	[thread overview]
Message-ID: <4C343A7C.8000800@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

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


[-- Attachment #2: bdf_parse.diff --]
[-- Type: text/x-patch, Size: 836 bytes --]

commit a5ed8a3a59d5abeb9dabfdf2d31fa524cf304dee
Author: Sergey Tovpeko <tovpeko@altell.ru>
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;
             }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2010-07-07  8:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07  8:27 Sergey Tovpeko [this message]
2010-07-07 11:07 ` [PATCH] xl, fix for short BDF (without domain specified) Stefano Stabellini
2010-07-07 12:43   ` Sergey Tovpeko
2010-07-07 17:02     ` Stefano Stabellini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C343A7C.8000800@gmail.com \
    --to=tsv.devel@gmail.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).