ia64/xen-unstable

changeset 2164:02a135451216

bitkeeper revision 1.1159.1.32 (4118d35c609YWhxt_3C-hWCNhXozxA)

migration integration with new xend
author iap10@labyrinth.cl.cam.ac.uk
date Tue Aug 10 13:53:32 2004 +0000 (2004-08-10)
parents 920e29e2986d
children 01bf507e2306 72482a685ea5
files tools/libxc/xc_linux_restore.c tools/python/xen/xend/XendDomain.py tools/python/xen/xend/XendDomainInfo.py
line diff
     1.1 --- a/tools/libxc/xc_linux_restore.c	Tue Aug 10 13:47:15 2004 +0000
     1.2 +++ b/tools/libxc/xc_linux_restore.c	Tue Aug 10 13:53:32 2004 +0000
     1.3 @@ -86,7 +86,7 @@ int xc_linux_restore(int xc_handle, XcIO
     1.4      int rc = 1, i, n, k;
     1.5      unsigned long mfn, pfn, xpfn;
     1.6      unsigned int prev_pc, this_pc;
     1.7 -    u32 dom = ioctxt->domain;
     1.8 +    u32 dom = 0;
     1.9      int verify = 0; 
    1.10  
    1.11      /* Number of page frames in use by this Linux session. */
    1.12 @@ -143,7 +143,7 @@ int xc_linux_restore(int xc_handle, XcIO
    1.13          return 1;
    1.14      }
    1.15  
    1.16 -    /* Start writing out the saved-domain record. */
    1.17 +    /* Start reading the saved-domain record. */
    1.18      if ( xcio_read(ioctxt, signature, 16) ||
    1.19           (memcmp(signature, "LinuxGuestRecord", 16) != 0) )
    1.20      {
    1.21 @@ -201,6 +201,7 @@ int xc_linux_restore(int xc_handle, XcIO
    1.22          goto out;
    1.23      }
    1.24  
    1.25 +#if 0
    1.26      /* Set the domain's name to that from the restore file */
    1.27      if ( xc_domain_setname( xc_handle, dom, name ) )
    1.28      {
    1.29 @@ -218,6 +219,21 @@ int xc_linux_restore(int xc_handle, XcIO
    1.30  		   dom, nr_pfns,nr_pfns * (PAGE_SIZE / 1024));
    1.31          goto out;
    1.32      }
    1.33 +#endif
    1.34 +
    1.35 +
    1.36 +    /* XXX create domain on CPU=-1 so that in future it auto load ballances by default */
    1.37 +    if ( xc_domain_create( xc_handle,  nr_pfns * (PAGE_SIZE / 1024),
    1.38 +			   name,
    1.39 +			   -1, &dom ) )
    1.40 +    {
    1.41 +	xcio_error(ioctxt, "Could not create domain. pfns=%d, %dKB",
    1.42 +		   nr_pfns,nr_pfns * (PAGE_SIZE / 1024));
    1.43 +        goto out;
    1.44 +    }
    1.45 +    
    1.46 +    ioctxt->domain = dom;
    1.47 +    printf("Created domain %ld\n",dom);
    1.48  
    1.49      /* Get the domain's shared-info frame. */
    1.50      op.cmd = DOM0_GETDOMAININFO;
     2.1 --- a/tools/python/xen/xend/XendDomain.py	Tue Aug 10 13:47:15 2004 +0000
     2.2 +++ b/tools/python/xen/xend/XendDomain.py	Tue Aug 10 13:53:32 2004 +0000
     2.3 @@ -413,7 +413,7 @@ class XendDomain:
     2.4  
     2.5      def domain_exists(self, name):
     2.6          name = str(name)
     2.7 -        return self.domain_by_name.get(name) or self.domain_by_id.get(name):
     2.8 +        return self.domain_by_name.get(name) or self.domain_by_id.get(name)
     2.9  
    2.10      def domain_unpause(self, id):
    2.11          """Unpause domain execution.
     3.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Aug 10 13:47:15 2004 +0000
     3.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Aug 10 13:53:32 2004 +0000
     3.3 @@ -473,7 +473,7 @@ class XendDomainInfo:
     3.4          # When creating or rebooting, a domain with my name should not exist.
     3.5          # When restoring, a domain with my name will exist, but it should have
     3.6          # my domain id.
     3.7 -        if dominfo and (not self.dom or dominfo.dom != self.dom)
     3.8 +        if dominfo and (not self.dom or dominfo.dom != self.dom):
     3.9              raise VmError('vm name clash: ' + name)
    3.10          
    3.11      def construct(self, config):