ia64/xen-unstable

changeset 1325:47b57e3d20f1

bitkeeper revision 1.879.1.2 (408f99e7sN48_I90Di8Eqaodd_1KjQ)

A few fixes to new I/O world.
author kaf24@scramble.cl.cam.ac.uk
date Wed Apr 28 11:47:51 2004 +0000 (2004-04-28)
parents 8f158bd218a6
children 7178b507e88b
files tools/xend/lib/domain_controller.h tools/xend/lib/main.py xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/backend/control.c xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/frontend/main.c
line diff
     1.1 --- a/tools/xend/lib/domain_controller.h	Wed Apr 28 09:35:33 2004 +0000
     1.2 +++ b/tools/xend/lib/domain_controller.h	Wed Apr 28 11:47:51 2004 +0000
     1.3 @@ -258,13 +258,13 @@ typedef struct {
     1.4  } blkif_be_vbd_shrink_t; 
     1.5  
     1.6  /*
     1.7 - * CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED:
     1.8 + * CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED:
     1.9   *  Notify the domain controller that the back-end driver is DOWN or UP.
    1.10   *  If the driver goes DOWN while interfaces are still UP, the domain
    1.11   *  will automatically send DOWN notifications.
    1.12   */
    1.13  typedef struct {
    1.14      unsigned int status; /* BLKIF_DRIVER_STATUS_??? */
    1.15 -} blkif_be_driver_status_changed;
    1.16 +} blkif_be_driver_status_changed_t;
    1.17  
    1.18  #endif /* __DOMAIN_CONTROLLER_H__ */
     2.1 --- a/tools/xend/lib/main.py	Wed Apr 28 09:35:33 2004 +0000
     2.2 +++ b/tools/xend/lib/main.py	Wed Apr 28 11:47:51 2004 +0000
     2.3 @@ -46,11 +46,13 @@ def daemon_loop():
     2.4  
     2.5      # The DOM0 control interface is not set up via the management interface.
     2.6      # Note that console messages don't come our way (actually, only driver
     2.7 -    # back-ends should use the DOM0 control interface). We therefore don't
     2.8 -    # need to set up console structures.
     2.9 -    xend.utils.port(0)
    2.10 -    xend.main.notifier.bind(port.local_port)
    2.11 -    xend.main.control_list[port.local_port] = (port, 0, 0, 0)
    2.12 +    # back-ends should use the DOM0 control interface) -- the console
    2.13 +    # structures are dummies.
    2.14 +    dom0_port = xend.utils.port(0)
    2.15 +    xend.main.notifier.bind(dom0_port.local_port)
    2.16 +    xend.main.control_list[dom0_port.local_port] =          \
    2.17 +      (dom0_port, xend.utils.buffer(), xend.utils.buffer(), \
    2.18 +       xend.console.interface(0, dom0_port.local_port))
    2.19  
    2.20      ##
    2.21      ## MAIN LOOP
     3.1 --- a/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/backend/control.c	Wed Apr 28 09:35:33 2004 +0000
     3.2 +++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/backend/control.c	Wed Apr 28 11:47:51 2004 +0000
     3.3 @@ -56,5 +56,16 @@ static void blkif_ctrlif_rx(ctrl_msg_t *
     3.4  
     3.5  void blkif_ctrlif_init(void)
     3.6  {
     3.7 +    ctrl_msg_t                       cmsg;
     3.8 +    blkif_be_driver_status_changed_t st;
     3.9 +
    3.10      (void)ctrl_if_register_receiver(CMSG_BLKIF_BE, blkif_ctrlif_rx);
    3.11 +
    3.12 +    /* Send a driver-UP notification to the domain controller. */
    3.13 +    cmsg.type      = CMSG_BLKIF_BE;
    3.14 +    cmsg.subtype   = CMSG_BLKIF_BE_DRIVER_STATUS_CHANGED;
    3.15 +    cmsg.length    = sizeof(blkif_be_driver_status_changed_t);
    3.16 +    st.status      = BLKIF_DRIVER_STATUS_UP;
    3.17 +    memcpy(cmsg.msg, &st, sizeof(st));
    3.18 +    ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
    3.19  }
     4.1 --- a/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/frontend/main.c	Wed Apr 28 09:35:33 2004 +0000
     4.2 +++ b/xenolinux-2.4.26-sparse/arch/xen/drivers/blkif/frontend/main.c	Wed Apr 28 11:47:51 2004 +0000
     4.3 @@ -670,7 +670,19 @@ static void blkif_ctrlif_rx(ctrl_msg_t *
     4.4  
     4.5  int __init xlblk_init(void)
     4.6  {
     4.7 +    ctrl_msg_t                       cmsg;
     4.8 +    blkif_fe_driver_status_changed_t st;
     4.9 +
    4.10      (void)ctrl_if_register_receiver(CMSG_BLKIF_FE, blkif_ctrlif_rx);
    4.11 +
    4.12 +    /* Send a driver-UP notification to the domain controller. */
    4.13 +    cmsg.type      = CMSG_BLKIF_FE;
    4.14 +    cmsg.subtype   = CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED;
    4.15 +    cmsg.length    = sizeof(blkif_fe_driver_status_changed_t);
    4.16 +    st.status      = BLKIF_DRIVER_STATUS_UP;
    4.17 +    memcpy(cmsg.msg, &st, sizeof(st));
    4.18 +    ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
    4.19 +
    4.20      return 0;
    4.21  }
    4.22