direct-io.hg

changeset 1529:2c0b02513019

bitkeeper revision 1.990.2.10 (40d70516XUydiLPdu_bFRuiiudIOxw)

Some small changes for back-end domains.
author mjw@wray-m-3.hpl.hp.com
date Mon Jun 21 15:56:06 2004 +0000 (2004-06-21)
parents f394dae9278b
children 396e842f2f14
files tools/xenmgr/lib/XendDomainInfo.py
line diff
     1.1 --- a/tools/xenmgr/lib/XendDomainInfo.py	Mon Jun 21 14:51:36 2004 +0000
     1.2 +++ b/tools/xenmgr/lib/XendDomainInfo.py	Mon Jun 21 15:56:06 2004 +0000
     1.3 @@ -28,6 +28,9 @@ xendConsole = XendConsole.instance()
     1.4  import server.SrvConsoleServer
     1.5  xend = server.SrvConsoleServer.instance()
     1.6  
     1.7 +SIF_BLK_BE_DOMAIN = (1<<4)
     1.8 +SIF_NET_BE_DOMAIN = (1<<5)
     1.9 +
    1.10  def readlines(fd):
    1.11      """Version of readlines safe against EINTR.
    1.12      """
    1.13 @@ -331,23 +334,28 @@ def xen_domain_create(config, ostype, na
    1.14      vifs_n  number of network interfaces
    1.15      returns vm
    1.16      """
    1.17 +    flags = 0
    1.18      if not os.path.isfile(kernel):
    1.19          raise VmError('Kernel image does not exist: %s' % kernel)
    1.20      if ramdisk and not os.path.isfile(ramdisk):
    1.21          raise VMError('Kernel ramdisk does not exist: %s' % ramdisk)
    1.22  
    1.23      cpu = int(sxp.child_value(config, 'cpu', '-1'))
    1.24 +    print 'xen_domain_create> create ', memory, name, cpu
    1.25      dom = xc.domain_create(mem_kb= memory * 1024, name= name, cpu= cpu)
    1.26      if dom <= 0:
    1.27          raise VmError('Creating domain failed: name=%s memory=%d kernel=%s'
    1.28                        % (name, memory, kernel))
    1.29      console = xendConsole.console_create(dom)
    1.30      buildfn = getattr(xc, '%s_build' % ostype)
    1.31 +    
    1.32 +    print 'xen_domain_create> build ', ostype, dom, kernel, cmdline, ramdisk
    1.33      err = buildfn(dom            = dom,
    1.34                    image          = kernel,
    1.35                    control_evtchn = console.port2,
    1.36                    cmdline        = cmdline,
    1.37 -                  ramdisk        = ramdisk)
    1.38 +                  ramdisk        = ramdisk,
    1.39 +                  flags          = flags)
    1.40      if err != 0:
    1.41          raise VmError('Building domain failed: type=%s dom=%d err=%d'
    1.42                        % (ostype, dom, err))
    1.43 @@ -552,10 +560,10 @@ def vm_configure(vm, config):
    1.44      """
    1.45      config_controllers(vm, config)
    1.46      if vm.block_controller:
    1.47 -        d = xend.blkif_create(vm.dom)
    1.48 -    else:
    1.49          d = defer.Deferred()
    1.50          d.callback(1)
    1.51 +    else:
    1.52 +        d = xend.blkif_create(vm.dom)
    1.53      d.addCallback(_vm_configure1, vm, config)
    1.54      return d
    1.55