direct-io.hg

changeset 2178:2362ecf749a8

bitkeeper revision 1.1159.17.4 (41193547mY3GJ0dxBp4SGUzPrYt5CQ)

Merge labyrinth.cl.cam.ac.uk:/auto/groups/xeno/BK/xeno.bk
into labyrinth.cl.cam.ac.uk:/auto/anfs/scratch/labyrinth/iap10/xeno-clone/xeno.bk
author iap10@labyrinth.cl.cam.ac.uk
date Tue Aug 10 20:51:19 2004 +0000 (2004-08-10)
parents 9e5c2fef3f55 553d32ef82b4
children d7ed6fd183db e035c42a8e6f
files linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c linux-2.4.26-xen-sparse/arch/xen/kernel/setup.c linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c
line diff
     1.1 --- a/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c	Tue Aug 10 17:29:50 2004 +0000
     1.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/drivers/blkif/frontend/main.c	Tue Aug 10 20:51:19 2004 +0000
     1.3 @@ -805,4 +805,16 @@ void blkdev_suspend(void)
     1.4  
     1.5  void blkdev_resume(void)
     1.6  {
     1.7 +    ctrl_msg_t                       cmsg;
     1.8 +    blkif_fe_driver_status_changed_t st;
     1.9 +    
    1.10 +
    1.11 +    /* Send a driver-UP notification to the domain controller. */
    1.12 +    cmsg.type      = CMSG_BLKIF_FE;
    1.13 +    cmsg.subtype   = CMSG_BLKIF_FE_DRIVER_STATUS_CHANGED;
    1.14 +    cmsg.length    = sizeof(blkif_fe_driver_status_changed_t);
    1.15 +    st.status      = BLKIF_DRIVER_STATUS_UP;
    1.16 +    memcpy(cmsg.msg, &st, sizeof(st));
    1.17 +    ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
    1.18  }
    1.19 +
     2.1 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/setup.c	Tue Aug 10 17:29:50 2004 +0000
     2.2 +++ b/linux-2.4.26-xen-sparse/arch/xen/kernel/setup.c	Tue Aug 10 20:51:19 2004 +0000
     2.3 @@ -1200,6 +1200,7 @@ static void __do_suspend(void)
     2.4      /* Hmmm... a cleaner interface to suspend/resume blkdevs would be nice. */
     2.5      extern void blkdev_suspend(void);
     2.6      extern void blkdev_resume(void);
     2.7 +    extern void netif_resume(void);
     2.8      
     2.9      extern void time_suspend(void);
    2.10      extern void time_resume(void);
    2.11 @@ -1248,8 +1249,8 @@ static void __do_suspend(void)
    2.12  
    2.13      __sti();
    2.14  
    2.15 -    //blkdev_resume();
    2.16 -    //netdev_resume();
    2.17 +    blkdev_resume();
    2.18 +    netif_resume();
    2.19  
    2.20   out:
    2.21      if ( suspend_record != NULL )
     3.1 --- a/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c	Tue Aug 10 17:29:50 2004 +0000
     3.2 +++ b/linux-2.6.7-xen-sparse/drivers/xen/netfront/netfront.c	Tue Aug 10 20:51:19 2004 +0000
     3.3 @@ -874,4 +874,21 @@ static int __init netif_init(void)
     3.4      return err;
     3.5  }
     3.6  
     3.7 +void netif_resume(void)
     3.8 +{
     3.9 +    ctrl_msg_t                       cmsg;
    3.10 +    netif_fe_driver_status_changed_t st;
    3.11 +
    3.12 +    /* Send a driver-UP notification to the domain controller. */
    3.13 +    cmsg.type      = CMSG_NETIF_FE;
    3.14 +    cmsg.subtype   = CMSG_NETIF_FE_DRIVER_STATUS_CHANGED;
    3.15 +    cmsg.length    = sizeof(netif_fe_driver_status_changed_t);
    3.16 +    st.status      = NETIF_DRIVER_STATUS_UP;
    3.17 +    st.nr_interfaces = 0;
    3.18 +    memcpy(cmsg.msg, &st, sizeof(st));
    3.19 +    ctrl_if_send_message_block(&cmsg, NULL, 0, TASK_UNINTERRUPTIBLE);
    3.20 +
    3.21 +}
    3.22 +
    3.23 +
    3.24  __initcall(netif_init);