Skip to contentSkip to conversation

Give domain-ID 0 to xc.test_assign_device

PATCH In review Masaki Kanno 1 participant 2 messages Apr 7, 2009 – Apr 8, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Give domain-ID 0 to xc.test_assign_device

Hi,

When xend calls xc.test_assign_device, xend does not have to give the domain-ID of a guest domain.
This patch gives domain-ID 0 to xc.test_assign_device.

The following methods give domain-ID 0 to xc.test_assign_device currently.
- setupDevice@xend/server/pciif.py
- pciinfo@xend/XendNode.py

Best regards,
Kan

tools/python/xen/xend/XendDomainInfo.py +3 -3
diff -r 5c69f98c348e tools/python/xen/xend/XendDomainInfo.py
@@ -634,7 +634,7 @@ class XendDomainInfo:
                 new_dev['bus'],
                 new_dev['slot'],
                 new_dev['func'])
-        bdf = xc.test_assign_device(self.domid, pci_str)
+        bdf = xc.test_assign_device(0, pci_str)
         if bdf != 0:
             if bdf == -1:
                 raise VmError("failed to assign device: maybe the platform"
@@ -689,7 +689,7 @@ class XendDomainInfo:
         for pci_str in coassignment_list:
             (domain, bus, dev, func) = parse_pci_name(pci_str) 
             dev_str =  '0x%x,0x%x,0x%x,0x%x' % (domain, bus, dev, func)
-            if xc.test_assign_device(self.domid, dev_str) == 0:
+            if xc.test_assign_device(0, dev_str) == 0:
                 continue
             if not pci_str in assigned_pci_device_str_list:
                 raise VmError(('pci: failed to pci-attach %s to dom%d" + \
@@ -2339,7 +2339,7 @@ class XendDomainInfo:
             pci = map(lambda x: x[0:4], pci)  # strip options 
             pci_str = str(pci)
         if hvm and pci_str:
-            bdf = xc.test_assign_device(self.domid, pci_str)
+            bdf = xc.test_assign_device(0, pci_str)
             if bdf != 0:
                 if bdf == -1:
                     raise VmError("failed to assign device: maybe the platform"

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

#1 lore raw

Hi Keir,

The patch is needed for inactive managed domains. So could you apply the patch?
I'm going to write a patch (or a few patches) for inactive managed domains.

Best regards,
Kan

Quoted 22 lines · Masaki Kanno

Hi,

When xend calls xc.test_assign_device, xend does not have to give the domain-ID of a guest domain.
This patch gives domain-ID 0 to xc.test_assign_device.

The following methods give domain-ID 0 to xc.test_assign_device currently.
- setupDevice@xend/server/pciif.py
- pciinfo@xend/XendNode.py

Best regards,
Kan

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