ia64/xen-unstable

changeset 13872:ce97d6714be4

[XEND] Open save/restore files with O_LARGEFILE if possible
Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
author Tim Deegan <Tim.Deegan@xensource.com>
date Wed Feb 07 17:29:21 2007 +0000 (2007-02-07)
parents ed9dba8e2c67
children 780f097b54c5
files tools/python/xen/xend/XendDomain.py
line diff
     1.1 --- a/tools/python/xen/xend/XendDomain.py	Wed Feb 07 16:22:55 2007 +0000
     1.2 +++ b/tools/python/xen/xend/XendDomain.py	Wed Feb 07 17:29:21 2007 +0000
     1.3 @@ -800,7 +800,10 @@ class XendDomain:
     1.4                                  "support.")
     1.5  
     1.6              path = self._managed_check_point_path(dom_uuid)
     1.7 -            fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
     1.8 +            oflags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
     1.9 +            if hasattr(os, "O_LARGEFILE"):
    1.10 +                oflags |= os.O_LARGEFILE
    1.11 +            fd = os.open(path, oflags)
    1.12              try:
    1.13                  # For now we don't support 'live checkpoint' 
    1.14                  XendCheckpoint.save(fd, dominfo, False, False, path)
    1.15 @@ -840,8 +843,11 @@ class XendDomain:
    1.16                  # Restore that replaces the existing XendDomainInfo
    1.17                  try:
    1.18                      log.debug('Current DomainInfo state: %d' % dominfo.state)
    1.19 +                    oflags = os.O_RDONLY
    1.20 +                    if hasattr(os, "O_LARGEFILE"):
    1.21 +                        oflags |= os.O_LARGEFILE
    1.22                      XendCheckpoint.restore(self,
    1.23 -                                           os.open(chkpath, os.O_RDONLY),
    1.24 +                                           os.open(chkpath, oflags),
    1.25                                             dominfo,
    1.26                                             paused = start_paused)
    1.27                      os.unlink(chkpath)
    1.28 @@ -1009,7 +1015,10 @@ class XendDomain:
    1.29          @raise XendError: Failure to restore domain
    1.30          """
    1.31          try:
    1.32 -            fd = os.open(src, os.O_RDONLY)
    1.33 +            oflags = os.O_RDONLY
    1.34 +            if hasattr(os, "O_LARGEFILE"):
    1.35 +                oflags |= os.O_LARGEFILE
    1.36 +            fd = os.open(src, oflags)
    1.37              try:
    1.38                  return self.domain_restore_fd(fd, paused=paused)
    1.39              finally:
    1.40 @@ -1193,7 +1202,10 @@ class XendDomain:
    1.41              if dominfo.getDomid() == DOM0_ID:
    1.42                  raise XendError("Cannot save privileged domain %i" % domid)
    1.43  
    1.44 -            fd = os.open(dst, os.O_WRONLY | os.O_CREAT | os.O_TRUNC)
    1.45 +            oflags = os.O_WRONLY | os.O_CREAT | os.O_TRUNC
    1.46 +            if hasattr(os, "O_LARGEFILE"):
    1.47 +                oflags |= os.O_LARGEFILE
    1.48 +            fd = os.open(dst, oflags)
    1.49              try:
    1.50                  # For now we don't support 'live checkpoint' 
    1.51                  XendCheckpoint.save(fd, dominfo, False, False, dst)