WARNING - OLD ARCHIVES

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

xen-devel

[Xen-devel] Re: [PATCH] PV Passthrough PCI Device Hotplug Support (Tools

To: "Zhai, Edwin" <edwin.zhai@xxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH] PV Passthrough PCI Device Hotplug Support (Tools Part)
From: Yosuke Iwamatsu <y-iwamatsu@xxxxxxxxxxxxx>
Date: Mon, 10 Mar 2008 20:22:54 +0900
Cc: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 10 Mar 2008 04:23:27 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20080310071700.GM15578@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <C3E44EB2.1440F%Keir.Fraser@xxxxxxxxxxxx> <47BEA1AC.40707@xxxxxxxxxxxxx> <47D48C8E.7060206@xxxxxxxxxxxxx> <20080310071700.GM15578@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.6 (Windows/20070728)
Zhai, Edwin wrote:
Yosuke,

Thanks for you work.
I have tested your patch works on HVM VT-d side.

I'm relieved to hear that. Thank you.


One suggestion is error handling for user input. e.g. following input error should be caught by xm:

[root@vt-gang32 ~]# xm pci-attach EdwinHVMDomainVtd2 0:2.0.0 (should be 0:2:0.0)

Error: pci: failed to locate device and parse it's resources - [Errno 2] No such file or directory: '/sys/bus/pci/devices/0000:00:02.0/driver'
Usage: xm pci-attach <Domain> <domain:bus:slot.func> [virtual slot]

Okay.
The small patch below should fix the issue.
(applied after the previous patch)

Thanks,
  Yosuke Iwamatsu

---------

xm: Fix parsing pci device name.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@xxxxxxxxxxxxx>

diff -r 9233270dfe6a tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Mon Mar 10 17:58:25 2008 +0900
+++ b/tools/python/xen/xm/main.py       Mon Mar 10 20:26:49 2008 +0900
@@ -2240,7 +2240,7 @@ def parse_pci_configuration(args, state)
     pci_match = re.match(r"((?P<domain>[0-9a-fA-F]{1,4})[:,])?" + \
             r"(?P<bus>[0-9a-fA-F]{1,2})[:,]" + \
             r"(?P<slot>[0-9a-fA-F]{1,2})[.,]" + \
-            r"(?P<func>[0-9a-fA-F])", pci_dev_str)
+            r"(?P<func>[0-7])$", pci_dev_str)
     if pci_match == None:
         raise OptionError("Invalid argument: %s %s" % (pci_dev_str,vslt))
     pci_dev_info = pci_match.groupdict('0')


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