ia64/xen-unstable

changeset 19520:d61d135291f7

xend: Give domain-ID 0 to xc.test_assign_device

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

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Apr 08 10:18:31 2009 +0100 (2009-04-08)
parents cb453e5a2f81
children 9f945f16bd02
files tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Wed Apr 08 09:02:22 2009 +0100
     1.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Wed Apr 08 10:18:31 2009 +0100
     1.3 @@ -634,7 +634,7 @@ class XendDomainInfo:
     1.4                  new_dev['bus'],
     1.5                  new_dev['slot'],
     1.6                  new_dev['func'])
     1.7 -        bdf = xc.test_assign_device(self.domid, pci_str)
     1.8 +        bdf = xc.test_assign_device(0, pci_str)
     1.9          if bdf != 0:
    1.10              if bdf == -1:
    1.11                  raise VmError("failed to assign device: maybe the platform"
    1.12 @@ -689,7 +689,7 @@ class XendDomainInfo:
    1.13          for pci_str in coassignment_list:
    1.14              (domain, bus, dev, func) = parse_pci_name(pci_str) 
    1.15              dev_str =  '0x%x,0x%x,0x%x,0x%x' % (domain, bus, dev, func)
    1.16 -            if xc.test_assign_device(self.domid, dev_str) == 0:
    1.17 +            if xc.test_assign_device(0, dev_str) == 0:
    1.18                  continue
    1.19              if not pci_str in assigned_pci_device_str_list:
    1.20                  raise VmError(('pci: failed to pci-attach %s to dom%d" + \
    1.21 @@ -2339,7 +2339,7 @@ class XendDomainInfo:
    1.22              pci = map(lambda x: x[0:4], pci)  # strip options 
    1.23              pci_str = str(pci)
    1.24          if hvm and pci_str:
    1.25 -            bdf = xc.test_assign_device(self.domid, pci_str)
    1.26 +            bdf = xc.test_assign_device(0, pci_str)
    1.27              if bdf != 0:
    1.28                  if bdf == -1:
    1.29                      raise VmError("failed to assign device: maybe the platform"