ia64/xen-unstable

changeset 8165:dab434c9349c

Fix migrate.

Signed-off-by: Steven Hand <steven@xensource.com>
author smh22@firebug.cl.cam.ac.uk
date Thu Dec 01 12:27:29 2005 +0100 (2005-12-01)
parents c55ac1858bbc
children d84ffe8f32ae
files tools/python/xen/xend/XendCheckpoint.py tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendCheckpoint.py	Thu Dec 01 11:27:27 2005 +0100
     1.2 +++ b/tools/python/xen/xend/XendCheckpoint.py	Thu Dec 01 12:27:29 2005 +0100
     1.3 @@ -40,11 +40,19 @@ def write_exact(fd, buf, errmsg):
     1.4          raise XendError(errmsg)
     1.5  
     1.6  def read_exact(fd, size, errmsg):
     1.7 -    buf = os.read(fd, size)
     1.8 -    if len(buf) != size:
     1.9 -        raise XendError(errmsg)
    1.10 +    buf  = '' 
    1.11 +    while size != 0: 
    1.12 +        str = os.read(fd, size)
    1.13 +        if not len(str):
    1.14 +            log.error("read_exact: EOF trying to read %d (buf='%s')" % \
    1.15 +                      (size, buf))
    1.16 +            raise XendError(errmsg)
    1.17 +        size = size - len(str)
    1.18 +        buf  = buf + str
    1.19      return buf
    1.20  
    1.21 +
    1.22 +
    1.23  def save(fd, dominfo, live):
    1.24      write_exact(fd, SIGNATURE, "could not write guest state file: signature")
    1.25  
     2.1 --- a/tools/python/xen/xend/XendDomain.py	Thu Dec 01 11:27:27 2005 +0100
     2.2 +++ b/tools/python/xen/xend/XendDomain.py	Thu Dec 01 12:27:29 2005 +0100
     2.3 @@ -397,6 +397,7 @@ class XendDomain:
     2.4              raise XendError("can't connect: %s" % err[1])
     2.5  
     2.6          sock.send("receive\n")
     2.7 +        sock.recv(80) 
     2.8          XendCheckpoint.save(sock.fileno(), dominfo, live)
     2.9  
    2.10