ia64/xen-unstable
changeset 1441:2a1ade2f1f48
bitkeeper revision 1.941 (40c5c3aeUZGucE9_GNi3DXxAGD0Klg)
Merge-related fixups.
Merge-related fixups.
author | mwilli2@equilibrium.research.intel-research.net |
---|---|
date | Tue Jun 08 13:48:30 2004 +0000 (2004-06-08) |
parents | 3ee528275c75 |
children | 089bd7abf02e |
files | tools/examples/xc_dom_create.py tools/xend/lib/blkif.py |
line diff
1.1 --- a/tools/examples/xc_dom_create.py Tue Jun 08 11:19:01 2004 +0000 1.2 +++ b/tools/examples/xc_dom_create.py Tue Jun 08 13:48:30 2004 +0000 1.3 @@ -274,7 +274,7 @@ def make_domain(): 1.4 # set the expertise level appropriately 1.5 xenctl.utils.VBD_EXPERT_MODE = vbd_expert 1.6 1.7 - if not (flags & 4): # It's not a block backend (or it's old IO world) 1.8 + if not (flags & 1<<4): # It's not a block backend (or it's old IO world) 1.9 if new_io_world: 1.10 cmsg = 'new_block_interface(dom='+str(id)+')' 1.11 xend_response = xenctl.utils.xend_control_message(cmsg) 1.12 @@ -350,7 +350,7 @@ def make_domain(): 1.13 sys.exit() 1.14 1.15 if new_io_world: 1.16 - if not (flags & 8): # If it's not the net backend, give it a frontend. 1.17 + if not (flags & 1<<5): # If it's not the net backend, give it a frontend. 1.18 cmsg = 'new_network_interface(dom='+str(id)+')' 1.19 xend_response = xenctl.utils.xend_control_message(cmsg) 1.20 if not xend_response['success']:
2.1 --- a/tools/xend/lib/blkif.py Tue Jun 08 11:19:01 2004 +0000 2.2 +++ b/tools/xend/lib/blkif.py Tue Jun 08 13:48:30 2004 +0000 2.3 @@ -4,7 +4,7 @@ 2.4 ## Copyright (c) 2004, K A Fraser (University of Cambridge) 2.5 ################################################################# 2.6 2.7 -import errno, re, os, select, signal, socket, struct, sys 2.8 +import errno, re, os, select, signal, socket, sys 2.9 import xend.main, xend.console, xend.manager, xend.utils, Xc 2.10 2.11 CMSG_BLKIF_BE = 1 2.12 @@ -47,7 +47,7 @@ def backend_rx_req(port, msg): 2.13 subtype = (msg.get_header())['subtype'] 2.14 print "Received blkif-be request, subtype %d" % subtype 2.15 if subtype == CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED: 2.16 - (status, dummy) = struct.unpack("II", msg.get_payload()) 2.17 + status = (msg.get_payload())['status'] 2.18 if status == BLKIF_DRIVER_STATUS_UP: 2.19 if xend.blkif.recovery: 2.20 # Nasty hack: we count the number of VBDs we reattach so that 2.21 @@ -107,9 +107,9 @@ def backend_rx_rsp(port, msg): 2.22 for blkif_key in interface.list.keys(): 2.23 blkif = interface.list[blkif_key] 2.24 print " Notifying %d" % blkif.dom 2.25 - msg = xend.utils.message(CMSG_BLKIF_FE, \ 2.26 - CMSG_BLKIF_FE_INTERFACE_STATUS_CHANGED, 0) 2.27 - msg.append_payload(struct.pack("III", 0,1,0)) 2.28 + msg = xend.utils.message(CMSG_BLKIF_FE, 2.29 + CMSG_BLKIF_FE_INTERFACE_STATUS_CHANGED, 2.30 + 0, { 'handle' : 0, 'status' : 1 }) 2.31 blkif.ctrlif_tx_req(xend.main.port_from_dom(blkif.dom),msg) 2.32 xend.blkif.recovery = False 2.33 print "Done notifying guests" 2.34 @@ -158,8 +158,11 @@ class interface: 2.35 2.36 def reattach_device(self, vdev): 2.37 (pdev, start_sect, nr_sect, readonly) = self.devices[vdev] 2.38 - msg = xend.utils.message(CMSG_BLKIF_BE, CMSG_BLKIF_BE_VBD_CREATE, 0) 2.39 - msg.append_payload(struct.pack("IIHII",self.dom,0,vdev,readonly,0)) 2.40 + msg = xend.utils.message(CMSG_BLKIF_BE, CMSG_BLKIF_BE_VBD_CREATE, 2.41 + 0, { 'domid' : self.dom, 2.42 + 'blkif_handle' : 0, 2.43 + 'vdevice' : vdev, 2.44 + 'readonly' : readonly }) 2.45 xend.blkif.pendaddr = xend.main.mgmt_req_addr 2.46 backend_tx_req(msg) 2.47 2.48 @@ -200,9 +203,9 @@ class interface: 2.49 pl = msg.get_payload() 2.50 (hnd, frame) = (pl['handle'], pl['shmem_frame']) 2.51 xc = Xc.new() 2.52 - self.evtchn = xc.evtchn_bind_interdomain( \ 2.53 - dom1=xend.blkif.be_port.remote_dom, \ 2.54 - dom2=self.dom) 2.55 + self.evtchn = xc.evtchn_bind_interdomain( 2.56 + dom1=xend.blkif.be_port.remote_dom, 2.57 + dom2=self.dom) 2.58 msg = xend.utils.message(CMSG_BLKIF_BE, 2.59 CMSG_BLKIF_BE_CONNECT, 0, 2.60 { 'domid' : self.dom, 'blkif_handle' : 0,