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

Re: [Xen-devel] Re: [PATCH] Fix xm pci-attach/detach for inactivemanaged

To: Masaki Kanno <kanno.masaki@xxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [PATCH] Fix xm pci-attach/detach for inactivemanaged domains
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Sat, 16 May 2009 02:34:30 +1000
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 15 May 2009 09:34:58 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <5EC9D52AF92FAAkanno.masaki@xxxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <5CC9D493E098B9kanno.masaki@xxxxxxxxxxxxxx> <20090515003015.GA23201@xxxxxxxxxxxx> <5EC9D52AF92FAAkanno.masaki@xxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
On Fri, May 15, 2009 at 04:01:30PM +0900, Masaki Kanno wrote:
Content-Description: Mail message body
> Hi Simon,
> 
> Thanks for your review and test.
> 
> >In the case of pci-attach if I follow the folliwing steps:
> >
> >$ xm new hvm.conf
> >$ xm pci-attach hvm 00:1a.0
> >$ xm start hvm
> >[ wait a bit ]
> >$ xm pci-list hvm
> >
> >Then pci-list never indicates that 00:1a.0 has been assigned a vslot.
> 
> Maybe, the domain start failed.
> Are there the following messages in a qemu-dm-hvm.log file?
> 
>  register_real_device: Assigning real physical device 00:1a.0 ...
>  register_real_device: Error: no free virtual PCI slot
>  pt_init: Error: Registration failed (00:1a.0)
>  Error: Initialization failed for pass-through devices
> 
> If so, the problem is solved by new patches.
> Could you review and test the patches?

Yes, I cam to the same conclusion.
Though my solution was a little different.

I think that the change below be an alternate solution
to both of your patches. Though there is still a problem
that the assigned vslot isn't reported by pci-list if
a function is attached while the domain isn't running.

I will review your patches once I have had some sleep.
In the mean time, here is the change that have been thinking about.

Index: xen-unstable.hg/tools/python/xen/xend/server/pciif.py
===================================================================
--- xen-unstable.hg.orig/tools/python/xen/xend/server/pciif.py  2009-05-16 
01:40:42.000000000 +1000
+++ xen-unstable.hg/tools/python/xen/xend/server/pciif.py       2009-05-16 
01:41:14.000000000 +1000
@@ -73,13 +73,15 @@ class PciController(DevController):
         for pci_config in config.get('devs', []):
             vslot = pci_config.get('vslot')
             if vslot is not None:
-                vslots = vslots + vslot + ";"
+                vslot = parse_hex(vslot)
+                vslots = "%s0x%02x;" % (vslots, vslot)
+           else:
+               vslot = parse_hex(pci_config.get('requested_vslot'))
 
             domain = parse_hex(pci_config.get('domain', 0))
             bus = parse_hex(pci_config.get('bus', 0))
             slot = parse_hex(pci_config.get('slot', 0))
             func = parse_hex(pci_config.get('func', 0))            
-            requested_vslot = parse_hex(pci_config.get('requested_vslot', 0))
 
             opts = pci_config.get('opts', '')
             if len(opts) > 0:
@@ -90,7 +92,7 @@ class PciController(DevController):
             back['dev-%i' % pcidevid] = "%04x:%02x:%02x.%01x" % \
                                         (domain, bus, slot, func)
             back['uuid-%i' % pcidevid] = pci_config.get('uuid', '')
-            back['vslot-%i' % pcidevid] = "%02x" % requested_vslot
+            back['vslot-%i' % pcidevid] = "%02x" % vslot
             pcidevid += 1
 
         if vslots != "":



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