Skip to contentSkip to conversation

Fix xm pci-list for inactive managed domains

PATCH In review Masaki Kanno 2 participants 4 messages May 14, 2009

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 Fix xm pci-list for inactive managed domains

Hi,

Virtual slot numbers are shown as follows by this patch.

# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0','01:00.1' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
domain   bus   slot   func
0x0      0x01  0x00   0x0
0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0@a','01:00.1' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
0xa  0x0      0x01  0x00   0x0
-    0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0','01:00.1@1a' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
-    0x0      0x01  0x00   0x0
0x1a 0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0@a','01:00.1@1a' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
0xa  0x0      0x01  0x00   0x0
0x1a 0x0      0x01  0x00   0x1

Best regards,
Kan

tools/python/xen/xm/main.py +14 -3
diff -r 2522cc95efd2 tools/python/xen/xm/main.py
@@ -2165,13 +2165,24 @@ def xm_pci_list(args):
     if len(devs) == 0:
         return
 
-    has_vslot = devs[0].has_key('vslot')
+    has_vslot = False
+    for x in devs:
+        if x.has_key('vslot'):
+            has_vslot = True
+        elif not x.has_key('requested_vslot'):
+            x['vslot'] = '-'
+        elif x['requested_vslot'] == "0x%s" % AUTO_PHP_SLOT_STR:
+            x['vslot'] = '-'
+        else:
+            has_vslot = True
+            x['vslot'] = x['requested_vslot']
+
     if has_vslot:
         hdr_str = 'VSlt domain   bus   slot   func'
-        fmt_str =  "%(vslot)-3s    %(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
+        fmt_str =  "%(vslot)-4s %(domain)-3s      %(bus)-4s  %(slot)-4s   %(func)-3s    "
     else:
         hdr_str = 'domain   bus   slot   func'
-        fmt_str =  "%(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
+        fmt_str =  "%(domain)-3s      %(bus)-4s  %(slot)-4s   %(func)-3s    "
     hdr = 0
 
     for x in devs:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Acked-by on v2 1/1
#1 lore raw
Quoted 44 lines · Masaki Kanno

Hi,

Virtual slot numbers are shown as follows by this patch.

# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0','01:00.1' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
domain   bus   slot   func
0x0      0x01  0x00   0x0
0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0@a','01:00.1' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
0xa  0x0      0x01  0x00   0x0
-    0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0','01:00.1@1a' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
-    0x0      0x01  0x00   0x0
0x1a 0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0@a','01:00.1@1a' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
0xa  0x0      0x01  0x00   0x0
0x1a 0x0      0x01  0x00   0x1
Quoted 2 lines

Hi Kanno-san,

this looks good to me.

#2 lore raw

Re: Re: [PATCH V2] Fix xm pci-list for inactive manageddomains

Hi Simon,

Thanks for your review.

Kan

Quoted 60 lines · Simon Horman
Quoted 44 lines · Masaki Kanno

Hi,

Virtual slot numbers are shown as follows by this patch.

# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0','01:00.1' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
domain   bus   slot   func
0x0      0x01  0x00   0x0
0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0@a','01:00.1' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
0xa  0x0      0x01  0x00   0x0
-    0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0','01:00.1@1a' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
-    0x0      0x01  0x00   0x0
0x1a 0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0@a','01:00.1@1a' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
0xa  0x0      0x01  0x00   0x0
0x1a 0x0      0x01  0x00   0x1
Quoted 2 lines

Hi Kanno-san,

this looks good to me.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw
In reply to Masaki Kanno

Hi,

Sorry, please ignore the patch.
I'm going to send a correct patch tomorrow.

Best

Quoted 56 lines · Masaki Kanno

Hi,

Virtual slot numbers are shown as follows by this patch.

# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0','01:00.1' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
domain   bus   slot   func
0x0      0x01  0x00   0x0
0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0@a','01:00.1' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
0xa  0x0      0x01  0x00   0x0
-    0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0','01:00.1@1a' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
-    0x0      0x01  0x00   0x0
0x1a 0x0      0x01  0x00   0x1
# cat /etc/xen/vm1 | grep pci
pci = [ '01:00.0@a','01:00.1@1a' ]
# xm new vm1
Using config file "/etc/xen/vm1".
# xm pci-list vm1
VSlt domain   bus   slot   func
0xa  0x0      0x01  0x00   0x0
0x1a 0x0      0x01  0x00   0x1

Best regards,
Kan

-------------------------------text/plain-------------------------------
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel