ia64/xen-unstable

changeset 5166:d867c2bbd27e

bitkeeper revision 1.1563 (4295e70c6gPBeUtVURfaYnxTU_GbrA)

Make disconnect/destroy messages from xend to the backend drivers wait for
responses to allow backends to shut down the connection properly.
author akw27@arcadians.cl.cam.ac.uk
date Thu May 26 15:11:08 2005 +0000 (2005-05-26)
parents 98ec71a98df7
children 41a5c6143c83
files tools/python/xen/xend/server/blkif.py tools/python/xen/xend/server/netif.py tools/python/xen/xend/server/usbif.py
line diff
     1.1 --- a/tools/python/xen/xend/server/blkif.py	Thu May 26 12:51:47 2005 +0000
     1.2 +++ b/tools/python/xen/xend/server/blkif.py	Thu May 26 15:11:08 2005 +0000
     1.3 @@ -103,14 +103,16 @@ class BlkifBackend:
     1.4          msg = packMsg('blkif_be_disconnect_t',
     1.5                        { 'domid'        : self.frontendDomain,
     1.6                          'blkif_handle' : self.id })
     1.7 -        self.backendChannel.writeRequest(msg)
     1.8 +        self.backendChannel.requestResponse(msg)
     1.9 +        #todo: check return status
    1.10          self.connected = False
    1.11  
    1.12      def send_be_destroy(self):
    1.13          msg = packMsg('blkif_be_destroy_t',
    1.14                        { 'domid'        : self.frontendDomain,
    1.15                          'blkif_handle' : self.id })
    1.16 -        self.backendChannel.writeRequest(msg)
    1.17 +        self.backendChannel.requestResponse(msg)
    1.18 +        #todo: check return status
    1.19  
    1.20      def connectInterface(self, val):
    1.21          self.openEvtchn()
     2.1 --- a/tools/python/xen/xend/server/netif.py	Thu May 26 12:51:47 2005 +0000
     2.2 +++ b/tools/python/xen/xend/server/netif.py	Thu May 26 15:11:08 2005 +0000
     2.3 @@ -313,13 +313,15 @@ class NetDev(Dev):
     2.4          msg = packMsg('netif_be_disconnect_t',
     2.5                        { 'domid'        : self.frontendDomain,
     2.6                          'netif_handle' : self.vif })
     2.7 -        return self.backendChannel.writeRequest(msg)
     2.8 +        self.backendChannel.requestResponse(msg)
     2.9 +        #todo: check return status
    2.10  
    2.11      def send_be_destroy(self, response=None):
    2.12          msg = packMsg('netif_be_destroy_t',
    2.13                        { 'domid'        : self.frontendDomain,
    2.14                          'netif_handle' : self.vif })
    2.15 -        return self.backendChannel.writeRequest(msg)
    2.16 +        self.backendChannel.requestResponse(msg)
    2.17 +        #todo: check return status
    2.18      
    2.19      def recv_fe_interface_connect(self, val):
    2.20          self.openEvtchn()
     3.1 --- a/tools/python/xen/xend/server/usbif.py	Thu May 26 12:51:47 2005 +0000
     3.2 +++ b/tools/python/xen/xend/server/usbif.py	Thu May 26 15:11:08 2005 +0000
     3.3 @@ -89,13 +89,14 @@ class UsbBackend:
     3.4          log.debug('>UsbifBackendController>send_be_disconnect> %s', str(self))
     3.5          msg = packMsg('usbif_be_disconnect_t',
     3.6                        { 'domid'        : self.frontendDomain })
     3.7 -        self.backendChannel.writeRequest(msg)
     3.8 +        self.backendChannel.requestResponse(msg)
     3.9  
    3.10      def send_be_destroy(self, response=None):
    3.11          log.debug('>UsbifBackendController>send_be_destroy> %s', str(self))
    3.12          msg = packMsg('usbif_be_destroy_t',
    3.13                        { 'domid'        : self.frontendDomain })
    3.14 -        self.backendChannel.writeRequest(msg, response=response)
    3.15 +        self.backendChannel.requestResponse(msg)
    3.16 +        #todo: check return status
    3.17  
    3.18      
    3.19      def connectInterface(self, val):