ia64/xen-unstable

changeset 1469:1c03ec9209f0

bitkeeper revision 1.946.1.4 (40cd843f6NSyFYPvGTRmyXVfcuiXHw)

Support xend restart by reconnecting the control interface.
author mjw@wray-m-3.hpl.hp.com
date Mon Jun 14 10:55:59 2004 +0000 (2004-06-14)
parents 1d69c0528a2e
children cb46d894f7e6
files BitKeeper/etc/ignore linux-2.4.26-xen-sparse/arch/xen/kernel/ctrl_if.c tools/xend/lib/utils.c tools/xenmgr/lib/server/blkif.py
line diff
     1.1 --- a/BitKeeper/etc/ignore	Fri Jun 11 14:40:53 2004 +0000
     1.2 +++ b/BitKeeper/etc/ignore	Mon Jun 14 10:55:59 2004 +0000
     1.3 @@ -25,132 +25,6 @@ xen/include/xen/compile.h
     1.4  xen/tools/elf-reloc
     1.5  xen/tools/figlet/figlet
     1.6  TAGS
     1.7 -linux-2.4.26-xen-sparse/drivers/scsi/aic7xxx/Makefile~
     1.8 -linux-2.4.26-xen/.config.old
     1.9 -linux-2.4.26-xen/.depend
    1.10 -linux-2.4.26-xen/.hdepend
    1.11 -linux-2.4.26-xen/.version
    1.12 -linux-2.4.26-xen/.config
    1.13 -linux-2.4.26-xen/COPYING
    1.14 -linux-2.4.26-xen/CREDITS
    1.15 -linux-2.4.26-xen/Documentation/00-INDEX
    1.16 -linux-2.4.26-xen/Documentation/BK-usage/00-INDEX
    1.17 -linux-2.4.26-xen/Documentation/BK-usage/bk-kernel-howto.txt
    1.18 -linux-2.4.26-xen/Documentation/BK-usage/bk-make-sum
    1.19 -linux-2.4.26-xen/Documentation/BK-usage/bksend
    1.20 -linux-2.4.26-xen/Documentation/BK-usage/bz64wrap
    1.21 -linux-2.4.26-xen/Documentation/BK-usage/cset-to-linus
    1.22 -linux-2.4.26-xen/Documentation/BK-usage/csets-to-patches
    1.23 -linux-2.4.26-xen/Documentation/BK-usage/unbz64wrap
    1.24 -linux-2.4.26-xen/Documentation/BUG-HUNTING
    1.25 -linux-2.4.26-xen/Documentation/Changes
    1.26 -linux-2.4.26-xen/Documentation/CodingStyle
    1.27 -linux-2.4.26-xen/Documentation/Configure.help
    1.28 -linux-2.4.26-xen/Documentation/DMA-mapping.txt
    1.29 -linux-2.4.26-xen/Documentation/DocBook/Makefile
    1.30 -linux-2.4.26-xen/Documentation/DocBook/deviceiobook.tmpl
    1.31 -linux-2.4.26-xen/Documentation/DocBook/journal-api.tmpl
    1.32 -linux-2.4.26-xen/Documentation/DocBook/kernel-api.tmpl
    1.33 -linux-2.4.26-xen/Documentation/DocBook/kernel-hacking.tmpl
    1.34 -linux-2.4.26-xen/Documentation/DocBook/kernel-locking.tmpl
    1.35 -linux-2.4.26-xen/Documentation/DocBook/mcabook.tmpl
    1.36 -linux-2.4.26-xen/Documentation/DocBook/mousedrivers.tmpl
    1.37 -linux-2.4.26-xen/Documentation/DocBook/parport-multi.fig
    1.38 -linux-2.4.26-xen/Documentation/DocBook/parport-share.fig
    1.39 -linux-2.4.26-xen/Documentation/DocBook/parport-structure.fig
    1.40 -linux-2.4.26-xen/Documentation/DocBook/parportbook.tmpl
    1.41 -linux-2.4.26-xen/Documentation/DocBook/procfs-guide.tmpl
    1.42 -linux-2.4.26-xen/Documentation/DocBook/procfs_example.c
    1.43 -linux-2.4.26-xen/Documentation/DocBook/sis900.tmpl
    1.44 -linux-2.4.26-xen/Documentation/DocBook/tulip-user.tmpl
    1.45 -linux-2.4.26-xen/Documentation/DocBook/via-audio.tmpl
    1.46 -linux-2.4.26-xen/Documentation/DocBook/videobook.tmpl
    1.47 -linux-2.4.26-xen/Documentation/DocBook/wanbook.tmpl
    1.48 -linux-2.4.26-xen/Documentation/DocBook/z8530book.tmpl
    1.49 -linux-2.4.26-xen/Documentation/IO-mapping.txt
    1.50 -linux-2.4.26-xen/Documentation/IPMI.txt
    1.51 -linux-2.4.26-xen/Documentation/IRQ-affinity.txt
    1.52 -linux-2.4.26-xen/Documentation/LVM-HOWTO
    1.53 -linux-2.4.26-xen/Documentation/README.DAC960
    1.54 -linux-2.4.26-xen/Documentation/README.moxa
    1.55 -linux-2.4.26-xen/Documentation/README.nsp32_cb.eng
    1.56 -linux-2.4.26-xen/Documentation/README.nsp_cs.eng
    1.57 -linux-2.4.26-xen/Documentation/SAK.txt
    1.58 -linux-2.4.26-xen/Documentation/SubmittingDrivers
    1.59 -linux-2.4.26-xen/Documentation/SubmittingPatches
    1.60 -linux-2.4.26-xen/Documentation/VGA-softcursor.txt
    1.61 -linux-2.4.26-xen/Documentation/arm/Booting
    1.62 -linux-2.4.26-xen/Documentation/arm/ConfigVars
    1.63 -linux-2.4.26-xen/Documentation/arm/MEMC
    1.64 -linux-2.4.26-xen/Documentation/arm/Netwinder
    1.65 -linux-2.4.26-xen/Documentation/arm/README
    1.66 -linux-2.4.26-xen/Documentation/arm/SA1100/ADSBitsy
    1.67 -linux-2.4.26-xen/Documentation/arm/SA1100/Assabet
    1.68 -linux-2.4.26-xen/Documentation/arm/SA1100/Brutus
    1.69 -linux-2.4.26-xen/Documentation/arm/SA1100/CERF
    1.70 -linux-2.4.26-xen/Documentation/arm/SA1100/DMA
    1.71 -linux-2.4.26-xen/Documentation/arm/SA1100/FreeBird
    1.72 -linux-2.4.26-xen/Documentation/arm/SA1100/GraphicsClient
    1.73 -linux-2.4.26-xen/Documentation/arm/SA1100/GraphicsMaster
    1.74 -linux-2.4.26-xen/Documentation/arm/SA1100/HUW_WEBPANEL
    1.75 -linux-2.4.26-xen/Documentation/arm/SA1100/Itsy
    1.76 -linux-2.4.26-xen/Documentation/arm/SA1100/LART
    1.77 -linux-2.4.26-xen/Documentation/arm/SA1100/PCMCIA
    1.78 -linux-2.4.26-xen/Documentation/arm/SA1100/PLEB
    1.79 -linux-2.4.26-xen/Documentation/arm/SA1100/Pangolin
    1.80 -linux-2.4.26-xen/Documentation/arm/SA1100/SA1100_USB
    1.81 -linux-2.4.26-xen/Documentation/arm/SA1100/Tifon
    1.82 -linux-2.4.26-xen/Documentation/arm/SA1100/Victor
    1.83 -linux-2.4.26-xen/Documentation/arm/SA1100/Yopy
    1.84 -linux-2.4.26-xen/Documentation/arm/SA1100/empeg
    1.85 -linux-2.4.26-xen/Documentation/arm/SA1100/nanoEngine
    1.86 -linux-2.4.26-xen/Documentation/arm/SA1100/serial_UART
    1.87 -linux-2.4.26-xen/Documentation/arm/Setup
    1.88 -linux-2.4.26-xen/Documentation/arm/empeg/README
    1.89 -linux-2.4.26-xen/Documentation/arm/empeg/ir.txt
    1.90 -linux-2.4.26-xen/Documentation/arm/empeg/mkdevs
    1.91 -linux-2.4.26-xen/Documentation/arm/nwfpe/NOTES
    1.92 -linux-2.4.26-xen/Documentation/arm/nwfpe/README
    1.93 -linux-2.4.26-xen/Documentation/arm/nwfpe/README.FPE
    1.94 -linux-2.4.26-xen/Documentation/arm/nwfpe/TODO
    1.95 -linux-2.4.26-xen/Documentation/binfmt_misc.txt
    1.96 -linux-2.4.26-xen/Documentation/cachetlb.txt
    1.97 -linux-2.4.26-xen/Documentation/cciss.txt
    1.98 -linux-2.4.26-xen/Documentation/cdrom/00-INDEX
    1.99 -linux-2.4.26-xen/Documentation/cdrom/Makefile
   1.100 -linux-2.4.26-xen/Documentation/cdrom/aztcd
   1.101 -linux-2.4.26-xen/Documentation/cdrom/cdrom-standard.tex
   1.102 -linux-2.4.26-xen/Documentation/cdrom/cdu31a
   1.103 -linux-2.4.26-xen/Documentation/cdrom/cm206
   1.104 -linux-2.4.26-xen/Documentation/cdrom/gscd
   1.105 -linux-2.4.26-xen/Documentation/cdrom/ide-cd
   1.106 -linux-2.4.26-xen/Documentation/cdrom/isp16
   1.107 -linux-2.4.26-xen/Documentation/cdrom/mcd
   1.108 -linux-2.4.26-xen/Documentation/cdrom/mcdx
   1.109 -linux-2.4.26-xen/Documentation/cdrom/optcd
   1.110 -linux-2.4.26-xen/Documentation/cdrom/sbpcd
   1.111 -linux-2.4.26-xen/Documentation/cdrom/sjcd
   1.112 -linux-2.4.26-xen/Documentation/cdrom/sonycd535
   1.113 -linux-2.4.26-xen/Documentation/computone.txt
   1.114 -linux-2.4.26-xen/Documentation/cpqarray.txt
   1.115 -linux-2.4.26-xen/Documentation/cris/README
   1.116 -linux-2.4.26-xen/Documentation/crypto/api-intro.txt
   1.117 -linux-2.4.26-xen/Documentation/crypto/descore-readme.txt
   1.118 -linux-2.4.26-xen/Documentation/devices.txt
   1.119 -linux-2.4.26-xen/Documentation/digiboard.txt
   1.120 -linux-2.4.26-xen/Documentation/digiepca.txt
   1.121 -linux-2.4.26-xen/Documentation/dnotify.txt
   1.122 -linux-2.4.26-xen/Documentation/exception.txt
   1.123 -linux-2.4.26-xen/Documentation/fb/00-INDEX
   1.124 -linux-2.4.26-xen/Documentation/fb/README-sstfb.txt
   1.125 -linux-2.4.26-xen/Documentation/fb/aty128fb.txt
   1.126 -linux-2.4.26-xen/Documentation/fb/clgenfb.txt
   1.127 -linux-2.4.26-xen/Documentation/fb/framebuffer.txt
   1.128 -linux-2.4.26-xen/Documentation/fb/internals.txt
   1.129 -linux-2.4.26-xen/Documentation/fb/matroxfb.txt
   1.130 -linux-2.4.26-xen/Documentation/fb/modedb.txt
   1.131 -linux-2.4.26-xen/Documentation/fb/pvr2fb.txt
   1.132 -linux-2.4.26-xen/Documentation/fb/sa1100fb.txt
   1.133 -tools/xenmgr/lib/server/blkif.py~
   1.134 -tools/xenmgr/lib/server/messages.py~
   1.135 -tools/xenmgr/lib/server/netif.py~
   1.136 +linux-2.4.26-xen/*
   1.137 +*~
   1.138 +tools/xend-2004-06-10_1309.tgz
     2.1 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/ctrl_if.c	Fri Jun 11 14:40:53 2004 +0000
     2.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/kernel/ctrl_if.c	Mon Jun 14 10:55:59 2004 +0000
     2.3 @@ -330,6 +330,19 @@ void ctrl_if_suspend(void)
     2.4      unbind_evtchn_from_irq(ctrl_if_evtchn);
     2.5  }
     2.6  
     2.7 +/** Reset the control interface progress pointers.
     2.8 + * Marks the queues empty if 'clear' non-zero.
     2.9 + */
    2.10 +void ctrl_if_reset(int clear){
    2.11 +    control_if_t *ctrl_if = get_ctrl_if();
    2.12 +
    2.13 +    if(clear){
    2.14 +        *ctrl_if = (control_if_t){};
    2.15 +    }
    2.16 +    ctrl_if_tx_resp_cons = ctrl_if->tx_resp_prod;
    2.17 +    ctrl_if_rx_req_cons  = ctrl_if->rx_resp_prod;
    2.18 +}
    2.19 +
    2.20  void ctrl_if_resume(void)
    2.21  {
    2.22      if ( start_info.flags & SIF_INITDOMAIN )
    2.23 @@ -349,8 +362,7 @@ void ctrl_if_resume(void)
    2.24          initdom_ctrlif_domcontroller_port   = op.u.bind_interdomain.port2;
    2.25      }
    2.26  
    2.27 -    ctrl_if_tx_resp_cons = 0;
    2.28 -    ctrl_if_rx_req_cons  = 0;
    2.29 +    ctrl_if_reset(0);
    2.30  
    2.31      ctrl_if_evtchn = start_info.domain_controller_evtchn;
    2.32      ctrl_if_irq    = bind_evtchn_to_irq(ctrl_if_evtchn);
    2.33 @@ -365,7 +377,7 @@ void ctrl_if_resume(void)
    2.34  
    2.35  void __init ctrl_if_init(void)
    2.36  {
    2.37 -    int i;
    2.38 +        int i;
    2.39  
    2.40      for ( i = 0; i < 256; i++ )
    2.41          ctrl_if_rxmsg_handler[i] = ctrl_if_rxmsg_default_handler;
    2.42 @@ -373,6 +385,7 @@ void __init ctrl_if_init(void)
    2.43  
    2.44      spin_lock_init(&ctrl_if_lock);
    2.45  
    2.46 +    ctrl_if_reset(1);
    2.47      ctrl_if_resume();
    2.48  }
    2.49  
     3.1 --- a/tools/xend/lib/utils.c	Fri Jun 11 14:40:53 2004 +0000
     3.2 +++ b/tools/xend/lib/utils.c	Mon Jun 14 10:55:59 2004 +0000
     3.3 @@ -670,7 +670,7 @@ static void unmap_control_interface(int 
     3.4      (void)munmap(vaddr, PAGE_SIZE);
     3.5  }
     3.6  
     3.7 -typedef struct {
     3.8 +typedef struct xu_port_object {
     3.9      PyObject_HEAD;
    3.10      int mem_fd;
    3.11      int xc_handle;
    3.12 @@ -683,6 +683,42 @@ typedef struct {
    3.13  
    3.14  static PyObject *port_error;
    3.15  
    3.16 +static int xup_connect(xu_port_object *xup, domid_t dom,
    3.17 +                       int local_port, int remote_port){
    3.18 +    // From our prespective rx = producer, tx = consumer.
    3.19 +    int err = 0;
    3.20 +    printf("%s> dom=%u %d:%d\n", __FUNCTION__, dom, local_port, remote_port);
    3.21 +
    3.22 +    // Consumer = tx.
    3.23 +    //xup->interface->tx_resp_prod = 0;
    3.24 +    //xup->interface->tx_req_prod = 0;
    3.25 +    xup->tx_resp_prod = xup->interface->tx_resp_prod;
    3.26 +    xup->tx_req_cons = xup->interface->tx_resp_prod;
    3.27 +    printf("%s> tx: %p %p : %p %p\n", __FUNCTION__,
    3.28 +           xup->interface->tx_resp_prod,
    3.29 +           xup->tx_resp_prod,
    3.30 +           xup->tx_req_cons,
    3.31 +           xup->interface->tx_req_prod);
    3.32 +
    3.33 +    // Producer = rx.
    3.34 +    //xup->interface->rx_req_prod  = 0;
    3.35 +    //xup->interface->rx_resp_prod = 0;
    3.36 +    xup->rx_req_prod  = xup->interface->rx_req_prod;
    3.37 +    xup->rx_resp_cons = xup->interface->rx_resp_prod;
    3.38 +    printf("%s> rx: %p %p : %p %p\n", __FUNCTION__,
    3.39 +           xup->rx_resp_cons,
    3.40 +           xup->interface->rx_resp_prod,
    3.41 +           xup->interface->rx_req_prod,
    3.42 +           xup->rx_req_prod);
    3.43 +
    3.44 +    xup->remote_dom   = dom;
    3.45 +    xup->local_port   = local_port;
    3.46 +    xup->remote_port  = remote_port;
    3.47 +
    3.48 +    printf("%s< err=%d\n", __FUNCTION__, err);
    3.49 +    return err;
    3.50 +}
    3.51 +
    3.52  static PyObject *xu_port_notify(PyObject *self, PyObject *args)
    3.53  {
    3.54      xu_port_object *xup = (xu_port_object *)self;
    3.55 @@ -988,19 +1024,7 @@ static PyObject *xu_port_new(PyObject *s
    3.56          goto fail4;
    3.57      }
    3.58  
    3.59 -    xup->interface->tx_resp_prod = 0;
    3.60 -    xup->interface->rx_req_prod  = 0;
    3.61 -    xup->interface->tx_req_prod = 0;
    3.62 -    xup->interface->rx_resp_prod = 0;
    3.63 -
    3.64 -    xup->tx_req_cons  = 0;
    3.65 -    xup->tx_resp_prod = 0;
    3.66 -    xup->rx_req_prod  = 0;
    3.67 -    xup->rx_resp_cons = 0;
    3.68 -    xup->remote_dom   = dom;
    3.69 -    xup->local_port   = port1;
    3.70 -    xup->remote_port  = port2;
    3.71 -
    3.72 +    xup_connect(xup, dom, port1, port2);
    3.73      return (PyObject *)xup;
    3.74  
    3.75      
     4.1 --- a/tools/xenmgr/lib/server/blkif.py	Fri Jun 11 14:40:53 2004 +0000
     4.2 +++ b/tools/xenmgr/lib/server/blkif.py	Mon Jun 14 10:55:59 2004 +0000
     4.3 @@ -98,7 +98,7 @@ class BlkifControllerFactory(controller.
     4.4              blkif.reattached()
     4.5  
     4.6      def recv_be_driver_status_changed(self, msg, req):
     4.7 -        val = unpackMsg('blkif_be_driver_status_changed_t'. msg)
     4.8 +        val = unpackMsg('blkif_be_driver_status_changed_t', msg)
     4.9          status = val['status']
    4.10          if status == BLKIF_DRIVER_STATUS_UP and not self.attached:
    4.11              for blkif in self.getInstances():